FindLua52.cmake: Substitute full BSD-License.

As demanded in the (now removed) parenthesized note in the comments.

--- cmake/Modules/FindLua52.cmake
+++ cmake/Modules/FindLua52.cmake
@@ -13,18 +13,39 @@
 # in locations other than lua/

 #=============================================================================
+# CMake - Cross Platform Makefile Generator
 # Copyright 2007-2009 Kitware, Inc.
+#
 # Adjusted for Lua 5.2 (from 5.1) by Christian Neumüller
 #
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
 #
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+#   nor the names of their contributors may be used to endorse or promote
+#   products derived from this software without specific prior written
+#   permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)

 FIND_PATH(LUA_INCLUDE_DIR lua.h
   HINTS


[cmake] fix onther unconditional dune-grid macro usage

--- cmake/modules/DuneUtils.cmake
+++ cmake/modules/DuneUtils.cmake
@@ -133,8 +133,10 @@
     add_dependencies(${_test_target} ${testnames})
     foreach( test ${testnames} )
       add_dune_mpi_flags(${test})
-      add_dune_alugrid_flags(${test})
-      add_dune_superlu_flags(${test})
+      if(dune-grid_FOUND)
+        add_dune_alugrid_flags(${test})
+        add_dune_superlu_flags(${test})
+      endif(dune-grid_FOUND)
       if(COMMAND add_dune_tbb_flags)
         add_dune_tbb_flags(${test})
       endif()


cmake/modules/FindVIGRA.cmake: Changed to search for vigranumpycore instead of impex.

--- cmake/modules/FindVIGRA.cmake
+++ cmake/modules/FindVIGRA.cmake
@@ -3,20 +3,35 @@
 # It sets the following variables:
 #  VIGRA_FOUND              - Set to false, or undefined, if vigra isn't found.
 #  VIGRA_INCLUDE_DIR        - Vigra include directory.
-#  VIGRA_IMPEX_LIBRARY      - Vigra's impex library
-#  VIGRA_IMPEX_LIBRARY_DIR  - path to Vigra impex library
+#  VIGRA_VIGRANUMPYCORE_LIBRARY      - Vigra's impex library
+#  VIGRA_VIGRANUMPYCORE_LIBRARY_DIR  - path to Vigra impex library
+

 # configVersion.hxx only present, after build of Vigra
 FIND_PATH(VIGRA_INCLUDE_DIR vigra/configVersion.hxx PATHS $ENV{VIGRA_ROOT}/include ENV CPLUS_INCLUDE_PATH)
-FIND_LIBRARY(VIGRA_IMPEX_LIBRARY vigraimpex PATHS $ENV{VIGRA_ROOT}/src/impex $ENV{VIGRA_ROOT}/lib ENV LD_LIBRARY_PATH ENV LIBRARY_PATH)
-GET_FILENAME_COMPONENT(VIGRA_IMPEX_LIBRARY_PATH ${VIGRA_IMPEX_LIBRARY} PATH)
-SET( VIGRA_IMPEX_LIBRARY_DIR ${VIGRA_IMPEX_LIBRARY_PATH} CACHE PATH "Path to Vigra impex library.")
+
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c
+                            "import vigra.vigranumpycore; print vigra.vigranumpycore.__file__"
+                            RESULT_VARIABLE VIGRA_VIGRANUMPYCORE_LIBRARY_NOT_FOUND
+                            OUTPUT_VARIABLE VIGRA_VIGRANUMPYCORE_LIBRARY
+                            OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+IF(NOT VIGRA_VIGRANUMPYCORE_LIBRARY_NOT_FOUND)
+    GET_FILENAME_COMPONENT(VIGRA_VIGRANUMPYCORE_LIBRARY_PATH ${VIGRA_VIGRANUMPYCORE_LIBRARY} PATH)
+    SET( VIGRA_VIGRANUMPYCORE_LIBRARY_DIR ${VIGRA_VIGRANUMPYCORE_LIBRARY_PATH} CACHE PATH "Path to Vigra's vigranumpycore library.")
+
+    MESSAGE(STATUS "Found VIGRA")
+    MESSAGE(STATUS "  > vigranumpy: ${VIGRA_VIGRANUMPYCORE_LIBRARY}")
+    MESSAGE(STATUS "  > includes:   ${VIGRA_INCLUDE_DIR}")
+ENDIF()
+
+

 EXECUTE_PROCESS ( COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)

 # handle the QUIETLY and REQUIRED arguments and set VIGRA_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRA DEFAULT_MSG VIGRA_IMPEX_LIBRARY VIGRA_INCLUDE_DIR )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRA DEFAULT_MSG VIGRA_VIGRANUMPYCORE_LIBRARY_PATH VIGRA_VIGRANUMPYCORE_LIBRARY VIGRA_INCLUDE_DIR )

-MARK_AS_ADVANCED( VIGRA_INCLUDE_DIR VIGRA_IMPEX_LIBRARY VIGRA_IMPEX_LIBRARY_DIR)
+MARK_AS_ADVANCED( VIGRA_INCLUDE_DIR VIGRA_VIGRANUMPYCORE_LIBRARY_PATH VIGRA_VIGRANUMPYCORE_LIBRARY VIGRA_VIGRANUMPYCORE_LIBRARY_DIR)


Fix incompatibility in soapcpp2 versions, try both -help and -v

--- cmake/modules/FindgSOAP.cmake
+++ cmake/modules/FindgSOAP.cmake
@@ -60,8 +60,15 @@
 # ----------------------------------------------------
 message(STATUS " - wsdlh : ${GSOAP_WSDL2H}")
 message(STATUS " - SOAPCPP2 : ${GSOAP_SOAPCPP2}")
-execute_process(COMMAND ${GSOAP_SOAPCPP2}  "-v"   OUTPUT_VARIABLE GSOAP_STRING_VERSION ERROR_VARIABLE GSOAP_STRING_VERSION )
+
+execute_process(COMMAND ${GSOAP_SOAPCPP2}  "-help"   OUTPUT_VARIABLE GSOAP_STRING_VERSION ERROR_VARIABLE GSOAP_STRING_VERSION )
 string(REGEX MATCH "[0-9]*\\.[0-9]*\\.[0-9]*" GSOAP_VERSION ${GSOAP_STRING_VERSION})
+
+if( "${GSOAP_VERSION}" STREQUAL "..")
+  execute_process(COMMAND ${GSOAP_SOAPCPP2}  "-v"   OUTPUT_VARIABLE GSOAP_STRING_VERSION ERROR_VARIABLE GSOAP_STRING_VERSION )
+  string(REGEX MATCH "[0-9]*\\.[0-9]*\\.[0-9]*" GSOAP_VERSION ${GSOAP_STRING_VERSION})
+endif()
+
 message(STATUS " - GSOAP VERSION : ${GSOAP_VERSION}")
 if( "${GSOAP_VERSION}"  VERSION_LESS "2.7.6")
 	set(GSOAP_276_COMPAT_FLAGS "")


Remove Typo introduced in last commit

Remove Typo introduced in last commit

--- CMake/Superbuild/External_Slicer.cmake
+++ CMake/Superbuild/External_Slicer.cmake
@@ -126,7 +126,6 @@
       -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF
       -DSlicer_USE_SimpleITK:BOOL=OFF
       -DSlicer_USE_NUMPY:BOOL=OFF
-      -DSlicer_ITV3_COMPATIBILITY:BOOL=ON
       # Slicer built-in modules
       -DSlicer_CLIMODULES_DISABLED:STRING=${Slicer_CLIMODULES_DISABLED}
       -DSlicer_QTLOADABLEMODULES_DISABLED:STRING=${Slicer_QTLOADABLEMODULES_DISABLED}


Revert warning in ESP32 build (#1770)

Revert warning in ESP32 build (#1770)

***NO_CI***

--- CMake/toolchain.xtensa-esp32-elf.cmake
+++ CMake/toolchain.xtensa-esp32-elf.cmake
@@ -57,8 +57,8 @@

 set(CMAKE_CXX_FLAGS "" CACHE INTERNAL "")

-set(CMAKE_C_FLAGS_DEBUG "-std=gnu99 -Og -ggdb -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -Wundef -mfix-esp32-psram-cache-issue -DWITH_POSIX -DHAVE_CONFIG_H -DESP_PLATFORM -D IDF_VER=\"v3.3.1\" -MMD -MP  " CACHE INTERNAL "c compiler flags debug")
-set(CMAKE_CXX_FLAGS_DEBUG " -Og -ggdb -std=gnu++11 -fno-exceptions -fno-rtti  -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -Wundef -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags debug")
+set(CMAKE_C_FLAGS_DEBUG "-std=gnu99 -Og -ggdb -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -DWITH_POSIX -DHAVE_CONFIG_H -DESP_PLATFORM -D IDF_VER=\"v3.3.1\" -MMD -MP  " CACHE INTERNAL "c compiler flags debug")
+set(CMAKE_CXX_FLAGS_DEBUG " -Og -ggdb -std=gnu++11 -fno-exceptions -fno-rtti  -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags debug")

 set(CMAKE_ASM_FLAGS_DEBUG " -g3 -ggdb" CACHE INTERNAL "asm compiler flags debug")

@@ -66,10 +66,10 @@
 set(CMAKE_EXE_LINKER_FLAGS_DEBUG " -nostdlib -u call_user_start_cpu0  -Wl,--gc-sections -Wl,-static " CACHE INTERNAL "linker flags debug")

 # set release flags
-set(CMAKE_C_FLAGS_RELEASE " -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -MMD -MP -Wall -Wextra -Werror -Wundef -mfix-esp32-psram-cache-issue -D IDF_VER=\"v3.3.1\"  " CACHE INTERNAL "c compiler flags release")
-set(CMAKE_C_FLAGS_MINSIZEREL " -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -MMD -MP -Wall -Wextra -Werror -Wundef -mfix-esp32-psram-cache-issue -D IDF_VER=\"v3.3.1\"  " CACHE INTERNAL "c compiler flags minsizerel")
-set(CMAKE_CXX_FLAGS_RELEASE " -Os -std=gnu++11 -g3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -Wundef -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags release")
-set(CMAKE_CXX_FLAGS_MINSIZEREL " -Os -std=gnu++11 -g3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -Wundef -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags minsizerel")
+set(CMAKE_C_FLAGS_RELEASE " -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -MMD -MP -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -D IDF_VER=\"v3.3.1\"  " CACHE INTERNAL "c compiler flags release")
+set(CMAKE_C_FLAGS_MINSIZEREL " -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -MMD -MP -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -D IDF_VER=\"v3.3.1\"  " CACHE INTERNAL "c compiler flags minsizerel")
+set(CMAKE_CXX_FLAGS_RELEASE " -Os -std=gnu++11 -g3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags release")
+set(CMAKE_CXX_FLAGS_MINSIZEREL " -Os -std=gnu++11 -g3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Wextra -Werror -mfix-esp32-psram-cache-issue -DESP_PLATFORM " CACHE INTERNAL "cxx compiler flags minsizerel")

 set(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm compiler flags release")
 set(CMAKE_EXE_LINKER_FLAGS_RELEASE " -nostdlib -u call_user_start_cpu0  -Wl,--gc-sections -Wl,-static " CACHE INTERNAL "linker flags release")


With Azure Pipelines automatically set the build parallel level

Use CMake's ProcessorCount module to determine the number of core and
parrallelism to use while building and testing SimpleITK.

--- Testing/CI/Azure/azure.cmake
+++ Testing/CI/Azure/azure.cmake
@@ -25,8 +25,12 @@
 set(CTEST_SITE "Azure.${CTEST_SITE}")
 set(CTEST_UPDATE_VERSION_ONLY 1)

-set_from_env(PARALLEL_LEVEL "PARALLEL_LEVEL" DEFAULT 2 )
+include( ProcessorCount )
+ProcessorCount( _processor_count )
+set_from_env(PARALLEL_LEVEL "PARALLEL_LEVEL" DEFAULT "${_processor_count}" )
 set( CTEST_TEST_ARGS ${CTEST_TEST_ARGS} PARALLEL_LEVEL ${PARALLEL_LEVEL})
+
+
 set_from_env(workspace "AGENT_BUILDDIRECTORY" REQUIRED)
 file(TO_CMAKE_PATH "${workspace}" CTEST_DASHBOARD_ROOT)
 file(RELATIVE_PATH dashboard_source_name "${workspace}" "$ENV{BUILD_SOURCESDIRECTORY}")


A number of improvements in android cmake toolchain

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -63,6 +63,10 @@
 #
 #    ANDROID_NO_UNDEFINED=ON - set true to show all undefined symbols as linker
 #      errors even if they are not used.
+#
+#    ANDROID_SO_UNDEFINED=OFF - set true to allow undefined symbols in shared
+#      libraries. Automatically turned on for NDK r5x and r6x due to GLESv2
+#      problems.
 #
 #    LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_SOURCE_DIR} - where to output binary
 #      files. See additional details below.
@@ -148,6 +152,9 @@
 #     [~] ANDROID_API_LEVEL is renamed to ANDROID_NATIVE_API_LEVEL
 #   - modified January 2012 Andrey Kamaev andrey.kamaev@itseez.com
 #     [+] added stlport_static support (experimental)
+#     [+] added special check for cygwin
+#     [+] filtered out hidden files (starting with .) while globbing inside NDK
+#     [+] automatically applied GLESv2 linkage fix for NDK revisions 5-6
 # ------------------------------------------------------------------------------

 # this one is important
@@ -169,7 +176,16 @@
 set( ANDROID_DEFAULT_NDK_API_LEVEL 8 )
 set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 )

-option( ANDROID_USE_STLPORT "Experimental: use stlport_static instead of gnustl_static" FALSE )
+
+macro( __LIST_FILTER listvar regex )
+ if( ${listvar} )
+  foreach( __val ${${listvar}} )
+   if( __val MATCHES "${regex}" )
+    list( REMOVE_ITEM ${listvar} "${__val}" )
+   endif()
+  endforeach()
+ endif()
+endmacro()

 macro( __INIT_VARIABLE var_name )
  set( __test_path 0 )
@@ -244,6 +260,7 @@

 macro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )
  file( GLOB __gccExePath "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
+ __LIST_FILTER( __gccExePath "bin/[.].*-gcc${TOOL_OS_SUFFIX}$" )
  list( LENGTH __gccExePath __gccExePathsCount )
  if( NOT __gccExePathsCount EQUAL 1 )
   message( WARNING "Could not uniquely determine machine name for compiler from ${_root}." )
@@ -264,6 +281,28 @@
  endif()
  unset( __fileCopyProcess )
 endmacro()
+
+
+#stl version: by default gnustl_static will be used
+set( ANDROID_USE_STLPORT FALSE CACHE BOOL "Experimental: use stlport_static instead of gnustl_static")
+mark_as_advanced( ANDROID_USE_STLPORT )
+
+#fight against cygwin
+set( ANDROID_FORBID_SYGWIN TRUE CACHE BOOL "Prevent cmake from working under cygwin and using cygwin tools")
+mark_as_advanced( ANDROID_FORBID_SYGWIN )
+if( ANDROID_FORBID_SYGWIN )
+ if( CYGWIN )
+  message( FATAL_ERROR "Android NDK and android-cmake toolchain are not welcome Cygwin. It is unlikely that this cmake toolchain will work under cygwin. But if you want to try then you can set cmake variable ANDROID_FORBID_SYGWIN to FALSE and rerun cmake." )
+ endif()
+
+ if( CMAKE_HOST_WIN32 )
+  #remove cygwin from PATH
+  set( __new_path "$ENV{PATH}")
+  __LIST_FILTER( __new_path "cygwin" )
+  set(ENV{PATH} "${__new_path}")
+  unset(__new_path)
+ endif()
+endif()

 #detect current host platform
 set( TOOL_OS_SUFFIX "" )
@@ -376,6 +415,7 @@
  file( GLOB ANDROID_SUPPORTED_NATIVE_API_LEVELS RELATIVE "${ANDROID_NDK}/platforms" "${ANDROID_NDK}/platforms/android-*" )
  string( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
  file( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
+ __LIST_FILTER( __availableToolchains "^[.]" )
  set( __availableToolchainMachines "" )
  set( __availableToolchainArchs "" )
  set( __availableToolchainCompilerVersions "" )
@@ -475,7 +515,7 @@
 if( ANDROID_ARCH_NAME STREQUAL "arm" AND NOT ARMEABI_V6 )
  __INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD OBSOLETE_FORCE_ARM VALUES OFF )
  set( ANDROID_FORCE_ARM_BUILD ${ANDROID_FORCE_ARM_BUILD} CACHE BOOL "Use 32-bit ARM instructions instead of Thumb-1" FORCE )
- MARK_AS_ADVANCED( ANDROID_FORCE_ARM_BUILD )
+ mark_as_advanced( ANDROID_FORCE_ARM_BUILD )
 else()
  unset( ANDROID_FORCE_ARM_BUILD CACHE )
 endif()
@@ -710,7 +750,7 @@
  if( EXISTS "${CMAKE_BINARY_DIR}/systemlibs/${ANDROID_NDK_ABI_NAME}/libstlport_static.a" )
   set( LINKER_FLAGS "${LINKER_FLAGS} -Wl,--start-group -lstlport_static" )
  endif()
-else()
+else( ANDROID_USE_STLPORT )
  if( EXISTS "${__stlLibPath}/libgnustl_static.a" )
   __COPY_IF_DIFFERENT( "${__stlLibPath}/libgnustl_static.a" "${CMAKE_BINARY_DIR}/systemlibs/${ANDROID_NDK_ABI_NAME}/libstdc++.a" )
  elseif( ANDROID_ARCH_NAME STREQUAL "arm" AND EXISTS "${__stlLibPath}/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )
@@ -748,14 +788,25 @@
 unset( __stlLibPath )

 #other linker flags
-#if( NOT ANDROID_USE_STLPORT )
- __INIT_VARIABLE( ANDROID_NO_UNDEFINED OBSOLETE_NO_UNDEFINED VALUES ON )
- set( ANDROID_NO_UNDEFINED ${ANDROID_NO_UNDEFINED} CACHE BOOL "Don't all undefined symbols" FORCE )
- MARK_AS_ADVANCED( ANDROID_NO_UNDEFINED )
- if( ANDROID_NO_UNDEFINED )
-  set( LINKER_FLAGS "-Wl,--no-undefined ${LINKER_FLAGS}" )
- endif()
-#endif()
+__INIT_VARIABLE( ANDROID_NO_UNDEFINED OBSOLETE_NO_UNDEFINED VALUES ON )
+set( ANDROID_NO_UNDEFINED ${ANDROID_NO_UNDEFINED} CACHE BOOL "Show all undefined symbols as linker errors" FORCE )
+mark_as_advanced( ANDROID_NO_UNDEFINED )
+if( ANDROID_NO_UNDEFINED )
+ set( LINKER_FLAGS "-Wl,--no-undefined ${LINKER_FLAGS}" )
+endif()
+
+if (ANDROID_NDK MATCHES "-r[56].?$")
+ #libGLESv2.so in NDK's prior to r7 refers to exteranal symbols. So this flag option is required for all projects using OpenGL from native.
+ __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES ON )
+else()
+ __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES OFF )
+endif()
+set( ANDROID_SO_UNDEFINED ${ANDROID_SO_UNDEFINED} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" FORCE )
+mark_as_advanced( ANDROID_SO_UNDEFINED )
+if( ANDROID_SO_UNDEFINED )
+ set( LINKER_FLAGS "${LINKER_FLAGS} -Wl,-allow-shlib-undefined" )
+endif()
+
 if( ARMEABI_V7A )
  # this is *required* to use the following linker flags that routes around
  # a CPU bug in some Cortex-A8 implementations:
@@ -839,7 +890,7 @@
 endmacro()

 set( ANDROID_SET_OBSOLETE_VARIABLES ON CACHE BOOL "Define obsolete Andrid-specific cmake variables" )
-MARK_AS_ADVANCED( ANDROID_SET_OBSOLETE_VARIABLES )
+mark_as_advanced( ANDROID_SET_OBSOLETE_VARIABLES )
 if( ANDROID_SET_OBSOLETE_VARIABLES )
  set( ANDROID_API_LEVEL ${ANDROID_NATIVE_API_LEVEL} )
  set( ARM_TARGET "${ANDROID_ABI}" )
@@ -851,9 +902,11 @@
 #   ANDROID_FORCE_ARM_BUILD : ON/OFF
 #   ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14 (depends on NDK version)
 #   ANDROID_NO_UNDEFINED : ON/OFF
+#   ANDROID_SO_UNDEFINED : OFF/ON  (default depends on NDK version)
 #   ANDROID_SET_OBSOLETE_VARIABLES : ON/OFF
 #   LIBRARY_OUTPUT_PATH_ROOT : <any path>
-#   ANDROID_USE_STLPORT : ON/OFF(default) - EXPERIMENTAL!!!
+#   ANDROID_USE_STLPORT : OFF/ON - EXPERIMENTAL!!!
+#   ANDROID_FORBID_SYGWIN : ON/OFF
 # Can be set only at the first run:
 #   ANDROID_NDK
 #   ANDROID_STANDALONE_TOOLCHAIN


FindMPI: fix a CMP0054 warning for CMake

Change-Id: I374752a4366d125f39335ff82f9364064f9b9d56

--- CMake/FindMPI.cmake
+++ CMake/FindMPI.cmake
@@ -136,7 +136,7 @@
 # or if we know it matches the regular compiler.
 foreach (lang C CXX Fortran)
   foreach (id GNU Intel PGI XL)
-    if (NOT CMAKE_${lang}_COMPILER_ID OR "${CMAKE_${lang}_COMPILER_ID}" STREQUAL "${id}")
+    if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID} STREQUAL id)
       list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES})
     endif()
     unset(_MPI_${id}_${lang}_COMPILER_NAMES)    # clean up the namespace here


