Fixed build error by using a different cmake function for checking the compiler flags

--- CMake/usFunctionCheckCompilerFlags.cmake
+++ CMake/usFunctionCheckCompilerFlags.cmake
@@ -24,29 +24,41 @@

 include(TestCXXAcceptsFlag)

-function(usFunctionCheckCompilerFlags CXX_FLAG_TO_TEST RESULT_VAR)
+function(usFunctionCheckCompilerFlags FLAG_TO_TEST RESULT_VAR)

-  if(CXX_FLAG_TO_TEST STREQUAL "")
-    message(FATAL_ERROR "CXX_FLAG_TO_TEST shouldn't be empty")
+  if(FLAG_TO_TEST STREQUAL "")
+    message(FATAL_ERROR "FLAG_TO_TEST shouldn't be empty")
   endif()

-  set(_test_flag ${CXX_FLAG_TO_TEST})
-  CHECK_CXX_ACCEPTS_FLAG("-Werror=unknown-warning-option" HAS_FLAG_unknown-warning-option)
-  if(HAS_FLAG_unknown-warning-option)
-    set(_test_flag "-Werror=unknown-warning-option ${CXX_FLAG_TO_TEST}")
-  endif()
+  # Clear all flags. If not, existing flags triggering warnings might lead to
+  # false-negatives when checking for certain compiler flags.
+  set(CMAKE_C_FLAGS )
+  set(CMAKE_C_FLAGS_DEBUG )
+  set(CMAKE_C_FLAGS_MINSIZEREL )
+  set(CMAKE_C_FLAGS_RELEASE )
+  set(CMAKE_C_FLAGS_RELWITHDEBINFO )
+  set(CMAKE_CXX_FLAGS )
+  set(CMAKE_CXX_FLAGS_DEBUG )
+  set(CMAKE_CXX_FLAGS_MINSIZEREL )
+  set(CMAKE_CXX_FLAGS_RELEASE )
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO )

-  # Internally, the macro CMAKE_CXX_ACCEPTS_FLAG calls TRY_COMPILE. To avoid
+  # Internally, the macro CMAKE_CXX_COMPILER_FLAG calls TRY_COMPILE. To avoid
   # the cost of compiling the test each time the project is configured, the variable set by
   # the macro is added to the cache so that following invocation of the macro with
   # the same variable name skip the compilation step.
-  # For that same reason, usFunctionCheckCompilerFlags function appends a unique suffix to
-  # the HAS_FLAG variable. This suffix is created using a 'clean version' of the flag to test.
-  string(REGEX REPLACE "-\\s\\$\\+\\*\\{\\}\\(\\)\\#" "" suffix ${CXX_FLAG_TO_TEST})
-  CHECK_CXX_ACCEPTS_FLAG(${_test_flag} HAS_FLAG_${suffix})
+  # For that same reason, the usFunctionCheckCompilerFlags function appends a unique suffix to
+  # the HAS_CXX_FLAG variable. This suffix is created using a 'clean version' of the
+  # flag to test. The value of HAS_CXX_FLAG_${suffix} additonally needs to be a valid
+  # pre-processor token because CHECK_CXX_COMPILER_FLAG adds it as a definition to the compiler
+  # arguments. An invalid token triggers compiler warnings, which in case of the "-Werror" flag
+  # leads to false-negative checks.
+  string(REGEX REPLACE "[/-]" "_" suffix ${FLAG_TO_TEST})
+  string(REGEX REPLACE "[, \\$\\+\\*\\{\\}\\(\\)\\#]" "" suffix ${suffix})
+  CHECK_CXX_COMPILER_FLAG(${FLAG_TO_TEST} HAS_CXX_FLAG_${suffix})

-  if(HAS_FLAG_${suffix})
-    set(${RESULT_VAR} "${${RESULT_VAR}} ${CXX_FLAG_TO_TEST}" PARENT_SCOPE)
+  if(HAS_CXX_FLAG_${suffix})
+    set(${RESULT_VAR} "${${RESULT_VAR}} ${FLAG_TO_TEST}" PARENT_SCOPE)
   endif()

 endfunction()


Fix cil (#359)

Fix cil (#359)

* fix CIL

--- SuperBuild/External_CCPi-Framework.cmake
+++ SuperBuild/External_CCPi-Framework.cmake
@@ -62,12 +62,14 @@
       STAMP_DIR ${${proj}_STAMP_DIR}
       TMP_DIR ${${proj}_TMP_DIR}
       INSTALL_DIR ${libcilreg_Install_Dir}
-
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${${proj}_SOURCE_DIR}/Wrappers/Python/ccpi ${PYTHON_DEST}/ccpi && ${CMAKE_COMMAND} -E copy_directory ${${proj}_SOURCE_DIR}/Wrappers/Python/data ${SUPERBUILD_INSTALL_DIR}/share/ccpi/ && ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/patches/cil-patch.py ${${proj}_SOURCE_DIR}/Wrappers/Python/ccpi/framework/TestData.py ${PYTHON_DEST}/ccpi/framework/TestData.py
-      CMAKE_ARGS
-        -DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir}
+      # apparently this is the only way to pass environment variables to
+      # external projects
+      CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${${proj}_TAG}
+        ${CMAKE_COMMAND} ${${proj}_SOURCE_DIR}
+          -DCMAKE_INSTALL_PREFIX:STRING=${libcilreg_Install_Dir}
+          -DCMAKE_BUILD_TYPE:STRING=Release
+          -DPYTHON_DEST_DIR:PATH=${PYTHON_DEST}
+      INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install && ${CMAKE_COMMAND} -E copy_directory ${${proj}_SOURCE_DIR}/Wrappers/Python/data ${SUPERBUILD_INSTALL_DIR}/share/ccpi/ && ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/patches/cil-patch.py ${${proj}_SOURCE_DIR}/Wrappers/Python/ccpi/framework/TestData.py ${PYTHON_DEST}/ccpi/framework/TestData.py
       DEPENDS ${${proj}_DEPENDENCIES}
     )


Fix log.

Fix log.

--- rpi/cmaketc/Toolchain-raspberrypi-arm.cmake
+++ rpi/cmaketc/Toolchain-raspberrypi-arm.cmake
@@ -5,7 +5,7 @@

 # Check for Raspberry Pi Tools and bail out if they don't have it
 if(DEFINED ENV{PI_TOOLS_HOME} AND DEFINED ENV{PI_TOOL})
-  message("Using Raspberry Pi Tools found in $ENV{PI_TOOLS_HOME}/ENV{PI_TOOL}")
+  message("Using Raspberry Pi Tools found in $ENV{PI_TOOLS_HOME}/$ENV{PI_TOOL}")
 else()
   message("PI_TOOLS_HOME or PI_TOOL is not set; You must tell CMake where to find Raspberry Pi Tools (cross-compiler)")
   return()


remove mpl2/cmake/FindCplex.cmake

remove mpl2/cmake/FindCplex.cmake

Signed-off-by: Matt Liberty <44ef1ce0ef6935daf739a0795dad249ba5322e97@eng.ucsd.edu>


Further cleanup to bgfx cmake wrapper.

Further cleanup to bgfx cmake wrapper.

--- cmake/bgfx.cmake
+++ cmake/bgfx.cmake
@@ -22,9 +22,11 @@
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
     set(bgfx_SYSTEM_NAME "osx")
     set(bgfx_COMPILER "clang")
+    set(bgfx_GENIE_GCC "osx")
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
     set(bgfx_SYSTEM_NAME "linux")
     set(bgfx_COMPILER "gcc")
+    set(bgfx_GENIE_GCC "linux-gcc")
 else()
     message(FATAL_ERROR "BGFX does not support the system '${CMAKE_SYSTEM_NAME}'.")
 endif()
@@ -32,11 +34,11 @@
 # Configure platform-specific build commands.
 if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 14 2015.*")
     set(bgfx_COMPILER "vs2015")
-    set(bgfx_CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E env "BX_DIR=${bx_DIR}" "${bx_GENIE}.exe" --with-tools "${bgfx_COMPILER}")
+    set(bgfx_CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E env "BX_DIR=${bx_DIR}" "${bx_GENIE}${CMAKE_EXECUTABLE_SUFFIX}" --with-tools "${bgfx_COMPILER}")
     set(bgfx_BUILD_COMMAND "devenv" "<SOURCE_DIR>/.build/projects/${bgfx_COMPILER}/bgfx.sln" /Build Release|x64)
 elseif("${CMAKE_GENERATOR}" STREQUAL "Unix Makefiles")
-    set(bgfx_CONFIGURE_COMMAND "echo")
-    set(bgfx_BUILD_COMMAND "make" -C <SOURCE_DIR> "BX_DIR=${bx_SOURCE_DIR}" "${bgfx_SYSTEM_NAME}-release64")
+    set(bgfx_CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E env "BX_DIR=${bx_DIR}" "${bx_GENIE}${CMAKE_EXECUTABLE_SUFFIX}" --with-tools "--gcc=${bgfx_GENIE_GCC}" gmake)
+    set(bgfx_BUILD_COMMAND "$(MAKE)" -C "<SOURCE_DIR>/.build/projects/gmake-${bgfx_SYSTEM_NAME}" config=release64)
 else()
     message(FATAL_ERROR "BGFX does not support the generator '${CMAKE_GENERATOR}'.")
 endif()
@@ -68,6 +70,5 @@
 add_dependencies(bgfx bgfx_EXTERNAL)
 set_target_properties(bgfx PROPERTIES
     INTERFACE_INCLUDE_DIRECTORIES "${bgfx_INCLUDE_DIR};${bx_INCLUDE_DIR}"
-    # INTERFACE_LINK_LIBRARIES "libGL"
     IMPORTED_LOCATION "${bgfx_LIBRARY}"
 )


Added Qt5Gui requirement for QImage etc.

--- cmake/deps.cmake
+++ cmake/deps.cmake
@@ -15,6 +15,7 @@
 set(CMAKE_INCLUDE_CURRENT_DIR ON)

 find_package(Qt5Core REQUIRED)
+find_package(Qt5Gui REQUIRED)

 # OpenCV
 find_package(OpenCV REQUIRED)


Configuration subdirectory is already added

--- cmake/test.cmake
+++ cmake/test.cmake
@@ -87,11 +87,6 @@

 set(test_working_directory
   "${vistk_binary_dir}/tests")
-
-if (WIN32)
-  set(test_working_directory
-    "${test_working_directory}/$<CONFIGURATION>")
-endif (WIN32)

 set(BUILDNAME "" CACHE STRING "The build name for CDash submissions")


Remove DEAL_II_WRETURN_TYPE_CONST_QUALIFIER_BUG.

This was a workaround for a bug in gcc 4.3 that has long since been fixed.

--- cmake/checks/check_03_compiler_bugs.cmake
+++ cmake/checks/check_03_compiler_bugs.cmake
@@ -18,31 +18,6 @@
 #                   Check for various compiler bugs:                   #
 #                                                                      #
 ########################################################################
-
-
-#
-# On some gcc 4.3 snapshots, a 'const' qualifier on a return type triggers a
-# warning. This is unfortunate, since we happen to stumble on this
-# in some of our template trickery with iterator classes. If necessary,
-# do not use the relevant warning flag
-#
-# - Wolfgang Bangerth, Matthias Maier, rewritten 2012
-#
-PUSH_CMAKE_REQUIRED("-Wreturn-type")
-PUSH_CMAKE_REQUIRED("-Werror")
-CHECK_CXX_COMPILER_BUG(
-  "
-  const double foo() { return 1.; }
-  int main() { return 0; }
-  "
-  DEAL_II_WRETURN_TYPE_CONST_QUALIFIER_BUG
-  )
-RESET_CMAKE_REQUIRED()
-
-IF(DEAL_II_WRETURN_TYPE_CONST_QUALIFIER_BUG)
-  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS -Wno-return-type)
-ENDIF()
-

 #
 # In some cases, we would like to name partial specializations


Reduce required version of gcc to 4.8 per latest project README

--- cmake/projects/nlohmann_json/hunter.cmake
+++ cmake/projects/nlohmann_json/hunter.cmake
@@ -10,8 +10,8 @@

 # See https://github.com/nlohmann/json#supported-compilers
 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-  if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")
-    hunter_report_broken_package("The nlohmann_json package requires GCC 4.9 or newer.")
+  if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")
+    hunter_report_broken_package("The nlohmann_json package requires GCC 4.8 or newer.")
   endif()
 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4")


[BALL] Spectrum_test skipped using MSVC

[BALL] Spectrum_test skipped using MSVC

Spectrum class is not dllexported and can't be used with MSVC.

--- source/TEST/cmake/BALLTestExecutables.cmake
+++ source/TEST/cmake/BALLTestExecutables.cmake
@@ -268,10 +268,15 @@
 	JohnsonBoveyShiftProcessor_test
 	ShiftModel_test
 	ShiftModule_test
-	Spectrum_test
 	Peak_test
 	PeakList_test
 )
