Cleanup and path management

Cleanup and path management

- added quadrature nodes and weights to data/quadrature
- improved paths.hpp
- separated tests

--- cmake_modules/yolo/YOLOProjectAddTestCase.cmake
+++ cmake_modules/yolo/YOLOProjectAddTestCase.cmake
@@ -1,45 +1,45 @@
 include(CMakeParseArguments)
-#
-#set(TESTS_REQUIRING_TEST_DATA
-#        # Fails remotely
-#        test_aerodynamics_AerodynamicMomentAndAerodynamicForce
-#        test_aerodynamics_TabulatedAtmosphere
-#        test_aerodynamics_ControlSurfaceIncrements
-#        test_aerodynamics_WindModel
-#        test_ephemerides_ApproximatePlanetPositions
-#        test_ephemerides_TabulatedEphemeris
-#        test_spice_SpiceInterface
-#        test_simulation_EnvironmentModelSetup
-#        test_simulation_AccelerationModelSetup
-#        test_io_BasicInputOutput
-#        # Fails locally
-#        test_aerodynamics_AerodynamicCoefficientsFromFile
-#        test_basic_astro_EmpiricalAcceleration
-#        test_earth_orientation_EarthOrientationCalculator
-#        test_earth_orientation_EopReader
-#        test_earth_orientation_PolarMotionCalculator
-#        test_earth_orientation_TimeScaleConverter
-#        test_earth_orientation_ShortPeriodEopCorrections
-#        test_electromagnetism_PanelledRadiationPressure
-#        test_interpolators_CubicSplineInterpolator
-#        test_interpolators_LinearInterpolator
-#        test_interpolators_MultiLinearInterpolator
-#        test_integrators_EulerIntegrator
-#        test_integrators_RungeKutta4Integrator
-#        test_integrators_RungeKuttaFehlberg45Integrator
-#        test_integrators_RungeKuttaFehlberg78Integrator
-#        test_integrators_RungeKutta87DormandPrinceIntegrator
-#        test_quadrature_GaussianQuadrature
-#        test_io_MapTextFileReader
-#        test_io_MatrixTextFileReader
-#        test_io_TwoLineElementsTextFileReader
-#        test_io_MissileDatcomReader
-#        test_io_MissileDatcomData
-#        test_io_DictionaryInputSystem
-#        test_io_MultiArrayReader
-#        test_io_MultiArrayWriter
-#        test_io_AerodynamicCoefficientReader
-#        )
+
+set(TESTS_REQUIRING_TEST_DATA
+        # Fails remotely
+        test_aerodynamics_AerodynamicMomentAndAerodynamicForce
+        test_aerodynamics_TabulatedAtmosphere
+        test_aerodynamics_ControlSurfaceIncrements
+        test_aerodynamics_WindModel
+        test_ephemerides_ApproximatePlanetPositions
+        test_ephemerides_TabulatedEphemeris
+        test_spice_SpiceInterface
+        test_simulation_EnvironmentModelSetup
+        test_simulation_AccelerationModelSetup
+        test_io_BasicInputOutput
+        # Fails locally
+        test_aerodynamics_AerodynamicCoefficientsFromFile
+        test_basic_astro_EmpiricalAcceleration
+        test_earth_orientation_EarthOrientationCalculator
+        test_earth_orientation_EopReader
+        test_earth_orientation_PolarMotionCalculator
+        test_earth_orientation_TimeScaleConverter
+        test_earth_orientation_ShortPeriodEopCorrections
+        test_electromagnetism_PanelledRadiationPressure
+        test_interpolators_CubicSplineInterpolator
+        test_interpolators_LinearInterpolator
+        test_interpolators_MultiLinearInterpolator
+        test_integrators_EulerIntegrator
+        test_integrators_RungeKutta4Integrator
+        test_integrators_RungeKuttaFehlberg45Integrator
+        test_integrators_RungeKuttaFehlberg78Integrator
+        test_integrators_RungeKutta87DormandPrinceIntegrator
+        test_quadrature_GaussianQuadrature
+        test_io_MapTextFileReader
+        test_io_MatrixTextFileReader
+        test_io_TwoLineElementsTextFileReader
+        test_io_MissileDatcomReader
+        test_io_MissileDatcomData
+        test_io_DictionaryInputSystem
+        test_io_MultiArrayReader
+        test_io_MultiArrayWriter
+        test_io_AerodynamicCoefficientReader
+        )

 function("TUDAT_ADD_TEST_CASE" arg1)
     # arg1 : Test name. Will add source file ${CMAKE_CURRENT_SOURCE_DIR}/tests/unitTest${arg1}.cpp


SK:

SK:

-DOC: added todo comment

--- src/Testing/dashboard_script_SK_linux64.cmake
+++ src/Testing/dashboard_script_SK_linux64.cmake
@@ -72,7 +72,7 @@
 ELASTIX_IMAGE_3D_PIXELTYPES:STRING=float
 ELASTIX_IMAGE_4D_PIXELTYPES:STRING=short

-// Compile all elastix components
+// Compile all elastix components; todo: automate this
 USE_AffineDTITransformElastix:BOOL=ON
 USE_BSplineInterpolatorFloat:BOOL=ON
 USE_BSplineResampleInterpolatorFloat:BOOL=ON


Add default build settings for Amazon Linux 2022.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -97,6 +97,12 @@
   set(DEFAULT_EXTRA_LINK_DIRECTORY "${VESPA_DEPS}/lib64" "/usr/lib64/llvm7.0/lib" PARENT_SCOPE)
   set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include" "/usr/include/llvm7.0" PARENT_SCOPE)
   set(DEFAULT_VESPA_LLVM_VERSION "7" PARENT_SCOPE)
+endfunction()
+
+function(setup_vespa_default_build_settings_amzn_2022)
+  message("-- Setting up default build settings for amzn 2022")
+  set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include" "/usr/include/openblas" PARENT_SCOPE)
+  set(DEFAULT_VESPA_LLVM_VERSION "13" PARENT_SCOPE)
 endfunction()

 function(setup_vespa_default_build_settings_ubuntu)
@@ -216,6 +222,8 @@
     setup_vespa_default_build_settings_fedora_37()
   elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "amzn 2")
     setup_vespa_default_build_settings_amzn_2()
+  elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "amzn 2022")
+    setup_vespa_default_build_settings_amzn_2022()
   elseif(VESPA_OS_DISTRO STREQUAL "ubuntu")
     setup_vespa_default_build_settings_ubuntu()
   elseif(VESPA_OS_DISTRO STREQUAL "debian")


[cmake][bundle] call fixup_bundle only on one executable

* 'fixup_bundle' automatically fixups the other executables in the bundle path
* 'verify_app' is already called for each app in 'fixup_bundle'

--- src/cmake/MakeBundle.cmake
+++ src/cmake/MakeBundle.cmake
@@ -2,11 +2,12 @@

 # Perform bundle fixup on all executables of an install directory
 # and generates a standalone bundle with all required runtime dependencies.
-#
+#
 # This scripts accepts the following parameters:
 #   - CMAKE_INSTALL_PREFIX: install target path
 #   - BUNDLE_INSTALL_PREFIX: bundle installation path
-#   - BUNDLE_LIBS_PATHS: additional paths (semi-colon separated) to look for runtime dependencies
+#   - BUNDLE_LIBS_PATHS: additional paths (colon separated) to look for runtime dependencies
+
 message(STATUS "Starting Bundle")
 message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
 message(STATUS "BUNDLE_INSTALL_PREFIX: ${BUNDLE_INSTALL_PREFIX}")
@@ -17,17 +18,14 @@
 list(APPEND LIBS_LOOKUPS_PATHS ${BUNDLE_LIBS_PATHS})

 # Get all executables in installed 'bin' folder
+# and copy them in the bundle installation path
 get_bundle_all_executables(${CMAKE_INSTALL_PREFIX}/bin BUNDLE_APPS)
-message(STATUS "BUNDLE_APPS: ${BUNDLE_APPS}")
+file(INSTALL ${BUNDLE_APPS} DESTINATION ${BUNDLE_INSTALL_PREFIX})

-# Perform the bundle fixup
-foreach(f ${BUNDLE_APPS})
-  get_filename_component(filename "${f}" NAME)
-  set(bf "${BUNDLE_INSTALL_PREFIX}/${filename}")
-  message(STATUS "Bundle application: ${f} => ${bf}")
-  file(COPY "${f}" DESTINATION "${BUNDLE_INSTALL_PREFIX}")
-  fixup_bundle(${bf} "" "${LIBS_LOOKUPS_PATHS}" )
-  verify_app("${bf}")
-endforeach()
+# Get first bundled executable as reference app
+# fixup_bundle will automatically fixup all the others executable in the bundle
+get_bundle_all_executables(${BUNDLE_INSTALL_PREFIX} BUNDLE_APPS)
+list(GET BUNDLE_APPS 0 MAIN_APP)
+fixup_bundle(${MAIN_APP} "" "${LIBS_LOOKUPS_PATHS}")

-message(STATUS "Bundle done")
+message(STATUS "Bundle done: ${BUNDLE_INSTALL_PREFIX}")


numpy.cmake: Updated to numpy 1.7.0 (there is a known bug in 1.6.x that conflicts with h5py)

--- numpy.cmake
+++ numpy.cmake
@@ -17,10 +17,10 @@
 include (atlas)

 external_source (numpy
-    1.6.2
-    numpy-1.6.2.tar.gz
-    95ed6c9dcc94af1fc1642ea2a33c1bba
-    http://downloads.sourceforge.net/project/numpy/NumPy/1.6.2)
+    1.7.0
+    numpy-1.7.0.tar.gz
+    4fa54e40b6a243416f0248123b6ec332
+    http://downloads.sourceforge.net/project/numpy/NumPy/1.7.0)

 # Select FORTRAN ABI
 if (Fortran_COMPILER_NAME STREQUAL "gfortran")


Only enable Eigen+MKL when we have MKL

Only enable Eigen+MKL when we have MKL

--- lib/smurff-cpp/cmake/scripts/DependenciesConfig.cmake
+++ lib/smurff-cpp/cmake/scripts/DependenciesConfig.cmake
@@ -94,6 +94,8 @@
       add_definitions(-DMKL_THREAD_LIBRARY_SEQUENTIAL )
   endif()

+  add_definitions(-DEIGEN_USE_MKL_ALL)
+
   message(STATUS MKL: ${MKL_LIBRARIES} )
 endmacro(configure_mkl)

@@ -106,7 +108,6 @@
   find_package(Eigen3 REQUIRED)
   endif()

-  add_definitions(-DEIGEN_USE_MKL_ALL)

   message(STATUS EIGEN3: ${EIGEN3_INCLUDE_DIR})
 endmacro(configure_eigen)


#1269 - Update cmake file to use latest (hopefully bug-fixed) OpenIGTLink

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

--- CMake/CMakeExternals/OPENIGTLINK.cmake
+++ CMake/CMakeExternals/OPENIGTLINK.cmake
@@ -34,7 +34,7 @@

 IF(NOT DEFINED OpenIGTLink_DIR)

-    SET(revision_tag 2b9a418b66)
+    SET(revision_tag 85f359f008)
     IF(${proj}_REVISION_TAG)
         SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


added comments for workaround of possible bug in cmake 3.0 between linux and win32

--- WkBuild.cmake
+++ WkBuild.cmake
@@ -556,8 +556,13 @@

 		#setting target property
 		set_target_properties( ${target_name} PROPERTIES COMPILE_FLAGS "${${PROJECT_NAME}_C_FLAGS}")
-		set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:${${PROJECT_NAME}_C_DEFINITIONS_DEBUG}> )
-		set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>:${${PROJECT_NAME}_C_DEFINITIONS_RELEASE}> )
+		#IF(WIN32)
+		#	set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:${PROJECT_NAME}_C_DEFINITIONS_DEBUG> )
+		#	set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>:${PROJECT_NAME}_C_DEFINITIONS_RELEASE> )
+		#ELSE() #buggy cmake 3.0
+			set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:${${PROJECT_NAME}_C_DEFINITIONS_DEBUG}> )
+			set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>:${${PROJECT_NAME}_C_DEFINITIONS_RELEASE}> )
+		#ENDIF()
 	endif()
 	#message(STATUS "${PROJECT_NAME}_CXX_COMPILER_LOADED ${${PROJECT_NAME}_CXX_COMPILER_LOADED}")
 	if ( ${PROJECT_NAME}_CXX_COMPILER_LOADED )
@@ -571,8 +576,13 @@

 		#setting target property
 		set_target_properties( ${target_name} PROPERTIES COMPILE_FLAGS "${${PROJECT_NAME}_CXX_FLAGS}")