CMake macro add_compiler_flag() deprecated by add_common_flags().

--- cmake/Compiler.cmake
+++ cmake/Compiler.cmake
@@ -23,7 +23,13 @@
     endforeach()
 endmacro()

+# @deprecated - use add_common_flags() instead
 macro(add_compiler_flag)
+    message(DEPRECATION "add_compiler_flag() is deprecated, use add_common_flags() instead")
+    add_common_flags(${ARGN})
+endmacro()
+
+macro(add_common_flags)
     foreach(flag ${ARGN})
         add_c_flag(${flag})
         add_cxx_flag(${flag})


make windeployqt more verbose

make windeployqt more verbose

--- cmake/DeployQt.cmake
+++ cmake/DeployQt.cmake
@@ -45,7 +45,6 @@
     add_custom_command(TARGET ${target} POST_BUILD
         COMMAND "${CMAKE_COMMAND}" -E
             env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
-                --verbose 0
                 --no-compiler-runtime
                 --no-angle
                 --no-opengl-sw


[macOS] Fix searching for SKIA_OPENGL_LIBRARY

In macOS, if the user's filesystem is **case-sensitive**, then laf CAN'T locate
`/System/Library/Frameworks/OpenGL.framework/`, which results in link failures.
(aseprite/aseprite#1776)

This is because `cmake/FindSkia.cmake` tries to locate `/System/Library/Frameworks/opengl.framework/`.
(Notice the lowercase "opengl" instead of "OpenGL").

This commit fixes such error on macOS with a **case-sensitive**
filesystem. Tested on Macbook Pro Retina 2014 with Mojave + APFS
(case-sensitive).

--- cmake/FindSkia.cmake
+++ cmake/FindSkia.cmake
@@ -23,6 +23,8 @@
 find_library(SKIA_LIBRARY skia PATH "${SKIA_LIBRARY_DIR}")
 if(WIN32)
   find_library(SKIA_OPENGL_LIBRARY opengl32)
+elseif(APPLE)
+  find_library(SKIA_OPENGL_LIBRARY OpenGL NAMES GL)
 else()
   find_library(SKIA_OPENGL_LIBRARY opengl NAMES GL)
 endif()


Update package

Update package

--- cmake/packages.cmake
+++ cmake/packages.cmake
@@ -51,7 +51,7 @@
 #message(STATUS "XXXXXXXXXXXXXXX CPACK_PACKAGE_FILE_NAME=" ${CPACK_PACKAGE_FILE_NAME})

 if (UNIX)
-    set (CPACK_GENERATOR "RPM;TGZ;DEB")
+    set (CPACK_GENERATOR "TGZ;DEB;RPM")
     set (CPACK_PACKAGING_INSTALL_PREFIX "/home/s/safe")
 else (UNIX)
     set (CPACK_GENERATOR "TGZ")


Set ${CONTINUE} to ${CPPCheck_FOUND} not CPPCheck_FOUND

--- CPPCheck.cmake
+++ CPPCheck.cmake
@@ -23,7 +23,7 @@

     endif (NOT DEFINED CPPCheck_FOUND)

-    set (${CONTINUE} CPPCheck_FOUND)
+    set (${CONTINUE} ${CPPCheck_FOUND})

 endmacro (_validate_cppcheck)


CommonLibrary:Allow global static/shared setting

--- CommonLibrary.cmake
+++ CommonLibrary.cmake
@@ -8,7 +8,7 @@
 # * NAME_HEADERS for all internal header files
 # * NAME_PUBLIC_HEADERS for public, installed header files
 # * NAME_LINK_LIBRARIES for dependencies of name
-# * NAME_LIBRARY_TYPE for setting shared or static library
+# * NAME_LIBRARY_TYPE or COMMON_LIBRARY_TYPE for SHARED or STATIC library
 # * PROJECT_INCLUDE_NAME for the include directory and project include header
 # * VERSION for the API version
 # * VERSION_ABI for the ABI version
@@ -71,7 +71,10 @@
   source_group(
     ${PROJECT_INCLUDE_NAME} FILES ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
   if (NOT ${NAME}_LIBRARY_TYPE)
-    set(${NAME}_LIBRARY_TYPE SHARED)
+    set(${NAME}_LIBRARY_TYPE ${COMMON_LIBRARY_TYPE})
+    if (NOT ${NAME}_LIBRARY_TYPE)
+      set(${NAME}_LIBRARY_TYPE SHARED)
+    endif()
   endif()
   foreach(LIBRARY_TYPE ${${NAME}_LIBRARY_TYPE})
     set(LIBNAME ${Name})


COMP: boost version set to latest: 1.65.0 #12

--- SuperBuild/ExternalBoost.cmake
+++ SuperBuild/ExternalBoost.cmake
@@ -26,8 +26,8 @@
 set( BOOST_CONFIGURE_COMMAND )
 set( B2_ARGS --with-program_options --with-filesystem --with-log --with-date_time --with-thread --with-regex address-model=64 )
 if( UNIX )
-  set( BOOST_URL "http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz")
-  set( BOOST_MD5 51528a0e3b33d9e10aaa311d9eb451e3 )
+  set( BOOST_URL "http://dl.bintray.com/boostorg/release/1.65.0/source/boost_1_65_0.tar.gz")
+  set( BOOST_MD5 d75a27ad1a34cfc7c9b5cb92594410c3 )
   set( BOOST_CONFIGURE_COMMAND ./bootstrap.sh )
   set( BOOST_BUILD_COMMAND ./b2 ${B2_ARGS})
 else()
@@ -39,8 +39,8 @@
     elseif(MSVC14)
       set(B2_ARGS "--toolset=msvc-14.0" ${B2_ARGS})
     endif(MSVC11)
-    set( BOOST_URL "http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.zip")
-    set( BOOST_MD5 08d29a2d85db3ebc8c6fdfa3a1f2b83c )
+    set( BOOST_URL "http://dl.bintray.com/boostorg/release/1.65.0/source/boost_1_65_0.zip")
+    set( BOOST_MD5 eb1e11262e0cfc6949d054f6d8d25dc6 )
     set( BOOST_CONFIGURE_COMMAND cmd /C bootstrap.bat msvc )
     set( BOOST_BUILD_COMMAND b2.exe ${B2_ARGS})
   endif()


Update golang script

Update golang script

--- golang.cmake
+++ golang.cmake
@@ -1,8 +1,8 @@

 function(external_go_project)
   set(options)
-  set(singleValueOpts TARGET)
-  set(multiValueOpts ARGS)
+  set(singleValueOpts TARGET PACKAGE)
+  set(multiValueOpts)

   cmake_parse_arguments(GO_EXTERNAL "${options}" "${singleValueOpts}" "${multiValueOpts}" ${ARGN})

@@ -10,29 +10,33 @@
     message(FATAL_ERROR "No target specified for external_go_project")
   endif()

-  if (NOT GO_EXTERNAL_ARGS)
-    message(FATAL_ERROR "No ARGS specified for external_go_project")
+  if (NOT GO_EXTERNAL_PACKAGE)
+    message(FATAL_ERROR "No Package specified for external_go_project")
   endif()

-  add_custom_target(${TARGET} env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} get ${ARGS})
+  add_custom_target(${GO_EXTERNAL_TARGET} env GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} get ${GO_EXTERNAL_PACKAGE})
 endfunction()

 function(add_go_executable)
   set(options)
-  set(singleValueOpts NAME)
+  set(singleValueOpts TARGET NAME)
   set(multiValueOpts SOURCE_FILES)

   cmake_parse_arguments(GO_EXECUTABLE "${options}" "${singleValueOpts}" "${multiValueOpts}" ${ARGN})

+  if (NOT GO_EXECUTABLE_TARGET)
+    message(FATAL_ERROR "No target provided to add_go_executable")
+  endif()
+
   if (NOT GO_EXECUTABLE_NAME)
-    message(FATAL_ERROR "No name provided to add_go_executable")
+    set(GO_EXECUTABLE_NAME ${GO_EXECUTABLE_TARGET})
   endif()

   if (NOT GO_EXECUTABLE_SOURCE_FILES)
     file(GLOB GO_EXECUTABLE_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.go")
   endif()

-  add_custom_target(${GO_EXECUTABLE_NAME}  COMMAND GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} build
+  add_custom_target(${GO_EXECUTABLE_TARGET}  COMMAND GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} build
     -o "${CMAKE_CURRENT_BINARY_DIR}/${GO_EXECUTABLE_NAME}"
     ${CMAKE_GO_FLAGS} ${GO_EXECUTABLE_SOURCE_FILES}
     WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
@@ -43,13 +47,17 @@

 function(add_go_library)
   set(options STATIC SHARED)
-  set(singleValueOpts NAME)
+  set(singleValueOpts TARGET NAME)
   set(multiValueOpts SOURCE_FILES)

   cmake_parse_arguments(GO_LIBRARY "${options}" "${singleValueOpts}" "${multiValueOpts}" ${ARGN})

+  if (NOT GO_LIBRARY_TARGET)
+    message(FATAL_ERROR "No target provided for go library")
+  endif()
+
   if (NOT GO_LIBRARY_NAME)
-    message(FATAL_ERROR "No name provided for go library")
+    set(GO_LIBRARY_NAME ${GO_LIBRARY_TARGET})
   endif()

   if (GO_LIBRARY_SHARED)
@@ -68,7 +76,7 @@
     file(GLOB GO_LIBRARY_SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.go")
   endif()

-  add_custom_target(${GO_LIBRARY_NAME} COMMAND GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} build ${BUILD_MODE}
+  add_custom_target(${GO_LIBRARY_TARGET} COMMAND GOPATH=${GOPATH} ${CMAKE_Go_COMPILER} build ${BUILD_MODE}
     -o "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}"
     ${CMAKE_GO_FLAGS} ${GO_LIBRARY_SOURCE_FILES}
     WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})


Switch to llvm-3.3-dev as the latest release

--- FindLLVM.cmake
+++ FindLLVM.cmake
@@ -5,42 +5,43 @@
 #  LLVM_CFLAGS      - llvm compiler flags
 #  LLVM_LFLAGS      - llvm linker flags
 #  LLVM_MODULE_LIBS - list of llvm libs for working with modules.
-#  LLVM_FOUND       - True if llvm found.

-find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-3.4 DOC "llvm-config executable")
+set(LLVM_VERSION "3.3")
+
+find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-${LLVM_VERSION} DOC "llvm-config executable")

 if (LLVM_CONFIG_EXECUTABLE)