+
+IF(NOT MSVC)
+	LIST(APPEND BALL_NMR_TESTS
+		Spectrum_test
+	)
+ENDIF()

 SET(BALL_FORMATS_TESTS
 	AmiraMeshFile_test


Make test to check if source directory has to be deleted/re-cloned more robust

--- CMake/VisomicsDashboardDriverScript.cmake
+++ CMake/VisomicsDashboardDriverScript.cmake
@@ -199,7 +199,7 @@
 get_filename_component(work_dir ${src_dir} PATH)
 get_filename_component(src_name ${src_dir} NAME)

-if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
+if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.git")
   _write_gitclone_script(
     ${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}-${GIT_TAG}-${SCRIPT_MODE}-gitclone.cmake # script_filename
     ${CTEST_SOURCE_DIRECTORY} # source_dir


iOS: Fix to prevent absolute paths from being inserted into resources.cfg for iOS to fix running the sample browser on devices.

--HG--
branch : v1-7
extra : rebase_source : f9345a5a2b07d9ba1bc58c7c7c8497769a1c7a91

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -27,11 +27,11 @@
     set(OGRE_MEDIA_DIR_DBG "${OGRE_MEDIA_PATH}")
   else()
     if(OGRE_INSTALL_SAMPLES_SOURCE)
-      set(OGRE_MEDIA_PATH "media")
+      set(OGRE_MEDIA_PATH "Media")
       set(OGRE_MEDIA_DIR_REL "../../../${OGRE_MEDIA_PATH}")
       set(OGRE_MEDIA_DIR_DBG "../../../${OGRE_MEDIA_PATH}")
     else()
-      set(OGRE_MEDIA_PATH "Samples/media")
+      set(OGRE_MEDIA_PATH "Samples/Media")
       set(OGRE_MEDIA_DIR_REL "../../../../${OGRE_MEDIA_PATH}")
       set(OGRE_MEDIA_DIR_DBG "../../../../${OGRE_MEDIA_PATH}")
     endif()
@@ -142,17 +142,20 @@

 # CREATE CONFIG FILES - BUILD DIR VERSIONS
-if (NOT OGRE_BUILD_PLATFORM_IPHONE)
-  set(OGRE_MEDIA_DIR_REL "${OGRE_SOURCE_DIR}/Samples/Media")
-  set(OGRE_MEDIA_DIR_DBG "${OGRE_SOURCE_DIR}/Samples/Media")
-endif ()
-
+set(OGRE_MEDIA_DIR_REL "${OGRE_SOURCE_DIR}/Samples/Media")
+set(OGRE_MEDIA_DIR_DBG "${OGRE_SOURCE_DIR}/Samples/Media")
 if (WIN32)
   set(OGRE_PLUGIN_DIR_REL ".")
   set(OGRE_PLUGIN_DIR_DBG ".")
   set(OGRE_SAMPLES_DIR_REL ".")
   set(OGRE_SAMPLES_DIR_DBG ".")
 elseif (APPLE)
+  # iPhone needs to use relative paths in the config files
+  if(OGRE_BUILD_PLATFORM_IPHONE)
+    set(OGRE_MEDIA_DIR_REL "${OGRE_MEDIA_PATH}")
+    set(OGRE_MEDIA_DIR_DBG "${OGRE_MEDIA_PATH}")
+  endif(OGRE_BUILD_PLATFORM_IPHONE)
+
   # not used on OS X, uses Resources
   set(OGRE_PLUGIN_DIR_REL "")
   set(OGRE_PLUGIN_DIR_DBG "")


Do not use the new DX SDKs when building for MSVC 2008.

--- CMake/Packages/FindDirectX11.cmake
+++ CMake/Packages/FindDirectX11.cmake
@@ -31,7 +31,7 @@
 			set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.0/lib/${MSVC_CXX_ARCHITECTURE_ID}/"

 		endif()
-	else()
+	elseif( NOT MSVC90 )
 		# Windows 10.x SDK
 		if(CMAKE_CL_64)
 			set(DirectX11_LIBPATH_SUFFIX "x64")


ENH: json files must now begin with a A-Za-z to be globbed

Previously tempory or hidden files might be added to the list of json
files, such as those which began with , of #.

--- CMake/generate_filter_source.cmake
+++ CMake/generate_filter_source.cmake
@@ -124,7 +124,7 @@
   endif()

   # Glob all json files in the current directory
-  file ( GLOB json_config_files ${generated_code_input_path}/json/*.json)
+  file ( GLOB json_config_files ${generated_code_input_path}/json/[a-zA-Z]*.json)

   # Loop through json files and expand each one
   foreach ( f ${json_config_files} )


Removed one more ref to windows

Removed one more ref to windows

--- CMake/hoomd/HOOMDCFlagsSetup.cmake
+++ CMake/hoomd/HOOMDCFlagsSetup.cmake
@@ -41,19 +41,6 @@
         set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-march=${GCC_ARCH} -g -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)

         endif (HONOR_GENTOO_FLAGS)
-    elseif(MSVC80)
-        # default flags for visual studio 2005
-        if (CMAKE_CL_64)
-            set(SSE_OPT "")
-        else (CMAKE_CL_64)
-            set(SSE_OPT "/arch:SSE2")
-        endif (CMAKE_CL_64)
-
-        set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHs /GR /MP" CACHE STRING "Flags used by all build types." FORCE)
-        set(CMAKE_CXX_FLAGS_RELEASE "${SSE_OPT} /Oi /Ot /Oy /fp:fast /MD /Ox /Ob2 /D NDEBUG" CACHE STRING "Flags used by the compiler during release builds." FORCE)
-        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${SSE_OPT} /Oi /Ot /Oy /fp:fast /MD /Zi /Ox /Ob1 /D NDEBUG" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)
-        set(CMAKE_CXX_FLAGS_MINSIZEREL "${SSE_OPT} /Oi /Ot /Oy /fp:fast /MD /O1 /Ob1 /D NDEBUG" CACHE STRING "Flags used by the compiler during minimum size release builds." FORCE)
-
     elseif(CMAKE_CXX_COMPILER MATCHES "icpc")
         # default flags for intel
         set(CMAKE_CXX_FLAGS_DEBUG "-xHOST -O0 -g" CACHE STRING "Flags used by the compiler during debug builds." FORCE)


pack python runtime into bundle with file list

--- CMake/mitkMacroInstallPython.cmake
+++ CMake/mitkMacroInstallPython.cmake
@@ -96,31 +96,31 @@

   # install the python runtime from the superbuild
   if(NOT MITK_USE_SYSTEM_PYTHON)
-    #TODO: handle APPLE runtime is missing
     if(UNIX)
+      set(_python_runtime_dir lib/python${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION})
       list(APPEND _python_dirs "${Python_DIR}/lib")
-      # install python stuff
-      install(DIRECTORY "${Python_DIR}/lib/python${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION}"
-            DESTINATION ${_destination}/Python/lib
-            USE_SOURCE_PERMISSIONS
-            COMPONENT Runtime)
-      install(FILES "${Python_DIR}/include/python${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION}/pyconfig.h"
-              DESTINATION ${_destination}/Python/include/python${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION})
-    else()
+    else() #WIN32
+      set(_python_runtime_dir Lib)
       list(APPEND _python_dirs "${Python_DIR}/libs")
       list(APPEND _python_dirs "${Python_DIR}/bin")
+    endif()
+      # install python stuff
+      #install(DIRECTORY "${Python_DIR}/lib/python${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION}"
+      #      DESTINATION ${_destination}/Python/lib
+      #      USE_SOURCE_PERMISSIONS
+      #      COMPONENT Runtime)

-      file(GLOB_RECURSE item RELATIVE "${Python_DIR}/Lib" "${Python_DIR}/Lib/*")
-      foreach(f ${item})
-        get_filename_component(_filepath "${f}" PATH)
-        install(FILES "${Python_DIR}/Lib/${f}" DESTINATION bin/Python/Lib/${_filepath})
-      endforeach()
-      file(GLOB_RECURSE item RELATIVE "${Python_DIR}/include" "${Python_DIR}/include/*")
-      foreach(f ${item})
-        get_filename_component(_filepath "${f}" PATH)
-        install(FILES "${Python_DIR}/include/${f}" DESTINATION bin/Python/include/${_filepath})
-      endforeach()
-    endif()
+    file(GLOB_RECURSE item RELATIVE "${Python_DIR}/${_python_runtime_dir}" "${Python_DIR}/${_python_runtime_dir}/*")
+    foreach(f ${item})
+      get_filename_component(_filepath "${f}" PATH)
+      install(FILES "${Python_DIR}/${_python_runtime_dir}/${f}" DESTINATION ${_destination}/Python/${_python_runtime_dir}/${_filepath})
+    endforeach()
+
+    file(GLOB_RECURSE item RELATIVE "${Python_DIR}/include" "${Python_DIR}/include/*")
+    foreach(f ${item})
+      get_filename_component(_filepath "${f}" PATH)
+      install(FILES "${Python_DIR}/include/${f}" DESTINATION ${_destination}/Python/include/${_filepath})
+    endforeach()
   endif()

   if(Numpy_DIR)


cmake: Always pass IDF_TARGET into mconf, avoid error about uninitialized environment variable

--- tools/cmake/kconfig.cmake
+++ tools/cmake/kconfig.cmake
@@ -200,6 +200,7 @@
         "COMPONENT_KCONFIGS=${kconfigs}"
         "COMPONENT_KCONFIGS_PROJBUILD=${kconfig_projbuilds}"
         "IDF_CMAKE=y"
+        "IDF_TARGET=${IDF_TARGET}"
         "KCONFIG_CONFIG=${sdkconfig}"
         ${mconf} ${root_kconfig}
         # VERBATIM cannot be used here because it cannot handle ${mconf}="winpty mconf-idf" and the escaping must be


build system: project: quote linker map file argument

--- tools/cmake/project.cmake
+++ tools/cmake/project.cmake
@@ -444,7 +444,7 @@

     if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
         set(mapfile "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.map")
-        target_link_libraries(${project_elf} "-Wl,--cref -Wl,--Map=${mapfile}")
+        target_link_libraries(${project_elf} "-Wl,--cref" "-Wl,--Map=\"${mapfile}\"")
     endif()

     set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY


Fix RustAddLibrary for multiple components.

Change-Id: I74a5a5a72817559766d65a485493474de5e8487c
GitOrigin-RevId: 4116bed377cf8d851d8a81e250caf236f330f1f4

--- apps/system/rust.cmake
+++ apps/system/rust.cmake
@@ -31,7 +31,7 @@
     endif()

     add_custom_target(
-        ${libmain}_custom
+        ${lib_name}_custom
         BYPRODUCTS
         ${RUST_BUILD_DIR}/${RUST_LIB_FILENAME}
         ${USES_TERMINAL_DEBUG}
@@ -49,5 +49,5 @@
         TARGET ${lib_name}
         PROPERTY IMPORTED_LOCATION "${RUST_BUILD_DIR}/${RUST_LIB_FILENAME}"
     )
-    add_dependencies(${lib_name} ${libmain}_custom)
+    add_dependencies(${lib_name} ${lib_name}_custom)
 endfunction()


Fix install permissions of binaries.

Fix install permissions of binaries.

--- arangosh/install.cmake
+++ arangosh/install.cmake
@@ -3,32 +3,32 @@
 # we can't use RUNTIME DESTINATION here.

 install(
-  FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOBENCH}${CMAKE_EXECUTABLE_SUFFIX}
+  PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOBENCH}${CMAKE_EXECUTABLE_SUFFIX}
   DESTINATION ${CMAKE_INSTALL_BINDIR})
 install_config(arangobench)

 install(
-  FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGODUMP}${CMAKE_EXECUTABLE_SUFFIX}
+  PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGODUMP}${CMAKE_EXECUTABLE_SUFFIX}
   DESTINATION ${CMAKE_INSTALL_BINDIR})
 install_config(arangodump)

 install(
-  FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOIMP}${CMAKE_EXECUTABLE_SUFFIX}
+  PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOIMP}${CMAKE_EXECUTABLE_SUFFIX}
   DESTINATION ${CMAKE_INSTALL_BINDIR})
 install_config(arangoimp)

 install(
-  FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGORESTORE}${CMAKE_EXECUTABLE_SUFFIX}
+  PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGORESTORE}${CMAKE_EXECUTABLE_SUFFIX}
   DESTINATION ${CMAKE_INSTALL_BINDIR})
 install_config(arangorestore)

 install(
-  FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOSH}${CMAKE_EXECUTABLE_SUFFIX}
+  PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOSH}${CMAKE_EXECUTABLE_SUFFIX}
   DESTINATION ${CMAKE_INSTALL_BINDIR})
 install_config(arangosh)

 install(
-  FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOVPACK}${CMAKE_EXECUTABLE_SUFFIX}
+  PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOVPACK}${CMAKE_EXECUTABLE_SUFFIX}
   DESTINATION ${CMAKE_INSTALL_BINDIR})

 install_command_alias(${BIN_ARANGOSH}


WIP: COMP: FindNiftyreg hardcoded to find png and z on linux too

--- CMake/FindNiftyreg.cmake
+++ CMake/FindNiftyreg.cmake
@@ -20,9 +20,9 @@
 set(Niftyreg_FIND_COMPONENTS _reg_aladin _reg_blockMatching _reg_f3d _reg_femTrans _reg_globalTrans _reg_localTrans _reg_maths _reg_measure _reg_ReadWriteImage _reg_resampling _reg_tools reg_nifti reg_png)

 # *NIX OSes use system png and zlib, for Windows OS Niftyreg is configured to build these libraries
-if( WIN32)
+#if( WIN32)
 	list(APPEND Niftyreg_FIND_COMPONENTS png z)
-endif (WIN32)
+#endif (WIN32)

 set(Niftyreg_INCLUDE_DIR ${NIFTYREG_DIR}/include CACHE PATH "Installed Include Directory of NiftyReg" )
 #set(Niftyreg_LIBRARIES "" CACHE STRING "Found libraries NiftyReg" )


ENH: Merge changes from main tree into VTK-5-2 branch. (cvs -q up -j1.13 -j1.14 CMake/vtkExportKit.cmake)

--- CMake/vtkExportKit.cmake
+++ CMake/vtkExportKit.cmake
@@ -1,5 +1,5 @@
 #-----------------------------------------------------------------------------
-MACRO(VTK_EXPORT_KIT kit ukit sources)
+MACRO(VTK_EXPORT_KIT2 kit ukit dest_dir sources)
   SET(VTK_EXPORT_KIT ${kit})
   SET(VTK_EXPORT_UKIT ${ukit})
   SET(VTK_EXPORT_KIT_DOLLAR "$")
@@ -25,11 +25,11 @@
     ENDIF(IS_EXCLUDE MATCHES "^1$")
   ENDFOREACH(src)
   CONFIGURE_FILE(${VTK_CMAKE_DIR}/vtkKit.cmake.in
-                 ${VTK_BINARY_DIR}/Utilities/InstallOnly/vtk${kit}Kit.cmake
+                 ${dest_dir}/InstallOnly/vtk${kit}Kit.cmake
                  @ONLY IMMEDIATE)
   IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
     INSTALL(FILES
-      ${VTK_BINARY_DIR}/Utilities/InstallOnly/vtk${kit}Kit.cmake
+      ${dest_dir}/InstallOnly/vtk${kit}Kit.cmake
       DESTINATION "${VTK_INSTALL_PACKAGE_DIR_CM24}"
       COMPONENT Development)
   ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
@@ -56,6 +56,11 @@
     ENDIF(IS_EXCLUDE MATCHES "^1$")
   ENDFOREACH(src)
   CONFIGURE_FILE(${VTK_CMAKE_DIR}/vtkKit.cmake.in
-                 ${VTK_BINARY_DIR}/Utilities/vtk${kit}Kit.cmake
+                 ${dest_dir}/vtk${kit}Kit.cmake
                  @ONLY IMMEDIATE)
+ENDMACRO(VTK_EXPORT_KIT2)
+
+#-----------------------------------------------------------------------------
+MACRO(VTK_EXPORT_KIT kit ukit sources)
+  VTK_EXPORT_KIT2(${kit} ${ukit} ${VTK_BINARY_DIR}/Utilities "${sources}")
 ENDMACRO(VTK_EXPORT_KIT)


Use BRANCH_NAME env variable as branch name

--- utils/functions.cmake
+++ utils/functions.cmake
@@ -115,12 +115,16 @@
       OUTPUT_STRIP_TRAILING_WHITESPACE
     )

-    execute_process(
-      COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
-      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-      OUTPUT_VARIABLE GIT_BRANCH
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
+    set(GIT_BRANCH $ENV{BRANCH_NAME})
+
+    if("${GIT_BRANCH}" STREQUAL "")
+        execute_process(
+          COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
+          WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+          OUTPUT_VARIABLE GIT_BRANCH
+          OUTPUT_STRIP_TRAILING_WHITESPACE
+        )
+    endif()

     cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME)


#1508 prefer architecture-specific install directory for python bindings, when LIB_SUFFIX is used

--- cmake/OpenCVDetectPython.cmake
+++ cmake/OpenCVDetectPython.cmake
@@ -17,28 +17,35 @@
     OUTPUT_STRIP_TRAILING_WHITESPACE)

   string(REGEX MATCH "[0-9]+.[0-9]+" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
-  if(CMAKE_HOST_UNIX)
-    execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import *; print get_python_lib()"
-                    RESULT_VARIABLE PYTHON_CVPY_PROCESS
-                    OUTPUT_VARIABLE PYTHON_STD_PACKAGES_PATH
-                    OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if("${PYTHON_STD_PACKAGES_PATH}" MATCHES "site-packages")
-      set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
-    else() #debian based assumed, install to the dist-packages.
-      set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
-    endif()
-  elseif(CMAKE_HOST_WIN32)
-    get_filename_component(PYTHON_PATH "${PYTHON_EXECUTABLE}" PATH)
-    file(TO_CMAKE_PATH "${PYTHON_PATH}" PYTHON_PATH)
-    if(NOT EXISTS "${PYTHON_PATH}/Lib/site-packages")
-      unset(PYTHON_PATH)
-      get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE)
-      file(TO_CMAKE_PATH "${PYTHON_PATH}" PYTHON_PATH)
-    endif()
-    set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages")
-  endif()

   if(NOT ANDROID AND NOT IOS)
+    if(CMAKE_HOST_UNIX)
+      execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import *; print get_python_lib()"
+                      RESULT_VARIABLE PYTHON_CVPY_PROCESS
+                      OUTPUT_VARIABLE PYTHON_STD_PACKAGES_PATH
+                      OUTPUT_STRIP_TRAILING_WHITESPACE)
+      if("${PYTHON_STD_PACKAGES_PATH}" MATCHES "site-packages")
+        set(PYTHON_PACKAGES_PATH "python${PYTHON_VERSION_MAJOR_MINOR}/site-packages")
+      else() #debian based assumed, install to the dist-packages.
+        set(PYTHON_PACKAGES_PATH "python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages")
+      endif()
+      if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${PYTHON_PACKAGES_PATH}")
+        set(PYTHON_PACKAGES_PATH "lib${LIB_SUFFIX}/${PYTHON_PACKAGES_PATH}")
+      else()
+        set(PYTHON_PACKAGES_PATH "lib/${PYTHON_PACKAGES_PATH}")
+      endif()
+      set(PYTHON_PACKAGES_PATH "${PYTHON_PACKAGES_PATH}" CACHE PATH "Where to install the python packages.")
+    elseif(CMAKE_HOST_WIN32)
+      get_filename_component(PYTHON_PATH "${PYTHON_EXECUTABLE}" PATH)
+      file(TO_CMAKE_PATH "${PYTHON_PATH}" PYTHON_PATH)
+      if(NOT EXISTS "${PYTHON_PATH}/Lib/site-packages")
+        unset(PYTHON_PATH)
+        get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE)
+        file(TO_CMAKE_PATH "${PYTHON_PATH}" PYTHON_PATH)
+      endif()
+      set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages")
+    endif()
+
     # Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
     execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print numpy.distutils.misc_util.get_numpy_include_dirs()[0]"
                     RESULT_VARIABLE PYTHON_NUMPY_PROCESS
@@ -52,7 +59,7 @@
       ocv_include_directories(${PYTHON_NUMPY_INCLUDE_DIRS})
       message(STATUS "    Use NumPy headers from: ${PYTHON_NUMPY_INCLUDE_DIRS}")
     endif()
-  endif()
+  endif(NOT ANDROID AND NOT IOS)

   if(BUILD_DOCS)
     # look for Sphinx


Added BUILD_LIST feature

Added BUILD_LIST feature

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -420,6 +420,41 @@
   foreach(m ${OPENCV_MODULES_BUILD})
     set(HAVE_${m} ON CACHE INTERNAL "Module ${m} will be built in current configuration")
   endforeach()
+
+  # Whitelist feature
+  if(BUILD_LIST)
+    # Prepare the list
+    string(REGEX REPLACE "[ ,:]+" ";" whitelist "${BUILD_LIST}" )
+    if(BUILD_opencv_world)
+      list(APPEND whitelist world)
+    endif()
+    ocv_list_add_prefix(whitelist "opencv_")
+    ocv_list_sort(whitelist)
+    ocv_list_unique(whitelist)
+    message(STATUS "Using whitelist: ${whitelist}")
+    # Expand the list
+    foreach(depth RANGE 10)
+      set(new_whitelist ${whitelist})
+      foreach(m ${whitelist})
+        list(APPEND new_whitelist ${OPENCV_MODULE_${m}_REQ_DEPS})
+        list(APPEND new_whitelist ${OPENCV_MODULE_${m}_PRIVATE_REQ_DEPS})
+      endforeach()
+      ocv_list_sort(new_whitelist)
+      ocv_list_unique(new_whitelist)
+      if("${whitelist}" STREQUAL "${new_whitelist}")
+        break()
+      endif()
+      set(whitelist "${new_whitelist}")
+    endforeach()
+    # Disable modules not in whitelist
+    foreach(m ${OPENCV_MODULES_BUILD})
+      list(FIND whitelist ${m} idx)
+      if(idx EQUAL -1)
+        message(STATUS "Module ${m} disabled by whitelist")
+        __ocv_module_turn_off(${m})
+      endif()
+    endforeach()
+  endif()

   # disable MODULES with unresolved dependencies
   set(has_changes ON)


build: don't depend on the LINK_LIBRARIES target property for plugins

Without this using system libraries instead of the bundled code will
fail on older CMake versions (such as 2.8.7, which is used on Ubuntu
12.04).

--- cmake/SquashPlugin.cmake
+++ cmake/SquashPlugin.cmake
@@ -86,7 +86,7 @@
         set_property (TARGET ${PLUGIN_TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${ldflag}")
       endforeach ()
     else ()
-      set_property (TARGET ${PLUGIN_TARGET} APPEND PROPERTY LINK_LIBRARIES ${${SQUASH_PLUGIN_EXTERNAL_PKG_PREFIX}_LIBRARIES})
+      target_link_libraries (${PLUGIN_TARGET} ${${SQUASH_PLUGIN_EXTERNAL_PKG_PREFIX}_LIBRARIES})
     endif ()

     if (NOT "${${SQUASH_PLUGIN_EXTERNAL_PKG_PREFIX}_CFLAGS}" STREQUAL "")


added byproducts line

added byproducts line

--- cmake/stm32/common.cmake
+++ cmake/stm32/common.cmake
@@ -55,6 +55,7 @@
         TARGET ${TARGET}
         POST_BUILD
         COMMAND ${CMAKE_OBJCOPY} -O binary ${TARGET}${CMAKE_EXECUTABLE_SUFFIX_C} ${TARGET}.bin
+        BYPRODUCTS ${TARGET}.bin
         COMMENT "Generating binary file ${CMAKE_PROJECT_NAME}.bin"
     )
 endfunction()
@@ -64,6 +65,7 @@
         TARGET ${TARGET}
         POST_BUILD
         COMMAND ${CMAKE_OBJCOPY} -O ihex ${TARGET}${CMAKE_EXECUTABLE_SUFFIX_C} ${TARGET}.hex
+        BYPRODUCTS ${TARGET}.hex
         COMMENT "Generating hex file ${CMAKE_PROJECT_NAME}.hex"
     )
 endfunction()


COMP: clean up ImportGDAL

COMP: clean up ImportGDAL

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -64,8 +64,6 @@
   MARK_AS_ADVANCED(GDAL_VERSION_PATCH_STRING)

   MATH(EXPR GDAL_NUM_VERSION "((${GDAL_VERSION_MAJOR})*100+${GDAL_VERSION_MINOR})*100+${GDAL_VERSION_PATCH}")
-  # MESSAGE(STATUS "GDAL Num version: ${GDAL_NUM_VERSION}")
-  # ADD_DEFINITIONS(-DGDAL_VERSION=${GDAL_NUM_VERSION})

   # Find geotiff headers
   FIND_PATH(GEOTIFF_INCLUDE_DIRS geotiff.h $ENV{GDAL_INCLUDE_DIR} ${GDAL_INCLUDE_DIR} ${OSGEO4W_INCLUDE} /usr/include/geotiff /usr/include/libgeotiff)


COMP: Fixed warnings on unused vars. BUG: Pass KWStyle vars to sub projs

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -58,6 +58,7 @@
   ## Insight
   ##
   if( TubeTK_USE_ITKV4 )
+
     set( proj Insight )
     ExternalProject_Add( ${proj}
       GIT_REPOSITORY "${GIT_PROTOCOL}://itk.org/ITK.git"
@@ -80,6 +81,8 @@
       INSTALL_COMMAND ""
       )

+    set( ITK_DIR "${base}/Insight-Build" )
+
     # Also get SimpleITK
     set( proj SimpleITK )
     ExternalProject_Add( ${proj}
@@ -89,7 +92,6 @@
       BINARY_DIR "SimpleITK-Build"
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
-        -Dgit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
         -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
         -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
         -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
@@ -112,9 +114,13 @@
       DEPENDS
         "Insight"
       )
-      set( TubeTK_DEPENDS ${TubeTK_DEPENDS} "SimpleITK" )
-      set( SimpleITK_DIR "${base}/SimpleITK-Build" )
+
+    set( SimpleITK_DIR "${base}/SimpleITK-Build" )
+    set( TubeTK_SimpleITK_Def "-DSimpleITK_DIR:PATH=${SimpleITK_DIR}" )
+    set( TubeTK_DEPENDS ${TubeTK_DEPENDS} "SimpleITK" )
+
   else( TubeTK_USE_ITKV4 )
+
     set( proj Insight )
     ExternalProject_Add( ${proj}
       GIT_REPOSITORY "${GIT_PROTOCOL}://github.com/Slicer/ITK.git"
@@ -123,7 +129,6 @@
       BINARY_DIR Insight-Build
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
-        -Dgit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
         -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
         -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
         -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
@@ -136,10 +141,14 @@
         -DITK_USE_OPTIMIZED_REGISTRATION_METHODS:BOOL=ON
       INSTALL_COMMAND ""
       )
+
   endif( TubeTK_USE_ITKV4 )
+
   set( ITK_DIR "${base}/Insight-Build" )
-
   set( TubeTK_DEPENDS ${TubeTK_DEPENDS} "Insight" )
+
+  set( SimpleITK_DIR "" )
+  set( TubeTK_SimpleITK_Def "" )

 endif( NOT USE_SYSTEM_ITK )

@@ -179,7 +188,6 @@
         BINARY_DIR VTK-Build
         CMAKE_GENERATOR ${gen}
         CMAKE_ARGS
-          -Dgit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
           -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
           -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
           -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
@@ -209,7 +217,6 @@
         BINARY_DIR VTK-Build
         CMAKE_GENERATOR ${gen}
         CMAKE_ARGS
-          -Dgit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
           -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
           -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
           -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
@@ -243,14 +250,7 @@
   BINARY_DIR tclap-Build
   CMAKE_GENERATOR ${gen}
   CMAKE_ARGS
-    -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-    -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-    -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-    -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
-    -DBUILD_SHARED_LIBS:BOOL=${shared}
-    -DBUILD_EXAMPLES:BOOL=OFF
-    -DBUILD_TESTING:BOOL=OFF
   INSTALL_COMMAND ""
   )
 set( TCLAP_DIR "${base}/tclap-Build" )
@@ -281,7 +281,6 @@
     -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
     -DBUILD_SHARED_LIBS:BOOL=${shared}
-    -DBUILD_EXAMPLES:BOOL=OFF
     -DBUILD_TESTING:BOOL=OFF
     -DITK_DIR:PATH=${ITK_DIR}
   INSTALL_COMMAND ""
@@ -306,8 +305,6 @@
     -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
     -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
-    -DBUILD_SHARED_LIBS:BOOL=${shared}
-    -DBUILD_EXAMPLES:BOOL=OFF
     -DBUILD_TESTING:BOOL=OFF
     -DITK_DIR:PATH=${ITK_DIR}
     -DTCLAP_DIR:PATH=${TCLAP_DIR}
@@ -359,13 +356,8 @@
         BINARY_DIR CTK-Build
         CMAKE_GENERATOR ${gen}
         CMAKE_ARGS
-          -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-          -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-          -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-          -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
           -DCMAKE_BUILD_TYPE:STRING=${build_type}
           -DBUILD_SHARED_LIBS:BOOL=${shared}
-          -DBUILD_EXAMPLES:BOOL=OFF
           -DBUILD_TESTING:BOOL=OFF
           -DCTK_USE_GIT_PROTOCOL:BOOL=TRUE
           -DCTK_LIB_Widgets:BOOL=ON
@@ -375,7 +367,6 @@
           -Dgit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
           -DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
           -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-          -DVTK_DIR:PATH=${VTK_DIR}
         INSTALL_COMMAND ""
         DEPENDS
           ${CTK_DEPENDS}
@@ -394,7 +385,6 @@
 ##
 ## TubeTK - Normal Build
 ##
-if( NOT TubeTK_USE_ITKV4 )
 set( proj TubeTK )
 ExternalProject_Add( ${proj}
   DOWNLOAD_COMMAND ""
@@ -407,7 +397,6 @@
     -DMAKECOMMAND:STRING=${MAKECOMMAND}
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
     -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-    -DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
     -DBUILD_TESTING:BOOL=${BUILD_TESTING}
     -DBUILD_DOCUMENTATION:BOOL=${BUILD_DOCUMENTATION}
     -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
@@ -417,6 +406,7 @@
     -DTubeTK_USE_SUPERBUILD:BOOL=FALSE
     -DTubeTK_USE_VTK:BOOL=${TubeTK_USE_VTK}
     -DTubeTK_USE_KWSTYLE:BOOL=${TubeTK_USE_KWSTYLE}
+    -DKWSTYLE_DASHBOARD_SUBMISSION:BOOL=${KWSTYLE_DASHBOARD_SUBMISSION}
     -DTubeTK_USE_CTK:BOOL=${TubeTK_USE_CTK}
     -DTubeTK_USE_QT:BOOL=${TubeTK_USE_QT}
     -DTubeTK_USE_ITKV4:BOOL=${TubeTK_USE_ITKV4}
@@ -426,49 +416,8 @@
     -DGenerateCLP_DIR:PATH=${GenerateCLP_DIR}
     -DCTK_DIR:PATH=${CTK_DIR}
     -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+    ${TubeTK_SimpleITK_Def}
   INSTALL_COMMAND ""
   DEPENDS
     ${TubeTK_DEPENDS}
- )
-
-##
-## TubeTK - ITKv4 Build
-##
-else( NOT TubeTK_USE_ITKV4 )
-set( proj TubeTK )
-ExternalProject_Add( ${proj}
-  DOWNLOAD_COMMAND ""
-  SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
-  BINARY_DIR TubeTK-Build
-  CMAKE_GENERATOR ${gen}
-  CMAKE_ARGS
-    -DBUILDNAME:STRING=${BUILDNAME}
-    -DSITE:STRING=${SITE}
-    -DMAKECOMMAND:STRING=${MAKECOMMAND}
-    -DCMAKE_BUILD_TYPE:STRING=${build_type}
-    -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-    -DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-    -DBUILD_TESTING:BOOL=${BUILD_TESTING}
-    -DBUILD_DOCUMENTATION:BOOL=${BUILD_DOCUMENTATION}
-    -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
-    -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
-    -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-    -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-    -DTubeTK_USE_SUPERBUILD:BOOL=FALSE
-    -DTubeTK_USE_VTK:BOOL=${TubeTK_USE_VTK}
-    -DTubeTK_USE_KWSTYLE:BOOL=${TubeTK_USE_KWSTYLE}
-    -DTubeTK_USE_CTK:BOOL=${TubeTK_USE_CTK}
-    -DTubeTK_USE_QT:BOOL=${TubeTK_USE_QT}
-    -DTubeTK_USE_ITKV4:BOOL=${TubeTK_USE_ITKV4}
-    -DTubeTK_EXECUTABLE_DIRS:BOOL=${TubeTK_EXECUTABLE_DIRS}
-    -DITK_DIR:PATH=${ITK_DIR}
-    -DSimpleITK_DIR:PATH=${SimpleITK_DIR}
-    -DVTK_DIR:PATH=${VTK_DIR}
-    -DGenerateCLP_DIR:PATH=${GenerateCLP_DIR}
-    -DCTK_DIR:PATH=${CTK_DIR}
-    -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
-  INSTALL_COMMAND ""
-  DEPENDS
-    ${TubeTK_DEPENDS}
- )
-endif( NOT TubeTK_USE_ITKV4 )
+  )


BUG: Fix link error in VS9

BUG: Fix link error in VS9

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -377,7 +377,7 @@
     -DSITE:STRING=${SITE}
     -DMAKECOMMAND:STRING=${MAKECOMMAND}
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
-    -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+    -DBUILD_SHARED_LIBS:BOOL=${shared}
     -DBUILD_TESTING:BOOL=${BUILD_TESTING}
     -DBUILD_DOCUMENTATION:BOOL=${BUILD_DOCUMENTATION}
     -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}


Update subproject.cmake

Update subproject.cmake

--- CMake/subproject.cmake
+++ CMake/subproject.cmake
@@ -9,7 +9,8 @@
       message("Subproject ${name} already included, skipping")
    else()
       find_package(${package_name} QUIET)
-      if(NOT SOURCE_${package_name} AND ${package_name}_FOUND)
+      string(TOUPPER ${package_name} upper)
+      if(NOT SOURCE_${upper} AND ${upper}_FOUND)
          message("Found ${package_name} on system")
       else()
          message("Adding ${name} as subdirectory")


iox-#609 Remove cxx_std_17 from toolchain

Signed-off-by: Hintz Martin (XC-AD/ESB5) <cfa934f6a18d8fc1b7e02e9604aec5d1a5fb6d87@de.bosch.com>


version 0.3.0

version 0.3.0

--- src/PluginConfig.cmake
+++ src/PluginConfig.cmake
@@ -5,7 +5,7 @@
 #
 #\**********************************************************/

-set(PLUGIN_VERSION "0.2.0")
+set(PLUGIN_VERSION "0.3.0")
 set(PLUGIN_NAME "FBVLC")
 set(PLUGIN_PREFIX "FBVLC")
 set(PLUGIN_DESCRIPTION "VLC Web Plugin (powered by FireBreath)")
@@ -19,9 +19,9 @@
 # 1) place vlc into FBVLC\Win\WiX\vlc-${VLC_VERSION}
 # 2) uncomment following
 if(APPLE)
-    set(VLC_VERSION "2.1.5")
+    set(VLC_VERSION "3.0.6")
 else()
-    set(VLC_VERSION "2.1.5")
+    set(VLC_VERSION "3.0.6")
 endif()
 # 3) run prepXXXX.cmd from FireBreath


Fix missing stubs in CoreCLR (#448)

Fix missing stubs in CoreCLR (#448)

Signed-off-by: José Simões <1616ff7a83d123f98f8f38fa2524eab406644781@eclo.solutions>

--- CMake/Modules/FindNF_CoreCLR.cmake
+++ CMake/Modules/FindNF_CoreCLR.cmake
@@ -128,7 +128,10 @@
     CLRStartup.cpp

     # Core stubs
+    Hardware_stub.cpp
     Heap_Persistence_stub.cpp
+    InterruptHandler_stub.cpp
+    NativeEventDispatcher_stub.cpp
     RPC_stub.cpp
     BinaryFormatter_stub.cpp


Remove glob that doesn't work on older cmakes

--- scripts/EnvironmentScript.cmake
+++ scripts/EnvironmentScript.cmake
@@ -28,7 +28,6 @@
 # Adds many paths to a path file
 function(_add_to_a_path THISFILE)
     foreach(path ${ARGN})
-        file(GLOB these_files "${path}")
         _add_to_a_path_single("${THISFILE}" "${these_files}")
     endforeach()
 endfunction()


Integrate sanitizers in the engine

Integrate sanitizers in the engine

--- sequoia-engine/cmake/SequoiaEngineOptions.cmake
+++ sequoia-engine/cmake/SequoiaEngineOptions.cmake
@@ -27,6 +27,9 @@
 option(SEQUOIA_ENGINE_USE_CCACHE "Use compile cache if available" ON)
 option(SEQUOIA_ENGINE_WERROR "Treat warning as errors" OFF)

+option(SEQUOIA_ENGINE_MSAN "Enable Clang's memory sanitizer (msan)" OFF)
+option(SEQUOIA_ENGINE_ASAN "Enable Clang's address sanitizer (asan)" OFF)
+
 option(SEQUOIA_ENGINE_TESTING "Enable testing" ON)
 option(SEQUOIA_ENGINE_BENCHMARKING "Enable benchmarking" OFF)

@@ -35,6 +38,8 @@
   SEQUOIA_ENGINE_OPTIMIZE
   SEQUOIA_ENGINE_USE_CCACHE
   SEQUOIA_ENGINE_WERROR
+  SEQUOIA_ENGINE_MSAN
+  SEQUOIA_ENGINE_ASAN
   SEQUOIA_ENGINE_TESTING
   SEQUOIA_ENGINE_BENCHMARKING
 )


[CMake] Don't pass -fPIC when compiling the darwin builtins

This change makes CMake match autoconf.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@252547 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -264,7 +264,7 @@
     set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} -O3)
   endif()

-  set(CMAKE_C_FLAGS "-fPIC -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
+  set(CMAKE_C_FLAGS "-fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
   set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
   set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS})


removing artifacts after commit 20dbad670e1a6ebf52d3aa12d55c7784070a115d

--- scripts/cmake/doctestAddTests.cmake
+++ scripts/cmake/doctestAddTests.cmake
@@ -11,10 +11,6 @@
 set(script)
 set(suite)
 set(tests)
-
-if(NOT DEFINED ${add_labels})
-    set(add_labels 0)
-endif()

 function(add_command NAME)
   set(_args "")


Added consistent compiler definitions, and merge gcc and clang options

--- cmake/Modules/Compiler.cmake
+++ cmake/Modules/Compiler.cmake
@@ -2,6 +2,18 @@
 include( CheckCCompilerFlag )

 if( CMAKE_COMPILER_IS_GNUCC )
+	set( GCC 1 )
+endif (CMAKE_COMPILER_IS_GNUCC )
+
+if( __COMPILER_CLANG )
+	set( CLANG 1 )
+endif( __COMPILER_CLANG )
+
+if( CMAKE_C_COMPILER_ID EQUAL SunPro )
+	set( SUNSTUDIO 1 )
+endif( CMAKE_C_COMPILER_ID EQUAL SunPro )
+
+if( CLANG OR GCC )
 	check_c11( )
 	if( HAVE_C11 )
 		add_definitions( -std=c11 )
@@ -9,12 +21,11 @@
 		add_definitions( -std=c99 )
 	endif( HAVE_C11 )

-	if( HAVE_WALL )
-		add_definitions( -Wall -pedantic )
-	endif( HAVE_WALL )
+	add_definitions( -Wall -pedantic )

 	check_c_compiler_flag( -Wno-pointer-sign HAVE_WNO_POINTER_SIGN )
 	if( HAVE_WNO_POINTER_SIGN )
 		add_definitions( -Wno-pointer-sign )
+		add_definitions( -Werror )
 	endif( HAVE_WNO_POINTER_SIGN )
-endif( CMAKE_COMPILER_IS_GNUCC )
+endif( CLANG OR GCC )


Simplify version detection

Simplify version detection

Instead of reading individual version components from version.h, get
the whole thing at once using SAMPGDK_VERSION_STRING.

--- cmake/Modules/FindGDK4.cmake
+++ cmake/Modules/FindGDK4.cmake
@@ -78,34 +78,21 @@
   GDK4_INCLUDE_DIRS
 )

-function(get_version name text)
-  string(REGEX MATCH "#define[   ]+SAMPGDK_VERSION_${name}[   ]+[0-9]+" match "${text}")
+function(get_version_string var text)
+  string(REGEX MATCH "#define[\\t ]+SAMPGDK_VERSION_STRING[\\t ]+\".*\""
+         match "${text}")
   if(match)
-    string(REGEX REPLACE ".* ([0-9]+)" "\\1" number "${match}")
-    set(GDK4_VERSION_${name} ${number} PARENT_SCOPE)
+    string(REGEX REPLACE ".*\"(.*)\"" "\\1" version_string "${match}")
+    set(${var} ${version_string} PARENT_SCOPE)
   endif()
 endfunction()

 if(GDK4_INCLUDE_DIR)
   file(READ "${GDK4_INCLUDE_DIR}/sampgdk/version.h" text)
-
-  get_version(MAJOR "${text}")
-  get_version(MINOR "${text}")
-  get_version(PATCH "${text}")
-  get_version(TWEAK "${text}")
-
-  if(NOT GDK4_VERSION_TWEAK OR GDK4_VERSION_TWEAK EQUAL 0)
-    if(NOT GDK4_VERSION_PATCH OR GDK4_VERSION_PATCH EQUAL 0)
-      set(GDK4_VERSION "${GDK4_VERSION_MAJOR}.${GDK4_VERSION_MINOR}")
-    else()
-      set(GDK4_VERSION "${GDK4_VERSION_MAJOR}.${GDK4_VERSION_MINOR}.${GDK4_VERSION_PATCH}")
-    endif()
-  else()
-    set(GDK4_VERSION "${GDK4_VERSION_MAJOR}.${GDK4_VERSION_MINOR}.${GDK4_VERSION_PATCH}.${GDK4_VERSION_TWEAK}")
-  endif()
+  get_version_string(GDK4_VERSION_STRING "${text}")
 endif()

 find_package_handle_standard_args(GDK4 REQUIRED_VARS GDK4_INCLUDE_DIRS
                                                      GDK4_LIBRARY_DIRS
                                                      GDK4_LIBRARIES
-                                  VERSION_VAR GDK4_VERSION)
+                                  VERSION_VAR GDK4_VERSION_STRING)