-		set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:${${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG}> )
-		set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>:${${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE}> )
+		#if (WIN32)
+		#	set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG> )
+		#	set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>:${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE> )
+		#else() # buggy cmake 3
+			set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:${${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG}> )
+			set_property( TARGET ${target_name} APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Release>:${${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE}> )
+		#endif()
 	endif()

 	get_target_property(${PROJECT_NAME}_${target_name}_TYPE ${target_name} TYPE)


Try to work around appveyor ar.exe invocation error by shortening the file paths relative to a working directory of ar.exe.

--- src/CombineUnixArchives.cmake
+++ src/CombineUnixArchives.cmake
@@ -99,8 +99,9 @@
     # if same-named objects exist in one archive.
     foreach(old_obj_file_path ${objects})
       get_filename_component(old_obj_file_name ${old_obj_file_path} NAME)
-      set(new_obj_file_path "${working_dir}/${basename}.${old_obj_file_name}")
+      set(new_obj_file_path "${working_dir}/${basename}-${old_obj_file_name}")
       file(RENAME ${old_obj_file_path} ${new_obj_file_path})
+      file(RELATIVE_PATH new_obj_file_path ${scratch_dir} ${new_obj_file_path})
       list(APPEND all_object_locations ${new_obj_file_path})
     endforeach()
   endforeach()
@@ -110,7 +111,7 @@
   message(STATUS "ZZZ COMBINE_UNIX_ARCHIVES: TARGET_LOCATION=${TARGET_LOCATION},
           all_object_locations=${all_object_locations}")
   execute_process(COMMAND ${CMAKE_AR} rcs ${TARGET_LOCATION} ${all_object_locations}
-                  RESULT_VARIABLE exe_result)
+                  WORKING_DIRECTORY ${scratch_dir} RESULT_VARIABLE exe_result)
   if(NOT "${exe_result}" STREQUAL "0")
     message(FATAL_ERROR "COMBINE_UNIX_ARCHIVES: archive construction process failed exe_result='${exe_result}'")
   endif()


Fix arm linux toolchain file

Fix arm linux toolchain file

Use find_program() to set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER.

Originally the variables was set to compiler name, without absolute path.
CMake 3.0 tries to find them in CMAKE_FIND_ROOT_PATH (since
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM was set to ONLY) and fails.

--- platforms/linux/arm-gnueabi.toolchain.cmake
+++ platforms/linux/arm-gnueabi.toolchain.cmake
@@ -5,13 +5,12 @@
 set(GCC_COMPILER_VERSION "4.6" CACHE STRING "GCC Compiler version")

 set(FLOAT_ABI_SUFFIX "")
-
 if (NOT SOFTFP)
   set(FLOAT_ABI_SUFFIX "hf")
 endif()

-set(CMAKE_C_COMPILER    arm-linux-gnueabi${FLOAT_ABI_SUFFIX}-gcc-${GCC_COMPILER_VERSION})
-set(CMAKE_CXX_COMPILER  arm-linux-gnueabi${FLOAT_ABI_SUFFIX}-g++-${GCC_COMPILER_VERSION})
+find_program(CMAKE_C_COMPILER NAMES arm-linux-gnueabi${FLOAT_ABI_SUFFIX}-gcc-${GCC_COMPILER_VERSION})
+find_program(CMAKE_CXX_COMPILER NAMES arm-linux-gnueabi${FLOAT_ABI_SUFFIX}-g++-${GCC_COMPILER_VERSION})
 set(ARM_LINUX_SYSROOT /usr/arm-linux-gnueabi${FLOAT_ABI_SUFFIX} CACHE PATH "ARM cross compilation system root")

 set(CMAKE_CXX_FLAGS           ""                    CACHE STRING "c++ flags")


test2

--- modules/FindSDL2.cmake
+++ modules/FindSDL2.cmake
@@ -6,13 +6,13 @@
 #
 # This module responds to the the flag:
 # SDL2_BUILDING_LIBRARY
-# If this is defined, then no SDL2main will be linked in because
+# If this is defined, then no SDL2_main will be linked in because
 # only applications need main().
 # Otherwise, it is assumed you are building an application and this
 # module will attempt to locate and set the the proper link flags
 # as part of the returned SDL2_LIBRARY variable.
 #
-# Don't forget to include SDLmain.h and SDLmain.m your project for the
+# Don't forget to include SDL2main.h and SDL2main.m your project for the
 # OS X framework based version. (Other versions link to -lSDL2main which
 # this module will try to find on your behalf.) Also for OS X, this
 # module will automatically add the -framework Cocoa on your behalf.
@@ -37,7 +37,7 @@
 # and providing a more controlled/consistent search behavior.
 # Added new modifications to recognize OS X frameworks and
 # additional Unix paths (FreeBSD, etc).
-# Also corrected the header search path to follow "proper" SDL guidelines.
+# Also corrected the header search path to follow "proper" SDL2 guidelines.
 # Added a search for SDL2main which is needed by some platforms.
 # Added a search for threads which is needed by some platforms.
 # Added needed compile switches for MinGW.
@@ -48,9 +48,14 @@
 # CMAKE_INCLUDE_PATH to modify the search paths.
 #
 # Note that the header path has changed from SDL2/SDL.h to just SDL.h
-# This needed to change because "proper" SDL convention
+# This needed to change because "proper" SDL2 convention
 # is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
 # reasons because not all systems place things in SDL2/ (see FreeBSD).
+#
+# Ported by Johnny Patterson. This is a literal port for SDL2 of the FindSDL.cmake
+# module with the minor edit of changing "SDL" to "SDL2" where necessary. This
+# was not created for redistribution, and exists temporarily pending official
+# SDL2 CMake modules.

 #=============================================================================
 # Copyright 2003-2009 Kitware, Inc.
@@ -65,46 +70,54 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)

-SET(SDL2_SEARCH_PATHS
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local
-    /usr
-    /sw # Fink
-    /opt/local # DarwinPorts
-    /opt/csw # Blastwave
-    /opt
+FIND_PATH(SDL2_INCLUDE_DIR SDL.h
+  HINTS
+  $ENV{SDL2DIR}
+  PATH_SUFFIXES include/SDL2 include
+  PATHS
+  ~/Library/Frameworks
+  /Library/Frameworks
+  /usr/local/include/SDL2
+  /usr/include/SDL2
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
+  /opt
+)
+#MESSAGE("SDL2_INCLUDE_DIR is ${SDL2_INCLUDE_DIR}")
+
+FIND_LIBRARY(SDL2_LIBRARY_TEMP
+  NAMES SDL2
+  HINTS
+  $ENV{SDL2DIR}
+  PATH_SUFFIXES lib64 lib
+  PATHS
+  /sw
+  /opt/local
+  /opt/csw
+  /opt
 )

-FIND_PATH(SDL2_INCLUDE_DIR SDL.h
-    HINTS
-    $ENV{SDL2DIR}
-    PATH_SUFFIXES include/SDL2 include
-    PATHS ${SDL2_SEARCH_PATHS}
-)
-
-FIND_LIBRARY(SDL2_LIBRARY_TEMP
-    NAMES SDL2
-    HINTS
-    $ENV{SDL2DIR}
-    PATH_SUFFIXES lib64 lib
-    PATHS ${SDL2_SEARCH_PATHS}
-)
+#MESSAGE("SDL2_LIBRARY_TEMP is ${SDL2_LIBRARY_TEMP}")

 IF(NOT SDL2_BUILDING_LIBRARY)
-    IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
-        # Non-OS X framework versions expect you to also dynamically link to
-        # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
-        # seem to provide SDL2main for compatibility even though they don't
-        # necessarily need it.
-        FIND_LIBRARY(SDL2MAIN_LIBRARY
-            NAMES SDL2main
-            HINTS
-            $ENV{SDL2DIR}
-            PATH_SUFFIXES lib64 lib
-            PATHS ${SDL2_SEARCH_PATHS}
-        )
-    ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
+  IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
+    # Non-OS X framework versions expect you to also dynamically link to
+    # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
+    # seem to provide SDL2main for compatibility even though they don't
+    # necessarily need it.
+    FIND_LIBRARY(SDL2MAIN_LIBRARY
+      NAMES SDL2main
+      HINTS
+      $ENV{SDL2DIR}
+      PATH_SUFFIXES lib64 lib
+      PATHS
+      /sw
+      /opt/local
+      /opt/csw
+      /opt
+    )
+  ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
 ENDIF(NOT SDL2_BUILDING_LIBRARY)

 # SDL2 may require threads on your system.
@@ -112,53 +125,56 @@
 # frameworks may already provide it.
 # But for non-OSX systems, I will use the CMake Threads package.
 IF(NOT APPLE)
-    FIND_PACKAGE(Threads)
+  FIND_PACKAGE(Threads)
 ENDIF(NOT APPLE)

 # MinGW needs an additional library, mwindows
 # It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows
 # (Actually on second look, I think it only needs one of the m* libraries.)
 IF(MINGW)
-    SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
+  SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
 ENDIF(MINGW)

+SET(SDL2_FOUND "NO")
 IF(SDL2_LIBRARY_TEMP)
-    # For SDL2main
-    IF(NOT SDL2_BUILDING_LIBRARY)
-        IF(SDL2MAIN_LIBRARY)
-            SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
-        ENDIF(SDL2MAIN_LIBRARY)
-    ENDIF(NOT SDL2_BUILDING_LIBRARY)
+  # For SDL2main
+  IF(NOT SDL2_BUILDING_LIBRARY)
+    IF(SDL2MAIN_LIBRARY)
+      SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
+    ENDIF(SDL2MAIN_LIBRARY)
+  ENDIF(NOT SDL2_BUILDING_LIBRARY)

-    # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
-    # CMake doesn't display the -framework Cocoa string in the UI even
-    # though it actually is there if I modify a pre-used variable.
-    # I think it has something to do with the CACHE STRING.
-    # So I use a temporary variable until the end so I can set the
-    # "real" variable in one-shot.
-    IF(APPLE)
-        SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
-    ENDIF(APPLE)
+  # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
+  # CMake doesn't display the -framework Cocoa string in the UI even
+  # though it actually is there if I modify a pre-used variable.
+  # I think it has something to do with the CACHE STRING.
+  # So I use a temporary variable until the end so I can set the
+  # "real" variable in one-shot.
+  IF(APPLE)
+    SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
+  ENDIF(APPLE)

-    # For threads, as mentioned Apple doesn't need this.
-    # In fact, there seems to be a problem if I used the Threads package
-    # and try using this line, so I'm just skipping it entirely for OS X.
-    IF(NOT APPLE)
-        SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
-    ENDIF(NOT APPLE)
+  # For threads, as mentioned Apple doesn't need this.
+  # In fact, there seems to be a problem if I used the Threads package
+  # and try using this line, so I'm just skipping it entirely for OS X.
+  IF(NOT APPLE)
+    SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
+  ENDIF(NOT APPLE)

-    # For MinGW library
-    IF(MINGW)
-        SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
-    ENDIF(MINGW)
+  # For MinGW library
+  IF(MINGW)
+    SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
+  ENDIF(MINGW)

-    # Set the final string here so the GUI reflects the final state.
-    SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
-    # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
-    SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
+  # Set the final string here so the GUI reflects the final state.
+  SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
+  # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
+  SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
+
+  SET(SDL2_FOUND "YES")
 ENDIF(SDL2_LIBRARY_TEMP)

 INCLUDE(FindPackageHandleStandardArgs)

-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
-
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
+                                  REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)


add gl libraries to FindQGLViewer.cmake

add gl libraries to FindQGLViewer.cmake

--- kr_cmake_modules/cmake/Modules/FindQGLViewer.cmake
+++ kr_cmake_modules/cmake/Modules/FindQGLViewer.cmake
@@ -127,7 +127,7 @@
 # Set standard CMake FindPackage variables if found.
 if(QGLVIEWER_FOUND)
     list(APPEND QGLVIEWER_INCLUDE_DIRS ${QGLVIEWER_INCLUDE_DIR} ${QT_INCLUDES})
-    list(APPEND QGLVIEWER_LIBRARIES ${QGLVIEWER_LIBRARY} ${QT_LIBRARIES})
+    list(APPEND QGLVIEWER_LIBRARIES ${QGLVIEWER_LIBRARY} ${QT_LIBRARIES} GL glut GLU)
 endif()

 # Handle REQUIRED / QUIET optional arguments.


fix configuration of OpenAL

fix configuration of OpenAL

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@2249 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -302,6 +302,12 @@
         NAMES OpenAL openal
         COMPONENTS al OpenAL32
         PREFIXES ${ENV_NAALI_DEP_PATH}/OpenAL ${ENV_NAALI_DEP_PATH}/OpenAL/libs/Win32)
+
+        if (OPENAL_FOUND)
+            set (OPENAL_LIBRARIES ${OPENAL_LIBRARY})
+            set (OPENAL_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR})
+        endif()
+
         # Force include dir on MSVC
         if (MSVC)
   		   set (OPENAL_INCLUDE_DIRS ${ENV_NAALI_DEP_PATH}/OpenAL/include)


Bug #19149091 5.5 BUILD BREAKS ON LINUX IF SUN DTRACE IS INSTALLED

  Add some code adapted from 5.6 to check for "real" DTrace. If found,
  and system is Linux, we simply set DTRACE to OFF. Otherwise no change.

  Build will still break if one tries to manually set DTRACE to ON.

--- cmake/dtrace.cmake
+++ cmake/dtrace.cmake
@@ -37,7 +37,15 @@
  # On FreeBSD, dtrace does not handle userland tracing yet
  IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD"
      AND NOT BUGGY_GCC_NO_DTRACE_MODULES)