-  message(STATUS "LLVM llvm-config-3.4 found at: ${LLVM_CONFIG_EXECUTABLE}")
+	message(STATUS "LLVM llvm-config-${LLVM_VERSION} found at: ${LLVM_CONFIG_EXECUTABLE}")
 else (LLVM_CONFIG_EXECUTABLE)
-  message(FATAL_ERROR "Could NOT find LLVM executable. Version 3.4 expected.")
+	message(FATAL_ERROR "Could NOT find LLVM executable. Version ${LLVM_VERSION} expected.")
 endif (LLVM_CONFIG_EXECUTABLE)

 execute_process(
-  COMMAND ${LLVM_CONFIG_EXECUTABLE} --includedir
-  OUTPUT_VARIABLE LLVM_INCLUDE_DIR
-  OUTPUT_STRIP_TRAILING_WHITESPACE
+	COMMAND ${LLVM_CONFIG_EXECUTABLE} --includedir
+	OUTPUT_VARIABLE LLVM_INCLUDE_DIR
+	OUTPUT_STRIP_TRAILING_WHITESPACE
 )

 execute_process(
-  COMMAND ${LLVM_CONFIG_EXECUTABLE} --libdir
-  OUTPUT_VARIABLE LLVM_LIBRARY_DIR
-  OUTPUT_STRIP_TRAILING_WHITESPACE
+	COMMAND ${LLVM_CONFIG_EXECUTABLE} --libdir
+	OUTPUT_VARIABLE LLVM_LIBRARY_DIR
+	OUTPUT_STRIP_TRAILING_WHITESPACE
 )

 execute_process(
-  COMMAND ${LLVM_CONFIG_EXECUTABLE} --cppflags
-  OUTPUT_VARIABLE LLVM_CFLAGS
-  OUTPUT_STRIP_TRAILING_WHITESPACE
+	COMMAND ${LLVM_CONFIG_EXECUTABLE} --cppflags
+	OUTPUT_VARIABLE LLVM_CFLAGS
+	OUTPUT_STRIP_TRAILING_WHITESPACE
 )

 execute_process(
-  COMMAND ${LLVM_CONFIG_EXECUTABLE} --ldflags
-  OUTPUT_VARIABLE LLVM_LFLAGS
-  OUTPUT_STRIP_TRAILING_WHITESPACE
+	COMMAND ${LLVM_CONFIG_EXECUTABLE} --ldflags
+	OUTPUT_VARIABLE LLVM_LFLAGS
+	OUTPUT_STRIP_TRAILING_WHITESPACE
 )

 execute_process(
-  COMMAND ${LLVM_CONFIG_EXECUTABLE} --libs core analysis jit native
-  OUTPUT_VARIABLE LLVM_MODULE_LIBS
-  OUTPUT_STRIP_TRAILING_WHITESPACE
+	COMMAND ${LLVM_CONFIG_EXECUTABLE} --libs core analysis jit native
+	OUTPUT_VARIABLE LLVM_MODULE_LIBS
+	OUTPUT_STRIP_TRAILING_WHITESPACE
 )


Closes #86: Find script does not work with 1.0

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[ ] Bugfix
[ ] New Feature
[x] Cleanup
[ ] Optimization
[ ] Documentation

--- FindEqualizer.cmake
+++ FindEqualizer.cmake
@@ -205,7 +205,7 @@
         "See the ${CMAKE_CURRENT_LIST_FILE} for more details.")
     endif()
   endif()
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Equalizer DEFAULT_MSG
+  find_package_handle_standard_args(Equalizer DEFAULT_MSG<
                                     _eq_LIBRARY _eq_INCLUDE_DIR)
 endif()

@@ -224,8 +224,10 @@
 endif()

 set(EQUALIZER_INCLUDE_DIRS ${_eq_INCLUDE_DIR})
-set(EQUALIZER_LIBRARIES ${_eq_LIBRARY} ${_eq_fabric_LIBRARY}
-                        ${COLLAGE_LIBRARIES})
+set(EQUALIZER_LIBRARIES ${_eq_LIBRARY} ${COLLAGE_LIBRARIES})
+if(EQUALIZER_VERSION VERSION_GREATER 1.0)
+  set(EQUALIZER_LIBRARIES ${EQUALIZER_LIBRARIES} ${_eq_fabric_LIBRARY})
+endif()
 get_filename_component(EQUALIZER_LIBRARY_DIR ${_eq_LIBRARY} PATH)

 if(EQUALIZER_FOUND)


Update Version.cmake

Update Version.cmake

--- src/Version.cmake
+++ src/Version.cmake
@@ -2,4 +2,4 @@
 # Boilerplate package Version.cmake file for BootsOnTheGround PACKAGE.
 # (NOTE: This version number is loaded by the package and the project.)
 #
-SET( VERSION "0.4.0" )
+SET( VERSION "0.5.0" )


Only add module target dependencies if the module actually has any

--- cmake/fips.cmake
+++ cmake/fips.cmake
@@ -201,7 +201,9 @@
     fips_apply_target_group(${CurTargetName})

     # make sure dependencies are built first
-    add_dependencies(${CurTargetName} ${CurDependencies})
+    if (CurDependencies)
+        add_dependencies(${CurTargetName} ${CurDependencies})
+    endif()

     # handle generators (post-target)
     fips_handle_generators(${CurTargetName})


fixed typo

fixed typo

--- cmake/vienna_build_common.cmake
+++ cmake/vienna_build_common.cmake
@@ -5,7 +5,7 @@
 cmake_policy(SET CMP0013 NEW)
 cmake_policy(SET CMP0014 NEW)

-#this function sets various variables before actually calling the include/add_subdirective command
+#this function sets various variables before actually calling the include/add_subdirectory command
 #  some of the variables set here are automatic variables that either have to be emulated (for the include call)
 #  or that are not set according to specification (for example PROJECT_SOURCE_DIR should point to the directory that
 #  contains the "closest" CMakeLists.txt that has project() command in it - but this just not the case when we use
@@ -89,7 +89,7 @@
     set(VIENNA_BUILD_GLOBAL_DEFINES "" CACHE INTERNAL "")
     set(VIENNA_BUILD_GLOBAL_INCLUDES "" CACHE INTERNAL "")
     set(VIENNA_BUILD_GLOBAL_BEFORE_INCLUDES "" CACHE INTERNAL "")
-
+
     #setup the VIENNA_BUILD_${SUB_PROJECT}_SOURCE_DIR variables
     foreach (SUB_PROJECT ${SUB_PROJECTS})
       string(TOUPPER ${SUB_PROJECT} SUB_PROJECT_UPPER)


Fixed the gdx.cmake script to run on XCode 4.4

Switched the pbxcp command to a rsync as the new XCode 4.4
remove it from it's command line tools

--- cmake/gdx.cmake
+++ cmake/gdx.cmake
@@ -12,15 +12,10 @@
 endmacro()

 macro(gdx_ios_copy_resources target_name target_files destination)
-    execute_process(COMMAND xcode-select -print-path OUTPUT_VARIABLE _output OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-    set(APP_NAME $(TARGET_BUILD_DIR)/$(FULL_PRODUCT_NAME))
-
     add_custom_command(
         TARGET ${target_name}
         POST_BUILD
-        COMMAND ${_output}/../../Contents/OtherFrameworks/DevToolsCore.framework/Versions/A/Resources/pbxcp -exclude
-            .DS_Store -exclude CVS -exclude .svn -exclude .git -resolve-src-symlinks ${target_files} ${APP_NAME}/${destination})
+        COMMAND rsync -r --exclude .DS_Store --exclude CVS --exclude .svn --exclude .git  ${target_files} "\${BUILT_PRODUCTS_DIR}/\${CONTENTS_FOLDER_PATH}/${destination}")
 endmacro()

 macro(gdx_setup_target target_name target_type sources)


fixed cmake config

fixed cmake config

--- src/cmake/httpppConfig.cmake
+++ src/cmake/httpppConfig.cmake
@@ -9,3 +9,4 @@
 endif()

 set(httppp_LIBRARIES httppp)
+set(httppp_INCLUDE_DIR "httppp")


Update flags option

Update flags option

--- test/claw_reference_test.cmake
+++ test/claw_reference_test.cmake
@@ -9,8 +9,9 @@

 function(claw_add_basic_test)
   set(options DEBUG COMPILE COMPARE IGNORE)
-  set(oneValueArgs NAME ORIGINAL TRANSFORMED REFERENCE WORKING_DIRECTORY CLAW_FLAGS)
-  cmake_parse_arguments(claw_add_basic_test "${options}" "${oneValueArgs}" "" ${ARGN})
+  set(oneValueArgs NAME ORIGINAL TRANSFORMED REFERENCE WORKING_DIRECTORY)
+  set(multiValueArgs CLAW_FLAGS)
+  cmake_parse_arguments(claw_add_basic_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

   if("${claw_add_basic_test_NAME}" STREQUAL "")
     message(FATAL "claw_add_basic_test NAME is required")
@@ -57,7 +58,8 @@
     add_custom_command(
       OUTPUT  ${output_file}
       COMMAND ${CMAKE_COMMAND} -E env CLAW_TRANS_SET_PATH=${CLAW_TRANS_SET_PATH}
-        ${CLAWFC} ${claw_add_basic_test_CLAW_FLAGS} --debug-omni --debug -J ${XMOD_DIR}
+        ${CLAWFC} ${claw_add_basic_test_CLAW_FLAGS} --debug-omni --debug
+        -J ${XMOD_DIR}
         -o ${output_file} ${original_file}
       WORKING_DIRECTORY ${claw_add_basic_test_WORKING_DIRECTORY}
       DEPENDS ${original_file}
@@ -152,8 +154,7 @@
 #
 function(claw_add_basic_test_set)
   set(oneValueArgs NAME DIRECTORY)
-  set(multiValueArgs EXCLUDE)
-  cmake_parse_arguments(claw_add_basic_test_set "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+  cmake_parse_arguments(claw_add_basic_test_set "" "${oneValueArgs}" "" ${ARGN})

   if("${claw_add_basic_test_set_NAME}" STREQUAL "")
     message(FATAL "claw_add_basic_test_set NAME is required")
@@ -167,12 +168,6 @@

   subdirlist(tests_dirs ${claw_add_basic_test_set_DIRECTORY})
   foreach(t_name ${tests_dirs})
-    if(${claw_add_basic_test_set_EXCLUDE})
-      list(FIND ${claw_add_basic_test_set_EXCLUDE} ${t_name} _index)
-      if("${_index}" GREATER -1)
-        continue()
-      endif()
-    endif()

     if(NO_COMPILE_${t_name})
       set(test_option_compile COMPILE)


SK:

SK:

-BUG: not removing the binary directory caused errors (because cmake complains that the output directories for testing already exist). So, always delete the binary directory before testing.

--- src/Testing/Dashboard/elxDashboardCommon.cmake
+++ src/Testing/Dashboard/elxDashboardCommon.cmake
@@ -165,10 +165,8 @@
 endmacro()

 # Start with a fresh build tree.
-if ( NOT dashboard_model STREQUAL Experimental )
-  message( "Clearing build tree..." )
-  ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )
-endif()
+message( "Clearing build tree..." )
+ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )

 # Support each testing model
 if( dashboard_model STREQUAL Continuous )


Added option to select minimum iOS version

--- support/iOS.cmake
+++ support/iOS.cmake
@@ -45,7 +45,8 @@
 find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
 if (CMAKE_UNAME)
   exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
-  string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
+  string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION
+          "${CMAKE_HOST_SYSTEM_VERSION}")
 endif (CMAKE_UNAME)

 # Skip the platform compiler checks for cross compiling