[AddSwift.cmake] Remove leftover use_internal_sdk parameter values

The `use_internal_sdk` flag has been removed from `_add_variant_link_flags` and
`_add_variant_c_compile_flags` in commit
d9bbb6caf09a512f10edc4379194ec6a07aed847

In four instances where previously FALSE was given as the value for that
parameter, this value has not been removed from the call.
This causes the two functions to try to append flags to FALSE instead of the
respective link_flags and c_compile_flags variables.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1612,14 +1612,12 @@
       "${SWIFTEXE_SINGLE_ARCHITECTURE}"
       "${CMAKE_BUILD_TYPE}"
       "${LLVM_ENABLE_ASSERTIONS}"
-      FALSE
       c_compile_flags)
   _add_variant_link_flags(
       "${SWIFTEXE_SINGLE_SDK}"
       "${SWIFTEXE_SINGLE_ARCHITECTURE}"
       "${CMAKE_BUILD_TYPE}"
       "${LLVM_ENABLE_ASSERTIONS}"
-      FALSE
       link_flags)

   list(APPEND link_flags


Move FindKode.cmake to playground/pim/kode

svn path=/trunk/KDE/kdepim/; revision=942226

--- cmake/modules/FindKode.cmake
+++ cmake/modules/FindKode.cmake
@@ -1,49 +0,0 @@
-#
-# Find the Kode tools
-#
-# The following variables are defined by this module:
-#
-# KODE_XML_COMPILER_EXECUTABLE - the kxml_compiler executable
-#
-# The following macros are provieded (from KodeMacros.cmake):
-#
-# kode_add_xml_parser (name schema1 ... schemaN)
-#   Generate code to handle XML defined by the given schemata
-#
-
-
-# check if we are currently building kdepim
-if ( EXISTS ${CMAKE_SOURCE_DIR}/libkdepim/kdepim_export.h )
-	if (WIN32)
-		# CMAKE_CFG_INTDIR is the output subdirectory created e.g. by XCode and MSVC
-		set( KODE_XML_COMPILER_EXECUTABLE ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/kxml_compiler.exe.bat )
-	else(WIN32)
-		# On problems when building with XCode try adding ${CMAKE_CFG_INTDIR}, see also FindKDE4Internal.cmake
-		set( KODE_XML_COMPILER_EXECUTABLE ${CMAKE_BINARY_DIR}/kode/kxml_compiler/kxml_compiler.shell )
-	endif(WIN32)
-	set( _KODE_XML_COMPILER_DEP kxml_compiler )
-else ( EXISTS ${CMAKE_SOURCE_DIR}/libkdepim/kdepim_export.h )
-	find_program( KODE_XML_COMPILER_EXECUTABLE NAME kxml_compiler PATHS
-		${KDE4_BIN_INSTALL_DIR}
-		$ENV{KDEDIR}/bin
-		/opt/kde/bin
-		/opt/kde4/bin
-		NO_SYSTEM_PATH
-		NO_CMAKE_SYSTEM_PATH
-	)
-
-	if ( NOT KODE_XML_COMPILER_EXECUTABLE )
-		find_program( KODE_XML_COMPILER_EXECUTABLE NAME kxml_compiler )
-	endif ( NOT KODE_XML_COMPILER_EXECUTABLE )
-
-	if ( KODE_XML_COMPILER_EXECUTABLE )
-		message( STATUS "Found Kode XML compiler: ${KODE_XML_COMPILER_EXECUTABLE}" )
-	else ( KODE_XML_COMPILER_EXECUTABLE )
-		message( FATAL_ERROR "Couldn't find kxml_compiler" )
-	endif ( KODE_XML_COMPILER_EXECUTABLE )
-
-	set( _KODE_XML_COMPILER_DEP )
-endif ( EXISTS ${CMAKE_SOURCE_DIR}/libkdepim/kdepim_export.h )
-
-# macros to use the Kode tools
-include( KodeMacros )


Always turn off the linuxvga device if not on a Linux system.

svn path=/trunk/; revision=6919

--- cmake/modules/linuxvga.cmake
+++ cmake/modules/linuxvga.cmake
@@ -50,4 +50,6 @@
       set(PLD_linuxvga OFF CACHE BOOL "Enable linuxvga device" FORCE)
     endif(VGA_FOUND)
   endif(PLD_linuxvga)
+else(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+  set(PLD_linuxvga OFF CACHE BOOL "Enable linuxvga device" FORCE)
 endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")


INDI main library is obsolete

INDI main library is obsolete

--- cmake_modules/FindINDI.cmake
+++ cmake_modules/FindINDI.cmake
@@ -16,7 +16,7 @@
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

-if (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES AND INDI_CLIENT_LIBRARIES)
+if (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_CLIENT_LIBRARIES)

   # in cache already
   set(INDI_FOUND TRUE)
@@ -27,10 +27,9 @@
   message(STATUS "[Cached] INDI_DATA_DIR:         ${INDI_DATA_DIR}")
   message(STATUS "[Cached] INDI_LIBRARIES:        ${INDI_LIBRARIES}")
   message(STATUS "[Cached] INDI_DRIVER_LIBRARIES: ${INDI_DRIVER_LIBRARIES}")
-  message(STATUS "[Cached] INDI_MAIN_LIBRARIES:   ${INDI_MAIN_LIBRARIES}")
   message(STATUS "[Cached] INDI_CLIENT_LIBRARIES: ${INDI_CLIENT_LIBRARIES}")

-else (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES AND INDI_CLIENT_LIBRARIES)
+else (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_CLIENT_LIBRARIES)

   find_package(PkgConfig)

@@ -58,10 +57,6 @@
       HINTS ${PC_INDI_LIBRARY_DIRS}
     )

-    find_library(INDI_MAIN_LIBRARIES NAMES indimain
-      HINTS ${PC_INDI_LIBRARY_DIRS}
-    )
-
     find_library(INDI_CLIENT_LIBRARIES NAMES indiclient
       HINTS ${PC_INDI_LIBRARY_DIRS}
     )
@@ -76,7 +71,7 @@

   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(INDI
-                                    REQUIRED_VARS INDI_INCLUDE_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES INDI_MAIN_LIBRARIES INDI_CLIENT_LIBRARIES
+                                    REQUIRED_VARS INDI_INCLUDE_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES INDI_CLIENT_LIBRARIES
                                     VERSION_VAR INDI_VERSION
   )

@@ -87,9 +82,8 @@
   message(STATUS "Found INDI_DATA_DIR:         ${INDI_DATA_DIR}")
   message(STATUS "Found INDI_LIBRARIES:        ${INDI_LIBRARIES}")
   message(STATUS "Found INDI_DRIVER_LIBRARIES: ${INDI_DRIVER_LIBRARIES}")
-  message(STATUS "Found INDI_MAIN_LIBRARIES:   ${INDI_MAIN_LIBRARIES}")
   message(STATUS "Found INDI_CLIENT_LIBRARIES: ${INDI_CLIENT_LIBRARIES}")

-  mark_as_advanced(INDI_INCLUDE_DIR INDI_DATA_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES INDI_MAIN_LIBRARIES INDI_CLIENT_LIBRARIES)
+  mark_as_advanced(INDI_INCLUDE_DIR INDI_DATA_DIR INDI_LIBRARIES INDI_DRIVER_LIBRARIES INDI_CLIENT_LIBRARIES)

-endif (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_MAIN_LIBRARIES AND INDI_CLIENT_LIBRARIES)
+endif (INDI_INCLUDE_DIR AND INDI_DATA_DIR AND INDI_LIBRARIES AND INDI_DRIVER_LIBRARIES AND INDI_CLIENT_LIBRARIES)


Update compiler.cmake

Update compiler.cmake

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -148,7 +148,7 @@
                  CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
              # Find all dynamic runtime (MD) references and replace with static (MT)
              if (${flag_var} MATCHES "/MD")
-                 string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+                 #string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
              endif (${flag_var} MATCHES "/MD")
          endforeach (flag_var)
      endif ()
@@ -209,13 +209,11 @@
                  "C3280" # Declaration hides variable
                  )
      endif ()