-   SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace")
+   # 5.5 not able to do Sun dtrace on linux, just disable it
+   EXECUTE_PROCESS(
+     COMMAND ${DTRACE} -V
+     OUTPUT_VARIABLE out)
+   IF(out MATCHES "Sun D" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
+     SET(ENABLE_DTRACE OFF CACHE BOOL "Sun DTrace on Linux not supported")
+   ELSE()
+     SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace")
+   ENDIF()
  ENDIF()
  SET(HAVE_DTRACE ${ENABLE_DTRACE})
  IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")


BUMP: Bump TubeTK to have the spatial object fixes

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
-    GIT_TAG "09c9f66c67b02bef46f20ae4f50d0da46bdb0a23"
+    GIT_TAG "3f74380ade5a73b4029b9c6812eadfa915748320"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


Removed debug message

Removed debug message

--- CMakeModules/CheckIncludeFileCXX.cmake
+++ CMakeModules/CheckIncludeFileCXX.cmake
@@ -53,7 +53,7 @@
       list(APPEND CMAKE_CXX_FLAGS " ${ARGV2}")
     endif()

-  MESSAGE("COMPILING WITH FLAGS " ${CMAKE_CXX_FLAGS})
+  #MESSAGE("COMPILING WITH FLAGS " ${CMAKE_CXX_FLAGS})
 	try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx


Fixed: Android toolchain should take into account the CMAKE_PREFIX_PATH variable

--- CMake/Toolchains/Android.cmake
+++ CMake/Toolchains/Android.cmake
@@ -1523,7 +1523,7 @@
 set( BUILD_ANDROID True )

 # where is the target environment
-set( CMAKE_FIND_ROOT_PATH "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )
+set( CMAKE_FIND_ROOT_PATH "${CMAKE_PREFIX_PATH}" "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )

 # only search for libraries and includes in the ndk toolchain
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )


esp32/boards/UM_TINYPICO: Fix include of sdkconfig fragment.

This was broken by 32ec07a3504d6dcbfc53997197a3c53e8c03497f

--- ports/esp32/boards/UM_TINYPICO/mpconfigboard.cmake
+++ ports/esp32/boards/UM_TINYPICO/mpconfigboard.cmake
@@ -3,7 +3,7 @@
     boards/sdkconfig.ble
     boards/sdkconfig.240mhz
     boards/sdkconfig.spiram
-    boards/TINYPICO/sdkconfig.board
+    boards/UM_TINYPICO/sdkconfig.board
 )

 if(NOT MICROPY_FROZEN_MANIFEST)


Patch forge build to use arrayfire fork of freetype2

--- CMakeModules/build_forge.cmake
+++ CMakeModules/build_forge.cmake
@@ -46,7 +46,7 @@
     ENDIF(WIN32)
 ENDIF()

-SET(FORGE_VERSION 1.0.1)
+SET(FORGE_VERSION 1.0.2-ft)

 # FIXME Tag forge correctly during release
 ExternalProject_Add(


updated external project forge tag

updated external project forge tag

--- CMakeModules/build_forge.cmake
+++ CMakeModules/build_forge.cmake
@@ -16,7 +16,7 @@
 ExternalProject_Add(
     forge-ext
     GIT_REPOSITORY https://github.com/arrayfire/forge.git
-    GIT_TAG f9c27b1787ed1551b3aedb12749d4068606a97f9
+    GIT_TAG api_cleanup
     PREFIX "${prefix}"
     INSTALL_DIR "${prefix}"
     UPDATE_COMMAND ""
@@ -25,7 +25,7 @@
     -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
     -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-    -DUSE_GLEWmx_STATIC:STRING=${USE_GLEWmx_STATIC}
+    -DUSE_GLEWmx_STATIC:BOOL=${USE_GLEWmx_STATIC}
     -DGLEW_ROOT_DIR:STRING=${GLEW_ROOT_DIR}
     -DGLFW_ROOT_DIR:STRING=${GLFW_ROOT_DIR}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>


remove update step for CMake external project GTest

--- ext/gtest.cmake
+++ ext/gtest.cmake
@@ -16,6 +16,8 @@
     # CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
     #            -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
     #            -Dgtest_force_shared_crt=ON
+		# Disable updating
+		UPDATE_COMMAND ""
     # Disable install step
     INSTALL_COMMAND ""
     # Wrap download, configure and build steps in a script to log output


Avoid double-target in install_configserver_component

--- functions.cmake
+++ functions.cmake
@@ -682,7 +682,7 @@
     if(NOT PARAM_CLASSIFIER)
        SET(PARAM_CLASSIFIER "jar-with-dependencies")
     endif()
-    install_jar("target/${NAME}-${PARAM_CLASSIFIER}.jar")
+    install_jar("${NAME}-${PARAM_CLASSIFIER}.jar")
     install_app_component_symlink(configserver-app "${NAME}" CLASSIFIER "${PARAM_CLASSIFIER}")
 endfunction()


No length comparisons for header install

--- standard/InstallHeaders.cmake
+++ standard/InstallHeaders.cmake
@@ -40,31 +40,20 @@
       get_filename_component(src_bin ${src} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
       if(EXISTS ${src_src})
         set(src ${src_src})
+        file(RELATIVE_PATH src_rel ${CMAKE_CURRENT_SOURCE_DIR} ${src})
+        get_filename_component(src_rel ${src_rel} DIRECTORY)
+        set(actual_rel ${src_rel})
       elseif(EXISTS ${src_bin})
         set(src ${src_bin})
+        file(RELATIVE_PATH bin_rel ${CMAKE_CURRENT_BINARY_DIR} ${src})
+        get_filename_component(bin_rel ${bin_rel} DIRECTORY)
+        set(actual_rel ${bin_rel})
       else()
         message(FATAL_ERROR "Could not find input header file ${src}")
       endif()
     endif()

-    # We find out what directory part the file is in, we want the shortest
-    # relative path on the assumption that the file will be most properly
-    # located in the directory whose relative address is the shortest.
-    file(RELATIVE_PATH src_rel ${CMAKE_CURRENT_SOURCE_DIR} ${src})
-    get_filename_component(src_rel ${src_rel} DIRECTORY)
-    if(src_rel)
-      string(LENGTH ${src_rel} src_rel_len)
-      set(actual_rel ${src_rel})
-    endif()

-    file(RELATIVE_PATH bin_rel ${CMAKE_CURRENT_BINARY_DIR} ${src})
-    get_filename_component(bin_rel ${bin_rel} DIRECTORY)
-    if(bin_rel)
-      string(LENGTH ${bin_rel} bin_rel_len)
-      if(src_rel AND bin_rel_len LESS src_rel_len)
-        set(actual_rel ${bin_rel})
-      endif()
-    endif()

     get_filename_component(src_ext ${src} EXT)
     install(


Updated the hack/eval.cmake.

Updated the hack/eval.cmake.

--- hack/eval.cmake
+++ hack/eval.cmake
@@ -1,13 +1,86 @@
 #!/usr/bin/env cmake -P
 cmake_minimum_required(VERSION 3.0.2)

-macro(eval expr)
-  set(_fname ".cmake-tmp")
-  file(WRITE ${_fname} "${expr}")
-  include(${_fname})
-  file(REMOVE ${_fname})
-endmacro()
+message([[## eval()]])
+function(eval expr)
+  set(path ".cmake-tmp")
+  file(WRITE ${path} "${expr}")
+  include(${path})
+  file(REMOVE ${path})
+endfunction()

 eval([[
   message("Hai")
 ]])
+
+message([[## eval_lambda()]])
+function(eval_lambda)
+  list(GET ARGV -1 lambda)
+  list(REMOVE_AT ARGV -1)
+  unset(names)
+
+  if(lambda MATCHES [[^\(([^)]*)\)(.*)$]])
+    set(names ${CMAKE_MATCH_1})
+    set(lambda ${CMAKE_MATCH_2})
+  endif()
+
+  eval("
+    function(eval_lambda_impl ${names})
+      ${lambda}
+    endfunction()
+  ")
+  eval_lambda_impl(${ARGV})
+endfunction()
+
+eval_lambda(1 2 33 [[(a b c)
+  message("${a} ${b} ${c}")
+]])
+
+function(in_working)
+  list(GET ARGV -1 lambda)
+  list(REMOVE_AT ARGV -1)
+
+  get_filename_component(name ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
+  set(working_dir ${CMAKE_CURRENT_LIST_DIR}/.${name}-working)
+
+  file(REMOVE_RECURSE ${working_dir})
+  file(MAKE_DIRECTORY ${working_dir})
+
+  eval_lambda(${working_dir} ${ARGV} ${lambda})
+
+  file(REMOVE_RECURSE ${working_dir})
+endfunction()
+
+function(in_working block)
+  get_filename_component(name ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
+  set(working_dir ${CMAKE_CURRENT_LIST_DIR}/.${name}-working)
+
+  message("## create working")
+  file(REMOVE_RECURSE ${working_dir})
+  file(MAKE_DIRECTORY ${working_dir})
+
+  eval_lambda(${working_dir} ${block})
+
+  message("## delete working")
+  file(REMOVE_RECURSE ${working_dir})
+endfunction()
+
+in_working([[(dir)
+  set(path ${dir}/hoge.txt)
+  file(WRITE ${path} a b c)
+
+  file(READ ${path} content)
+  message("content: ${content}")
+
+  file(READ ${path} content HEX)
+  message("content: ${content}")
+
+  file(READ ${path} content LIMIT 2 OFFSET 1)
+  message("content: ${content}")
+]]) #[[
+  ## create working
+  abc
+  616263
+  bc
+  ## delete working
+]]


Ensure that the variable value is forced into the global scope.

--- CMake/mitkBuildConfigurationWorkbenchRelease.cmake
+++ CMake/mitkBuildConfigurationWorkbenchRelease.cmake
@@ -1,3 +1,3 @@
 include(${CMAKE_CURRENT_LIST_DIR}/mitkBuildConfigurationDefault.cmake)

-set(MITK_VTK_DEBUG_LEAKS FALSE)
+set(MITK_VTK_DEBUG_LEAKS OFF CACHE BOOL "Enable VTK Debug Leaks" FORCE)


something

something

--- cmake/CopyWhenDiffMacro.cmake
+++ cmake/CopyWhenDiffMacro.cmake
@@ -9,10 +9,14 @@
     file(READ ${src} _SRC_CONTENTS)
     file(READ ${target} _TARGET_CONTENTS)
     if(NOT _SRC_CONTENTS STREQUAL _TARGET_CONTENTS)
+        message("!!! ${src} does not equal ${target}")
         file(GENERATE OUTPUT "${target}" INPUT "${src}")
+    else()
+        message("!!! ${src} does equal ${target}")
     endif(NOT _SRC_CONTENTS STREQUAL _TARGET_CONTENTS)
   else(EXISTS "${target}")
     # just copy the file, since the target doesn't exist.
+    message("!!! ${target} dies not exist")
     file(GENERATE OUTPUT "${target}" INPUT "${src}")
   endif(EXISTS "${target}")
 endmacro(copy_when_diff)


Look for arrow.pc in the right directory

--- cmake/Modules/FindArrow.cmake
+++ cmake/Modules/FindArrow.cmake
@@ -71,7 +71,8 @@
     set_target_properties(arrow PROPERTIES IMPORTED_LOCATION "${ARROW_STATIC_LIB}")

     # Determine arrow version information for CPP macros
-    file(STRINGS ${ARROW_ROOT}/lib/pkgconfig/arrow.pc _ARROW_VERSION REGEX "^Version: ([0-9]+\\.[0-9]+\\.[0-9]+)")
+    get_filename_component(ARROW_STATIC_LIB_DIR ${ARROW_STATIC_LIB} DIRECTORY)
+    file(STRINGS ${ARROW_LIB_DIR}/pkgconfig/arrow.pc _ARROW_VERSION REGEX "^Version: ([0-9]+\\.[0-9]+\\.[0-9]+)")
     STRING(REGEX REPLACE "^Version: ([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" ARROW_VERSION_MAJOR "${_ARROW_VERSION}")
     STRING(REGEX REPLACE "^Version: [0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" ARROW_VERSION_MINOR "${_ARROW_VERSION}")
     STRING(REGEX REPLACE "^Version: [0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" ARROW_VERSION_PATCH "${_ARROW_VERSION}")


Fixed typo in OpenNI2 cmake file

Fixed typo in OpenNI2 cmake file

--- cmake/OpenCVFindOpenNI2.cmake
+++ cmake/OpenCVFindOpenNI2.cmake
@@ -21,8 +21,8 @@
         find_library(OPENNI2_LIBRARY "OpenNI2" PATHS $ENV{OPENNI2_LIB64} DOC "OpenNI2 library")
     endif()
 elseif(UNIX OR APPLE)
-    find_file(OPENNI_INCLUDES "OpenNI.h" PATHS "/usr/include/ni2" "/usr/include/openni2" DOC "OpenNI2 c++ interface header")
-    find_library(OPENNI_LIBRARY "OpenNI2" PATHS "/usr/lib" DOC "OpenNI2 library")
+    find_file(OPENNI2_INCLUDES "OpenNI.h" PATHS "/usr/include/ni2" "/usr/include/openni2" DOC "OpenNI2 c++ interface header")
+    find_library(OPENNI2_LIBRARY "OpenNI2" PATHS "/usr/lib" DOC "OpenNI2 library")
 endif()

 if(OPENNI2_LIBRARY AND OPENNI2_INCLUDES)


cleanup: use CMAKE_MSVC_RUNTIME_LIBRARY when possible (#5853)

--- cmake/SelectMSVCRuntime.cmake
+++ cmake/SelectMSVCRuntime.cmake
@@ -27,13 +27,33 @@
 # runtime is needed. In the future we may need to use a more complex expression
 # to determine this, but this is a good start.
 #
-if (MSVC AND VCPKG_TARGET_TRIPLET MATCHES "-static$")
-    foreach (flag_var
-             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
-             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
-        if (${flag_var} MATCHES "/MD")
-            string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+
+if (MSVC)
+    # TODO(#5852) - if we require CMake >= 3.15 we can remove this conditional
+    # and the hacks below.
+    if ((${CMAKE_VERSION} VERSION_GREATER 3.15) OR (${CMAKE_VERSION}
+                                                    VERSION_EQUAL 3.14))
+        if (VCPKG_TARGET_TRIPLET MATCHES "-static$")
+            set(CMAKE_MSVC_RUNTIME_LIBRARY
+                "MultiThreaded$<$<CONFIG:Debug>:Debug>")
+        else ()
+            set(CMAKE_MSVC_RUNTIME_LIBRARY
+                "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
         endif ()
-    endforeach (flag_var)
-    unset(flag_var)
+    elseif (VCPKG_TARGET_TRIPLET MATCHES "-static$")
+        message(
+            WARNING
+                [===[
+CMake is too old to use CMAKE_MSVC_RUNTIME_LIBRARY.
+Attempting to set CMAKE_CXX_FLAGS* to get consistent CRT versions.
+]===])
+        foreach (flag_var
+                 CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+                 CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+            if (${flag_var} MATCHES "/MD")
+                string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+            endif ()
+        endforeach (flag_var)
+        unset(flag_var)
+    endif ()
 endif ()


Fixes issue ROOT-5813 (CMake)

Fixes issue ROOT-5813 (CMake)

--- cmake/modules/FindAlien.cmake
+++ cmake/modules/FindAlien.cmake
@@ -12,7 +12,7 @@
 endif()

 find_path(ALIEN_INCLUDE_DIR gapiUI.h
-  ${ALIEN_DIR}/include
+  ${ALIEN_DIR}/include $ENV{ALIEN_DIR}/include
   /usr/local/include
   /opt/alien/api/include
   /opt/monalisa/include
@@ -21,7 +21,7 @@
 )

 find_library(ALIEN_LIBRARY NAMES gapiUI PATHS
-  ${ALIEN_DIR}/lib
+  ${ALIEN_DIR}/lib $ENV{ALIEN_DIR}/lib
   /usr/local/lib
   /opt/alien/api/lib
   /opt/monalisa/lib


cmake/modules/FindVIGRA.cmake: Export VIGRA_ROOT.

--- cmake/modules/FindVIGRA.cmake
+++ cmake/modules/FindVIGRA.cmake
@@ -39,6 +39,7 @@
 # handle the QUIETLY and REQUIRED arguments and set VIGRA_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRA DEFAULT_MSG VIGRA_VIGRANUMPYCORE_LIBRARY_PATH VIGRA_VIGRANUMPYCORE_LIBRARY VIGRA_INCLUDE_DIR )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRA DEFAULT_MSG VIGRA_ROOT VIGRA_VIGRANUMPYCORE_LIBRARY_PATH VIGRA_VIGRANUMPYCORE_LIBRARY VIGRA_INCLUDE_DIR )

-MARK_AS_ADVANCED( VIGRA_INCLUDE_DIR VIGRA_VIGRANUMPYCORE_LIBRARY_PATH VIGRA_VIGRANUMPYCORE_LIBRARY VIGRA_VIGRANUMPYCORE_LIBRARY_DIR)
+MARK_AS_ADVANCED(VIGRA_ROOT VIGRA_INCLUDE_DIR VIGRA_VIGRANUMPYCORE_LIBRARY_PATH VIGRA_VIGRANUMPYCORE_LIBRARY VIGRA_VIGRANUMPYCORE_LIBRARY_DIR)
+


[CMAKE] Factorize the test suite target name construction

Summary:
This is a minor refactor that adds a facility for building a test suite
target name from the test suite name.

There is no change in behavior.

Test Plan:
  ninja check

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D5311

--- cmake/modules/TestSuite.cmake
+++ cmake/modules/TestSuite.cmake
@@ -1,7 +1,11 @@
 # Allow to easily build test suites

+macro(get_target_from_suite SUITE TARGET)
+	set(${TARGET} "check-${SUITE}")
+endmacro()
+
 function(create_test_suite_with_parent_targets NAME)
-	set(TARGET "check-${NAME}")
+	get_target_from_suite(${NAME} TARGET)

 	add_custom_target(${TARGET}
 		COMMENT "Running ${NAME} test suite"
@@ -21,7 +25,9 @@

 set(TEST_RUNNER_TEMPLATE "${CMAKE_CURRENT_LIST_DIR}/../templates/TestRunner.cmake.in")
 function(_add_test_runner SUITE NAME COMMAND)
-	set(TARGET "check-${SUITE}-${NAME}")
+	get_target_from_suite(${SUITE} SUITE_TARGET)
+	set(TARGET "${SUITE_TARGET}-${NAME}")
+
 	set(LOG "${NAME}.log")
 	set(RUNNER "${CMAKE_CURRENT_BINARY_DIR}/run-${SUITE}-${NAME}.sh")
 	list(JOIN ARGN " " ARGS)
@@ -38,7 +44,7 @@
 			${COMMAND}
 			${RUNNER}
 	)
-	add_dependencies("check-${SUITE}" ${TARGET})
+	add_dependencies(${SUITE_TARGET} ${TARGET})
 endfunction()

 function(add_test_to_suite SUITE NAME)
@@ -54,8 +60,9 @@
 		${ARGN}
 	)

+	get_target_from_suite(${SUITE} SUITE_TARGET)
 	add_executable(${NAME} EXCLUDE_FROM_ALL ${ARG_UNPARSED_ARGUMENTS})
-	add_dependencies("check-${SUITE}" ${NAME})
+	add_dependencies("${SUITE_TARGET}" ${NAME})

 	foreach(_test_source ${ARG_TESTS})
 		target_sources(${NAME} PRIVATE "${_test_source}")
@@ -67,7 +74,7 @@
 		)

 		set(SUITE_UPGRADE_ACTIVATED "${SUITE}-upgrade-activated")
-		set(TARGET_UPGRADE_ACTIVATED "check-${SUITE_UPGRADE_ACTIVATED}")
+		get_target_from_suite(${SUITE_UPGRADE_ACTIVATED} TARGET_UPGRADE_ACTIVATED)
 		if(NOT TARGET ${TARGET_UPGRADE_ACTIVATED})
 			create_test_suite_with_parent_targets(
 				${SUITE_UPGRADE_ACTIVATED}


swig/java, add OUTDIR parameter, used to specify where swig will generate data.

Change-Id: Id6c2d4a6107d237fe809a50a39a6046e8ff99fb0
Reviewed-on: http://gerrit.aldebaran.lan/30037
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: gerrit

--- cmake/qibuild/swig/java.cmake
+++ cmake/qibuild/swig/java.cmake
@@ -16,12 +16,13 @@
 # \arg:module_name the target name
 # \arg:interface_file the swig interface file (extension is .i)
 # \param:PACKAGE package name
+# \param:OUTDIR swig output directory
 # \flag:CPP whereare the lib is in C++
 # \group:SRC The list of source files
 # \group:DEPENDS The list of dependencies
 #
 function(qi_swig_wrap_java name interface_file)
-  cmake_parse_arguments(ARG "CPP" "PACKAGE" "SRC;DEPENDS" ${ARGN})
+  cmake_parse_arguments(ARG "CPP" "PACKAGE;OUTDIR" "SRC;DEPENDS" ${ARGN})
   message(STATUS "Swig/java: ${module_name}")

   find_package(Java REQUIRED QUIET)
@@ -45,7 +46,11 @@
   include("UseSWIG")
   include("UseJava")

-  set(_out_dir ${CMAKE_CURRENT_BINARY_DIR}/${name})
+  if(ARG_OUTDIR)
+    set(_out_dir ${ARG_OUTDIR})
+  else()
+    set(_out_dir ${CMAKE_CURRENT_BINARY_DIR}/${name})
+  endif()
   set(CMAKE_SWIG_OUTDIR ${_out_dir})

   ##


better handling of includes and system include directories

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -836,21 +836,29 @@
 	endforeach()
 endmacro()

-macro (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
-	foreach (_include ${${_includesVar}})
-		if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-			file (TO_NATIVE_PATH "${_include}" _include)
-			list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
-		else()
-			list (FIND ${_systemIncludesVar} "${_include}" _index)
-			if (_index GREATER -1 AND CMAKE_INCLUDE_SYSTEM_FLAG_${_language})
-				list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${_include}")
+function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
+	set (_includeDirs ${${_includesVar}} ${${_systemIncludesVar}})
+	if (_includeDirs)
+		list (REMOVE_DUPLICATES _includeDirs)
+		foreach (_include ${_includeDirs})
+			if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+				file (TO_NATIVE_PATH "${_include}" _include)
+				list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
 			else()
-				list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
-			endif()
-		endif()
-	endforeach()
-endmacro()
+				set (_index -1)
+				if ("${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" MATCHES ".+")
+					list (FIND ${_systemIncludesVar} "${_include}" _index)
+				endif()
+				if (_index GREATER -1)
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${_include}")
+				else()
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+				endif()
+			endif()
+		endforeach()
+	endif()
+	set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
+endfunction()

 macro (cotire_add_frameworks_to_cmd _cmdVar _language)
 	if (APPLE)


BUG: SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION is only defined on Mac when creating an extension. Instead, we use Slicer_INSTALL_CLIMODULES_BIN_DIR which is defined on all platforms

--- DTIPrepTools.cmake
+++ DTIPrepTools.cmake
@@ -1,4 +1,3 @@
-
 macro(INSTALL_EXECUTABLE)
   set(options )
   set( oneValueArgs OUTPUT_DIR )
@@ -169,16 +168,12 @@
 endif()

 if( EXTENSION_SUPERBUILD_BINARY_DIR )
-  set(HIDDEN_CLI_INSTALL_DIR ${SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION}/../hidden-cli-modules )
-  if(APPLE) # On mac, Ext/cli_modules/DTIAtlasBuilder so Ext/ExternalBin is ../ExternalBin
-    set(NOCLI_INSTALL_DIR ${SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION}/../ExternalBin)
-  else() # On Windows : idem Linux : Ext/lib/Slicer4.2/cli_modules/DTIAtlasBuilder so Ext/ExternalBin is ../../../ExternalBin
-    set(NOCLI_INSTALL_DIR ${SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION}/../../../ExternalBin)
-  endif()
+  set(HIDDEN_CLI_INSTALL_DIR ${Slicer_INSTALL_CLIMODULES_BIN_DIR}/../hidden-cli-modules )
+  set(NOCLI_INSTALL_DIR ${Slicer_INSTALL_CLIMODULES_BIN_DIR}/../ExternalBin)
   set( CLIToolsList
     DTIPrepLauncher
      )
-  INSTALL_EXECUTABLE( OUTPUT_DIR ${SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION} LIST_EXEC ${CLIToolsList} )
+  INSTALL_EXECUTABLE( OUTPUT_DIR ${Slicer_INSTALL_CLIMODULES_BIN_DIR} LIST_EXEC ${CLIToolsList} )
   set( hiddenCLIToolsList
     DTIPrep
      )


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   12)
+SET(KWSYS_DATE_STAMP_DAY   13)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   21)
+SET(KWSYS_DATE_STAMP_DAY   22)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   07)
+SET(KWSYS_DATE_STAMP_DAY   08)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   15)
+SET(KWSYS_DATE_STAMP_DAY   16)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   26)
+SET(KWSYS_DATE_STAMP_DAY   27)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   07)
+SET(KWSYS_DATE_STAMP_DAY   08)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   01)
+SET(KWSYS_DATE_STAMP_DAY   02)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   14)
+SET(KWSYS_DATE_STAMP_DAY   15)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   27)
+SET(KWSYS_DATE_STAMP_DAY   28)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   14)
+SET(KWSYS_DATE_STAMP_DAY   15)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   15)
+SET(KWSYS_DATE_STAMP_DAY   16)


Fixed building of expat on Centos 7.

Fixed building of expat on Centos 7.

Centos 7 ships with an older version of docbook that will fail to build the man pages of expat.

As the documentation is not required for OCIO, I am disabling the documentation of expat when built inline to avoid the issue.

--- share/cmake/modules/FindExpat.cmake
+++ share/cmake/modules/FindExpat.cmake
@@ -163,6 +163,7 @@
             -DBUILD_examples:BOOL=OFF
             -DBUILD_tests:BOOL=OFF
             -DBUILD_shared:BOOL=OFF
+            -DBUILD_doc:BOOL=OFF
             -DCMAKE_C_FLAGS=${EXPAT_C_FLAGS}
             -DCMAKE_CXX_FLAGS=${EXPAT_CXX_FLAGS}
             -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}


Update External_STIR.cmake

Update External_STIR.cmake

- add `${HDF5_CMAKE_ARGS}`
- move `${Boost_CMAKE_ARGS}` to the same place for consistency

Fixes #421

--- SuperBuild/External_STIR.cmake
+++ SuperBuild/External_STIR.cmake
@@ -90,7 +90,6 @@
     -DBUILD_TESTING:BOOL=${BUILD_TESTING_${proj}}
     -DBUILD_DOCUMENTATION:BOOL=OFF
     -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
-    ${Boost_CMAKE_ARGS}
     -DCMAKE_INSTALL_PREFIX:PATH=${STIR_INSTALL_DIR}
     -DGRAPHICS:STRING=None
     -DCMAKE_CXX_STANDARD:STRING=11
@@ -132,8 +131,11 @@
     ${${proj}_EP_ARGS}
     ${${proj}_EP_ARGS_GIT}
     ${${proj}_EP_ARGS_DIRS}
-
-    CMAKE_ARGS ${STIR_CMAKE_ARGS}  ${${proj}_EXTRA_CMAKE_ARGS_LIST}
+    CMAKE_ARGS
+       ${STIR_CMAKE_ARGS}
+       ${Boost_CMAKE_ARGS}
+       ${HDF5_CMAKE_ARGS}
+       ${${proj}_EXTRA_CMAKE_ARGS_LIST}
     DEPENDS
         ${${proj}_DEPENDENCIES}
   )


COMP: Update VMTk to fix build error with latest ITK-5.3RC version

--- SuperBuild/External_VMTK.cmake
+++ SuperBuild/External_VMTK.cmake
@@ -48,9 +48,18 @@
     QUIET
     )

+  if(${Slicer_VERSION_MAJOR}.${Slicer_VERSION_MINOR} VERSION_GREATER_EQUAL 5.1)
+    # Slicer >= 5.1 uses recent ITK-5.3RC version, which has BooleanStdVectorType
+    # (see https://github.com/InsightSoftwareConsortium/ITK/commit/bc9ba8540f96c0fa4e9100b25b05eb812074a64e)
+    set(DEFAULT_VMTK_TAG a0ed7931c458bf43795b895370fbe16f729e24f4)
+  else()
+    # Slicer < 5.1 uses older ITK-5.3RC version, which does not yet have BooleanStdVectorType
+    set(DEFAULT_VMTK_TAG 30b0fdad5674d6f134e8a8b601bcef7917671b0a)
+  endif()
+
   ExternalProject_SetIfNotDefined(
     ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG
-    "30b0fdad5674d6f134e8a8b601bcef7917671b0a"
+    ${DEFAULT_VMTK_TAG}
     QUIET
     )

@@ -130,4 +139,3 @@
 endif()

 mark_as_superbuild(${proj}_DIR:PATH)
-


update template script according to latest changes

--- template/template_test.cmake
+++ template/template_test.cmake
@@ -7,6 +7,8 @@
 #
 # Initialize testing
 #
+
+set_ifndef(CTEST_PROJECT_NAME       "CTestExtTemplate")

 set_ifndef(CTEST_DASHBOARD_ROOT     "${CMAKE_CURRENT_LIST_DIR}/dashboard")
 set_ifndef(CTEST_SOURCE_DIRECTORY   "${CMAKE_CURRENT_LIST_DIR}")
@@ -24,37 +26,27 @@
 # Configure the testing model (set options, not specified by user, to default values)
 #

-set_ifndef(CTEST_UPDATE_CMAKE_CACHE     TRUE)
-set_ifndef(CTEST_EMPTY_BINARY_DIRECTORY TRUE)
-set_ifndef(CTEST_WITH_TESTS             TRUE)
-set_ifndef(CTEST_WITH_COVERAGE          FALSE)
-set_ifndef(CTEST_WITH_LCOV              FALSE)
+if(CTEST_MODEL MATCHES "Nightly")
+    if(CTEST_GCOVR_EXECUTABLE)
+        set_ifndef(CTEST_WITH_COVERAGE          TRUE)
+        set_ifndef(CTEST_COVERAGE_TOOL          "GCOVR")
+    endif()

-if(CTEST_MODEL MATCHES "Nightly")
-    if(CTEST_GCOVR_EXECUTABLE AND EXISTS "${CTEST_GCOVR_EXECUTABLE}")
-        set_ifndef(CTEST_WITH_GCOVR     TRUE)
+    if(CTEST_MEMORYCHECK_COMMAND)
+        set_ifndef(CTEST_WITH_DYNAMIC_ANALYSIS  TRUE)
+        set_ifndef(CTEST_DYNAMIC_ANALYSIS_TOOL  "CDASH")
     endif()
-    if(CTEST_MEMORYCHECK_COMMAND AND EXISTS "${CTEST_MEMORYCHECK_COMMAND}")
-        set_ifndef(CTEST_WITH_MEMCHECK  TRUE)
-    endif()
-else()
-    set_ifndef(CTEST_WITH_GCOVR         FALSE)
-    set_ifndef(CTEST_WITH_MEMCHECK      FALSE)
 endif()
-
-set_ifndef(CTEST_WITH_SUBMIT            FALSE)

 #
 # Configure cmake options
 #

-if(CTEST_UPDATE_CMAKE_CACHE)
-    set_ifndef(CTEST_CMAKE_GENERATOR "Unix Makefiles")
-    set_ifndef(CTEST_CONFIGURATION_TYPE "Debug")
+set_ifndef(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+set_ifndef(CTEST_CONFIGURATION_TYPE "Debug")

-    if(CTEST_WITH_GCOVR)
-        add_cmake_cache_entry("CMAKE_CXX_FLAGS" TYPE "STRING" "--coverage")
-    endif()
+if(CTEST_WITH_COVERAGE)
+    add_cmake_cache_entry("CMAKE_CXX_FLAGS" TYPE "STRING" "--coverage")
 endif()

 #
@@ -86,13 +78,14 @@
 #

 ctest_ext_coverage(
-    GCOVR HTML VERBOSE FILTER ".*/main.cpp")
+    GCOVR
+        HTML VERBOSE FILTER ".*/main.cpp")

 #
 # MemCheck
 #

-ctest_ext_memcheck()
+ctest_ext_dynamic_analysis()

 #
 # Submit


Make BUFFER_SIZE configurable

Make BUFFER_SIZE configurable

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -288,6 +288,10 @@
 set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_CPU_NUMBER=${NUM_THREADS}")

 set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_PARALLEL_NUMBER=${NUM_PARALLEL}")
+
+if (BUFFERSIZE)
+set(CCOMMON_OPT "${CCOMMON_OPT} -DBUFFERSIZE=${BUFFERSIZE}")
+endif ()

 if (USE_SIMPLE_THREADED_LEVEL3)
   set(CCOMMON_OPT "${CCOMMON_OPT} -DUSE_SIMPLE_THREADED_LEVEL3")


Propagate version number for openblas_get_config

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -309,6 +309,8 @@
 if (MIXED_MEMORY_ALLOCATION)
   set(CCOMMON_OPT "${CCOMMON_OPT} -DMIXED_MEMORY_ALLOCATION")
 endif ()
+
+set(CCOMMON_OPT "${CCOMMON_OPT} -DVERSION=\"\\\"${OpenBLAS_VERSION}\\\"\"")

 set(REVISION "-r${OpenBLAS_VERSION}")
 set(MAJOR_VERSION ${OpenBLAS_MAJOR_VERSION})


Replaced cp with copy in xpu_cmake (#41542)

--- cmake/xpu_kp.cmake
+++ cmake/xpu_kp.cmake
@@ -128,7 +128,7 @@
     COMMAND
       ${CMAKE_COMMAND} -E make_directory kernel_build
     COMMAND
-      cp ${kernel_path}/${kernel_name}.kps kernel_build/${kernel_name}.xpu -rf
+	  ${CMAKE_COMMAND} -E copy ${kernel_path}/${kernel_name}.kps kernel_build/${kernel_name}.xpu
     COMMAND
     ${XPU_CLANG} --sysroot=${CXX_DIR}  -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=1 ${OPT_LEVEL} -fno-builtin -mcpu=xpu2  -fPIC ${XPU_CXX_DEFINES}  ${XPU_CXX_FLAGS}  ${XPU_CXX_INCLUDES}
        -I.  -o kernel_build/${kernel_name}.bin.o.sec kernel_build/${kernel_name}.xpu
@@ -151,7 +151,7 @@
     COMMAND
       ${CMAKE_COMMAND} -E make_directory kernel_build
     COMMAND
-      cp ${kernel_path}/${kernel_name}.kps kernel_build/${kernel_name}.xpu -rf
+	  ${CMAKE_COMMAND} -E copy ${kernel_path}/${kernel_name}.kps kernel_build/${kernel_name}.xpu
     COMMAND
     ${XPU_CLANG} --sysroot=${CXX_DIR}  -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=1 ${OPT_LEVEL} -fno-builtin -mcpu=xpu2  -fPIC ${XPU_CXX_DEFINES}  ${XPU_CXX_FLAGS} ${XPU_CXX_INCLUDES}
         -I.  -o kernel_build/${kernel_name}.host.o kernel_build/${kernel_name}.xpu


FIX: linux build

FIX: linux build

--- external/UseGDAL.cmake
+++ external/UseGDAL.cmake
@@ -49,7 +49,7 @@
         set(HDF5_BASE_DIR ${CMAKE_BINARY_DIR}/3rdparty/hdf5)
         ExternalProject_Add(
             hdf5
-            URL "http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.14.tar.gz"
+            URL "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.14/src/hdf5-1.8.14.tar.gz"
             CMAKE_ARGS
                 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                 -DBUILD_SHARED_LIBS=ON
@@ -80,7 +80,7 @@
             #URL "http://download.osgeo.org/proj/proj-4.9.0b2.tar.gz"
             CONFIGURE_COMMAND <SOURCE_DIR>/configure --with-jni=no
             BUILD_IN_SOURCE 1
-            INSTALL_COMMAND cp PROJ4_BASE_DIR/source/src/.libs/libproj.so ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+            INSTALL_COMMAND cp ${PROJ4_BASE_DIR}/source/src/.libs/libproj.so ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
             # directories
             TMP_DIR ${CMAKE_BINARY_DIR}/3rdparty/tmp
             STAMP_DIR ${CMAKE_BINARY_DIR}/3rdparty/stamp


Adds better support for C&C++ flags. Also adds support for RelWithDebInfo and MinSizeRel build configurations.

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -274,25 +274,31 @@
 endif()

 set(CMAKE_C_FLAGS
-"${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 -fobjc-arc ${CMAKE_C_FLAGS}")
+"${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 -fobjc-arc ${C_FLAGS}")
 # Hidden visibilty is required for C++ on iOS.
 set(CMAKE_CXX_FLAGS
-  "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fvisibility=hidden -fvisibility-inlines-hidden -fobjc-abi-version=2 -fobjc-arc ${CMAKE_CXX_FLAGS}")
-set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fomit-frame-pointer -ffast-math ${BITCODE} ${CMAKE_CXX_FLAGS_RELEASE}")
-set(CMAKE_C_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
-set(CMAKE_CXX_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS}  -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
+"${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fvisibility=hidden -fvisibility-inlines-hidden -fobjc-abi-version=2 -fobjc-arc ${CXX_FLAGS}")
+set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -fomit-frame-pointer -ffast-math ${BITCODE} ${CXX_FLAGS_MINSIZEREL}")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -fomit-frame-pointer -ffast-math ${BITCODE} ${CXX_FLAGS_RELWITHDEBINFO}")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -fomit-frame-pointer -ffast-math ${BITCODE} ${CXX_FLAGS_RELEASE}")
+set(CMAKE_C_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -Wl,-search_paths_first ${C_LINK_FLAGS}")
+set(CMAKE_CXX_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS}  -Wl,-search_paths_first ${CXX_LINK_FLAGS}")
+
 # In order to ensure that the updated compiler flags are used in try_compile()
 # tests, we have to forcibly set them in the CMake cache, not merely set them
 # in the local scope.
 list(APPEND VARS_TO_FORCE_IN_CACHE
   CMAKE_C_FLAGS
   CMAKE_CXX_FLAGS
-  CMAKE_CXX_RELEASE
+  CMAKE_CXX_FLAGS_RELWITHDEBINFO
+  CMAKE_CXX_FLAGS_MINSIZEREL
+  CMAKE_CXX_FLAGS_RELEASE
   CMAKE_C_LINK_FLAGS
   CMAKE_CXX_LINK_FLAGS)
 foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE})
   set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "" FORCE)
 endforeach()