@@ -62,24 +63,28 @@

 set (CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
 set (CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
-set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
+set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG
+     "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
 set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")

 # Hidden visibilty is required for cxx on iOS
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
-set (CMAKE_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden ${CMAKE_CXX_FLAGS}")
+set (CMAKE_CXX_FLAGS
+     "-fvisibility=hidden -fvisibility-inlines-hidden ${CMAKE_CXX_FLAGS}")

 set (CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
+set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
+     "-dynamiclib -headerpad_max_install_names")
 set (CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
 set (CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
 set (CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
 set (CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")

-# hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build tree
-# (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL isn't in the cache
-# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
-# hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex
+# hack: if a new cmake (which uses CMAKE_INSTALL_NAME_TOOL) runs on an old build
+# tree (where install_name_tool was hardcoded) and where CMAKE_INSTALL_NAME_TOOL
+# isn't in the cache and still cmake didn't fail in CMakeFindBinUtils.cmake
+# (because it isn't rerun) hardcode CMAKE_INSTALL_NAME_TOOL here to
+# install_name_tool, so it behaves as it did before, Alex
 if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
   find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
 endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
@@ -130,15 +135,22 @@
   endif (_CMAKE_IOS_SDKS)
   message (STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
 endif (NOT DEFINED CMAKE_IOS_SDK_ROOT)
-set (CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK")
-
-# file(GLOB IOS_CXX_INCLUDE_DIRS ${CMAKE_IOS_SDK_ROOT}/usr/include/c++/*)
-# list(SORT IOS_CXX_INCLUDE_DIRS)
-# list(REVERSE IOS_CXX_INCLUDE_DIRS)
-# list(GET IOS_CXX_INCLUDE_DIRS 0 IOS_CXX_INCLUDE_DIR)
-# if (NOT DEFINED IOS_CXX_INCLUDE_DIR)
-#   message(FATAL_ERROR "No C++ include directory found in SDK.")
-# endif ()
+set (CMAKE_IOS_SDK_ROOT
+     ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK")
+
+# Parses the iOS SDK version from the SDK path.
+string(REGEX REPLACE
+       "^${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/[^0-9]*([0-9]+)\\.([0-9]+).*$" "\\1"
+       IOS_SDK_MAJOR_VERSION ${CMAKE_IOS_SDK_ROOT})
+string(REGEX REPLACE
+       "^${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/[^0-9]*([0-9]+)\\.([0-9]+).*$" "\\2"
+       IOS_SDK_MINOR_VERSION ${CMAKE_IOS_SDK_ROOT})
+set(MIN_IOS_VERSION "${IOS_SDK_MAJOR_VERSION}.${IOS_SDK_MINOR_VERSION}"
+    CACHE STRING "Minimum iOS version")
+
+
+
+message(STATUS "iOS: ${IOS_SDK_MAJOR_VERSION}.${IOS_SDK_MINOR_VERSION}")

 set(CMAKE_C_FLAGS "-isystem ${CMAKE_IOS_SDK_ROOT}/usr/include ${CMAKE_C_FLAGS}")
 set(CMAKE_CXX_FLAGS "-isystem ${CMAKE_IOS_SDK_ROOT}/usr/include ${CMAKE_CXX_FLAGS}")
@@ -148,12 +160,17 @@
                   ${LINKER_FLAGS}")

 if (${IOS_PLATFORM} STREQUAL "OS")
-  set(CMAKE_C_FLAGS "-miphoneos-version-min=7.0 ${CMAKE_C_FLAGS}")
-  set(CMAKE_CXX_FLAGS "-miphoneos-version-min=7.0 ${CMAKE_CXX_FLAGS}")
+  set(CMAKE_C_FLAGS
+      "-miphoneos-version-min=${MIN_IOS_VERSION} ${CMAKE_C_FLAGS}")
+  set(CMAKE_CXX_FLAGS
+      "-miphoneos-version-min=${MIN_IOS_VERSION} ${CMAKE_CXX_FLAGS}")
 else ()
-  set(CMAKE_C_FLAGS "-mios-simulator-version-min=7.0 ${CMAKE_C_FLAGS}")
-  set(CMAKE_CXX_FLAGS "-mios-simulator-version-min=7.0 ${CMAKE_CXX_FLAGS}")
-  set(LINKER_FLAGS "${LINKER_FLAGS} -L${CMAKE_IOS_SDK_ROOT}/usr/lib/system/host")
+  set(CMAKE_C_FLAGS
+      "-mios-simulator-version-min=${MIN_IOS_VERSION} ${CMAKE_C_FLAGS}")
+  set(CMAKE_CXX_FLAGS
+      "-mios-simulator-version-min=${MIN_IOS_VERSION} ${CMAKE_CXX_FLAGS}")
+  set(LINKER_FLAGS
+      "${LINKER_FLAGS} -L${CMAKE_IOS_SDK_ROOT}/usr/lib/system/host")
 endif ()

 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LINKER_FLAGS}")
@@ -162,7 +179,8 @@

 # Set the sysroot default to the most recent SDK
-set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support")
+set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH
+    "Sysroot used for iOS support")
 set(CMAKE_C_FLAGS "-isysroot ${CMAKE_IOS_SDK_ROOT} ${CMAKE_C_FLAGS}")
 set(CMAKE_CXX_FLAGS "-isysroot ${CMAKE_IOS_SDK_ROOT} ${CMAKE_CXX_FLAGS}")

@@ -170,13 +188,15 @@
 if (${IOS_PLATFORM} STREQUAL "OS")
   set(IOS_ARCH armv6 armv7)
 else ()
-  set (IOS_ARCH i386)
+  set(IOS_ARCH i386)
 endif ()

-set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE string  "Build architecture for iOS" FORCE)
+set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE string
+     "Build architecture for iOS" FORCE)

 # Set the find root to the iOS developer roots and to user defined paths
-set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE string  "iOS find search path root")
+set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT}
+     ${CMAKE_PREFIX_PATH} CACHE string  "iOS find search path root")

 # default to searching for frameworks first
 set (CMAKE_FIND_FRAMEWORK FIRST)
@@ -195,7 +215,8 @@

 # This little macro lets you set any XCode specific property
 macro (set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE)
-  set_property (TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE})
+  set_property (TARGET ${TARGET} PROPERTY
+                XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE})
 endmacro (set_xcode_property)


updates to .gitlab-ci.yml

updates to .gitlab-ci.yml

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -138,8 +138,8 @@
 #ctest_update (RETURN_VALUE count)
 update_test_models()
 ctest_configure()
-#ctest_build()
+ctest_build()
 #IF (NOT CTEST_SKIP_TESTING)
 #  ctest_test()
 #ENDIF()
-ctest_submit()
+#ctest_submit()


corrections linux

corrections linux

--- tbb/FindTBB.cmake
+++ tbb/FindTBB.cmake
@@ -83,15 +83,11 @@
 SET(_TBB_LIB_PATH ${TBB_LIB_PATH})                              # copy cached value
 IF(NOT _TBB_LIB_PATH)                                           # work on copy
 	# try to find "tbb.dll/so" from the env variables
-	#IF(MSVC)
-	#	find_file(_TBB_TBBDLL "tbb.dll" PATHS "" )
-	#ELSE()
-	#	find_library(_TBB_TBBDLL "tbb" PATHS "" ENV LD_LIBRARY_PATH)
-	#ENDIF()
-
-	#new
-	find_file(_TBB_TBBDLL "${_TBB_TBBLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" PATHS "" )
-
+	IF(MSVC)
+		find_file(_TBB_TBBDLL "tbb.dll" PATHS "" )
+	ELSE()
+		find_library(_TBB_TBBDLL "tbb" PATHS "" ENV LD_LIBRARY_PATH)
+	ENDIF()
 	#MESSAGE(STATUS "_TBB_TBBDLL=${_TBB_TBBDLL}")
 	IF(_TBB_TBBDLL)
 		get_filename_component(_TBB_DLL_PATH ${_TBB_TBBDLL} PATH CACHE)
@@ -106,12 +102,12 @@

 		#MESSAGE(STATUS "_TBB_LIB_PATH=${_TBB_LIB_PATH}")
 	ELSE()
-		MESSAGE(WARNING "!!!!!!!! ${_TBB_TBBLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} should be in PATH/LD_LIBRARY_PATH !!!!!!!!!")
+		MESSAGE(WARNING "!!!!!!!! ${CMAKE_SHARED_LIBRARY_PREFIX}${_TBB_TBBLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} should be in PATH/LD_LIBRARY_PATH !!!!!!!!!")
 	ENDIF()
 	unset(_TBB_TBBDLL CACHE)
 ENDIF()
 IF(NOT TBB_LIB_PATH) # set cache if needed
-	SET(TBB_LIB_PATH ${_TBB_LIB_PATH} CACHE PATH "where the optimized .so/.lib are")
+	SET(TBB_LIB_PATH "${_TBB_LIB_PATH}" CACHE PATH "where the optimized .so/.lib are" FORCE)
 ENDIF()

 # ----------------------------------------------------------------------------
@@ -146,7 +142,7 @@
 	unset(_TBB_TBBDLL_DEBUG CACHE)
 ENDIF()
 IF(NOT TBB_LIB_PATH_DEBUG) # set cache if needed
-	SET(TBB_LIB_PATH_DEBUG ${_TBB_LIB_PATH_DEBUG} CACHE PATH "where the debug .so/.lib are")
+	SET(TBB_LIB_PATH_DEBUG ${_TBB_LIB_PATH_DEBUG} CACHE PATH "where the debug .so/.lib are" FORCE)
 ENDIF()

 # ----------------------------------------------------------------------------
@@ -222,7 +218,7 @@
 	#MESSAGE(STATUS "_TBB_INCLUDE_DIRS=${_TBB_INCLUDE_DIRS}")
 ENDIF()
 IF(NOT TBB_INCLUDE_DIRS) # set cache if needed
-	SET(TBB_INCLUDE_DIRS ${_TBB_INCLUDE_DIRS} CACHE PATH "where the tbb/*.h are")
+	SET(TBB_INCLUDE_DIRS ${_TBB_INCLUDE_DIRS} CACHE PATH "where the tbb/*.h are" FORCE)
 ENDIF()
 unset(_TBB_INCLUDE_DIRS CACHE)

@@ -242,10 +238,10 @@
 	unset(_FILE)
 ENDIF()
 IF(NOT TBB_VERSION_INTERFACE)
-	SET(TBB_VERSION_INTERFACE ${_TBB_VERSION_INTERFACE} CACHE STRING "")
-	SET(TBB_VERSION_MAJOR ${_TBB_VERSION_MAJOR} CACHE INTERNAL "")
-	SET(TBB_VERSION_MINOR ${_TBB_VERSION_MINOR} CACHE INTERNAL "")
-	SET(TBB_VERSION_STRING ${_TBB_VERSION_STRING} CACHE STRING "")
+	SET(TBB_VERSION_INTERFACE ${_TBB_VERSION_INTERFACE} CACHE STRING "" FORCE)
+	SET(TBB_VERSION_MAJOR ${_TBB_VERSION_MAJOR} CACHE INTERNAL "" FORCE)
+	SET(TBB_VERSION_MINOR ${_TBB_VERSION_MINOR} CACHE INTERNAL "" FORCE)
+	SET(TBB_VERSION_STRING ${_TBB_VERSION_STRING} CACHE STRING "" FORCE)
 	mark_as_advanced(TBB_VERSION_INTERFACE)
 	mark_as_advanced(TBB_VERSION_MAJOR)
 	mark_as_advanced(TBB_VERSION_MINOR)
@@ -258,9 +254,9 @@
 # if all listed variables are TRUE
 find_package_handle_standard_args(TBB DEFAULT_MSG
 				TBB_LIBRARIES TBB_INCLUDE_DIRS
-				TBB_LIB_PATH TBB_LIB_PATH_DEBUG TBB_VERSION_STRING)
+				TBB_LIB_PATH TBB_LIB_PATH_DEBUG)

 #MESSAGE(STATUS "TBB_FOUND = ${TBB_FOUND}")
 # ----------------------------------------------------------------------------

-unset(_VERB)+unset(_VERB)


Fix GLEW_MX finder

Fix GLEW_MX finder

--- FindGLEW_MX.cmake
+++ FindGLEW_MX.cmake
@@ -17,7 +17,6 @@
     "  glewContextInit(0);\n"
     "}\n"
     )