-     string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR
-             ${MSVC_DISABLED_WARNINGS_LIST})
      if (NOT CLANG)
+         string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR ${MSVC_DISABLED_WARNINGS_LIST})
          string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
      endif ()
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 ${MSVC_DISABLED_WARNINGS_STR}")
-
      message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
      add_definitions(${MSVC_DISABLED_WARNINGS_STR})
  endif ()


ManageFile.cmake: Fix descriptions

ManageFile.cmake: Fix descriptions

--- Modules/ManageFile.cmake
+++ Modules/ManageFile.cmake
@@ -10,7 +10,7 @@
 #     [ERROR_MSG errorMessage]
 #     [ERROR_VAR errorVar]
 #     [VERBOSE_LEVEL verboseLevel]
-#     [FIND_FILE_ARGS ...]
+#     [FIND_ARGS ...]
 #   )
 #     - Find a file, with proper error handling.
 #       It is essentially a wrapper of FIND_FILE
@@ -21,14 +21,14 @@
 #           each verbose level.
 #         + ERROR_MSG errorMessage: Error message to be append.
 #         + ERROR_VAR errorVar: Variable to be set as 1 when not found.
-#         + FIND_FILE_ARGS: A list of arguments to be passed
+#         + FIND_ARGS: A list of arguments to be passed
 #           to FIND_FILE
 #
 #   FIND_PROGRAM_ERROR_HANDLING(<VAR>
 #     [ERROR_MSG errorMessage]
 #     [ERROR_VAR errorVar]
 #     [VERBOSE_LEVEL verboseLevel]