+
 set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
 set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
 set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")


Start add_engine command.

Start add_engine command.

    Some links are temporary hard coded. Will be
    obviously removed next.
    * build-aux/cmake/modules/UProject.cmake: Here.

--- build-aux/cmake/modules/UProject.cmake
+++ build-aux/cmake/modules/UProject.cmake
@@ -79,8 +79,28 @@
 #------------------------------------------------------------------------------
 #                                  Add engine
 #------------------------------------------------------------------------------
-# FIXME: Implement me :)
-
+# Allows you to create custom engine. Put in the MODULES section the name
+# of each module you want to put in (directory name)
+# e.g. add_engine (executable_name MODULES module1 module2..)
+
+MACRO (add_engine)
+
+    parse_arguments (PROJECT "MODULES" "" ${ARGN})
+    set (UOBJECT_NAME ${PROJECT_DEFAULT_ARGS}${UOBJECT_ENGINE_SUFFIX})
+
+    include_directories (/home/petit/engine-1.5.1/include)
+    add_executable (${UOBJECT_NAME} /home/petit/engine-1.5.1/share/umain/umain.cc)
+
+    # Link with needed projects
+    foreach (ENGINE_MODULE ${PROJECT_MODULES})
+        target_link_libraries (${UOBJECT_NAME} ${ENGINE_MODULE}${UOBJECT_ENGINE_LIBRARY_SUFFIX})
+    endforeach (ENGINE_MODULE)
+
+    # Link with urbi engine and dependencies
+
+    # FIXME: To be continued :)
+
+ENDMACRO (add_engine)

 #------------------------------------------------------------------------------