-  file(APPEND ${TEST_SRC} "}\n")

   try_compile(_glew_mx_SUPPORTED ${CMAKE_BINARY_DIR}/glew_test ${TEST_SRC}
     CMAKE_FLAGS


Use 'xcrun' to locate iOS SDKs

Use 'xcrun' to locate iOS SDKs

On CircleCI machines, the iOS SDKs are in slightly different locations than normal, but 'xcrun' is able to locate them.

--- toolchains/iOS.toolchain.cmake
+++ toolchains/iOS.toolchain.cmake
@@ -114,15 +114,11 @@
 endif (${IOS_PLATFORM} STREQUAL "OS")

 # Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT
-# Note Xcode 4.3 changed the installation location, choose the most recent one available
-set (XCODE_POST_43_ROOT "/Applications/Xcode.app/Contents/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
-set (XCODE_PRE_43_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
 if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
-	if (EXISTS ${XCODE_POST_43_ROOT})
-		set (CMAKE_IOS_DEVELOPER_ROOT ${XCODE_POST_43_ROOT})
-	elseif(EXISTS ${XCODE_PRE_43_ROOT})
-		set (CMAKE_IOS_DEVELOPER_ROOT ${XCODE_PRE_43_ROOT})
-	endif (EXISTS ${XCODE_POST_43_ROOT})
+	execute_process(COMMAND xcrun --sdk iphonesimulator --show-sdk-platform-path OUTPUT_VARIABLE XCRUN_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
+	if (DEFINED XCRUN_OUTPUT)
+		set (CMAKE_IOS_DEVELOPER_ROOT "${XCRUN_OUTPUT}/Developer")
+	endif (DEFINED XCRUN_OUTPUT)
 endif (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
 set (CMAKE_IOS_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT} CACHE PATH "Location of iOS Platform")


Removed trailing right angle bracket.

Removed trailing right angle bracket.

--- cmake/Modules/Urho3D-CMake-magic.cmake
+++ cmake/Modules/Urho3D-CMake-magic.cmake
@@ -270,7 +270,7 @@
             if (MSVC)
                 # Specific to VS generator
                 add_custom_command (TARGET ${TARGET_NAME} PRE_LINK
-                    COMMAND ${CMAKE_SOURCE_DIR}/cmake/Scripts/ObjectLocator.bat ${TARGET_NAME} ${CMAKE_BINARY_DIR}/CMakeScriptOutput ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.dir/$<CONFIGURATION> ${SOURCE_FILES}>
+                    COMMAND ${CMAKE_SOURCE_DIR}/cmake/Scripts/ObjectLocator.bat ${TARGET_NAME} ${CMAKE_BINARY_DIR}/CMakeScriptOutput ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.dir/$<CONFIGURATION> ${SOURCE_FILES}
                     COMMENT "Locating object files")
             elseif (CMAKE_GENERATOR MATCHES MinGW)
                 # Specific to MinGW Makefile generator


ADD QmitkRawImageFileSequenceOpener.ui

ADD QmitkRawImageFileSequenceOpener.ui

--- Qmitk/files.cmake
+++ Qmitk/files.cmake
@@ -59,6 +59,7 @@
   QmitkApplicationBase/QmitkControlsRightFctLayoutTemplate.ui
   QmitkApplicationBase/QmitkMainTemplate.ui
   QmitkApplicationBase/QmitkRawImageFileOpener.ui
+  QmitkApplicationBase/QmitkRawImageFileSequenceOpener.ui
   QmitkApplicationBase/QmitkNablaBase.ui
   QmitkApplicationBase/QmitkOptionDialog.ui
   QmitkApplicationBase/QmitkRenderWindowSelector.ui


typo fix

typo fix

--- CreatePackage.cmake
+++ CreatePackage.cmake
@@ -21,4 +21,3 @@

 endfunction()

-cd ..


(split) COMP: Update FLTK SVN configuration.

Upstream FLTK changed their SVN server configuration.  The domain name
has changed and a checkout now requires a blank username and password.

Since the currently released version of CMake does not support an empty
username and password in the SVN checkout, a custom DOWNLOAD_COMMAND
is used for the FLTK ExternalProject.

Change-Id: I9f59b84d585bfcb69ad063534e6f21be8f8f165a

--- External-FLTK.cmake
+++ External-FLTK.cmake
@@ -15,9 +15,16 @@

 set(FLTK_INSTALL_COMMAND ${CMAKE_MAKE_COMMAND} install)

+find_package(Subversion)
+if(NOT Subversion_SVN_EXECUTABLE)
+  message(FATAL_ERROR "error: could not find svn for checkout of ${name}")
+endif()
 ExternalProject_Add(FLTK
-  SVN_REPOSITORY "http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3"
-  SVN_REVISION -r "9815"
+  # Need to create our own version of svn checkout command because CMake <
+  # 2.8.12 does not support passing an empty string for the username and
+  # password.
+  DOWNLOAD_COMMAND ${Subversion_SVN_EXECUTABLE} co "http://seriss.com/public/fltk/fltk/branches/branch-1.3" -r "9815"
+    --non-interactive --username= --password= ${CMAKE_BINARY_DIR}/FLTK
   UPDATE_COMMAND ""
   PATCH_COMMAND ${FLTK_PATCH_COMMAND}
   SOURCE_DIR FLTK


switching cdash to panthema.net

switching cdash to panthema.net

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -10,12 +10,12 @@
 # All rights reserved. Published under the BSD-2 license in the LICENSE file.
 ################################################################################

-set(CTEST_PROJECT_NAME "thrill")
+set(CTEST_PROJECT_NAME "Thrill")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=thrill")
+set(CTEST_DROP_SITE "panthema.net")
+set(CTEST_DROP_LOCATION "/cdash-12/submit.php?project=Thrill")
 set(CTEST_DROP_SITE_CDASH TRUE)

 ################################################################################


refs #5127 try to ignore build warnings in jemalloc source

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@50813 c7de825b-a66e-492c-adef-691d508d4ae1

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -226,7 +226,7 @@
   "clang: warning: unknown warning option"
   # don't complain about warnings in jemalloc source
   "jemalloc-3.2.0/src"
-  "jemalloc/internal/jemalloc_internal.h"
+  "jemalloc/internal"
   # don't complain about ranlib or libtool on empty archive
   "has no symbols"
   "the table of contents is empty"


Fix doxygit target on missing organization

--- DoxygenRule.cmake
+++ DoxygenRule.cmake
@@ -53,10 +53,13 @@
     COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/doc/html ${GIT_DOCUMENTATION_DIR}
     COMMENT "Copying API documentation to ${GIT_DOCUMENTATION_DIR}"
     DEPENDS doxygen VERBATIM)
+
+  add_custom_target(doxygit
+    COMMAND ${CMAKE_COMMAND} -DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -DCMAKE_CURRENT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}" -DCMAKE_PROJECT_NAME="${GIT_DOCUMENTATION_REPO}" -P ${CMAKE_CURRENT_LIST_DIR}/Doxygit.cmake
+    COMMENT "Updating ${GIT_DOCUMENTATION_REPO}"
+    WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/../${GIT_DOCUMENTATION_REPO}"
+    DEPENDS doxycopy)
+else()
+  add_custom_target(doxygit
+    COMMENT "doxygit target not available, missiing GIT_DOCUMENTATION_REPO")
 endif()
-
-add_custom_target(doxygit
-  COMMAND ${CMAKE_COMMAND} -DCMAKE_SOURCE_DIR="${CMAKE_SOURCE_DIR}" -DCMAKE_CURRENT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}" -DCMAKE_PROJECT_NAME="${GIT_DOCUMENTATION_REPO}" -P ${CMAKE_CURRENT_LIST_DIR}/Doxygit.cmake
-  COMMENT "Updating ${GIT_DOCUMENTATION_REPO}"
-  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/../${GIT_DOCUMENTATION_REPO}"
-  DEPENDS doxycopy)


FIX: added QmitkNumberPropertySlider to moc headers

--- Qmitk/files.cmake
+++ Qmitk/files.cmake
@@ -130,6 +130,7 @@
   QmitkPropertyObservers/QmitkDataTreeListViewExpander.h
   QmitkPropertyObservers/QmitkDataTreeListView.h
   QmitkPropertyObservers/QmitkNumberPropertyEditor.h
+  QmitkPropertyObservers/QmitkNumberPropertySlider.h
   QmitkPropertyObservers/QmitkNumberPropertyView.h
   QmitkPropertyObservers/QmitkStringPropertyEditor.h
   QmitkPropertyObservers/QmitkStringPropertyOnDemandEdit.h


issue #506 addition - should now be fixed

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@4034 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -60,6 +60,7 @@
 if(NOT WIN32 AND NOT USB_10_FOUND)
   message(STATUS "OpenNI disabled because libusb-1.0 not found.")
   set(HAVE_OPENNI OFF)
+  set(OPENNI_FOUND OFF)
   return()
 else(NOT WIN32 AND NOT USB_10_FOUND)
 	include_directories(${USB_10_INCLUDE_DIR})


[CMake] Enable LLDB_BUILD_FRAMEWORK only on Apple platforms

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -13,16 +13,15 @@
 set(LLVM_EXTERNALIZE_DEBUGINFO OFF CACHE BOOL "" FORCE)
 set(LLVM_TARGETS_TO_BUILD      X86;ARM;AArch64 CACHE STRING "" FORCE)

-set(LLDB_BUILD_FRAMEWORK ON CACHE BOOL "" FORCE)
-set(LLDB_FRAMEWORK_TOOLS ${swift_lldb_framework_tools} CACHE STRING "" FORCE)
-
 set(LLDB_VERSION_MAJOR   992 CACHE STRING "" FORCE)
 set(LLDB_VERSION_MINOR   8   CACHE STRING "" FORCE)
 set(LLDB_VERSION_PATCH   1   CACHE STRING "" FORCE)
-set(LLDB_VERSION_SUFFIX  svn CACHE STRING "" FORCE) # Append to LLVM version
+set(LLDB_VERSION_SUFFIX  svn CACHE STRING "" FORCE)

 if(APPLE)
   set(LLDB_USE_SYSTEM_DEBUGSERVER ON CACHE BOOL "" FORCE)
+  set(LLDB_BUILD_FRAMEWORK ON CACHE BOOL "" FORCE)
+  set(LLDB_FRAMEWORK_TOOLS ${swift_lldb_framework_tools} CACHE STRING "" FORCE)
 endif()

 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")


[CMake] Allow for test labels also when adding gtests.

When using LABEL on ROOT_ADD_GTEST, arguments will now be passed on to
ROOT_ADD_TEST.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -1255,7 +1255,8 @@
 #                        [WORKING_DIR dir] [COPY_TO_BUILDDIR files]
 #                        [BUILD target] [PROJECT project]
 #                        [PASSREGEX exp] [FAILREGEX epx]
-#                        [PASSRC code])
+#                        [PASSRC code]
+#                        [LABELS label1 label2])
 #
 function(ROOT_ADD_TEST test)
   CMAKE_PARSE_ARGUMENTS(ARG "DEBUG;WILLFAIL;CHECKOUT;CHECKERR;RUN_SERIAL"
@@ -1489,7 +1490,7 @@
 # function ROOT_ADD_GTEST(<testsuite> source1 source2... COPY_TO_BUILDDIR file1 file2 LIBRARIES)
 #
 function(ROOT_ADD_GTEST test_suite)
-  CMAKE_PARSE_ARGUMENTS(ARG "WILLFAIL" "" "COPY_TO_BUILDDIR;LIBRARIES" ${ARGN})
+  CMAKE_PARSE_ARGUMENTS(ARG "WILLFAIL" "" "COPY_TO_BUILDDIR;LIBRARIES;LABELS" ${ARGN})
   include_directories(${CMAKE_CURRENT_BINARY_DIR} ${GTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR})

   ROOT_GET_SOURCES(source_files . ${ARG_UNPARSED_ARGUMENTS})
@@ -1509,6 +1510,9 @@
   if(ARG_WILLFAIL)
     set(willfail WILLFAIL)
   endif()
+  if(ARG_LABELS)
+    set(labels "LABELS ${ARG_LABELS}")
+  endif()

   ROOT_PATH_TO_STRING(mangled_name ${test_suite} PATH_SEPARATOR_REPLACEMENT "-")
   ROOT_ADD_TEST(
@@ -1517,6 +1521,7 @@
     WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR}
     COPY_TO_BUILDDIR ${ARG_COPY_TO_BUILDDIR}
     ${willfail}
+    ${labels}
   )
 endfunction()


Import upstream commit to get rid of old cmake syntax

Summary:
This imports 8bc55218 "cmake: get rid of the old & ugly syntax of having
arguments in else(), endif(), endmacro(), endfunction()" from
https://github.com/TelepathyIM/telepathy-qt.

Reviewers: #kde_telepathy, akulichalexandr, davidedmundson

Differential Revision: https://phabricator.kde.org/D7507

--- cmake/modules/TpQtMacros.cmake
+++ cmake/modules/TpQtMacros.cmake
@@ -128,15 +128,15 @@
   FOREACH(_currentArg ${ARGN})
     IF ("${_currentArg}" STREQUAL "DEPENDS")
       SET(_TPQT_DOING_DEPENDS TRUE)
-    ELSE ("${_currentArg}" STREQUAL "DEPENDS")
+    ELSE ()
       IF(_TPQT_DOING_DEPENDS)
         LIST(APPEND ${_tpqt_depends} "${_currentArg}")
-      ELSE(_TPQT_DOING_DEPENDS)
+      ELSE()
         LIST(APPEND ${_tpqt_other} "${_currentArg}")
-      ENDIF(_TPQT_DOING_DEPENDS)
-    ENDIF ("${_currentArg}" STREQUAL "DEPENDS")
-  ENDFOREACH(_currentArg)
-ENDMACRO (TPQT_EXTRACT_DEPENDS)
+      ENDIF()
+    ENDIF ()
+  ENDFOREACH()
+ENDMACRO ()

 # helper function to set up a moc rule
 FUNCTION (TPQT_CREATE_MOC_COMMAND_TARGET_DEPS infile outfile moc_flags moc_options)
@@ -151,28 +151,28 @@
     GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
     IF(_moc_outfile_dir)
       SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
-    ENDIF(_moc_outfile_dir)
+    ENDIF()
     SET (_moc_parameters_file ${outfile}_parameters)
     SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
     FILE (REMOVE ${_moc_parameters_file})
     FOREACH(arg ${_moc_parameters})
       FILE (APPEND ${_moc_parameters_file} "${arg}\n")
-    ENDFOREACH(arg)
+    ENDFOREACH()
     ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
                        COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
                        DEPENDS ${infile}
                        ${_moc_working_dir}
                        VERBATIM)
-  ELSE (WIN32)
+  ELSE ()
     ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
                        COMMAND ${QT_MOC_EXECUTABLE}
                        ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
                        DEPENDS ${infile})
-  ENDIF (WIN32)
+  ENDIF ()

   add_custom_target(moc-${_moc_outfile_name} DEPENDS ${outfile})
   add_dependencies(moc-${_moc_outfile_name} ${ARGN})
-ENDFUNCTION (TPQT_CREATE_MOC_COMMAND_TARGET_DEPS)
+ENDFUNCTION ()

 # add the -i option to QT_GENERATE_MOC
 function(TPQT_GENERATE_MOC_I infile outfile)
@@ -180,7 +180,7 @@
     get_filename_component(abs_infile ${infile} ABSOLUTE)
     qt5_create_moc_command(${abs_infile} ${outfile} "${moc_flags}" "-i")
     set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE)  # dont run automoc on this file
-endfunction(TPQT_GENERATE_MOC_I)
+endfunction()

 # same as tpqt_generate_moc_i, but lets the caller specify a list of targets which the mocs should depend on
 function(TPQT_GENERATE_MOC_I_TARGET_DEPS infile outfile)
@@ -188,7 +188,7 @@
     get_filename_component(abs_infile ${infile} ABSOLUTE)
     tpqt_create_moc_command_target_deps(${abs_infile} ${outfile} "${moc_flags}" "-i" ${ARGN})
     set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE)  # dont run automoc on this file
-endfunction(TPQT_GENERATE_MOC_I_TARGET_DEPS)
+endfunction()

 # generates mocs for the passed list. The list should be added to the target's sources
 function(tpqt_generate_mocs)
@@ -197,8 +197,8 @@
         string(REPLACE ".h" ".moc.hpp" generated_file ${moc_src})
         tpqt_generate_moc_i(${CMAKE_CURRENT_SOURCE_DIR}/${moc_src} ${CMAKE_CURRENT_BINARY_DIR}/_gen/${generated_file})
         set_property(SOURCE ${moc_src} APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_gen/${generated_file})
-    endforeach(moc_src ${ARGN})
-endfunction(tpqt_generate_mocs)
+    endforeach()
+endfunction()

 function(tpqt_client_generator spec group pretty_include namespace)
     tpqt_extract_depends(client_generator_args client_generator_depends ${ARGN})
@@ -231,12 +231,12 @@

     if (client_generator_depends)
         add_dependencies(generate_cli-${spec}-body ${client_generator_depends})
-    endif (client_generator_depends)
+    endif ()

     tpqt_generate_moc_i_target_deps(${CMAKE_CURRENT_BINARY_DIR}/_gen/cli-${spec}.h
                        ${CMAKE_CURRENT_BINARY_DIR}/_gen/cli-${spec}.moc.hpp
                        "generate_cli-${spec}-body")
-endfunction(tpqt_client_generator spec group pretty_include namespace)
+endfunction()

 function(tpqt_future_client_generator spec namespace)
     tpqt_extract_depends(future_client_generator_args future_client_generator_depends ${ARGN})
@@ -269,12 +269,12 @@

     if (future_client_generator_depends)
         add_dependencies(generate_future-${spec}-body ${future_client_generator_depends})
-    endif (future_client_generator_depends)
+    endif ()

     tpqt_generate_moc_i_target_deps(${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}.h
                        ${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}.moc.hpp
                        "generate_future-${spec}-body")
-endfunction(tpqt_future_client_generator spec namespace)
+endfunction()

 function(tpqt_service_generator spec group pretty_include namespace)
     tpqt_extract_depends(service_generator_args service_generator_depends ${ARGN})
@@ -306,12 +306,12 @@

     if (service_generator_depends)
         add_dependencies(generate_service-${spec}-body ${service_generator_depends})
-    endif (service_generator_depends)
+    endif ()

     tpqt_generate_moc_i_target_deps(${CMAKE_CURRENT_BINARY_DIR}/_gen/svc-${spec}.h
                        ${CMAKE_CURRENT_BINARY_DIR}/_gen/svc-${spec}.moc.hpp
                        "generate_service-${spec}-body")