-#     [FIND_PROGRAM_ARGS ...]
+#     [FIND_ARGS ...]
 #   )
 #     - Find an executable program, with proper error handling.
 #       It is essentially a wrapper of FIND_PROGRAM
@@ -39,7 +39,7 @@
 #           each verbose level.
 #         + ERROR_MSG errorMessage: Error message to be append.
 #         + ERROR_VAR errorVar: Variable to be set as 1 when not found.
-#         + FIND_PROGRAM_ARGS: A list of arguments to be passed
+#         + FIND_ARGS: A list of arguments to be passed
 #           to FIND_PROGRAM
 #
 # Defines following macros:
@@ -72,6 +72,7 @@
 	"BIN" "PRJ_DOC" "DATA" "PRJ_DATA" "SYSCONF" "SYSCONF_NO_REPLACE"
        	"LIB" "LIBEXEC"
 	)
+    INCLUDE(ManageMessage)

     MACRO(_MANAGE_FILE_SET_FILE_INSTALL_LIST fileType)
 	SET(FILE_INSTALL_${fileType}_LIST "${FILE_INSTALL_${fileType}_LIST}"


cmake: allow to build on mingw using static libs

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -366,7 +366,12 @@
   target_compile_definitions(dgl-cairo-definitions INTERFACE "DGL_CAIRO" "HAVE_CAIRO")

   target_include_directories(dgl-cairo PUBLIC ${CAIRO_INCLUDE_DIRS})
-  target_link_libraries(dgl-cairo PRIVATE dgl-cairo-definitions ${CAIRO_LIBRARIES})
+  if(MINGW)
+    target_link_libraries(dgl-cairo PRIVATE ${CAIRO_STATIC_LIBRARIES})
+  else()
+    target_link_libraries(dgl-cairo PRIVATE ${CAIRO_LIBRARIES})
+  endif()
+  target_link_libraries(dgl-cairo PRIVATE dgl-cairo-definitions)
 endfunction()

 # dpf__add_dgl_opengl
@@ -516,6 +521,9 @@
 function(dpf__add_executable NAME)
   add_executable("${NAME}" ${ARGN})
   dpf__set_target_defaults("${NAME}")
+  if(MINGW)
+    target_link_libraries("${NAME}" PRIVATE "-static")
+  endif()
 endfunction()

 # dpf__add_module
@@ -526,6 +534,9 @@
 function(dpf__add_module NAME)
   add_library("${NAME}" MODULE ${ARGN})
   dpf__set_target_defaults("${NAME}")
+  if(MINGW)
+    target_link_libraries("${NAME}" PRIVATE "-static")
+  endif()
 endfunction()

 # dpf__add_static_library


GTclang -> Dawn

GTclang -> Dawn

--- cmake/DawnMacros.cmake
+++ cmake/DawnMacros.cmake
@@ -22,7 +22,7 @@
 #
 macro(dawn_set_cxx_flags)
   # Remove -DNDEBUG flag if ASSERTS are ON
-  if(GTCLANG_ASSERTS)
+  if(DAWN_ASSERTS)
     set(ndebug_flag "-DNDEBUG")
     string(REPLACE "${ndebug_flag}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
     string(REPLACE "${ndebug_flag}" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")


Prefer arpack over parpack

Prefer arpack over parpack

--- cmake/FindARPACK.cmake
+++ cmake/FindARPACK.cmake
@@ -1,6 +1,6 @@
 SET(ARPACK_SEARCH_PATHS ${ARPACK_DIR})

-FIND_LIBRARY(ARPACK_LIB NAMES parpack arpack PATHS ${ARPACK_SEARCH_PATHS})
+FIND_LIBRARY(ARPACK_LIB NAMES arpack parpack PATHS ${ARPACK_SEARCH_PATHS})

 SET(ARPACK_FOUND FALSE)
 IF (ARPACK_LIB)


[cmake] Consider relevant environment variables in FindEigen3.cmake

--- cmake/FindEigen3.cmake
+++ cmake/FindEigen3.cmake
@@ -63,6 +63,9 @@

   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
       PATHS
+      $ENV{EIGEN_ROOT}/include
+      ENV CPATH
+      ENV CPLUS_INCLUDE_PATH
       ${CMAKE_INSTALL_PREFIX}/include
       ${KDE4_INCLUDE_DIR}
       PATH_SUFFIXES eigen3 eigen


Removed -lcblas

Removed -lcblas

--- cmake/SelectBLAS.cmake
+++ cmake/SelectBLAS.cmake
@@ -83,7 +83,7 @@
   else()
     add_definitions(-DBLAS_DEFAULT_LOCAL_HEADER)
   endif()
-  list(APPEND BLAS_LIBRARIES "-lcblas")
+  #list(APPEND BLAS_LIBRARIES "-lcblas")

 endif()


tweaks for the mac

tweaks for the mac

--- cmake/ectoMacros.cmake
+++ cmake/ectoMacros.cmake
@@ -1,7 +1,7 @@
 macro(ectomodule NAME)
   if(WIN32)
     link_directories(${Boost_LIBRARY_DIRS})
-    set(ECTO_MODULE_DEP_LIBS
+    set(ECTO_MODULE_DEP_LIBS
       ${PYTHON_LIBRARIES}
       ${Boost_PYTHON_LIBRARY}
       )
@@ -13,11 +13,11 @@
   endif()
   #these are required includes for every ecto module
   include_directories(
-    ${ecto_INCLUDE_DIRS}
+    ${ecto_INCLUDE_DIRS}
     ${PYTHON_INCLUDE_PATH}
     ${Boost_INCLUDE_DIRS}
     )
-
+
   add_library(${NAME}_ectomodule SHARED
     ${ARGN}
     )
@@ -41,7 +41,12 @@
       )
     message(STATUS "Using PY_SUFFIX = ${PY_SUFFIX}")
   endif()
-
+  if(APPLE)
+    set_target_properties(${NAME}_ectomodule
+      SUFFIX ".so"
+      )
+  endif()
+
   target_link_libraries(${NAME}_ectomodule
     ${ECTO_MODULE_DEP_LIBS}
     ${ecto_LIBRARIES}
@@ -53,7 +58,7 @@
 macro(ectorosmodule NAME)
   if(WIN32)
     link_directories(${Boost_LIBRARY_DIRS})
-    set(ECTO_MODULE_DEP_LIBS
+    set(ECTO_MODULE_DEP_LIBS
       ${PYTHON_LIBRARIES}
       ${Boost_PYTHON_LIBRARY}
       )
@@ -64,22 +69,22 @@
       )
   endif()
   include_directories(
-    ${ecto_INCLUDE_DIRS}
+    ${ecto_INCLUDE_DIRS}
     ${PYTHON_INCLUDE_PATH}
     ${Boost_INCLUDE_DIRS}
     )
-
-  rosbuild_add_library(${NAME}_ectomodule
+
+  rosbuild_add_library(${NAME}_ectomodule
     ${ARGN}
     )
-
+
   set_target_properties(${NAME}_ectomodule
     PROPERTIES
     OUTPUT_NAME ${NAME}
     LINK_FLAGS -shared-libgcc
     PREFIX ""
     )
-
+
   target_link_libraries(${NAME}_ectomodule
     ${ECTO_MODULE_DEP_LIBS}
     ${ecto_LIBRARIES}


cmake: extensions: add dt_alias()

cmake: extensions: add dt_alias()

This is a helper function for looking up the path to a devicetree
alias. It is analogous to dt_chosen(). It has to exist as a separate
function from dt_prop() for similar reasons that dt_chosen() does:
the edtlib APIs for interacting with /aliases are special-cased in the
same way they are for /chosen.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -2574,6 +2574,49 @@
   endforeach()

   get_target_property(${var} devicetree_target "DT_NODELABEL|${DT_LABEL_NODELABEL}")
+  if(${${var}} STREQUAL ${var}-NOTFOUND)
+    set(${var})
+  endif()
+
+  set(${var} ${${var}} PARENT_SCOPE)
+endfunction()
+
+# Usage:
+#   dt_alias(<var> PROPERTY <prop>)
+#
+# Get a node path for an /aliases node property.
+#
+# Example usage:
+#
+#   # The full path to the 'led0' alias is returned in 'path'.
+#   dt_alias(path PROPERTY "led0")
+#
+#   # The variable 'path' will be left undefined for a nonexistent
+#   # alias "does-not-exist".
+#   dt_alias(path PROPERTY "does-not-exist")
+#
+# The node's path will be returned in the <var> parameter. The
+# variable will be left undefined if the alias does not exist.
+#
+# <var>           : Return variable where the node path will be stored
+# PROPERTY <prop> : The alias to check
+function(dt_alias var)
+  set(req_single_args "PROPERTY")
+  cmake_parse_arguments(DT_ALIAS "" "${req_single_args}" "" ${ARGN})
+
+  if(${ARGV0} IN_LIST req_single_args)
+    message(FATAL_ERROR "dt_alias(${ARGV0} ...) missing return parameter.")
+  endif()
+
+  foreach(arg ${req_single_args})
+    if(NOT DEFINED DT_ALIAS_${arg})
+      message(FATAL_ERROR "dt_alias(${ARGV0} ...) "
+                          "missing required argument: ${arg}"
+      )
+    endif()
+  endforeach()
+
+  get_target_property(${var} devicetree_target "DT_ALIAS|${DT_ALIAS_PROPERTY}")
   if(${${var}} STREQUAL ${var}-NOTFOUND)
     set(${var})
   endif()


Check the ctest variable results for the return value of the script

Print a useful message about what error occurred during regression
testing.

--- Testing/CI/Azure/azure.cmake
+++ Testing/CI/Azure/azure.cmake
@@ -115,3 +115,27 @@
 message("CDash Build Identifier: ${build_date} ${CTEST_BUILD_NAME}")

 include("${DASHBOARD_BRANCH_DIRECTORY}/simpleitk_common.cmake")
+
+function(print_if var)
+  if( NOT ${${var}} EQUAL 0 )
+    message(SEND_ERROR  "\tUnexpected result ${var}: ${${var}}")
+  endif()
+endfunction()
+
+
+if(NOT ${configure_return} EQUAL 0 OR
+   NOT ${build_return} EQUAL 0 OR
+   NOT ${build_errors} EQUAL 0 OR
+   NOT ${build_warnings} EQUAL 0 OR
+   NOT ${test_return} EQUAL 0)
+  message(FATAL_ERROR
+    "Build did not complete without warnings, errors, or failures.")
+  print_if(configure_return)
+  print_if(build_return)
+  print_if(build_errors)
+  print_if(build_warnings)
+  print_if(test_return)
+
+else()
+  return(0)
+endif()


getdeps: add an install_fb_python_executable() function to the CMake utilities

Summary:
Add a `install_fb_python_executable()` function to `FBPythonBinary.cmake` for
helping to install python executables generated with
`add_fb_python_executable()`.  This primarily helps by automatically looking
up the correct output file to install from the generated targets.

Reviewed By: wez

Differential Revision: D18774539

fbshipit-source-id: 4b397580d72ac448f21d1db6d2cdd653cf3635df

--- build/fbcode_builder/CMake/FBPythonBinary.cmake
+++ build/fbcode_builder/CMake/FBPythonBinary.cmake
@@ -548,6 +548,30 @@
 endfunction()

 #
+# Install an FB-style packaged python binary.
+#
+# - DESTINATION <export-name>:
+#   Associate the installed target files with the given export-name.
+#
+function(install_fb_python_executable TARGET)
+  # Parse the arguments
+  set(one_value_args DESTINATION)
+  set(multi_value_args)
+  fb_cmake_parse_args(
+    ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
+  )
+
+  if(NOT DEFINED ARG_DESTINATION)
+    set(ARG_DESTINATION bin)
+  endif()
+
+  install(
+    PROGRAMS "$<TARGET_PROPERTY:${TARGET}.GEN_PY_EXE,EXECUTABLE>"
+    DESTINATION "${ARG_DESTINATION}"
+  )
+endfunction()
+
+#
 # Install a python library.
 #
 # - EXPORT <export-name>:


ENH: Speeding the continuous builds

ENH: Speeding the continuous builds

--- DashboardScripts/tubetk_run_continuous.cmake
+++ DashboardScripts/tubetk_run_continuous.cmake
@@ -1,3 +1,25 @@
+##############################################################################
+#
+# Library:   TubeTK
+#
+# Copyright 2010 Kitware Inc. 28 Corporate Drive,
+# Clifton Park, NY, 12065, USA.
+#
+# All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+##############################################################################

 include( ${CTEST_SCRIPT_DIRECTORY}/../../tubetk_config.cmake )

@@ -13,28 +35,24 @@
   ###########################################################################
   # run some "inside-the-loop" continuous scripts for a while
   #
-  while(${CTEST_ELAPSED_TIME} LESS 56000)
+  while( ${CTEST_ELAPSED_TIME} LESS 56000 )

-    set(START_TIME ${CTEST_ELAPSED_TIME})
+    set( START_TIME ${CTEST_ELAPSED_TIME} )

-    ctest_run_script(
-      "${SITE_SCRIPT_DIR}/tubetk_build_test.cmake" )
+    ctest_run_script( "${SITE_SCRIPT_DIR}/tubetk_build_test.cmake" )

     if( "$ENV{TUBETK_FORCE_BUILD}" STREQUAL "1" )

       if( SITE_CONTINUOUS_STYLE )
-        ctest_run_script(
-          "${SITE_SCRIPT_DIR}/tubetk_style.cmake" )
+        ctest_run_script( "${SITE_SCRIPT_DIR}/tubetk_style.cmake" )
       endif( SITE_CONTINUOUS_STYLE )

       if( SITE_CONTINUOUS_COVERAGE )
-        ctest_run_script(
-          "${SITE_SCRIPT_DIR}/tubetk_coverage.cmake" )
+        ctest_run_script( "${SITE_SCRIPT_DIR}/tubetk_coverage.cmake" )
       endif( SITE_CONTINUOUS_COVERAGE )

       if( SITE_CONTINUOUS_MEMORY )
-        ctest_run_script(
-          "${SITE_SCRIPT_DIR}/tubetk_memory.cmake" )
+        ctest_run_script( "${SITE_SCRIPT_DIR}/tubetk_memory.cmake" )
       endif( SITE_CONTINUOUS_MEMORY )

       set( ENV{TUBETK_FORCE_BUILD} "0" )
@@ -42,11 +60,11 @@
     endif()

     # loop no faster than once every 2 minutes
-    ctest_sleep(${START_TIME} 120 ${CTEST_ELAPSED_TIME})
+    ctest_sleep( 120 )

-  endwhile(${CTEST_ELAPSED_TIME} LESS 56000)
+  endwhile()

-endif( SITE_CONTINUOUS_BUILD_TEST )
+endif()

 # do not run this script as a dashboard
 set(CTEST_RUN_CURRENT_SCRIPT 0)


Fix conda flag?

Fix conda flag?

Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>

--- common/cmake/env.cmake
+++ common/cmake/env.cmake
@@ -209,7 +209,7 @@
     add_custom_command(
       OUTPUT ${OUTPUTS}
       COMMAND ${CMAKE_COMMAND} -E echo "Taking ${CONDA_BIN}.lock"
-      COMMAND flock ${CONDA_BIN}.lock ${CONDA_BIN} install --force-reinstall ${PACKAGE_SPEC}
+      COMMAND flock ${CONDA_BIN}.lock ${CONDA_BIN} install --force ${PACKAGE_SPEC}
       ${TOUCH_COMMANDS}
       DEPENDS conda ${CONDA_BIN}
       )


Check that numdiff and diff can run with very simple input.

This commit adds a check to ensure that calling diff or numdiff does not hang
forever: if it does hang (or cannot be run at all) then we cannot run the test
suite, so bail out.

--- cmake/macros/macro_deal_ii_pickup_tests.cmake
+++ cmake/macros/macro_deal_ii_pickup_tests.cmake
@@ -112,6 +112,26 @@
   IF(NUMDIFF_EXECUTABLE MATCHES "-NOTFOUND")
     SET(NUMDIFF_EXECUTABLE ${DIFF_EXECUTABLE})
   ENDIF()
+
+  #
+  # Check that the diff programs can run and terminate successfully:
+  #
+  FOREACH(_diff_program ${NUMDIFF_EXECUTABLE} ${DIFF_EXECUTABLE})
+    EXECUTE_PROCESS(COMMAND ${_diff_program} "-v"
+      TIMEOUT 4 # seconds
+      OUTPUT_QUIET
+      ERROR_QUIET
+      RESULT_VARIABLE _diff_program_status
+      )
+
+    IF(NOT "${_diff_program_status}" STREQUAL "0")
+      MESSAGE(FATAL_ERROR
+        "\nThe command \"${_diff_program} -v\" did not run correctly: it either "
+        "failed to exit after a few seconds or returned a nonzero exit code. "
+        "The test suite cannot be set up without this program, so please "
+        "reinstall it and then run the test suite setup command again.\n")
+    ENDIF()
+  ENDFOREACH()

   #
   # Set time limit:


A yacma update to enable more warnings.

A yacma update to enable more warnings.

--- cmake/yacma/YACMACompilerLinkerSettings.cmake
+++ cmake/yacma/YACMACompilerLinkerSettings.cmake
@@ -111,9 +111,7 @@
         # This limit is supposed to be at least 1024 in C++11, but for some reason
         # clang sets this to 256, and gcc to 900.
         _YACMA_CHECK_ENABLE_CXX_FLAG(-ftemplate-depth=1024)
-        # NOTE: this can be useful, but at the moment it triggers lots of warnings in type traits.
-        # Keep it in mind for the next time we touch type traits.
-        # _YACMA_CHECK_ENABLE_CXX_FLAG(-Wold-style-cast)
+        _YACMA_CHECK_ENABLE_CXX_FLAG(-Wold-style-cast)
         # NOTE: disable this for now, as it results in a lot of clutter from Boost.
         # _YACMA_CHECK_ENABLE_CXX_FLAG(-Wzero-as-null-pointer-constant)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-pedantic-errors)
@@ -131,6 +129,7 @@
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wshift-negative-value)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wshift-overflow=2)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wduplicated-cond)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnull-dereference)
         # From GCC 7.
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wduplicated-branches)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wrestrict)