@@ -125,7 +145,7 @@
         message (FATAL_ERROR "Invalid call of search macro. You cannot ask for"
                              " both library and path finding.")
     endif (ELEMENT_LIBRARY AND ELEMENT_PATH)
-
+
     if (ELEMENT_LIBRARY)
         find_library (${ELEMENT_LIBRARY})
         set(ELEMENT_TYPE library)
@@ -135,7 +155,7 @@
     else (ELEMENT_PATH)
         message (FATAL_ERROR "Invalid syntax. Specify LIBRARY or PATH section.")
     endif (ELEMENT_LIBRARY)
-
+
     # If we don't find the element
     if (NOT ${ARGV1})

@@ -176,7 +196,7 @@

     search (LIBRARY SDK_REMOTE_LIBRARY urbi PACKAGE "URBI SDK remote")
     search (LIBRARY JPEG_LIBRARY jpeg)
-    search (PATH SDK_REMOTE_INCLUDE_DIR urbi
+    search (PATH SDK_REMOTE_INCLUDE_DIR urbi
             FULLNAME "SDK Remote INCLUDE"
             PACKAGE  "URBI SDK Remote")


Added -pthread to link line, #2490

Added -pthread to link line, #2490

--- core/rosbuild/rosconfig.cmake
+++ core/rosbuild/rosconfig.cmake
@@ -89,6 +89,13 @@
 # Default link flags for all executables and libraries
 if(NOT DEFINED ROS_LINK_FLAGS)
   set(ROS_LINK_FLAGS "")
+  # Old versions of gcc need -pthread to enable threading, #2095.
+  # Also, some linkers, e.g., goLD, require -pthread (or another way to
+  # generate -lpthread).
+  # CYGWIN gcc has their -pthread disabled
+  if(UNIX AND NOT CYGWIN)
+    set(ROS_LINK_FLAGS "${ROS_LINK_FLAGS} -pthread")
+  endif(UNIX AND NOT CYGWIN)
 endif(NOT DEFINED ROS_LINK_FLAGS)

 # Default libraries to link against for all executables and libraries


install file and not absolute path (#110)

--- ament_cmake_python/cmake/ament_python_install_module.cmake
+++ ament_cmake_python/cmake/ament_python_install_module.cmake
@@ -57,6 +57,7 @@
     FILES "${module_file}"
     DESTINATION "${destination}"
   )
+  get_filename_component(module_file "${module_file}" NAME)
   if(NOT ARG_SKIP_COMPILE)
     # compile Python files
     install(CODE


COMP: Update Visualization/VTK/Widgets/CMakeLists.txt - VisualizationVTKWidgets now depends on CTKWidgets library

--- Libs/Visualization/VTK/Widgets/target_libraries.cmake
+++ Libs/Visualization/VTK/Widgets/target_libraries.cmake
@@ -6,5 +6,6 @@

 SET(target_libraries
   VTK_LIBRARIES
+  CTKWidgets
   CTKVisualizationVTKCore
   )


posix_sitl_default.cmake: add template module

Just to make sure it's built with CI

--- cmake/configs/posix_sitl_default.cmake
+++ cmake/configs/posix_sitl_default.cmake
@@ -180,6 +180,9 @@
 	# https://px4.io/dev/example_fixedwing_control
 	examples/fixedwing_control

+	# Template Module
+	templates/module
+
 	# Hardware test
 	#examples/hwtest
 )


[CMake] Fix 'Numpy not found' bug introduced in 424ecb

This fixes the following:

CMake is re-running because C:/Users/sftnight/build/debug/CMakeFiles/generate.stamp is out-of-date.
  the file 'C:/Users/sftnight/git/master/CMakeLists.txt'
  is newer than 'C:/Users/sftnight/build/debug/CMakeFiles/generate.stamp.depend'
  result='-1'
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.16299.
-- Looking for python
-- Preferring Python version 3
-- Found Python: C:/Python37-32/python.exe (found version "3.7.4") found components: Interpreter Development
CMake Error at C:/Program Files/CMake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:226 (message):
  No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.16/Modules/FindPython.cmake:347 (find_package_handle_standard_args)
  cmake/modules/SearchRootCoreDeps.cmake:72 (find_package)
  CMakeLists.txt:120 (include)

-- Configuring incomplete, errors occurred!
See also "C:/Users/sftnight/build/debug/CMakeFiles/CMakeOutput.log".
See also "C:/Users/sftnight/build/debug/CMakeFiles/CMakeError.log".
CMake Configure step failed.  Build files cannot be regenerated correctly.

Looking at cmake/modules/SearchRootCoreDeps.cmake, line 72:
find_package(Python COMPONENTS NumPy)

spotted by Bertrand on Windows.
Apparently the keyword REQUIRED is not enough to avoid stopping the
compilation if a package is not found, do the option QUIET is added.

--- cmake/modules/SearchRootCoreDeps.cmake
+++ cmake/modules/SearchRootCoreDeps.cmake
@@ -47,7 +47,7 @@
     endif()
     find_package(Python2 COMPONENTS Interpreter Development REQUIRED)
     # Search for NumPy, but not required:
-    find_package(Python2 COMPONENTS NumPy)
+    find_package(Python2 COMPONENTS NumPy QUIET)
     # Compat with find_package(PythonInterp), find_package(PythonLibs)
     set(PYTHON_EXECUTABLE "${Python2_EXECUTABLE}")
     set(PYTHON_INCLUDE_DIRS "${Python2_INCLUDE_DIRS}")
@@ -69,7 +69,7 @@
     endif()
     find_package(Python COMPONENTS Interpreter Development REQUIRED)
     # Search for NumPy, but not required:
-    find_package(Python COMPONENTS NumPy)
+    find_package(Python COMPONENTS NumPy QUIET)
     # Compat with find_package(PythonInterp), find_package(PythonLibs), find_package(NumPy)
     set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
     set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}")