-endfunction(tpqt_service_generator spec group pretty_include namespace)
+endfunction()

 # This function is used for generating CM in various examples
 function(tpqt_generate_manager_file MANAGER_FILE OUTPUT_FILENAME DEPEND_FILENAME)
@@ -330,7 +330,7 @@

     set_source_files_properties(${DEPEND_FILENAME}
                                 PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_gen/param-spec-struct.h)
-endfunction(tpqt_generate_manager_file MANAGER_FILE)
+endfunction()

 function(tpqt_xincludator _TARGET_NAME _INPUT_FILE _OUTPUT_FILE)
     tpqt_extract_depends(xincludator_gen_args xincludator_gen_depends ${ARGN})
@@ -352,8 +352,8 @@

     if (xincludator_gen_depends)
         add_dependencies(${_TARGET_NAME} ${xincludator_gen_depends})
-    endif (xincludator_gen_depends)
-endfunction(tpqt_xincludator _TARGET_NAME _INPUT_FILE _OUTPUT_FILE)
+    endif ()
+endfunction()

 function(tpqt_constants_gen _TARGET_NAME _SPEC_XML _OUTFILE)
     tpqt_extract_depends(constants_gen_args constants_gen_depends ${ARGN})
@@ -377,8 +377,8 @@

     if (constants_gen_depends)
         add_dependencies(${_TARGET_NAME} ${constants_gen_depends})
-    endif (constants_gen_depends)
-endfunction (tpqt_constants_gen _TARGET_NAME _SPEC_XML _OUTFILE)
+    endif ()
+endfunction ()

 function(tpqt_types_gen _TARGET_NAME _SPEC_XML _OUTFILE_DECL _OUTFILE_IMPL _NAMESPACE _REALINCLUDE _PRETTYINCLUDE)
     tpqt_extract_depends(types_gen_args types_gen_depends ${ARGN})
@@ -404,8 +404,8 @@

     if (types_gen_depends)
         add_dependencies(${_TARGET_NAME} ${types_gen_depends})
-    endif (types_gen_depends)
-endfunction(tpqt_types_gen _TARGET_NAME _SPEC_XML _OUTFILE_DECL _OUTFILE_IMPL _NAMESPACE _REALINCLUDE _PRETTYINCLUDE)
+    endif ()
+endfunction()

 macro(tpqt_add_generic_unit_test _fancyName _name)
     tpqt_generate_moc_i(${_name}.cpp ${CMAKE_CURRENT_BINARY_DIR}/_gen/${_name}.cpp.moc.hpp)
@@ -416,7 +416,7 @@

     # Valgrind and Callgrind targets
     _tpqt_add_check_targets(${_fancyName} ${_name} ${CMAKE_CURRENT_BINARY_DIR}/runGenericTest.sh ${CMAKE_CURRENT_BINARY_DIR}/test-${_name})
-endmacro(tpqt_add_generic_unit_test _fancyName _name)
+endmacro()

 macro(tpqt_add_dbus_unit_test _fancyName _name)
     tpqt_generate_moc_i(${_name}.cpp ${CMAKE_CURRENT_BINARY_DIR}/_gen/${_name}.cpp.moc.hpp)
@@ -428,7 +428,7 @@

     # Valgrind and Callgrind targets
     _tpqt_add_check_targets(${_fancyName} ${_name} ${with_session_bus} ${CMAKE_CURRENT_BINARY_DIR}/test-${_name})
-endmacro(tpqt_add_dbus_unit_test _fancyName _name)
+endmacro()

 macro(_tpqt_add_check_targets _fancyName _name _runnerScript)
     set_tests_properties(${_fancyName}
@@ -480,7 +480,7 @@
         COMMENT
             "Running callgrind on test \"${_fancyName}\"")
     add_dependencies(check-callgrind check-callgrind-${_fancyName})
-endmacro(_tpqt_add_check_targets _fancyName _name)
+endmacro()

 function(tpqt_setup_dbus_test_environment)
     file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/runDbusTest.sh "
@@ -488,12 +488,12 @@
 sh ${CMAKE_SOURCE_DIR}/tools/with-session-bus.sh \\
     --config-file=${CMAKE_BINARY_DIR}/tests/dbus-1/session.conf -- $@
 ")
-endfunction(tpqt_setup_dbus_test_environment)
+endfunction()

 macro(make_install_path_absolute out in)
     if (IS_ABSOLUTE "${in}")
         set(${out} "${in}")
-    else (IS_ABSOLUTE "${in}")
+    else ()
         set(${out} "\${TELEPATHY_QT${QT_VERSION_MAJOR}_INSTALL_DIR}/${in}")
-    endif (IS_ABSOLUTE "${in}")
-endmacro(make_install_path_absolute out in)
+    endif ()
+endmacro()


change cmake condition to prevent WCOS fom linking advapi32 (#9500)

* change condition to prevent WCOS fom linking advapi32.dll

* Remove linkage to advapi32.lib

--- cmake/onnxruntime_common.cmake
+++ cmake/onnxruntime_common.cmake
@@ -33,10 +33,7 @@
          "${ONNXRUNTIME_ROOT}/core/platform/windows/logging/*.h"
          "${ONNXRUNTIME_ROOT}/core/platform/windows/logging/*.cc"
     )
-    # Windows platform adapter code uses advapi32, which isn't linked in by default in desktop ARM
-    if (NOT WINDOWS_STORE)
-        list(APPEND onnxruntime_EXTERNAL_LIBRARIES advapi32)
-    endif()
+
 else()
     list(APPEND onnxruntime_common_src_patterns
          "${ONNXRUNTIME_ROOT}/core/platform/posix/*.h"


fix typos. (cc #76)

fix typos. (cc #76)

--- cmakemodules/script_SIMD.cmake
+++ cmakemodules/script_SIMD.cmake
@@ -53,12 +53,12 @@
 		SET(CMAKE_MRPT_HAS_SSE4_1 1)
 	ENDIF (NOT DISABLE_SSE4_1)

-	SET(DISABLE_SSE4_1 OFF CACHE BOOL "Forces compilation WITHOUT SSE4.2 extensions")
-	MARK_AS_ADVANCED(DISABLE_SSE4_1)
-	SET(CMAKE_MRPT_HAS_SSE4_1 0)
-	IF (NOT DISABLE_SSE4_1)
-		SET(CMAKE_MRPT_HAS_SSE4_1 1)
-	ENDIF (NOT DISABLE_SSE4_1)
+	SET(DISABLE_SSE4_2 OFF CACHE BOOL "Forces compilation WITHOUT SSE4.2 extensions")
+	MARK_AS_ADVANCED(DISABLE_SSE4_2)
+	SET(CMAKE_MRPT_HAS_SSE4_2 0)
+	IF (NOT DISABLE_SSE4_2)
+		SET(CMAKE_MRPT_HAS_SSE4_2 1)
+	ENDIF (NOT DISABLE_SSE4_2)

 	SET(DISABLE_SSE4_A OFF CACHE BOOL "Forces compilation WITHOUT SSE4a extensions")
 	MARK_AS_ADVANCED(DISABLE_SSE4_A)


FindTCL set TCL_INCLUDE_PATH

FindTCL set TCL_INCLUDE_PATH

--- cmake/FindTCL.cmake
+++ cmake/FindTCL.cmake
@@ -74,3 +74,7 @@
 endif()
 message(STATUS "TCL header: ${TCL_HEADER}")
 get_filename_component(TCL_HEADER_DIR "${TCL_HEADER}" PATH)
+
+if (TCL_HEADER)
+  get_filename_component(TCL_INCLUDE_PATH "${TCL_HEADER}" PATH)
+endif()


the gitlab repo on GNOME seems to be out of commission. Using github’s mirror.

--- cmake/LibXML2.cmake
+++ cmake/LibXML2.cmake
@@ -26,7 +26,8 @@
     include(FetchContent)
     FetchContent_Declare(
       libxmlprovider
-      URL "https://gitlab.gnome.org/GNOME/libxml2/-/archive/${agent_xml2_lib_version_tag}/libxml2-${agent_xml2_lib_version_tag}.zip"
+      URL "https://github.com/GNOME/libxml2/archive/${agent_xml2_lib_version_tag}.zip"
+#      URL "https://gitlab.gnome.org/GNOME/libxml2/-/archive/${agent_xml2_lib_version_tag}/libxml2-${agent_xml2_lib_version_tag}.zip"
     )
     FetchContent_GetProperties(libxmlprovider)


Set timeout value on windows and mac (#27197)

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -386,7 +386,7 @@
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cudnn_deterministic=true)
     # No unit test should exceed 2 minutes.
     if (APPLE OR WIN32)
-        set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 600)
+        set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 150)
     else()
         set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 120)
     endif()
@@ -748,7 +748,7 @@
     endif()

     if (APPLE OR WIN32)
-        set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 600)
+        set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 150)
     else()
         # No unit test should exceed 2 minutes in Linux.
         set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 120)


FIX: propagation dependencies and out of date rebuild

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -99,15 +99,37 @@
   set(libs ${ARGN})
   list(REMOVE_DUPLICATES libs)

-  # First get the file names of the libraries to be merged
+  # Get all propagation dependencies from the merged libraries
   foreach(lib ${libs})
+    list(APPEND libs_deps ${${lib}_LIB_DEPENDS})
+  endforeach()
+
+  # To produce a library we need at least one source file.
+  # It is created by add_custom_command below and will helps
+  # also help to track dependencies.
+  set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}_dummy.c)
+
+  # Make the generated dummy source file depended on all static input
+  # libs. If input lib changes,the source file is touched
+  # which causes the desired effect (relink).
+  add_custom_command(OUTPUT ${dummyfile}
+    COMMAND ${CMAKE_COMMAND} -E touch ${dummyfile}
+    DEPENDS ${libs})
+
+  # Generate dummy staic lib
+  file(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";")
+  add_library(${TARGET_NAME} STATIC ${dummyfile})
+  target_link_libraries(${TARGET_NAME} ${libs_deps})
+
+  foreach(lib ${libs})
+    # Get the file names of the libraries to be merged
     set(libfiles ${libfiles} $<TARGET_FILE:${lib}>)
   endforeach()

+  # Get the file name of the generated library
+  set(outlibfile "$<TARGET_FILE:${TARGET_NAME}>")
+
   if(APPLE) # Use OSX's libtool to merge archives
-    set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}_dummy.c)
-    file(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";")
-    add_library(${TARGET_NAME} STATIC ${dummyfile})
 		add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
       COMMAND rm "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.a"
       COMMAND /usr/bin/libtool -static -o "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.a" ${libfiles})
@@ -117,7 +139,8 @@
       set(objdir ${lib}.objdir)

       add_custom_command(OUTPUT ${objdir}
-        COMMAND ${CMAKE_COMMAND} -E make_directory ${objdir})
+        COMMAND ${CMAKE_COMMAND} -E make_directory ${objdir}
+        DEPENDS ${lib})

       add_custom_command(OUTPUT ${objlistfile}
         COMMAND ${CMAKE_AR} -x "$<TARGET_FILE:${lib}>"
@@ -125,23 +148,9 @@
         DEPENDS ${lib} ${objdir}
         WORKING_DIRECTORY ${objdir})

-      # Empty dummy source file that goes into merged library
-      set(mergebase ${lib}.mergebase.c)
-      add_custom_command(OUTPUT ${mergebase}
-        COMMAND ${CMAKE_COMMAND} -E touch ${mergebase}
-        DEPENDS ${objlistfile})
-
-      list(APPEND mergebases "${mergebase}")
-    endforeach()
-
-    # We need a target for the output merged library
-    add_library(${TARGET_NAME} STATIC ${mergebases})
-    set(outlibfile "$<TARGET_FILE:${TARGET_NAME}>")
-
-    foreach(lib ${libs})
       add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
-      COMMAND ${CMAKE_AR} ru ${outlibfile} @"../${lib}.objlist"
-      WORKING_DIRECTORY ${lib}.objdir)
+        COMMAND ${CMAKE_AR} ru ${outlibfile} *.o
+        WORKING_DIRECTORY ${objdir})
     endforeach()

     add_custom_command(TARGET ${TARGET_NAME} POST_BUILD


fix version

fix version

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -51,10 +51,20 @@
 	SET(REVISION_PREFIX "0x")
 	SET(REVISION_HUMAN ${MAINVERSION})
 	SET(PREFIX "v")
-	STRING(REGEX REPLACE "([0-9]+)\.*" "\\1" VERSION_MAJOR "${MAINVERSION}")
-	STRING(REGEX REPLACE ".*\0*([0-9]+)\.*" "\\1" VERSION_MINOR "${MAINVERSION}")
-	STRING(REGEX REPLACE ".*\..*-0*([0-9]+).*" "\\1" VERSION_SUB "${MAINVERSION}")
-	SET(REVISION ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_SUB})
+	STRING(REGEX REPLACE "([0-9]+)[.].*" "\\1" VERSION_MAJOR "${MAINVERSION}")
+	IF (${VERSION_MAJOR} LESS 10)
+		SET(VERSION_MAJOR "0${VERSION_MAJOR}")
+	ENDIF()
+
+	STRING(REGEX REPLACE ".*0*([0-9]+)[.].*" "\\1" VERSION_MINOR "${MAINVERSION}")
+	IF (${VERSION_MINOR} LESS 10)
+		SET(VERSION_MINOR "0${VERSION_MINOR}")
+	ENDIF()
+	STRING(REGEX REPLACE ".*[.].*0*([0-9]+).*" "\\1" VERSION_SUB "${MAINVERSION}")
+	IF (${VERSION_SUB} LESS 10)
+		SET(VERSION_SUB "0${VERSION_SUB}")
+	ENDIF()
+	#SET(REVISION ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_SUB})

 	EXECUTE_PROCESS(
 		COMMAND stat -c %y "${ROOT_DIR}/NEWS"


ManageDependency: pkgConf

ManageDependency: pkgConf

--- Modules/ManageDependency.cmake
+++ Modules/ManageDependency.cmake
@@ -200,7 +200,7 @@
 	    M_MSG(${M_ERROR} "pkgconfig is required with ${var}")
 	ENDIF(PKG_CONFIG_EXECUTABLE)
 	PKG_CHECK_MODULES(${var} ${_required}
-	    "${_opt_PKG_CONFIG}${_rel}${_opt_VER}")
+	    "${pkgConf}${_rel}${_opt_VER}")

 	## Get all variables
 	EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE}


ManageDependency: Dependency won't duplicate

--- Modules/ManageDependency.cmake
+++ Modules/ManageDependency.cmake
@@ -116,11 +116,17 @@
 	    SET(_name "${_name}-devel")
 	ENDIF(DEFINED ${var}_DEVEL)
 	IF("${_ver}" STREQUAL "")
-	    LIST(APPEND ${listVar} "${_name}")
+	    SET(_newDep  "${_name}")
 	ELSE("${_ver}" STREQUAL "")