Tentative clang warning workaround.

Tentative clang warning workaround.

--- cmake/yacma/YACMACompilerLinkerSettings.cmake
+++ cmake/yacma/YACMACompilerLinkerSettings.cmake
@@ -112,6 +112,9 @@
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-array-div)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wxor-used-as-pow)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wfinal-dtor-non-final-class)
+        # NOTE: this is a new flag in Clang 13 which seems to give
+        # incorrect warnings for UDLs.
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wno-reserved-identifier)
     endif()

     # Common configuration for GCC, clang and Intel.


BUG: uninstall otb macro is removed!

BUG: uninstall otb macro is removed!

--- Packaging/installer_files.cmake
+++ Packaging/installer_files.cmake
@@ -84,6 +84,7 @@

   install(PROGRAMS
     Files/selftester${SCRIPT_EXT}
+    Files/uninstall_otb${SCRIPT_EXT}
     DESTINATION ${PKG_STAGE_DIR}/tools)

   # only required for linux.
@@ -96,8 +97,6 @@
       DESTINATION ${PKG_STAGE_DIR})
   endif()

-  #add otb_uninstall script
-  add_uninstall_otb_script()

   #add otb_loader
   add_executable(otb_loader ${CMAKE_CURRENT_SOURCE_DIR}/Files/otb_loader.cxx)


Addressing remote repository access

Addressing remote repository access

--- Remote/point-cloud.remote.cmake
+++ Remote/point-cloud.remote.cmake
@@ -5,6 +5,6 @@

 vtk_fetch_module(vtkPointCloud
   "Point Cloud processing in VTK"
-  GIT_REPOSITORY 'https://gitlab.kitware.com/vtk/point-cloud'
+  GIT_REPOSITORY https://gitlab.kitware.com/vtk/point-cloud.git
   GIT_TAG master
   )


COMP: Tests disabled temporarily. See bug #18303.

--- Modules/OpenCL/Testing/files.cmake
+++ Modules/OpenCL/Testing/files.cmake
@@ -1,6 +1,7 @@
 set(MODULE_TESTS
   mitkOclResourceServiceTest.cpp
-  mitkOclImageTest.cpp
-  mitkOclBinaryThresholdImageFilterTest.cpp
-  mitkOclReferenceCountTest.cpp
+  #Tests disabled temporarily. See bug #18303
+  #mitkOclImageTest.cpp
+  #mitkOclBinaryThresholdImageFilterTest.cpp
+  #mitkOclReferenceCountTest.cpp
 )


Update libc++ feature to indicate that it is not OS X only

--HG--
branch : v1-9

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -124,7 +124,7 @@
 	set(_core "${_core}  + ZIP archives\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_LIBCPP_SUPPORT)
-	set(_core "${_core}  + libc++ support for OS X\n")
+	set(_core "${_core}  + libc++ support\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATIONMODE)
 	set(_core "${_core}  + Viewport orientation mode support\n")


CMake: add new components to feature summary and sort it [ci skip]

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -15,17 +15,26 @@
 set(_features "${_features}----------------------------------------------------------------------------\n\n")

 #summarise components
+if (OGRE_BUILD_COMPONENT_BITES)
+	set(_components "${_components}  + Bites\n")
+endif ()
+if (OGRE_BUILD_COMPONENT_HLMS)
+	set(_components "${_components}  + HLMS\n")
+endif ()
+if (OGRE_BUILD_COMPONENT_MESHLODGENERATOR)
+	set(_components "${_components}  + MeshLodGenerator\n")
+endif ()
+if (OGRE_BUILD_COMPONENT_OVERLAY)
+	set(_components "${_components}  + Overlay\n")
+endif ()
 if (OGRE_BUILD_COMPONENT_PAGING)
 	set(_components "${_components}  + Paging\n")
 endif ()
-if (OGRE_BUILD_COMPONENT_MESHLODGENERATOR)
-	set(_components "${_components}  + MeshLodGenerator\n")
-endif ()
 if (OGRE_BUILD_COMPONENT_PROPERTY)
 	set(_components "${_components}  + Property\n")
 endif ()
-if (OGRE_BUILD_COMPONENT_TERRAIN)
-	set(_components "${_components}  + Terrain\n")
+if (OGRE_BUILD_COMPONENT_PYTHON)
+	set(_components "${_components}  + Python\n")
 endif ()
 if (OGRE_BUILD_COMPONENT_RTSHADERSYSTEM)
 	set(_components "${_components}  + RTShader System\n")
@@ -39,14 +48,11 @@
 	endif ()

 endif ()
+if (OGRE_BUILD_COMPONENT_TERRAIN)
+	set(_components "${_components}  + Terrain\n")
+endif ()
 if (OGRE_BUILD_COMPONENT_VOLUME)
 	set(_components "${_components}  + Volume\n")
-endif ()
-if (OGRE_BUILD_COMPONENT_OVERLAY)
-	set(_components "${_components}  + Overlay\n")
-endif ()
-if (OGRE_BUILD_COMPONENT_HLMS)
-	set(_components "${_components}  + HLMS\n")
 endif ()

 if (DEFINED _components)


Fix MKL linking order to enable threaded BLAS

The DLL linking order given in FindMKL does not follow that in
Intel's Link Line Advisory.  More specifically, thread layering
is linked before the interface library.  This causes MKL to not
to schedule BLAS level 3 operations (and gemv) on the threads it
created.

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -260,14 +260,14 @@
     set_target_properties(MKL::MKL
       PROPERTIES
         IMPORTED_LOCATION "${MKL_Core_LINK_LIBRARY}"
-        INTERFACE_LINK_LIBRARIES "MKL::ThreadLayer;MKL::Interface;${CMAKE_DL_LIBS};${M_LIB}"
+        INTERFACE_LINK_LIBRARIES "MKL::Interface;MKL::ThreadLayer;${CMAKE_DL_LIBS};${M_LIB}"
         INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR};${MKL_FFTW_INCLUDE_DIR}"
         IMPORTED_NO_SONAME TRUE)
   else()
     set_target_properties(MKL::MKL
       PROPERTIES
         IMPORTED_LOCATION "${MKL_Core_LINK_LIBRARY}"
-        INTERFACE_LINK_LIBRARIES "MKL::ThreadLayer;MKL::Interface;MKL::ThreadingLibrary;${CMAKE_DL_LIBS};${M_LIB}"
+        INTERFACE_LINK_LIBRARIES "MKL::Interface;MKL::ThreadLayer;MKL::ThreadingLibrary;${CMAKE_DL_LIBS};${M_LIB}"
         INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR};${MKL_FFTW_INCLUDE_DIR}"
         IMPORTED_NO_SONAME TRUE)
   endif()