@@ -92,5 +92,5 @@
     "Please specify only PYTHON_EXECUTABLE to CMake with an absolute path to ensure matching versions are found.")
   endif()

-    find_package(NumPy)
+  find_package(NumPy QUIET)
 endif()


Clarify error for incorrect usage of hunter_fatal_error

--- cmake/modules/hunter_fatal_error.cmake
+++ cmake/modules/hunter_fatal_error.cmake
@@ -7,15 +7,15 @@
 include(hunter_wiki)

 function(hunter_fatal_error)
-  cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}")
-  if(NOT hunter_WIKI)
-    hunter_internal_error("Expected wiki")
+  cmake_parse_arguments(x "" "WIKI" "" "${ARGV}")
+  if(NOT x_WIKI)
+    hunter_internal_error("Expected argument WIKI")
   endif()
   message("")
-  foreach(x ${hunter_UNPARSED_ARGUMENTS})
+  foreach(x ${x_UNPARSED_ARGUMENTS})
     message("[hunter ** FATAL ERROR **] ${x}")
   endforeach()
   message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
   message("")
-  hunter_wiki("${hunter_WIKI}")
+  hunter_wiki("${x_WIKI}")
 endfunction()


ENH: Update niral utilities version

ENH: Update niral utilities version

This version fixes issues with the executables polydatatransform and polydatamerge. They were beign generated with a shared library. Now they are generated statically

--- SuperBuild/External_niral_utilities.cmake
+++ SuperBuild/External_niral_utilities.cmake
@@ -73,7 +73,7 @@

   ### --- End Project specific additions
   set( ${proj}_REPOSITORY ${git_protocol}://github.com/NIRALUser/niral_utilities.git )
-  set( ${proj}_GIT_TAG 50711ce510bc03f3aa77e2730d48741f6a83732a )
+  set( ${proj}_GIT_TAG 8f1290d823547ebb7be75db9cc552b7a1594f82a )
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


[Config] Fixed the delivery directory of Python modules and libraries

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -497,7 +497,7 @@

     # Set the Python installation directory
     set (INSTALL_PY_LIB_DIR
-      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
+      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
       CACHE PATH "Installation directory for Python libraries")

     # Update the list of include directories for the project
@@ -1461,7 +1461,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
+  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)


Use components in find script (closes #247)

--- globjects-config.cmake
+++ globjects-config.cmake
@@ -55,6 +55,35 @@
     /opt/local/lib64
 )

+macro (LIST_CONTAINS var value)
+    set (${var} FALSE)
+    string(TOUPPER ${value} VALUE_UPPER)
+    foreach (value2 ${ARGN})
+        string(TOUPPER ${value2} VALUE2_UPPER)
+        if (${VALUE_UPPER} STREQUAL ${VALUE2_UPPER})
+            set (${var} TRUE)
+        endif ()
+    endforeach ()
+endmacro ()
+
+if (globjects_FIND_COMPONENTS)
+    LIST_CONTAINS(INCLUDE_GLOBJECTS_BASE base ${globjects_FIND_COMPONENTS})
+    LIST_CONTAINS(INCLUDE_GLOBJECTS_CORE core ${globjects_FIND_COMPONENTS})
+    LIST_CONTAINS(INCLUDE_GLOBJECTS_UTILS utils ${globjects_FIND_COMPONENTS})
+    LIST_CONTAINS(INCLUDE_GLOBJECTS_WINDOW window ${globjects_FIND_COMPONENTS})
+else ()
+    set (INCLUDE_GLOBJECTS_BASE FALSE)
+    set (INCLUDE_GLOBJECTS_CORE FALSE)
+    set (INCLUDE_GLOBJECTS_UTILS FALSE)
+    set (INCLUDE_GLOBJECTS_WINDOW FALSE)
+endif ()
+
+if (NOT ${INCLUDE_GLOBJECTS_BASE} AND NOT ${INCLUDE_GLOBJECTS_CORE} AND NOT ${INCLUDE_GLOBJECTS_UTILS} AND NOT ${INCLUDE_GLOBJECTS_WINDOW})
+    message (WARNING "No components for globjects selected")
+
+    return()
+endif ()
+
 macro (find LIB_NAME HEADER)
     set(HINT_PATHS ${ARGN})

@@ -95,53 +124,63 @@
         set(${LIB_NAME_UPPER}_LIBRARY ${${LIB_NAME_UPPER}_LIBRARY_DEBUG})
     endif()

-    list(APPEND GLOBJECTS_INCLUDES ${${LIB_NAME_UPPER}_INCLUDE_DIR})
-    list(APPEND GLOBJECTS_LIBRARIES ${${LIB_NAME_UPPER}_LIBRARY})
-
     # DEBUG
     # message("${LIB_NAME_UPPER}_INCLUDE_DIR     = ${${LIB_NAME_UPPER}_INCLUDE_DIR}")
     # message("${LIB_NAME_UPPER}_LIBRARY_RELEASE = ${${LIB_NAME_UPPER}_LIBRARY_RELEASE}")
     # message("${LIB_NAME_UPPER}_LIBRARY_DEBUG   = ${${LIB_NAME_UPPER}_LIBRARY_DEBUG}")
     # message("${LIB_NAME_UPPER}_LIBRARY         = ${${LIB_NAME_UPPER}_LIBRARY}")

+    list(APPEND GLOBJECTS_INCLUDES ${${LIB_NAME_UPPER}_INCLUDE_DIR})
+    list(APPEND GLOBJECTS_LIBRARIES ${${LIB_NAME_UPPER}_LIBRARY})
 endmacro()

-find(base      globjects-base/globjects-base_api.h     ${LIB_PATHS})
-find(globjects globjects/globjects_api.h               ${LIB_PATHS})
-find(utils     globjects-utils/globjects-utils_api.h   ${LIB_PATHS})
-find(window    globjects-window/globjects-window_api.h ${LIB_PATHS})
+if (${INCLUDE_GLOBJECTS_WINDOW})
+    set (INCLUDE_GLOBJECTS_BASE TRUE)
+endif ()
+if (${INCLUDE_GLOBJECTS_UTILS})
+    set (INCLUDE_GLOBJECTS_CORE TRUE)
+endif ()
+if (${INCLUDE_GLOBJECTS_CORE})
+    set (INCLUDE_GLOBJECTS_BASE TRUE)
+endif ()

-if(GLOBJECTS_BASE_LIBRARY)
-  # no dependencies
-endif()
+if (${INCLUDE_GLOBJECTS_BASE})
+    find(base      globjects-base/globjects-base_api.h     ${LIB_PATHS})
+endif ()
+if (${INCLUDE_GLOBJECTS_CORE})
+    find(globjects globjects/globjects_api.h               ${LIB_PATHS})
+endif ()
+if (${INCLUDE_GLOBJECTS_UTILS})
+    find(utils     globjects-utils/globjects-utils_api.h   ${LIB_PATHS})
+endif ()
+if (${INCLUDE_GLOBJECTS_WINDOW})
+    find(window    globjects-window/globjects-window_api.h ${LIB_PATHS})
+endif ()

-if(GLOBJECTS_CORE_LIBRARY)
-  # add dependencies
-  if(NOT GLOBJECTS_BASE_LIBRARY)
-    message(WARNING "globjects-base not found")
-  endif()
-  find_package(glbinding REQUIRED)
-  list(APPEND GLOBJECTS_INCLUDES ${GLBINDING_INCLUDES})
-  list(APPEND GLOBJECTS_LIBRARIES ${GLBINDING_LIBRARIES})
-endif()
+# add dependencies
+if (${INCLUDE_GLOBJECTS_CORE})
+    if(NOT GLOBJECTS_BASE_LIBRARY)
+        message(WARNING "Required globjects-base not found")
+    endif()
+
+    find_package(glbinding REQUIRED)
+    list(APPEND GLOBJECTS_INCLUDES ${GLBINDING_INCLUDES})
+    list(APPEND GLOBJECTS_LIBRARIES ${GLBINDING_LIBRARIES})
+endif ()
+if (${INCLUDE_GLOBJECTS_UTILS})
+    if(NOT GLOBJECTS_CORE_LIBRARY)
+        message(WARNING "Required globjects-core not found")
+    endif()
+endif ()
+if (${INCLUDE_GLOBJECTS_WINDOW})
+    if(NOT GLOBJECTS_BASE_LIBRARY)
+        message(WARNING "Required globjects-base not found")
+    endif()

-if(GLOBJECTS_UTILS_LIBRARY)
-  # add dependencies
-  if(NOT GLOBJECTS_CORE_LIBRARY)
-    message(WARNING "globjects not found")
-  endif()
-endif()
-
-if(GLOBJECTS_WINDOW_LIBRARY)
-  # add dependencies
-  if(NOT GLOBJECTS_BASE_LIBRARY)
-    message(WARNING "globjects-base not found")
-  endif()
-
-  find_package(GLFW REQUIRED)
-  list(APPEND GLOBJECTS_INCLUDES ${GLFW_INCLUDE_DIR})
-  list(APPEND GLOBJECTS_LIBRARIES ${GLFW_LIBRARY})
-endif()
+    find_package(GLFW REQUIRED)
+    list(APPEND GLOBJECTS_INCLUDES ${GLFW_INCLUDE_DIR})
+    list(APPEND GLOBJECTS_LIBRARIES ${GLFW_LIBRARY})
+endif ()

 # DEBUG
 # message("GLOBJECTS_INCLUDES  = ${GLOBJECTS_INCLUDES}")