-	    LIST(APPEND ${listVar} "${_name} ${_rel} ${_ver}")
+	    SET(_newDep  "${_name} ${_rel} ${_ver}")
 	ENDIF("${_ver}" STREQUAL "")
-	SET(${listVar} "${${listVar}}" CACHE INTERNAL "${listVar}")
+
+	## Insert when it's not duplicated
+	LIST(FIND ${listVar} "${_newDep}" _index)
+	IF(_index EQUAL -1)
+	    LIST(APPEND ${listVar} "${_newDep}")
+	    SET(${listVar} "${${listVar}}" CACHE INTERNAL "${listVar}")
+	ENDIF(_index EQUAL -1)
     ENDMACRO(MANAGE_DEPENDENCY listVar var)

 ENDIF(NOT DEFINED _MANAGE_DEPENDENCY_CMAKE_)


BUG: fixing boost

BUG: fixing boost

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -255,14 +255,14 @@
 ENDIF(OTB_USE_CURL)

 #For BOOST header file
-IF(OTB_USE_BOOST)
+IF(OTB_USE_EXTERNAL_BOOST)
   SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
   	${Boost_INCLUDE_DIR} )
-ELSE(OTB_USE_BOOST)
+ELSE(OTB_USE_EXTERNAL_BOOST)
   SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
         ${OTB_INSTALL_INCLUDE_DIR}/Utilities/BGL
         ${OTB_INSTALL_INCLUDE_DIR}/Utilities/BGL/boost)
-ENDIF(OTB_USE_BOOST)
+ENDIF(OTB_USE_EXTERNAL_BOOST)

 # For OpentTreads  header file
 IF(NOT OTB_USE_EXTERNAL_OPENTHREADS)


toolchain: llvm: Find strip command

toolchain: llvm: Find strip command

Some targets require *strip* command. This command was not
being set when selecting llvm toolchain.

Signed-off-by: Flavio Ceolin <979b9165500b0741b9d0500e2efd74fc1547bff7@intel.com>

--- cmake/bintools/llvm/target.cmake
+++ cmake/bintools/llvm/target.cmake
@@ -11,6 +11,7 @@
 find_program(CMAKE_NM      llvm-nm      ${find_program_clang_args}   )
 find_program(CMAKE_OBJDUMP llvm-objdump ${find_program_clang_args}   )
 find_program(CMAKE_RANLIB  llvm-ranlib  ${find_program_clang_args}   )
+find_program(CMAKE_STRIP   llvm-strip   ${find_program_clang_args}   )
 find_program(CMAKE_OBJCOPY objcopy      ${find_program_binutils_args})
 find_program(CMAKE_READELF readelf      ${find_program_binutils_args})


Update FindWiringpi.cmake

Update FindWiringpi.cmake

--- cmake/modules/FindWiringpi.cmake
+++ cmake/modules/FindWiringpi.cmake
@@ -14,24 +14,13 @@
    PATH_SUFFIXES
    )

-FIND_LIBRARY(WIRINGPI_LIBRARY NAMES wiringPi
+FIND_LIBRARY(WIRINGPI_LIBRARIES NAMES wiringPi
    PATHS
    /usr
    /usr/local
    /opt
    )

-
-set(WIRINGPI_INCLUDE_DIRS
-  ${WIRINGPI_INCLUDE_DIR}
-  )
-if (WIRINGPI_LIBRARY)
-  set(WIRINGPI_LIBRARIES
-    ${WIRINGPI_LIBRARIES}
-    ${WIRINGPI_LIBRARY}
-    )
-endif (WIRINGPI_LIBRARY)
-
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(wiringPi DEFAULT_MSG WIRINGPI_LIBRARIES WIRINGPI_INCLUDE_DIR)


Set the xwinttf driver to be off be default until it is more stable

svn path=/trunk/; revision=7428

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -102,7 +102,7 @@
 "wxwidgets:wxwidgets:ON"
 "xfig:xfig:ON"
 "xwin:xwin:ON"
-"xwinttf:xwinttf:ON"
+"xwinttf:xwinttf:OFF"
 )

 set(PRESET_DEFAULT OFF)


cmake: Added Arduino updated SDK path

cmake: Added Arduino updated SDK path

--- cmake/ArduinoToolchain.cmake
+++ cmake/ArduinoToolchain.cmake
@@ -70,6 +70,7 @@
           NAMES lib/version.txt
           PATH_SUFFIXES share/arduino
                         Arduino.app/Contents/Resources/Java/
+			Arduino.app/Contents/Java/
                         ${ARDUINO_PATHS}
           HINTS ${SDK_PATH_HINTS}
           DOC "Arduino SDK path.")


Now checks out a custom branch based on the main source line from tbb