ENH: update ITK superbuild version

ENH: update ITK superbuild version

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -14,7 +14,7 @@
 set(proj ITK)  ## Use ITK convention of calling it ITK
 set(ITK_REPOSITORY git://itk.org/ITK.git)
 set(ITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.0)
-set(ITK_TAG_COMMAND GIT_TAG v4.0b01 ) # use ITKv4 Beta
+set(ITK_TAG_COMMAND GIT_TAG 2818d7a100c7b7feed5ea74ba6fe501a420e0d12 ) # use ITKv4 Beta
 set(WrapITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.0/WrapITK)

 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_languages_cache}\n${ep_common_cache}" )


gpio: fix missing cmakelists for esp32s2beta

--- components/soc/esp32s2beta/sources.cmake
+++ components/soc/esp32s2beta/sources.cmake
@@ -1,6 +1,8 @@
 set(SOC_SRCS    "cpu_util.c"
+                "gpio_periph.c"
                 "rtc_clk.c"
                 "rtc_init.c"
+                "rtc_periph.c"
                 "rtc_pm.c"
                 "rtc_sleep.c"
                 "rtc_time.c"


COMP: _LIBRARIES can be empty

COMP: _LIBRARIES can be empty

--- CMake/OTBModuleHeaderTest.cmake
+++ CMake/OTBModuleHeaderTest.cmake
@@ -86,7 +86,11 @@
         )
       add_executable( ${_test_name} ${_header_test_src} )
       target_link_libraries( ${_test_name} OTBCommon )
-      add_dependencies(${_test_name} ${${_name}_LIBRARIES})
+      if (${_name}_LIBRARIES)
+        # OTBBoostAdapters depends only on OTBBoost,
+        # and OTBBoost_LIBRARIES can be empty, so check for it
+        add_dependencies(${_test_name} ${${_name}_LIBRARIES})
+      endif()
       add_dependencies(${_name}-all ${_test_name})
       math( EXPR _test_num "${_test_num} + 1" )
     endforeach()


Use lowercase for a few cmake macros to keep capitalization normalized.

--- CMake/Utils/FindPkgMacros.cmake
+++ CMake/Utils/FindPkgMacros.cmake
@@ -124,16 +124,15 @@

 # Slightly customised framework finder
-MACRO(findpkg_framework fwk)
-  IF(APPLE)
-    SET(${fwk}_FRAMEWORK_PATH
+macro(findpkg_framework fwk)
+  if(APPLE)
+    set(${fwk}_FRAMEWORK_PATH
       ${${fwk}_FRAMEWORK_SEARCH_PATH}
       ${CMAKE_FRAMEWORK_PATH}
       ~/Library/Frameworks
       /Library/Frameworks
       /System/Library/Frameworks
       /Network/Library/Frameworks
-      /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Release
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
     )
@@ -146,16 +145,16 @@
       set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
     endforeach(i)

-    FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
-      SET(fwkpath ${dir}/${fwk}.framework)
-      IF(EXISTS ${fwkpath})
-        SET(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
+    foreach(dir ${${fwk}_FRAMEWORK_PATH})
+      set(fwkpath ${dir}/${fwk}.framework)
+      if(EXISTS ${fwkpath})
+        set(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
           ${fwkpath}/Headers ${fwkpath}/PrivateHeaders)
-        SET(${fwk}_FRAMEWORK_PATH ${dir})
+        set(${fwk}_FRAMEWORK_PATH ${dir})
         if (NOT ${fwk}_LIBRARY_FWK)
-          SET(${fwk}_LIBRARY_FWK "-framework ${fwk}")
+          set(${fwk}_LIBRARY_FWK "-framework ${fwk}")
         endif ()
-      ENDIF(EXISTS ${fwkpath})
-    ENDFOREACH(dir)
-  ENDIF(APPLE)
-ENDMACRO(findpkg_framework)
+      endif(EXISTS ${fwkpath})
+    endforeach(dir)
+  endif(APPLE)
+endmacro(findpkg_framework)


Added possibility to pass options to the Qt MOC tool.

--- CMake/ctkMacroBuildPlugin.cmake
+++ CMake/ctkMacroBuildPlugin.cmake
@@ -50,7 +50,7 @@
 #! \ingroup CMakeAPI
 macro(ctkMacroBuildPlugin)
   CtkMacroParseArguments(MY
-    "EXPORT_DIRECTIVE;SRCS;MOC_SRCS;UI_FORMS;INCLUDE_DIRECTORIES;EXPORTED_INCLUDE_SUFFIXES;TARGET_LIBRARIES;RESOURCES;CACHED_RESOURCEFILES;TRANSLATIONS;OUTPUT_DIR"
+    "EXPORT_DIRECTIVE;SRCS;MOC_SRCS;MOC_OPTIONS;UI_FORMS;INCLUDE_DIRECTORIES;EXPORTED_INCLUDE_SUFFIXES;TARGET_LIBRARIES;RESOURCES;CACHED_RESOURCEFILES;TRANSLATIONS;OUTPUT_DIR"
     "TEST_PLUGIN"
     ${ARGN}
     )
@@ -174,7 +174,7 @@
     # this is a workaround for Visual Studio. The relative include paths in the generated
     # moc files can get very long and can't be resolved by the MSVC compiler.
     foreach(moc_src ${MY_MOC_SRCS})
-      QT4_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src})
+      QT4_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} ${MY_MOC_OPTIONS})
     endforeach()
   endif()
   QT4_WRAP_UI(MY_UI_CPP ${MY_UI_FORMS})