Bugfix

Bugfix

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@28630 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_configure_feature.cmake
+++ deal.II/cmake/macros/macro_configure_feature.cmake
@@ -226,6 +226,7 @@
         IF(FEATURE_${_feature}_HAVE_BUNDLED)
           RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
           MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
+          SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE)
           SET_CACHED_OPTION(${_feature} ON)
         ELSE()
           MESSAGE(FATAL_ERROR "\n"
@@ -254,6 +255,7 @@
           ENDIF()

           MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.")
+          SET(FEATURE_${_feature}_EXTERNAL_CONFIGURED TRUE)
           SET_CACHED_OPTION(${_feature} ON)

         ELSE(FEATURE_${_feature}_EXTERNAL_FOUND)
@@ -263,6 +265,7 @@
           IF(FEATURE_${_feature}_HAVE_BUNDLED AND DEAL_II_ALLOW_BUNDLED)
             RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
             MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
+            SET(FEATURE_${_feature}_BUNDLED_CONFIGURED TRUE)
             SET_CACHED_OPTION(${_feature} ON)
           ELSE()
             IF(DEAL_II_WITH_${_feature})


Removed outdated workaround.

Removed outdated workaround.

--- dependencies/magic_get_interface.cmake
+++ dependencies/magic_get_interface.cmake
@@ -7,13 +7,6 @@
 target_include_directories(pfr INTERFACE
 	$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/magic_get/include>
 	$<INSTALL_INTERFACE:include>)
-
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-	# GCC broke their structured binding implementation in 7.2.0.
-	# See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81888
-	# TODO: Remove when fixed.
-	target_compile_options(magic_get INTERFACE -DBOOST_PFR_USE_CPP17=0)
-endif()

 install(TARGETS pfr EXPORT magic_get_targets INCLUDES DESTINATION include)
 install(


bugfix for catkin environment check - failing on mingw cross compiles.

--- cmake/all.cmake
+++ cmake/all.cmake
@@ -7,10 +7,10 @@
 endif()
 set(CATKIN_ALL_INCLUDED)

-if(WIN32 AND NOT CYGWIN)
+if( CMAKE_HOST_UNIX ) # true for linux, apple, mingw-cross and cygwin
+  set(CATKIN_ENV ${CMAKE_BINARY_DIR}/env.sh CACHE INTERNAL "catkin env")
+else()
   set(CATKIN_ENV ${CMAKE_BINARY_DIR}/env.bat CACHE INTERNAL "catkin env")
-else()
-  set(CATKIN_ENV ${CMAKE_BINARY_DIR}/env.sh CACHE INTERNAL "catkin env")
 endif()
 if(catkin_BINARY_DIR)
   set(CATKIN_CONTEXT_FILE ${catkin_BINARY_DIR}/catkin-context.py


Have OSX SDK fallback to /Developer/SDKs

--- cmake/mac.cmake
+++ cmake/mac.cmake
@@ -1,11 +1,16 @@
 SET(SDK_MIN "10.7")
 SET(SDK "10.7")
 SET(DEV_SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${SDK}.sdk")
+SET(DEV_SDK2 "/Developer/SDKs/MacOSX${SDK}.sdk")

 IF (NOT EXISTS "${DEV_SDK}" AND NOT IS_DIRECTORY "${DEV_SDK}")
-  MESSAGE("Could not find Mac OSX SDK at: ${DEV_SDK}")
-  MESSAGE("Aborting!")
-  RETURN()
+  IF (NOT EXISTS "${DEV_SDK2}" AND NOT IS_DIRECTORY "${DEV_SDK2}")
+    MESSAGE("Could not find Mac OSX SDK at: ${DEV_SDK}")
+    MESSAGE("Aborting!")
+    RETURN()
+  ELSE()
+    SET(DEV_SDK ${DEV_SDK2})
+  ENDIF()
 ENDIF()

 ADD_DEFINITIONS(


Removing old cmake package descriptor

Removing old cmake package descriptor

--- tools/cmake/UNUMCommon.cmake
+++ tools/cmake/UNUMCommon.cmake
@@ -1,38 +0,0 @@
-############################
-#This configuration file defines some cmake variables:
-#UNUM_INCLUDE_DIRS: list of include directories for the universal library
-#UNUM_LIBRARIES: libraries needed for interfaces like umfpack and arprec, see below
-#UNUM_CXX_DEFINITIONS: definitions to enable the requested interfaces
-#UNUM_VERSION: version (current: 1)
-#UNUM_MINOR_VERSION: minor version
-#
-#supported components:
-#
-
-unset(UNUM_LIBRARIES )
-unset(UNUM_CXX_DEFINITIONS )
-unset(UNUM_INCLUDE_DIRS )
-
-if (MSVC)
-    add_definitions(/wd4522) # multiple assignment ops for single type, to be investigated further if avoidable
-endif()
-
-if (USE_ASSERTS)
-  list(APPEND UNUM_CXX_DEFINITIONS "-DUNUM_ASSERT_FOR_THROW")
-endif()
-
-if(EXISTS ${UNUM_DIR}/posit/posit.hpp)
-	list(APPEND UNUM_INCLUDE_DIRS "${UNUM_DIR}/posit")
-else()
-	list(APPEND UNUM_INCLUDE_DIRS "${UNUM_DIR}/../../include")
-endif(EXISTS ${UNUM_DIR}/posit/posit.hpp)
-
-macro(unum_check_cxx_compiler_flag FLAG RESULT)
-  # counts entirely on compiler's return code, maybe better to combine it with check_cxx_compiler_flag
-  file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" "int main() { return 0;}\n")
-  try_compile(${RESULT}
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
-    COMPILE_DEFINITIONS ${FLAG})
-endmacro()
-


[FIX] Fixing the warning level for MSVC with new build system.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@13296 e6417c60-b987-48fd-844e-b20f0fcc1017

--- util/cmake/FindSeqAn.cmake
+++ util/cmake/FindSeqAn.cmake
@@ -210,14 +210,22 @@
 if (WIN32)
   # Always set NOMINMAX such that <Windows.h> does not define min/max as
   # macros.
-  set(SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -DNOMINMAX")
+  set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS}")
+  add_definitions (-DNOMINMAX)
 endif (WIN32)

 # Visual Studio Setup
 if (MSVC)
   # Warning level 3 for MSVC is disabled for now to see how much really bad warnings there are.
   #set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /W3)
-  set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /W2")
+
+  # TODO(holtgrew): This rather belongs into the SeqAn build system and notso much into FindSeqAn.cmake.
+
+  # Force to always compile with W2.
+  add_definitions (/W2)
+
+  # Disable warnings about unsecure (although standard) functions.
+  add_definitions (-D_SCL_SECURE_NO_WARNING)
 endif (MSVC)

 # ----------------------------------------------------------------------------


COMP: Update VariationalRegistration to address Doxygen warnings

ITK/Modules/Remote/VariationalRegistration/include/itkVariationalRegistrationCurvatureRegularizer.h:57:
warning: end of comment block while expecting command

Change-Id: I80bbba1c62465965e0e3b5f872749544be5459cd

--- Modules/Remote/VariationalRegistration.remote.cmake
+++ Modules/Remote/VariationalRegistration.remote.cmake
@@ -4,6 +4,6 @@
 #          Rene Werner <r.werner@uke.de>
 itk_fetch_module(VariationalRegistration
   "A module to perform variational image registration. https://hdl.handle.net/10380/3460"
-  GIT_REPOSITORY ${git_protocol}://github.com/VariationalRegistration/VariationalRegistration.git
-  GIT_TAG 71bf23a2ad4b4c0924d3cf041cafa3d617f02f32
+  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKVariationalRegistration.git
+  GIT_TAG da4acc1804e36b8f5b0fcf7179bddcf98679c6d3
   )


Fixed a readability optimization in CMake code that broke IPv6 support.

--- configure.cmake
+++ configure.cmake
@@ -95,6 +95,14 @@
   CHECK_TYPE_SIZE("${type}" SIZEOF_${defbase})
   IF(SIZEOF_${defbase})
     SET(HAVE_${defbase} 1 PARENT_SCOPE)
+  ENDIF()
+ENDFUNCTION()
+
+# Same for structs, setting HAVE_STRUCT_<name> instead
+FUNCTION(MY_CHECK_STRUCT_SIZE type defbase)
+  CHECK_TYPE_SIZE("struct ${type}" SIZEOF_${defbase})
+  IF(SIZEOF_${defbase})
+    SET(HAVE_STRUCT_${defbase} 1 PARENT_SCOPE)
   ENDIF()
 ENDFUNCTION()

@@ -991,8 +999,8 @@
   SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} winsock2.h ws2ipdef.h)
 ENDIF()

-MY_CHECK_TYPE_SIZE("struct sockaddr_in6" SOCKADDR_IN6)
-MY_CHECK_TYPE_SIZE("struct in6_addr" IN6_ADDR)
+MY_CHECK_STRUCT_SIZE("sockaddr_in6" SOCKADDR_IN6)
+MY_CHECK_STRUCT_SIZE("in6_addr" IN6_ADDR)

 IF(HAVE_STRUCT_SOCKADDR_IN6 OR HAVE_STRUCT_IN6_ADDR)
   SET(HAVE_IPV6 TRUE CACHE INTERNAL "")


cmake: dts overlay file with mixed separator style support

Fixes: #26112

All file paths provided on the list of overlay files are converted to
CMake style paths.

This ensures that even paths with mixed style `\` and `/` on Windows are
treated correctly. This fixes the issue where the deps file created
would cause ninja to re-invoke CMake in an endless loop on windows.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -66,7 +66,11 @@
 if(SUPPORTS_DTS)
   if(DTC_OVERLAY_FILE)
     # Convert from space-separated files into file list
-    string(REPLACE " " ";" DTC_OVERLAY_FILE_AS_LIST ${DTC_OVERLAY_FILE})
+    string(REPLACE " " ";" DTC_OVERLAY_FILE_RAW_LIST ${DTC_OVERLAY_FILE})
+    foreach(file ${DTC_OVERLAY_FILE_RAW_LIST})
+      file(TO_CMAKE_PATH "${file}" cmake_path_file)
+      list(APPEND DTC_OVERLAY_FILE_AS_LIST ${cmake_path_file})
+    endforeach()
     list(APPEND
       dts_files
       ${DTC_OVERLAY_FILE_AS_LIST}


cmake: cache DTS bindings directory

cmake: cache DTS bindings directory

We need this information in the cache now that we're not allowed to
parse generated_dts_board.conf from Python code after build time.

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

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -100,6 +100,11 @@
     endif()
   endforeach()

+  # Cache the location of the root bindings so they can be used by
+  # scripts which use the build directory.
+  set(CACHED_DTS_ROOT_BINDINGS ${DTS_ROOT_BINDINGS} CACHE INTERNAL
+    "DT bindings root directories")
+
   # TODO: Cut down on CMake configuration time by avoiding
   # regeneration of generated_dts_board_unfixed.h on every configure. How
   # challenging is this? What are the dts dependencies? We run the


Took latest iOS.cmake from https://code.google.com/p/ios-cmake/

--- cmake/iOS.cmake
+++ cmake/iOS.cmake
@@ -18,17 +18,38 @@
 #   In this case it will always be the most up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path.
 #   If set manually, this will force the use of a specific SDK version

+# Macros:
+#
+# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE)
+#  A convenience macro for setting xcode specific properties on targets
+#  example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1")
+#
+# find_host_package (PROGRAM ARGS)
+#  A macro used to find executable programs on the host system, not within the iOS environment.
+#  Thanks to the android-cmake project for providing the command
+
 # Standard settings
 set (CMAKE_SYSTEM_NAME Darwin)
-set (CMAKE_SYSTEM_VERSION 1 )
+set (CMAKE_SYSTEM_VERSION 1)
 set (UNIX True)
 set (APPLE True)
 set (IOS True)

+# Required as of cmake 2.8.10
+set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE)
+
+# Determine the cmake host system version so we know where to find the iOS SDKs
+find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
+if (CMAKE_UNAME)
+	exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
+	string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
+endif (CMAKE_UNAME)
+
 # Force the compilers to gcc for iOS
 include (CMakeForceCompiler)
-CMAKE_FORCE_C_COMPILER (gcc gcc)
-CMAKE_FORCE_CXX_COMPILER (g++ g++)
+CMAKE_FORCE_C_COMPILER (/usr/bin/clang Apple)
+CMAKE_FORCE_CXX_COMPILER (/usr/bin/clang++ Apple)
+set(CMAKE_AR ar CACHE FILEPATH "" FORCE)

 # Skip the platform compiler checks for cross compiling
 set (CMAKE_CXX_COMPILER_WORKS TRUE)
@@ -47,9 +68,9 @@
 set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
 set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")

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

 set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
 set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
@@ -66,53 +87,69 @@
 # and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
 # hardcode CMAKE_INSTALL_NAME_TOOL here to install_name_tool, so it behaves as it did before, Alex
 if (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
-    find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
+	find_program(CMAKE_INSTALL_NAME_TOOL install_name_tool)
 endif (NOT DEFINED CMAKE_INSTALL_NAME_TOOL)

-# Setup iOS platform
+# Setup iOS platform unless specified manually with IOS_PLATFORM
 if (NOT DEFINED IOS_PLATFORM)
-    set (IOS_PLATFORM "OS")
+	set (IOS_PLATFORM "OS")
 endif (NOT DEFINED IOS_PLATFORM)
 set (IOS_PLATFORM ${IOS_PLATFORM} CACHE STRING "Type of iOS Platform")

 # Check the platform selection and setup for developer root
 if (${IOS_PLATFORM} STREQUAL "OS")
-    set (IOS_PLATFORM_LOCATION "iPhoneOS.platform")
+	set (IOS_PLATFORM_LOCATION "iPhoneOS.platform")
+
+	# This causes the installers to properly locate the output libraries
+	set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos")
 elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
-    set (IOS_PLATFORM_LOCATION "iPhoneSimulator.platform")
+	set (IOS_PLATFORM_LOCATION "iPhoneSimulator.platform")
+
+	# This causes the installers to properly locate the output libraries
+	set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphonesimulator")
 else (${IOS_PLATFORM} STREQUAL "OS")
-    message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR")
+	message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS or SIMULATOR")
 endif (${IOS_PLATFORM} STREQUAL "OS")

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

-# Find and use the most recent iOS sdk
+# Find and use the most recent iOS sdk unless specified manually with CMAKE_IOS_SDK_ROOT
 if (NOT DEFINED CMAKE_IOS_SDK_ROOT)
-    file (GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*")
-    if (_CMAKE_IOS_SDKS)
-        list (SORT _CMAKE_IOS_SDKS)
-        list (REVERSE _CMAKE_IOS_SDKS)
-        list (GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT)
-    else (_CMAKE_IOS_SDKS)
-        message (FATAL_ERROR "No iOS SDK's found in default seach path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
-    endif (_CMAKE_IOS_SDKS)
-    message (STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
+	file (GLOB _CMAKE_IOS_SDKS "${CMAKE_IOS_DEVELOPER_ROOT}/SDKs/*")
+	if (_CMAKE_IOS_SDKS)
+		list (SORT _CMAKE_IOS_SDKS)
+		list (REVERSE _CMAKE_IOS_SDKS)
+		list (GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT)
+	else (_CMAKE_IOS_SDKS)
+		message (FATAL_ERROR "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
+	endif (_CMAKE_IOS_SDKS)
+	message (STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
 endif (NOT DEFINED CMAKE_IOS_SDK_ROOT)
 set (CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the selected iOS SDK")

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

-# set the architecture for iOS - using ARCHS_STANDARD_32_BIT sets armv6,armv7 and appears to be XCode's standard.
-# The other value that works is ARCHS_UNIVERSAL_IPHONE_OS but that sets armv7 only
-set (CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)" CACHE string  "Build architecture for iOS")
+# set the architecture for iOS
+# NOTE: Currently both ARCHS_STANDARD_32_BIT and ARCHS_UNIVERSAL_IPHONE_OS set armv7 only, so set both manually
+if (${IOS_PLATFORM} STREQUAL "OS")
+	set (IOS_ARCH armv6 armv7)
+else (${IOS_PLATFORM} STREQUAL "OS")
+	set (IOS_ARCH i386)
+endif (${IOS_PLATFORM} STREQUAL "OS")
+
+set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE string  "Build architecture for iOS")

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

 # set up the default search directories for frameworks
 set (CMAKE_SYSTEM_FRAMEWORK_PATH
-    ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
-    ${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks
-    ${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks
+	${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
+	${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks
+	${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks
 )

 # only search the iOS sdks, not the remainder of the host filesystem
@@ -132,3 +169,25 @@
 set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+
+# This little macro lets you set any XCode specific property
+macro (set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE)
+	set_property (TARGET ${TARGET} PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE})
+endmacro (set_xcode_property)
+
+
+# This macro lets you find executable programs on the host system
+macro (find_host_package)
+	set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+	set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
+	set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
+	set (IOS FALSE)
+
+	find_package(${ARGN})
+
+	set (IOS TRUE)
+	set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
+	set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+	set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+endmacro (find_host_package)
+


Add release flags to iOS toolchain.

Add release flags to iOS toolchain.

- Without explicitly specifying the flags for release compilation in
  the iOS toolchain file, no additional flags are passed and so the
  libraries were not being built with full optimisations, even though
  the CMAKE_BUILD_TYPE was 'Release'.

Change-Id: I742bab7589906b556640776d481491a8cc2303d4

--- cmake/iOS.cmake
+++ cmake/iOS.cmake
@@ -110,6 +110,7 @@
 # Hidden visibilty is required for cxx on iOS
 set (CMAKE_C_FLAGS_INIT "")
 set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden")
+set (CMAKE_CXX_FLAGS_RELEASE_INIT "-DNDEBUG -O3 -fomit-frame-pointer -ffast-math")

 set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
 set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")


makefile fix for impi w/ icc

makefile fix for impi w/ icc

--- cmake/mpi.cmake
+++ cmake/mpi.cmake
@@ -15,9 +15,10 @@
 ## ======================================================================== ##

 IF (OSPRAY_MPI)
-  OPTION(OSPRAY_FORCE_IMPI "Force use of Intel MPI" OFF)
+#  OPTION(OSPRAY_FORCE_IMPI "Force use of Intel MPI" OFF)

-  IF (OSPRAY_FORCE_IMPI)
+  IF ((OSPRAY_COMPILER STREQUAL "ICC"))
+#  IF (OSPRAY_FORCE_IMPI)
     SET(MPI_CXX_COMPILER "mpiicpc")
     execute_process(
       COMMAND ${MPI_CXX_COMPILER} -mt_mpi -show
@@ -25,8 +26,8 @@
       ERROR_VARIABLE   MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
       RESULT_VARIABLE  MPI_COMPILER_RETURN)
     set(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE})
-    message("MPI_COMPILE_CMDLINE ${MPI_COMPILE_CMDLINE}")
-    message("MPI_LINK_CMDLINE ${MPI_LINK_CMDLINE}")
+ #   message("MPI_COMPILE_CMDLINE ${MPI_COMPILE_CMDLINE}")
+  #  message("MPI_LINK_CMDLINE ${MPI_LINK_CMDLINE}")

     # Extract compile flags from the compile command line.
     string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
@@ -71,7 +72,7 @@
       string(REGEX REPLACE "//" "/" LPATH ${LPATH})
       list(APPEND MPI_LINK_PATH ${LPATH})
     endforeach()
-    message("MPI_ALL_LINK_PATHS ${MPI_ALL_LINK_PATHS}")
+#    message("MPI_ALL_LINK_PATHS ${MPI_ALL_LINK_PATHS}")

     # try using showme:libdirs if extracting didn't work.
     if (NOT MPI_LINK_PATH)
@@ -108,7 +109,7 @@
         "${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
     endif ()

-    message("MPI_LIBNAMES ${MPI_LIBNAMES}")
+#    message("MPI_LIBNAMES ${MPI_LIBNAMES}")
     # Determine full path names for all of the libraries that one needs
     # to link against in an MPI program
     foreach(LIB ${MPI_LIBNAMES})
@@ -123,7 +124,7 @@
         message(WARNING "Unable to find MPI library ${LIB}")
       endif()
     endforeach()
-    message("MPI_LIBRARIES_WORK ${MPI_LIBRARIES_WORK}")
+#    message("MPI_LIBRARIES_WORK ${MPI_LIBRARIES_WORK}")

     # Sanity check MPI_LIBRARIES to make sure there are enough libraries
     list(LENGTH MPI_LIBRARIES_WORK MPI_NUMLIBS)


FindGlog: Add support for 'glogd' Debug library (#1479)

Summary:
Glog v0.4.0 when configured with Debug build type adds a 'd' suffix to
the library file. This results in FindGlog.cmake failing to locate it.

Update FindGlog.cmake to use check for 'glogd', and use
select_library_configurations() to set GLOG_LIBRARY to the correct
found filename.

(Note: this has no effect if a non-Debug type is used.)

Pull Request resolved: https://github.com/facebook/folly/pull/1479

Reviewed By: yfeldblum

Differential Revision: D24503510

Pulled By: Orvid

fbshipit-source-id: 705df05a4a3d7df2df8af3bb66c319fb044adbce

--- build/fbcode_builder/CMake/FindGlog.cmake
+++ build/fbcode_builder/CMake/FindGlog.cmake
@@ -7,12 +7,17 @@
 # GLOG_LIBRARIES - link these to use Glog

 include(FindPackageHandleStandardArgs)
+include(SelectLibraryConfigurations)

-find_library(GLOG_LIBRARY glog
+find_library(GLOG_LIBRARY_RELEASE glog
+  PATHS ${GLOG_LIBRARYDIR})
+find_library(GLOG_LIBRARY_DEBUG glogd
   PATHS ${GLOG_LIBRARYDIR})

 find_path(GLOG_INCLUDE_DIR glog/logging.h
   PATHS ${GLOG_INCLUDEDIR})
+
+select_library_configurations(GLOG)

 find_package_handle_standard_args(glog DEFAULT_MSG
   GLOG_LIBRARY


ENH: Update version of QtTesting

ENH: Update version of QtTesting

This adds a lot of bug fixes as well as new features.

--- CMakeExternals/QtTesting.cmake
+++ CMakeExternals/QtTesting.cmake
@@ -24,7 +24,7 @@

 if(NOT DEFINED QtTesting_DIR)

-  set(revision_tag 828b35edbbac6b08668809c84391003a2f513d1b)
+  set(revision_tag b5324a213dc3c4abd7b588575ea926db57aa981e)
   if(${proj}_REVISION_TAG)
     set(revision_tag ${${proj}_REVISION_TAG})
   endif()


Bake templates into the compiler binary

Bake templates into the compiler binary

Summary: [Thrift] Bake templates into the compiler binary rather than having to package the templates with the compiler.

Reviewed By: stevegury, vitaut

Differential Revision: D16356056

fbshipit-source-id: b971dce7aada8dc2a26587fbf818e661acd0c555

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -99,10 +99,6 @@
     thrift_include_options
     "-I;$<JOIN:$<TARGET_PROPERTY:${LIB_NAME}.thrift_includes,INTERFACE_INCLUDE_DIRECTORIES>,;-I;>"
   )
-  file(
-    GLOB_RECURSE THRIFT_TEMPLATE_FILES
-    FOLLOW_SYMLINKS "${FBTHRIFT_TEMPLATES_DIR}/cpp2/*.mustache"
-  )

   # Emit the rule to run the thrift compiler
   add_custom_command(
@@ -115,7 +111,6 @@
     COMMAND
       "${FBTHRIFT_COMPILER}"
       --strict
-      --templates "${FBTHRIFT_TEMPLATES_DIR}"
       --gen "mstch_cpp2:${GEN_ARG_STR}"
       "${thrift_include_options}"
       -o "${output_dir}"


Fix configuration of CTKConfig based on DCMTK_HAVE_CONFIG_H_OPTIONAL value

This fixes the logic introduced by commit a32f524. Since the variable
is set to TRUE or FALSE only when DCMTK is looked up without using
DCMTKConfig, in case CTK is build against a version of DCMTK providing
DCMTKConfig, we need to also check if it is defined.

See #413

--- CMake/LastConfigureStep/CTKGenerateCTKConfig.cmake
+++ CMake/LastConfigureStep/CTKGenerateCTKConfig.cmake
@@ -162,7 +162,7 @@
 set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}set(CTK_EXTERNAL_LIBRARIES \"${CTK_EXTERNAL_LIBRARIES}\")\n")
 set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}# External project library directories\n")
 set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}set(CTK_EXTERNAL_LIBRARY_DIRS \"${CTK_EXTERNAL_LIBRARY_DIRS}\")\n")
-if(NOT DCMTK_HAVE_CONFIG_H_OPTIONAL AND TARGET CTKDICOMCore)
+if(DEFINED DCMTK_HAVE_CONFIG_H_OPTIONAL AND NOT DCMTK_HAVE_CONFIG_H_OPTIONAL AND TARGET CTKDICOMCore)
   set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}# Definition required to build DCMTK dependent libraries\n")
   set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}if(\"\${CMAKE_VERSION}\" VERSION_GREATER 2.8.10)\n")
   set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}  set_target_properties(CTKDICOMCore PROPERTIES INTERFACE_COMPILE_DEFINITIONS ${DCMTK_DEFINITIONS})\n")
@@ -206,7 +206,7 @@
 foreach(lib ${CTK_LIBRARIES})
   set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}set(${lib}_LIBRARY_DIRS \"\")\n")
 endforeach()
-if(NOT DCMTK_HAVE_CONFIG_H_OPTIONAL AND TARGET CTKDICOMCore)
+if(DEFINED DCMTK_HAVE_CONFIG_H_OPTIONAL AND NOT DCMTK_HAVE_CONFIG_H_OPTIONAL AND TARGET CTKDICOMCore)
   set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}# Definition required to build DCMTK dependent libraries\n")
   set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}if(\"\${CMAKE_VERSION}\" VERSION_GREATER 2.8.10)\n")
   set(CTK_CONFIG_CODE "${CTK_CONFIG_CODE}  set_target_properties(CTKDICOMCore PROPERTIES INTERFACE_COMPILE_DEFINITIONS ${DCMTK_DEFINITIONS})\n")


make range-v3 cacheable

make range-v3 cacheable

--- cmake/projects/range-v3/hunter.cmake
+++ cmake/projects/range-v3/hunter.cmake
@@ -39,6 +39,6 @@
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)
-# hunter_cacheable(range-v3)
+hunter_cacheable(range-v3)
 hunter_download(PACKAGE_NAME range-v3)