--- cmake/BuildExternalTBB.cmake
+++ cmake/BuildExternalTBB.cmake
@@ -12,10 +12,10 @@
 ExternalProject_Add(tbb
 	DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
 	GIT_REPOSITORY https://github.com/anhstudios/tbb.git
-	GIT_TAG 3.0.5-custom
+	GIT_TAG v3.0.5-custom
 	UPDATE_COMMAND ""
 	SOURCE_DIR ${tbb_source}
-	BINARY_DIR ${tbb_binary}
+	BINARY_DIR ${tbb_source}
 	CONFIGURE_COMMAND ""
 	BUILD_COMMAND ${tbb_build}
 	INSTALL_COMMAND ""
@@ -23,4 +23,4 @@

 # Set the path to the built Boost for use by other projects
 set(TBB_INCLUDE_DIR "${tbb_source}" CACHE PATH "" FORCE)
-set(TBB_LIBRARY_DIRS "${tbb_binary}/lib" CACHE PATH "" FORCE)+set(TBB_LIBRARY_DIRS "${tbb_binary}/lib" CACHE PATH "" FORCE)


Remove Mahalanobis example if HAVE_LAPACK is not available

--- cmake/FindMetaExamples.cmake
+++ cmake/FindMetaExamples.cmake
@@ -1,22 +1,23 @@
 function(find_meta_examples)
 	FILE(GLOB_RECURSE META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/*.sg)
-
+
 	# temporary hacks to exclude certain meta examples that have dependencies
 	IF(NOT HAVE_NLOPT)
 		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/gaussian_processes/gaussian_process_regression.sg)
 	ENDIF()
-
+
 	IF(NOT USE_GPL_SHOGUN)
 		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS
 			${CMAKE_SOURCE_DIR}/examples/meta/src/gaussian_processes/gaussian_process_regression.sg
 			${CMAKE_SOURCE_DIR}/examples/meta/src/multiclass_classifier/multiclass_logisticregression.sg
 			)
 	ENDIF()
-
+
 	IF(NOT HAVE_LAPACK)
 		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS
 			${CMAKE_SOURCE_DIR}/examples/meta/src/regression/linear_ridge_regression.sg
 			${CMAKE_SOURCE_DIR}/examples/meta/src/clustering/gmm.sg
+			${CMAKE_SOURCE_DIR}/examples/meta/src/distance/mahalanobis.sg
 			)
 	ENDIF()


Fix the BUILD_SHARED_LIBS=ON build, was getting the following error while linking liblldb.so:

../include/llvm/Target/TargetOptions.h:104: error: undefined reference to 'llvm::TargetRecip::TargetRecip()'

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@277585 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -202,6 +202,7 @@
   option
   support
   coverage
+  target
   )

 if ( NOT LLDB_DISABLE_PYTHON )


retry without forwarding

retry without forwarding

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -27,7 +27,7 @@
         -output-replacements-xml
         ${CHECK_CXX_SOURCE_FILES}
         # WARNING: fix to stop with error if there are replacements
-         2>&1 | tee /dev/stdout | grep -c "replacement " > /dev/null
+        tee /dev/stdout | grep -c "replacement " > /dev/null
         COMMENT "Checking format compliance"
     )
 ENDIF()
@@ -61,7 +61,7 @@
             check-lint COMMAND !
             ${RUN_CLANG_TIDY} -header-filter=${CMAKE_SOURCE_DIR}
             # WARNING: fix to stop with error if there are problems
-            2>&1 | tee /dev/stdout | grep -c ": error: " > /dev/null
+            | tee /dev/stdout | grep -c ": error: " > /dev/null
             COMMENT "Checking for problems in source files"
         )
     ENDIF()


cmake: ld: use linker prefix for undefined symbols

The undefined symbol option "-u" applies to linker so prefix
it with the linker prefix (usually "-Wl"). This fixes warnings
from LLVM/Clang about unknown arguments.

Signed-off-by: Daniel Leung <d94e04d205b5962d7873a139ef298b03c1717f72@intel.com>

--- cmake/linker/ld/target.cmake
+++ cmake/linker/ld/target.cmake
@@ -57,7 +57,7 @@
 # Force symbols to be entered in the output file as undefined symbols
 function(toolchain_ld_force_undefined_symbols)
   foreach(symbol ${ARGN})
-    zephyr_link_libraries(-u${symbol})
+    zephyr_link_libraries(${LINKERFLAGPREFIX},-u,${symbol})
   endforeach()
 endfunction()


CMake: fix spelling of a variable name

CMake: fix spelling of a variable name

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1458,7 +1458,7 @@
         elseif("${sdk}" STREQUAL "TVOS" OR "${sdk}" STREQUAL "TVOS_SIMULATOR")
           list(APPEND swiftlib_module_depends_flattened
               ${SWIFTLIB_SWIFT_MODULE_DEPENDS_TVOS})
-        elseif("${SDK}" STREQUAL "WATCHOS" OR "${sdk}" STREQUAL "WATCHOS_SIMULATOR")
+        elseif("${sdk}" STREQUAL "WATCHOS" OR "${sdk}" STREQUAL "WATCHOS_SIMULATOR")
           list(APPEND swiftlib_module_depends_flattened
               ${SWIFTLIB_SWIFT_MODULE_DEPENDS_WATCHOS})
         endif()


build: remove `LINK_FLAGS` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -680,7 +680,6 @@
 #     [ARCHITECTURE architecture]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
 #     [SWIFT_COMPILE_FLAGS flag1...]
-#     [LINK_FLAGS flag1...]
 #     [FILE_DEPENDS target1 ...]
 #     INSTALL_IN_COMPONENT comp
 #     source1 [source2 source3 ...])
@@ -708,9 +707,6 @@
 #
 # SWIFT_COMPILE_FLAGS
 #   Extra compile flags (Swift).
-#
-# LINK_FLAGS
-#   Extra linker flags.
 #
 # FILE_DEPENDS
 #   Additional files this library depends on.
@@ -738,7 +734,6 @@
         GYB_SOURCES
         INCORPORATE_OBJECT_LIBRARIES
         INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
-        LINK_FLAGS
         LLVM_LINK_COMPONENTS
         SWIFT_COMPILE_FLAGS)

@@ -991,7 +986,7 @@
   # Collect compile and link flags for the static and non-static targets.
   # Don't set PROPERTY COMPILE_FLAGS or LINK_FLAGS directly.
   set(c_compile_flags ${SWIFTLIB_SINGLE_C_COMPILE_FLAGS})
-  set(link_flags ${SWIFTLIB_SINGLE_LINK_FLAGS})
+  set(link_flags)

   set(library_search_subdir "${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
   set(library_search_directories


cmake/modules: sync FindODBC.cmake with version from CMake itself

This module was introduced with CMake 3.12, so we cannot remove it yet.

--- cmake/modules/FindODBC.cmake
+++ cmake/modules/FindODBC.cmake
@@ -1,43 +1,227 @@
-# Find the ODBC driver manager includes and library.
-#
-# ODBC is an open standard for connecting to different databases in a
-# semi-vendor-independent fashion.  First you install the ODBC driver
-# manager.  Then you need a driver for each separate database you want
-# to connect to (unless a generic one works).  VTK includes neither
-# the driver manager nor the vendor-specific drivers: you have to find
-# those yourself.
-#
-# This module defines
-# ODBC_INCLUDE_DIR where to find sql.h
-# ODBC_LIBRARIES, the libraries to link against to use ODBC
-# ODBC_FOUND.  If false, you cannot build anything that requires MySQL.
-# also defined, but not for general use is
-# ODBC_LIBRARY, where to find the ODBC driver manager library.
-
-#---For the windows platform ODBC is located automatically
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindODBC
+--------
+
+Find an Open Database Connectivity (ODBC) include directory and library.
+
+On Windows, when building with Visual Studio, this module assumes the ODBC
+library is provided by the available Windows SDK.
+
+On Unix, this module allows to search for ODBC library provided by
+unixODBC or iODBC implementations of ODBC API.
+This module reads hint about location of the config program:
+
+.. variable:: ODBC_CONFIG
+
+  Location of odbc_config or iodbc-config program
+
+Otherwise, this module tries to find the config program,
+first from unixODBC, then from iODBC.
+If no config program found, this module searches for ODBC header
+and library in list of known locations.
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+.. variable:: ODBC::ODBC
+
+  Imported target for using the ODBC library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+.. variable:: ODBC_FOUND
+
+  Set to true if ODBC library found, otherwise false or undefined.
+
+.. variable:: ODBC_INCLUDE_DIRS
+
+  Paths to include directories listed in one variable for use by ODBC client.
+  May be empty on Windows, where the include directory corresponding to the
+  expected Windows SDK is already available in the compilation environment.
+
+.. variable:: ODBC_LIBRARIES
+
+  Paths to libraries to linked against to use ODBC.
+  May just a library name on Windows, where the library directory corresponding
+  to the expected Windows SDK is already available in the compilation environment.
+
+.. variable:: ODBC_CONFIG
+
+  Path to unixODBC or iODBC config program, if found or specified.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+For users who wish to edit and control the module behavior, this module
+reads hints about search locations from the following variables:
+
+.. variable:: ODBC_INCLUDE_DIR
+
+  Path to ODBC include directory with ``sql.h`` header.
+
+.. variable:: ODBC_LIBRARY
+
+  Path to ODBC library to be linked.
+
+These variables should not be used directly by project code.
+
+Limitations
+^^^^^^^^^^^
+
+On Windows, this module does not search for iODBC.
+On Unix, there is no way to prefer unixODBC over iODBC, or vice versa,
+other than providing the config program location using the ``ODBC_CONFIG``.
+This module does not allow to search for a specific ODBC driver.
+
+#]=======================================================================]
+
+# Define lists used internally
+set(_odbc_include_paths)
+set(_odbc_lib_paths)
+set(_odbc_lib_names)
+set(_odbc_required_libs_names)
+
+### Try Windows Kits ##########################################################
 if(WIN32)
-  find_path(ODBC_INCLUDE_DIR NAMES sql.h sqlext.h)
-  if(NOT ODBC_INCLUDE_DIR)
-    set(ODBC_INCLUDE_DIR "")
+  # List names of ODBC libraries on Windows
+  set(ODBC_LIBRARY odbc32.lib)
+  set(_odbc_lib_names odbc32;)
+
+  # List additional libraries required to use ODBC library
+  if(MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+    set(_odbc_required_libs_names odbccp32;ws2_32)
+  elseif(MINGW)
+    set(_odbc_required_libs_names odbccp32)
   endif()
-  set(ODBC_LIBRARY odbc32.lib)
-else()
-  find_path(ODBC_INCLUDE_DIR sqlext.h
-    PATH_SUFFIXES odbc iodbc
-    HINTS $ENV{ODBC_DIR}/include ${ODBC_DIR}/include
-    DOC "Specify the directory containing sql.h."
-  )
-
-  find_library( ODBC_LIBRARY NAMES iodbc odbc odbc32
-    PATHS_SUFFIXES odbc
-    HINTS  $ENV{ODBC_DIR}/lib ${ODBC_DIR}/lib
-    DOC "Specify the ODBC driver manager library here."
-  )
-endif()
-
-set(ODBC_LIBRARIES ${ODBC_LIBRARY})
+endif()
+
+### Try unixODBC or iODBC config program ######################################
+if (UNIX)
+  find_program(ODBC_CONFIG
+    NAMES odbc_config iodbc-config
+    DOC "Path to unixODBC or iODBC config program")
+  mark_as_advanced(ODBC_CONFIG)
+endif()
+
+if (UNIX AND ODBC_CONFIG)
+  # unixODBC and iODBC accept unified command line options
+  execute_process(COMMAND ${ODBC_CONFIG} --cflags
+    OUTPUT_VARIABLE _cflags OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND ${ODBC_CONFIG} --libs
+    OUTPUT_VARIABLE _libs OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+  # Collect paths of include directories from CFLAGS
+  separate_arguments(_cflags NATIVE_COMMAND "${_cflags}")
+  foreach(arg IN LISTS _cflags)
+    if("${arg}" MATCHES "^-I(.*)$")
+      list(APPEND _odbc_include_paths "${CMAKE_MATCH_1}")
+    endif()
+  endforeach()
+  unset(_cflags)
+
+  # Collect paths of library names and directories from LIBS
+  separate_arguments(_libs NATIVE_COMMAND "${_libs}")
+  foreach(arg IN LISTS _libs)
+    if("${arg}" MATCHES "^-L(.*)$")
+      list(APPEND _odbc_lib_paths "${CMAKE_MATCH_1}")
+    elseif("${arg}" MATCHES "^-l(.*)$")
+      set(_lib_name ${CMAKE_MATCH_1})
+      string(REGEX MATCH "odbc" _is_odbc ${_lib_name})
+      if(_is_odbc)
+        list(APPEND _odbc_lib_names ${_lib_name})
+      else()
+        list(APPEND _odbc_required_libs_names ${_lib_name})
+      endif()
+      unset(_lib_name)
+    endif()
+  endforeach()
+  unset(_libs)
+endif()
+
+### Try unixODBC or iODBC in include/lib filesystems ##########################
+if (UNIX AND NOT ODBC_CONFIG)
+  # List names of both ODBC libraries, unixODBC and iODBC
+  set(_odbc_lib_names odbc;iodbc;unixodbc;)
+endif()
+
+### Find include directories ##################################################
+find_path(ODBC_INCLUDE_DIR
+  NAMES sql.h
+  PATHS ${_odbc_include_paths})
+
+if(NOT ODBC_INCLUDE_DIR AND WIN32)
+  set(ODBC_INCLUDE_DIR "")
+endif()
+
+### Find libraries ############################################################
+if(NOT ODBC_LIBRARY)
+  find_library(ODBC_LIBRARY
+    NAMES ${_odbc_lib_names}
+    PATHS ${_odbc_lib_paths}
+    PATH_SUFFIXES odbc)
+
+  foreach(_lib IN LISTS _odbc_required_libs_names)
+    find_library(_lib_path
+      NAMES ${_lib}
+      PATHS ${_odbc_lib_paths} # system parths or collected from ODBC_CONFIG
+      PATH_SUFFIXES odbc)
+    if(_lib_path)
+      list(APPEND _odbc_required_libs_paths ${_lib_path})
+    endif()
+    unset(_lib_path CACHE)
+  endforeach()
+endif()
+
+# Unset internal lists as no longer used
+unset(_odbc_include_paths)
+unset(_odbc_lib_paths)
+unset(_odbc_lib_names)
+unset(_odbc_required_libs_names)
+
+### Set result variables ######################################################
+set(_odbc_required_vars ODBC_LIBRARY)
+if(NOT WIN32)
+  list(APPEND _odbc_required_vars ODBC_INCLUDE_DIR)
+endif()

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(ODBC DEFAULT_MSG ODBC_INCLUDE_DIR ODBC_LIBRARY)
-mark_as_advanced(ODBC_INCLUDE_DIR ODBC_LIBRARY)
-
+find_package_handle_standard_args(ODBC DEFAULT_MSG ${_odbc_required_vars})
+
+unset(_odbc_required_vars)
+
+mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDE_DIR)
+
+set(ODBC_INCLUDE_DIRS ${ODBC_INCLUDE_DIR})
+list(APPEND ODBC_LIBRARIES ${ODBC_LIBRARY})
+list(APPEND ODBC_LIBRARIES ${_odbc_required_libs_paths})
+
+### Import targets ############################################################
+if(ODBC_FOUND)
+  if(NOT TARGET ODBC::ODBC)
+    if(IS_ABSOLUTE "${ODBC_LIBRARY}")
+      add_library(ODBC::ODBC UNKNOWN IMPORTED)
+      set_target_properties(ODBC::ODBC PROPERTIES
+        IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+        IMPORTED_LOCATION "${ODBC_LIBRARY}")
+    else()
+      add_library(ODBC::ODBC INTERFACE IMPORTED)
+      set_target_properties(ODBC::ODBC PROPERTIES
+        IMPORTED_LIBNAME "${ODBC_LIBRARY}")
+    endif()
+    set_target_properties(ODBC::ODBC PROPERTIES
+      INTERFACE_INCLUDE_DIRECTORIES "${ODBC_INCLUDE_DIR}")
+
+    if(_odbc_required_libs_paths)
+      set_property(TARGET ODBC::ODBC APPEND PROPERTY
+        INTERFACE_LINK_LIBRARIES "${_odbc_required_libs_paths}")
+    endif()
+  endif()
+endif()
+
+unset(_odbc_required_libs_paths)


Fix for msvc build

Fix for msvc build

--- cmake/remove_cxx_flags.cmake
+++ cmake/remove_cxx_flags.cmake
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.0.2)

-macro(remove_cxx_flags FLAGS)
+function(remove_cxx_flags FLAGS)
     list(LENGTH ${FLAGS} LEN)
     if(${LEN} EQUAL 0)
         return()
@@ -18,4 +18,4 @@
     endforeach(FLAG)

     set(CMAKE_CXX_FLAGS ${RESULT})
-endmacro(remove_cxx_flags)+endfunction(remove_cxx_flags)


#1289 - OpenIGTLink version upgrade

#1289 - OpenIGTLink version upgrade

git-svn-id: f70d4c833b20674991d6651a5f592bbdbe6b47b2@8416 30ced1d1-d8fb-0310-b896-84269ee58dd6

--- CMake/CMakeExternals/OPENIGTLINK.cmake
+++ CMake/CMakeExternals/OPENIGTLINK.cmake
@@ -35,7 +35,7 @@
 IF(NOT DEFINED OpenIGTLink_DIR)

     #1273 - OpenIGTLink version update due to bugfixes.
-    SET(revision_tag 1362db6789)
+    SET(revision_tag 3d9ec950d1)
     IF(${proj}_REVISION_TAG)
         SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


tried to fix FFTW3 issues

tried to fix FFTW3 issues

--- SuperBuild/External_SIRF.cmake
+++ SuperBuild/External_SIRF.cmake
@@ -56,6 +56,14 @@

   message(STATUS "HDF5_ROOT in External_SIRF: " ${HDF5_ROOT})
   set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${SUPERBUILD_INSTALL_DIR})
+
+  if (WIN32)
+    set(extra_args1 "-DFFTW3F_LIBRARY=${FFTW3F_LIBRARY}")
+    set(extra_args2 "-DFFTW3_INCLUDE_DIR=${FFTW3_INCLUDE_DIR}")
+  else()
+    set(extra_args1 "")
+    set(extra_args2 "")
+  endif()

   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
@@ -88,6 +96,8 @@
         -DPYTHON_DEST_DIR=${PYTHON_DEST_DIR}
         -DPYTHON_STRATEGY=${PYTHON_STRATEGY}
         -DNiftyReg_Binary_DIR=${NiftyReg_Binary_DIR}
+		${extra_args1}
+		${extra_args2}
 	INSTALL_DIR ${SIRF_Install_Dir}
     DEPENDS
         ${${proj}_DEPENDENCIES}


Bug 891: Determine sizeof(void*) via CMAKE variable instead of test program

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -489,20 +489,12 @@
 endmacro(ei_set_build_string)

 macro(ei_is_64bit_env VAR)
-
-  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
-      "int main() { return (sizeof(int*) == 8 ? 1 : 0); }
-      ")
-  try_run(run_res compile_res
-         ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/is64.cpp"
-          RUN_OUTPUT_VARIABLE run_output)
-
-  if(compile_res AND run_res)
-    set(${VAR} ${run_res})
-  elseif(CMAKE_CL_64)
+  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
     set(${VAR} 1)
-  elseif("$ENV{Platform}" STREQUAL "X64") # nmake 64 bit
-    set(${VAR} 1)
+  elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+    set(${VAR} 0)
+  else()
+    message(WARNING "Unsupported pointer size. Please contact the authors.")
   endif()
 endmacro(ei_is_64bit_env)


Added support for V2 CMSIS OS using `FREERTOS_CMSIS_V2`

--- cmake/FindFreeRTOS.cmake
+++ cmake/FindFreeRTOS.cmake
@@ -44,7 +44,11 @@
 	timers.h
 )

-SET(CMSIS_OS_SRC_FILE cmsis_os.c)
+IF(FREERTOS_CMSIS_V2)
+    SET(CMSIS_OS_SRC_FILE cmsis_os1.c)
+ELSE()
+    SET(CMSIS_OS_SRC_FILE cmsis_os.c)
+ENDIF()
 SET(CMSIS_OS_INC_FILE cmsis_os.h)

 SET(PORT_ARM_SRC_FILE port.c)
@@ -62,11 +66,20 @@
 	CMAKE_FIND_ROOT_PATH_BOTH
 )

-FIND_PATH(CMSIS_OS_INC_DIR ${CMSIS_OS_INC_FILE}
-	PATH_SUFFIXES CMSIS_RTOS
-	HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source
-	CMAKE_FIND_ROOT_PATH_BOTH
-)
+SET(CMSIS_OS_INC_DIR CMSIS_OS_INC_DIR-NOTFOUND)
+IF(FREERTOS_CMSIS_V2)
+    FIND_PATH(CMSIS_OS_INC_DIR ${CMSIS_OS_INC_FILE}
+        PATH_SUFFIXES CMSIS_RTOS_V2
+        HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source
+        CMAKE_FIND_ROOT_PATH_BOTH
+        )
+ELSE()
+    FIND_PATH(CMSIS_OS_INC_DIR ${CMSIS_OS_INC_FILE}
+        PATH_SUFFIXES CMSIS_RTOS
+        HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source
+        CMAKE_FIND_ROOT_PATH_BOTH
+        )
+ENDIF()

 FIND_PATH(PORTMACRO_INC_DIR ${PORTMACRO_ARM_HEADER}
 	PATH_SUFFIXES ARM_${PORT_GCC_DIR_SUFFIX}
@@ -84,11 +97,20 @@
 	LIST(APPEND FREERTOS_SOURCES ${FREERTOS_${SRC_CLEAN}_FILE})
 ENDFOREACH()

-FIND_FILE(CMSIS_OS_SOURCE ${CMSIS_OS_SRC_FILE}
-	PATH_SUFFIXES CMSIS_RTOS
-	HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source
-	CMAKE_FIND_ROOT_PATH_BOTH
-)
+SET(CMSIS_OS_SOURCE ${CMSIS_OS_SRC_FILE}-NOTFOUND)
+IF(FREERTOS_CMSIS_V2)
+    FIND_FILE(CMSIS_OS_SOURCE ${CMSIS_OS_SRC_FILE}
+        PATH_SUFFIXES CMSIS_RTOS_V2
+        HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source
+        CMAKE_FIND_ROOT_PATH_BOTH
+        )
+ELSE()
+    FIND_FILE(CMSIS_OS_SOURCE ${CMSIS_OS_SRC_FILE}
+        PATH_SUFFIXES CMSIS_RTOS
+        HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FreeRTOS/Source
+        CMAKE_FIND_ROOT_PATH_BOTH
+        )
+ENDIF()

 FIND_FILE(PORT_ARM_SOURCE ${PORT_ARM_SRC_FILE}
 	PATH_SUFFIXES ARM_${PORT_GCC_DIR_SUFFIX}


Also look for libclang in CLANG_LIBRARY_DIRS

--- cmake/FindLibClang.cmake
+++ cmake/FindLibClang.cmake
@@ -35,7 +35,7 @@

 if (LLVM_FOUND AND LLVM_LIBRARY_DIRS)
   MACRO(FIND_AND_ADD_CLANG_LIB _libname_)
-  find_library(CLANG_${_libname_}_LIB ${_libname_} HINTS ${LLVM_LIBRARY_DIRS})
+  find_library(CLANG_${_libname_}_LIB ${_libname_} HINTS ${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIRS})
   if (CLANG_${_libname_}_LIB)
      set(CLANG_LIBS ${CLANG_LIBS} ${CLANG_${_libname_}_LIB})
   endif (CLANG_${_libname_}_LIB)


Make glibc install quieter

Make glibc install quieter

--- cmake/GetLibStdCXX.cmake
+++ cmake/GetLibStdCXX.cmake
@@ -17,7 +17,7 @@
 	endif()
 	if(NOT EXISTS ${CMAKE_BINARY_DIR}/glibc-2.19)
 		message(STATUS "Extracting glibc...")
-		execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf glibc.tar.xz WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+		execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf glibc.tar.xz WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_QUIET)

 	endif()

@@ -28,17 +28,18 @@
 		COMMAND ../configure --prefix=${CMAKE_BINARY_DIR}/lib/chigraph/stdlib
 		WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glibc-2.19/build
 		RESULT_VARIABLE err
+		OUTPUT_QUIET
 		)
 		if (NOT err MATCHES "0")
 			message(FATAL_ERROR "Failed to configure glibc")
 		endif()

-		execute_process(COMMAND make -j${N} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glibc-2.19/build RESULT_VARIABLE err)
+		execute_process(COMMAND make -j${N} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glibc-2.19/build RESULT_VARIABLE err OUTPUT_QUIET)
 		if (NOT err MATCHES "0")
 			message(FATAL_ERROR "Failed to compile glibc")
 		endif()

-		execute_process(COMMAND make install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glibc-2.19/build)
+		execute_process(COMMAND make install WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/glibc-2.19/build OUTPUT_QUIET)
 		if (NOT err MATCHES "0")
 			message(FATAL_ERROR "Failed to install glibc")
 		endif()