fix: Build of Python script with future statements [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -3193,7 +3193,7 @@
         set (FUTURE_STATEMENTS)
         if (SCRIPT MATCHES "^(.*from[ \t]+__future__[ \t]+import[ \t]+[a-z_]+[^\n]*\n)(.*)$")
           set (FUTURE_STATEMENTS "${CMAKE_MATCH_1}")
-          set (SCRIPT            "${CMAKE_MATCH_3}")
+          set (SCRIPT            "${CMAKE_MATCH_2}")
         endif ()
         basis_remove_blank_line (SCRIPT) # remove a blank line therefore
         set (SCRIPT "${FUTURE_STATEMENTS}${PYTHON_CODE} # <-- added by BASIS\n${SCRIPT}")


ENH: Update PythonQt

ENH: Update PythonQt

List of changes:

* The list do not include the changes adding CMake support

$ git shortlog f0a6d6abc..dafdb7255 --no-merges
Florian Link (54):
      changed to native eol
      allow to set PYTHON_VERSION as env variable fixed wrong library name
      remove variadic functions
      added parsing of rvalue references and skip functions that contain them (provided by erik_lundin@users.sf.net)
      improved slot docs as provided from forum
      changes to the build scripts as provided on the forum (not tested)
      added unix pkg config as provided on forum
      added support for kwargs by supporting QVariantMap kwargs as last argument, refactored from forum
      added convenience evalScript
      fixed unicode code and filename support for Python 3
      added getNativeVariable
      added experimental support for qwebenginewidgets (not yet in QtAll)
      added missing qintptr which is used on QSocketNotifier
      support WId, quintptr and qintptr
      updated wrappers to contain QSocketNotifier and recent generator changes
      go back to QByteArray signal/slots to avoid overload problems with static/non-static
      patch from forum, move QT module dependencies into enabled wrappers
      fixed ref counting of types ignore eggs in importer
      make sure that Python.h is always included first added new PY3K loader removed buggy __pycache__ caching
      added patch from forum (stack unwinding)
      added support for attribute lookup error callback
      reverted usage of _PyImport_FixupBuiltin
      added missing abstract virtual
      removed WindowOkButtonHint and WindowCancelButtonHint, which have been removed from Qt 5.9
      (re-)added support for rejecting enum value using it to reject WindowOkButtonHint and WindowCancelButtonHint
      help generator to work on Qt 5.11.1
      added some missing classes that were added since Qt 5.6
      support Qt 5.11
      new wrappers for Qt 5.11 (no QtWebView wrappers, since QtWebView is not part of Qt 5.11 anymore)
      for compatibility, keep the obsolete or deprecated enum values
      initial GIL support (needs to be enabled via defines)
      add GIL scope to virtual functions
      switched to using macros for scopes
      switched to using macros for scopes
      added support for override re-added virtual functions with abstract base declaration
      re-added removed methods that have not been removed previously
      recreated wrappers against Qt 5.6.3 with GIL macros and override handling
      recreated wrappers for Qt 5.11
      added rvalue assignment and copy constructor to PythonQtObjectPtr added auto-detection if Python object is involved in slot class (and don't release the GIL if that is the case)
      added error on failed load
      if there is not promoter, we can't call the promoted functions static methods can not use this->
      compile thread support by default added PythonQt::setEnableThreadSupport() to enable the thread support (disabled by default) added PythonQtSafeObjectPtr to allow safe GIL-aware storage in QVariant
      fixed linux compilation problem
      reimplemented argument frame caching (previous approach was not thread-safe when GIL is used)
      added missing GIL scope
      fixed problematic self deletion without having the GIL and while iterating the loop
      use C++11 {} initializer for returnValue
      applied patch provided by Uwe Siems
      don't print omitted rvalue methods, we just don't want to wrap them
      enable QThread (it was removed long time ago but makes sense now that PythonQt support multi-threading) removed template function on QQmlEngine
      enable QMutexLocker (but __enter__ and __exit__ don't work yet due to PythonQt class wrapper implementation...)
      fixed QTimer wrapping for Qt 5.12
      applied patch from Uwe Siems (print correct file location in parser)
      removed methods that are not present on all platforms/configurations

Stefan Böhmann (6):
      Create README.md
      Update and cleanup doxygen config file
      Rename the Doxygen configuration file to the default name (doc.cfg -> Doxyfile).
      add git ignore file
      Cleanup README.md and removing redundant README file
      Fix some links in the API documentation

Uwe Siems (2):
      QEvent::ShortcutOverride is also a QKeyEvent
      Add the usable parts of class QLoggingCategory.

--- CMakeExternals/PythonQt.cmake
+++ CMakeExternals/PythonQt.cmake
@@ -82,7 +82,7 @@
   ctkFunctionExtractOptimizedLibrary(PYTHON_LIBRARIES PYTHON_LIBRARY)

   if (CTK_QT_VERSION VERSION_GREATER "4")
-    set(revision_tag fae2301264529b4c8c85ee6e285f9605176471f0) # patched-8
+    set(revision_tag dafdb7255b82163329672edebba4f267958c7376) # patched-10
   else()
     set(revision_tag 90c08fb0d523622d2de9e7a91f4ef116a66a8801) # patched-5
   endif()


ManageEnvironment: Reviewed

ManageEnvironment: Reviewed

--- Modules/ManageEnvironment.cmake
+++ Modules/ManageEnvironment.cmake
@@ -1,71 +1,73 @@
-# - Manage build environment such as environment variables and compile flags.
-# This module predefine various environment variables, cmake policies, and
-# compile flags.
+# - Manage build environment like environment variables and compile flags.
+# This module pre-defines and manages various environment variables,
+# cmake policies, and compile flags.
 #
 # The setting can be viewed and modified by ccmake.
 #
-# List of frequently used variable and compile flags:
-#    + CMAKE_INSTALL_PREFIX: Compile flag whose value is ${CMAKE_INSTALL_PREFIX}.
-#    + BIN_DIR: Directory for executable.
-#      Default:  ${CMAKE_INSTALL_PREFIX}/bin
-#    + DATA_DIR: Directory for architecture independent data files.
-#      Default: ${CMAKE_INSTALL_PREFIX}/share
-#    + DOC_DIR: Directory for documentation
-#      Default: ${DATA_DIR}/doc
-#    + SYSCONF_DIR: System wide configuration files.
-#      Default: /etc
-#    + LIB_DIR: System wide library path.
-#      Default: ${CMAKE_INSTALL_PREFIX}/lib for 32 bit,
-#               ${CMAKE_INSTALL_PREFIX}/lib64 for 64 bit.
-#    + LIBEXEC_DIR: Executables that are not meant to be executed by user directly.
-#      Default: ${CMAKE_INSTALL_PREFIX}/libexec
-#    + PROJECT_NAME: Project name
+# Included Modules:
+#   - ManageMessage
+#
+# Reads following variables:
+#   - CMAKE_INSTALL_PREFIX: Install directory used by install.
+#   - PROJECT_NAME: Project name.
+#
+# Defines following variables:
+#   - IS_64: Defined as "64" if built for 64-bit application.
+#
+# Defines or reads following variables:
+#   - BIN_DIR: Directory for executable.
+#     Default:  ${CMAKE_INSTALL_PREFIX}/bin
+#   - DATA_DIR: Directory for architecture independent data files.
+#     Default: ${CMAKE_INSTALL_PREFIX}/share
+#   - DOC_DIR: Directory for documentation
+#     Default: ${DATA_DIR}/doc
+#   - SYSCONF_DIR: System wide configuration files.
+#     Default: /etc
+#   - LIB_DIR: System wide library path.
+#     Default: ${CMAKE_INSTALL_PREFIX}/lib for 32 bit,
+#              ${CMAKE_INSTALL_PREFIX}/lib64 for 64 bit.
+#   - LIBEXEC_DIR: Executables that are not meant to be executed
+#       by user directly.
+#     Default: ${CMAKE_INSTALL_PREFIX}/libexec
+#   - PRJ_DATA_DIR: Data directory for the project.
+#     Default: ${DATA_DIR}/${PROJECT_NAME}
+#   - PRJ_DOC_DIR: DocuFILEPATH = File chooser dialog.
+#     Default: ${DOC_DIR}/${PROJECT_NAME}
+#   - CMAKE_FEDORA_TMP_DIR: Director that stores cmake-fedora
+#       temporary items.
+#     Default: ${CMAKE_BINARY_DIR}/NO_PACK
+#
+# Defines following compile flags: (which use same values with variables)
+#   - CMAKE_INSTALL_PREFIX
+#   - PROJECT_NAME
+#   - BIN_DIR
+#   - DATA_DIR
+#   - DOC_DIR
+#   - SYSCONF_DIR
+#   - LIB_DIR
+#   - LIBEXEC_DIR
+# Note: compile flag PRJ_VER is defined in ManageVersion.
 #
 # Defines following macros:
-#   SET_COMPILE_ENV(var default_value [ENV_NAME env_name]
-#     [CACHE type docstring [FORCE]])
-#   - Ensure a variable is set to nonempty value, then add the variable and value to
-#     compiling definition.
-#     The value is determined by following order:
-#     1. Value of var if var is defined.
-#     2. Environment variable with the same name (or specified via ENV_NAME)
-#     3. Parameter default_value
-#     Parameters:
-#     + var: Variable to be set
-#     + default_value: Default value of the var
-#     + env_name: (Optional)The name of environment variable.
-#       Only need if different from var.
-#     + CACHE type docstring [FORCE]:
-#       Same with "SET" command.
+#   SET_COMPILE_ENV(<var> [<defaultValue>] [ENV_NAME <envName>]
+#       [CACHE <type> <docstring> [FORCE]]
+#     )
+#     - Ensure a variable is set to nonempty value, then set the value
+#       to the compile flags with same name.
 #
-#  SET_USUAL_COMPILE_ENVS()
-#  - Set the most often used variable and compile flags.
-#    It defines compile flags according to the values of corresponding variables,
-#    usually under the same or similar name.
-#    If a corresponding variable is not defined yet, then a default value is assigned
-#    to that variable, then define the flag.
+#       The value is determined by first non-empty value:
+#       1. Value of <var>.
+#       2. Value of environment variable <var>,
+#          or if ENV_NAME is specified, value of <envName>.
+#       3. <defaultValue>
+#       * Parameters:
+#         + var: Variable to be set
+#         + defaultValue: Default value of the var
+#         + envName: (Optional)The name of environment variable.
+#           Only need if different from var.
+#         + CACHE type docstring [FORCE]:
+#           Same with "SET" command.
 #
-#    Defines following flags according to the variable with same name.
-#    + CMAKE_INSTALL_PREFIX: Compile flag whose value is ${CMAKE_INSTALL_PREFIX}.
-#    + BIN_DIR: Directory for executable.
-#      Default:  ${CMAKE_INSTALL_PREFIX}/bin
-#    + DATA_DIR: Directory for architecture independent data files.
-#      Default: ${CMAKE_INSTALL_PREFIX}/share
-#    + DOC_DIR: Directory for documentation
-#      Default: ${DATA_DIR}/doc
-#    + SYSCONF_DIR: System wide configuration files.
-#      Default: /etc
-#    + LIB_DIR: System wide library path.
-#      Default: ${CMAKE_INSTALL_PREFIX}/lib for 32 bit,
-#               ${CMAKE_INSTALL_PREFIX}/lib64 for 64 bit.
-#    + LIBEXEC_DIR: Executables that are not meant to be executed by user directly.
-#      Default: ${CMAKE_INSTALL_PREFIX}/libexec
-#    + PROJECT_NAME: Project name
-#    + PRJ_VER: Project version
-#    + PRJ_DATA_DIR: Data directory for the project.
-#      Default: ${DATA_DIR}/${PROJECT_NAME}
-#    + PRJ_DOC_DIR: DocuFILEPATH = File chooser dialog.
-#      Default: ${DOC_DIR}/${PROJECT_NAME}-${PRJ_VER}

 IF(DEFINED _MANAGE_ENVIRONMENT_CMAKE_)
     RETURN()
@@ -73,49 +75,46 @@
 SET(_MANAGE_ENVIRONMENT_CMAKE_ "DEFINED")
 SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)

-MACRO(SET_COMPILE_ENV var default_value)
+FUNCTION(SET_COMPILE_ENV var)
     SET(_stage "")
     SET(_env "${var}")
     SET(_setOpts "")
     SET(_force 0)
+    SET(_defaultValue "")
     FOREACH(_arg ${ARGN})
-	IF(_arg STREQUAL "ENV_NAME")
+	IF("${_arg}" STREQUAL "ENV_NAME")
 	    SET(_stage "ENV_NAME")
-	ELSEIF(_arg STREQUAL "CACHE")
-	    SET(_stage "_CACHE")
-	ELSE(_arg STREQUAL "ENV_NAME")
-	    IF(_stage STREQUAL "ENV_NAME")
+	ELSEIF("${_arg}" STREQUAL "CACHE")
+	    SET(_stage "CACHE")
+	ELSE()
+	    IF("${_stage}" STREQUAL "ENV_NAME")
 		SET(_env "${_arg}")
-	    ELSEIF(_stage STREQUAL "_CACHE")
+	    ELSEIF("${_stage}" STREQUAL "CACHE")
 		LIST(APPEND _setOpts "${_arg}")
-		IF(_arg STREQUAL "FORCE")
+		IF("${_arg}" STREQUAL "FORCE")
 		    SET(_force 1)
-		ENDIF(_arg STREQUAL "FORCE")
+		ENDIF()
+	    ELSE()
+		SET(_defaultValue "${_arg}")
 	    ENDIF(_stage STREQUAL "ENV_NAME")
 	ENDIF(_arg STREQUAL "ENV_NAME")
     ENDFOREACH(_arg ${ARGN})

-    IF(NOT "${_setOpts}" STREQUAL "")
+    IF("${_setOpts}" STREQUAL "")
+	SET(_setOpts "PARENT_SCOPE")
+    ELSE()
 	LIST(INSERT _setOpts 0 "CACHE")
-    ENDIF(NOT "${_setOpts}" STREQUAL "")
+    ENDIF()

     # Set the variable
-    IF(_force)
-	IF(NOT "$ENV{${_env}}" STREQUAL "")
-	    SET(${var} "$ENV{${_env}}" ${_setOpts})
-	ELSE(NOT "$ENV{${_env}}" STREQUAL "")
-	    SET(${var} "${default_value}" ${_setOpts})
-	ENDIF(NOT "$ENV{${_env}}" STREQUAL "")
-    ELSE(_force)
-	IF(NOT "${${var}}" STREQUAL "")
-	    SET(${var} "${${var}}" ${_setOpts})
-	ELSEIF(NOT "$ENV{${_env}}" STREQUAL "")
-	    SET(${var} "$ENV{${_env}}" ${_setOpts})
-	ELSE(NOT "${${var}}" STREQUAL "")
-	    # Default value
-	    SET(${var} "${default_value}" ${_setOpts})
-	ENDIF(NOT "${${var}}" STREQUAL "")
-    ENDIF(_force)
+    IF(NOT "${${var}}" STREQUAL "")
+	SET(${var} "${${var}}" ${_setOpts})
+    ELSEIF(NOT "$ENV{${_env}}" STREQUAL "")
+	SET(${var} "$ENV{${_env}}" ${_setOpts})
+    ELSEIF()
+	## Use default value
+	SET(${var} "${_defaultValue}" ${_setOpts})
+    ENDIF()

     # Enforce CMP0005 to new, yet pop after ADD_DEFINITION
     CMAKE_POLICY(PUSH)
@@ -123,7 +122,7 @@
     ADD_DEFINITIONS(-D${_env}=${${var}})
     CMAKE_POLICY(POP)
     M_MSG(${M_INFO2} "SET(${var} ${${var}})")
-ENDMACRO(SET_COMPILE_ENV var default_value)
+ENDFUNCTION(SET_COMPILE_ENV)

 MACRO(MANAGE_CMAKE_POLICY policyName defaultValue)
     IF(POLICY ${policyName})
@@ -135,14 +134,27 @@
     ENDIF(POLICY ${policyName})
 ENDMACRO(MANAGE_CMAKE_POLICY policyName defaultValue)

-# Include should be put after the cmake policy
-INCLUDE(ManageMessage)
+####################################################################
+# Variables settings
+#
+
+## CMAKE_FEODRA_MODULE_DIR: Directory contains cmake-fedora modules
+INCLUDE(ManageMessage RESULT_VARIABLE MANAGE_ENVIRONMENT_PATH)
+GET_FILENAME_COMPONENT(CMAKE_FEDORA_MODULE_DIR
+    "${MANAGE_ENVIRONMENT_PATH}" PATH CACHE)
+
+## CMAKE_FEDORA_TMP_DIR: Directory stores temporary files.
+SET(CMAKE_FEDORA_TMP_DIR "${CMAKE_BINARY_DIR}/NO_PACK"
+    CACHE PATH "cmake-fedora tmp dir")
+FILE(MAKE_DIRECTORY "${CMAKE_FEDORA_TMP_DIR}")
+
+## Print CMake system information
 M_MSG(${M_INFO1} "CMAKE_HOST_SYSTEM=${CMAKE_HOST_SYSTEM}")
+M_MSG(${M_INFO1} "CMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR}")
 M_MSG(${M_INFO1} "CMAKE_SYSTEM=${CMAKE_SYSTEM}")
+M_MSG(${M_INFO1} "CMAKE_HOST_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}")

-####################################################################
-# CMake Variables
-#
+## Set variables and compile flags
 SET_COMPILE_ENV(BIN_DIR  "${CMAKE_INSTALL_PREFIX}/bin"
     CACHE PATH "Binary dir")
 SET_COMPILE_ENV(DATA_DIR "${CMAKE_INSTALL_PREFIX}/share"
@@ -160,24 +172,8 @@

 SET_COMPILE_ENV(LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib${IS_64}"
     CACHE PATH "Library dir")
-
-SET_COMPILE_ENV(PROJECT_NAME "${PROJECT_NAME}")
+
+SET_COMPILE_ENV(PROJECT_NAME)
 SET_COMPILE_ENV(PRJ_DATA_DIR "${DATA_DIR}/${PROJECT_NAME}")
 SET_COMPILE_ENV(PRJ_DOC_DIR "${DOC_DIR}/${PROJECT_NAME}")

-# Directory to store cmake-fedora specific temporary files.
-IF(NOT CMAKE_FEDORA_TMP_DIR)
-    SET(CMAKE_FEDORA_TMP_DIR "${CMAKE_BINARY_DIR}/NO_PACK")
-ENDIF(NOT CMAKE_FEDORA_TMP_DIR)
-
-## Current cmake-fedora module
-## Include itself to get MANAGE_ENVIRONMENT_PATH
-INCLUDE(ManageEnvironment RESULT_VARIABLE MANAGE_ENVIRONMENT_PATH)
-GET_FILENAME_COMPONENT(CMAKE_FEDORA_MODULE_DIR
-    "${MANAGE_ENVIRONMENT_PATH}" PATH CACHE)
-
-ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_FEDORA_TMP_DIR}
-    COMMAND cmake -E make_directory ${CMAKE_FEDORA_TMP_DIR}
-    COMMENT "Create CMAKE_FEDORA_TMP_DIR"
-    )
-


Added .h entry at Find*. file

Added .h entry at Find*. file

--- pose_state_time/Findpose_state_time.cmake
+++ pose_state_time/Findpose_state_time.cmake
@@ -1,7 +1,7 @@
 #edit the following line to add the librarie's header files
 FIND_PATH(
         pose_state_time_INCLUDE_DIRS
-        NAMES timeStamp.h angle.h quaternion.h rotation.h
+        NAMES timeStamp.h angle.h quaternion.h rotation.h pose3d.h
         PATHS /usr/local/include/btr-headers
 )


clean up extra /s in paths - maybe that's what BundleUtilities is borking at on OSX

--- PyPort/system-python.cmake
+++ PyPort/system-python.cmake
@@ -7,10 +7,10 @@
 	endif()

 	#find python headers
-	file(GLOB_RECURSE PYTHON_H ${CMAKE_FIND_ROOT_PATH}/${PYTHON_HOME}/*Python.h)
+	file(GLOB_RECURSE PYTHON_H ${CMAKE_FIND_ROOT_PATH}${PYTHON_HOME}/*Python.h)
 	if(PYTHON_H)
 		message("Found Python.h using CMAKE_FIND_ROOT_PATH")
-		set(TOP_INCLUDE ${CMAKE_FIND_ROOT_PATH}/${PYTHON_HOME}/include)
+		set(TOP_INCLUDE ${CMAKE_FIND_ROOT_PATH}${PYTHON_HOME}/include)
 	else()
 		set(TOP_INCLUDE ${PYTHON_HOME}/include)
 		file(GLOB_RECURSE PYTHON_H ${PYTHON_HOME}/*Python.h)
@@ -22,16 +22,16 @@
 		set(PYTHON_VER ${CMAKE_MATCH_2})
 		set(PYTHON_MINOR_VER ${CMAKE_MATCH_3})
 		message("Version string: ${PYTHON_VER}")
-		if(PYTHON_HOME_DISCOVERED EQUAL PYTHON_HOME)
+		if("${PYTHON_HOME_DISCOVERED}" STREQUAL "${PYTHON_HOME}")
 			message("PYTHON_HOME confirmed")
 		else()
-			message("Warning: resetting PYTHON_HOME to ${PYTHON_HOME_DISCOVERED}")
+			message("Warning: resetting PYTHON_HOME (${PYTHON_HOME}) to (${PYTHON_HOME_DISCOVERED})")
 			set(PYTHON_HOME ${PYTHON_HOME_DISCOVERED})
 		endif()
 	endif()

 	find_path(PYTHON_INCLUDE_DIRS Python.h
-		PATHS ${PYTHON_HOME}/include/${PYTHON_VER}m ${PYTHON_HOME}/include/
+		PATHS ${PYTHON_HOME}/include/${PYTHON_VER}m ${PYTHON_HOME}/include
 		NO_DEFAULT_PATH
 		CMAKE_FIND_ROOT_PATH_BOTH)


Update GTest version to 1.10.0 in super build

--- SuperBuild/External_GTest.cmake
+++ SuperBuild/External_GTest.cmake
@@ -10,7 +10,7 @@
 set(GTEST_GIT_REPOSITORY "${git_protocol}://github.com/google/googletest.git" CACHE  STRING "Google Test repository")
 mark_as_advanced(GTEST_GIT_REPOSITORY)

-set(GTEST_GIT_TAG "0fe96607d85cf3a25ac40da369db62bbee2939a5" CACHE STRING "Tag or hash for GTtest git repo")
+set(GTEST_GIT_TAG "release-1.10.0" CACHE STRING "Tag or hash for GTtest git repo")
 mark_as_advanced(GTEST_GIT_TAG)
 set(GTEST_TAG_COMMAND GIT_TAG "${GTEST_GIT_TAG}")


ENH: Updated ITK to include patch #12 from Nick Tustison's gerrit patch.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -77,7 +77,7 @@

   ## HACK--TEMPORARY HACK to include Registration pipeline changes by Nick Tustison
   set(${proj}_REPOSITORY ${git_protocol}://github.com/hjmjohnson/ITK.git CACHE STRING "" FORCE)
-  set(${proj}_GIT_TAG 219d612314db6ba638cda3854edd98e92a51913e CACHE STRING "" FORCE)
+  set(${proj}_GIT_TAG RegistrationPipeline CACHE STRING "" FORCE)
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


[CMake] Passthrough CMAKE_SYSROOT to external projects

Differential Revision: https://reviews.llvm.org/D39029

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@317744 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/LLVMExternalProjectUtils.cmake
+++ cmake/modules/LLVMExternalProjectUtils.cmake
@@ -143,6 +143,7 @@
     CMAKE_ARGS ${${nameCanon}_CMAKE_ARGS}
                ${compiler_args}
                -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+               -DCMAKE_SYSROOT=${CMAKE_SYSROOT}
                -DLLVM_BINARY_DIR=${PROJECT_BINARY_DIR}
                -DLLVM_CONFIG_PATH=$<TARGET_FILE:llvm-config>
                -DLLVM_ENABLE_WERROR=${LLVM_ENABLE_WERROR}


BUG: fix missing ITK include for wrapping