update CMAKE module file

update CMAKE module file

--- cmake/FindMSGPACK.cmake
+++ cmake/FindMSGPACK.cmake
@@ -1,17 +1,64 @@
-# Find MessagePack
-# MSGPACK_INCLUDES - msgpack.h
-# MSGPACK_LIBRARIES - msgpack libraries
-# MSGPACK_FOUND - True if msgpack was found.
+# - Try to find msgpack
+# Once done this will define
+#  MSGPACK_FOUND - System has msgpack
+#  MSGPACK_INCLUDE_DIRS - The msgpack include directories
+#  MSGPACK_LIBRARIES - The libraries needed to use msgpack

-set(MSGPACK_ROOT "" CACHE STRING "MessagePack root directory")
+if(NOT MSGPACK_USE_BUNDLED)
+  find_package(PkgConfig)
+  if (PKG_CONFIG_FOUND)
+    pkg_search_module(PC_MSGPACK QUIET
+      msgpackc>=${Msgpack_FIND_VERSION}
+      msgpack>=${Msgpack_FIND_VERSION})
+  endif()
+else()
+  set(PC_MSGPACK_INCLUDEDIR)
+  set(PC_MSGPACK_INCLUDE_DIRS)
+  set(PC_MSGPACK_LIBDIR)
+  set(PC_MSGPACK_LIBRARY_DIRS)
+  set(LIMIT_SEARCH NO_DEFAULT_PATH)
+endif()

-find_path(MSGPACK_INCLUDE_DIR msgpack.h HINTS "${MSGPACK_ROOT}/include")
-find_library(MSGPACK_LIBRARY msgpack HINTS "${MSGPACK_ROOT}/lib")
+set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
+
+find_path(MSGPACK_INCLUDE_DIR msgpack/version_master.h
+  HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS}
+  ${LIMIT_SEARCH})
+
+if(MSGPACK_INCLUDE_DIR)
+  file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
+  string(REGEX REPLACE ".*MSGPACK_VERSION_MAJOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MAJOR "${msgpack_version_h}")
+  string(REGEX REPLACE ".*MSGPACK_VERSION_MINOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MINOR "${msgpack_version_h}")
+  string(REGEX REPLACE ".*MSGPACK_VERSION_REVISION +([0-9]+).*" "\\1" MSGPACK_VERSION_REVISION "${msgpack_version_h}")
+  set(MSGPACK_VERSION_STRING "${MSGPACK_VERSION_MAJOR}.${MSGPACK_VERSION_MINOR}.${MSGPACK_VERSION_REVISION}")
+else()
+  set(MSGPACK_VERSION_STRING)
+endif()
+
+# If we're asked to use static linkage, add libmsgpack{,c}.a as a preferred library name.
+if(MSGPACK_USE_STATIC)
+  list(APPEND MSGPACK_NAMES
+    "${CMAKE_STATIC_LIBRARY_PREFIX}msgpackc${CMAKE_STATIC_LIBRARY_SUFFIX}"
+    "${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
+endif()
+
+list(APPEND MSGPACK_NAMES msgpackc msgpack)
+
+find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
+  # Check each directory for all names to avoid using headers/libraries from
+  # different places.
+  NAMES_PER_DIR
+  HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS}
+  ${LIMIT_SEARCH})
+
+mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)

 set(MSGPACK_LIBRARIES ${MSGPACK_LIBRARY})
 set(MSGPACK_INCLUDE_DIRS ${MSGPACK_INCLUDE_DIR})

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(MSGPACK DEFAULT_MSG
-                                  MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR)
-mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
+# handle the QUIETLY and REQUIRED arguments and set MSGPACK_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(Msgpack
+  REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
+  VERSION_VAR MSGPACK_VERSION_STRING)


Bug 493 : multiple calls to FindUmfPack
(transplanted from 35ee747575143155b8ef538c0c0b30d0cf0894a3)

--HG--
extra : transplant_source : 5%EEtuu%141U%B8%EFS%8C%0C%0B0%D0%CF%08%94%A3

--- cmake/FindUmfpack.cmake
+++ cmake/FindUmfpack.cmake
@@ -19,8 +19,9 @@
 find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})

 if(UMFPACK_LIBRARIES)
-
-  get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
+  if (NOT UMFPACK_LIBDIR)
+    get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
+  endif(NOT UMFPACK_LIBDIR)

   find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
   if (AMD_LIBRARY)


build_system: delete unused file

build_system: delete unused file

We use cpp_rsc anyway to embed files in the library.

--- cmake/embed_files.cmake
+++ cmake/embed_files.cmake
@@ -1,27 +0,0 @@
-# Compilation step for static resources
-# Taken from:
-# https://beesbuzz.biz/code/4399-Embedding-binary-resources-with-CMake-and-C-11
-function(ADD_RESOURCES out_var)
-    set(result)
-    foreach(in_f ${ARGN})
-        set(out_f "${CMAKE_CURRENT_BINARY_DIR}/${in_f}.o")
-        file(RELATIVE_PATH rel_path_with_file ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${in_f})
-        get_filename_component(rel_path ${rel_path_with_file} DIRECTORY)
-        file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${rel_path})
-
-        if (APPLE)
-            set(binary_options -sectcreate binary)
-        else()
-            set(binary_options -b binary)
-        endif()
-
-        add_custom_command(OUTPUT ${out_f}
-            COMMAND ld -r ${binary_options} -o ${out_f} ${CMAKE_CURRENT_SOURCE_DIR}/${in_f}
-            DEPENDS ${in_f}
-            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-            COMMENT "Adding resource ${in_f}"
-            VERBATIM)
-        list(APPEND result ${out_f})
-    endforeach()
-    set(${out_var} "${result}" PARENT_SCOPE)
-endfunction()


ENH: allow build to fail and to submit

ENH: allow build to fail and to submit

--- CI/main_ci.cmake
+++ CI/main_ci.cmake
@@ -63,9 +63,9 @@
     CAPTURE_CMAKE_ERROR _configure_error
     )

-if ( _configure_rv EQUAL -1 )
-  message("An error occurs during ctest_configure:
-    ${_configure_error}")
+if ( NOT _configure_rv EQUAL 0 )
+  ctest_submit()
+  message( FATAL_ERROR "An error occurs during ctest_configure.")
 endif()

 ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
@@ -74,10 +74,10 @@
             )

 if ( NOT _build_rv EQUAL 0 )
-  message( SEND_ERROR "An error occurs during ctest_build:
-    ${_build_error}")
+  ctest_submit()
+  message( SEND_ERROR "An error occurs during ctest_build.")
 endif()

-# ctest_test(PARALLEL_LEVEL 8])
+# ctest_test(PARALLEL_LEVEL 8)

 ctest_submit()


Correctly detect ISPC_VERSION of dev builds (thanks to boogerlad #31)

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -34,7 +34,8 @@

 IF(NOT ISPC_VERSION)
   EXECUTE_PROCESS(COMMAND ${ISPC_EXECUTABLE} --version OUTPUT_VARIABLE ISPC_OUTPUT)
-  STRING(REGEX MATCH " [0-9]+[.][0-9]+[.][0-9]+ " ISPC_VERSION "${ISPC_OUTPUT}")
+  STRING(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev)? " DUMMY "${ISPC_OUTPUT}")
+  SET(ISPC_VERSION ${CMAKE_MATCH_1})

   IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
     MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")


proper binary directory under windows for ctest

--- common/cmake/test.cmake
+++ common/cmake/test.cmake
@@ -54,27 +54,33 @@
   ELSE()
     SET(models ${models_small_win32})
   ENDIF()
+
+  IF (WIN32)
+    SET(MY_PROJECT_BINARY_DIR "${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
+  ELSE()
+    SET(MY_PROJECT_BINARY_DIR "${PROJECT_BINARY_DIR}")
+  ENDIF()

   MACRO (ADD_EMBREE_MODEL_TEST name reference executable args model)

     ADD_TEST(NAME ${name}
-             WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+             WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
              COMMAND ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
                      --name ${name}
                      --modeldir ${BUILD_TESTING_MODEL_DIR}
                      --reference ${reference}
                      --model ${model}
-                     --execute ${PROJECT_BINARY_DIR}/${executable} ${args})
+                     --execute ${MY_PROJECT_BINARY_DIR}/${executable} ${args})

     IF (ENABLE_ISPC_SUPPORT AND RTCORE_RAY_PACKETS)
       ADD_TEST(NAME ${name}_ispc
-               WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+               WORKING_DIRECTORY ${MY_PROJECT_BINARY_DIR}
                COMMAND ${PROJECT_SOURCE_DIR}/scripts/invoke_test.py
                        --name ${name}_ispc
                        --modeldir ${BUILD_TESTING_MODEL_DIR}
                        --reference ${reference}
                        --model ${model}
-                       --execute ${PROJECT_BINARY_DIR}/${executable}_ispc ${args})
+                       --execute ${MY_PROJECT_BINARY_DIR}/${executable}_ispc ${args})
     ENDIF()
   ENDMACRO()


fix broken build

fix broken build

--- superbuild/versions.cmake
+++ superbuild/versions.cmake
@@ -228,4 +228,4 @@
   GIT_REPOSITORY https://bitbucket.org/fathomteam/moab.git
   GIT_TAG master
   )
-#endif()
+endif()


fix cmake >= 3.1 warnings (CMP0054)

fix cmake >= 3.1 warnings (CMP0054)

--- Build.cmake
+++ Build.cmake
@@ -20,7 +20,7 @@
   # description
   #  1) http://kjellkod.wordpress.com/2013/09/23/experimental-g3log-with-clang/
   #  2) https://github.com/maidsafe/MaidSafe/wiki/Hacking-with-Clang-llvm-abi-and-llvm-libc
-IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang")
+IF (${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang")
    MESSAGE("")
    MESSAGE("cmake for Clang ")
    SET(CMAKE_CXX_FLAGS "-Wall -std=c++11 -stdlib=libc++ -Wunused -D_GLIBCXX_USE_NANOSLEEP")
@@ -37,7 +37,7 @@

-ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
    MESSAGE("cmake for GCC ")
    IF (APPLE)
        set(CMAKE_CXX_FLAGS "-Wall -Wunused -std=c++11  -pthread -D_GLIBCXX_USE_NANOSLEEP")


yacma fix for recent CMake versions.

yacma fix for recent CMake versions.

--- cmake/yacma/YACMACompilerLinkerSettings.cmake
+++ cmake/yacma/YACMACompilerLinkerSettings.cmake
@@ -44,36 +44,32 @@

 # Enable conditionally a CXX flag, if supported by the compiler.
 # This is for flags intended to be enabled in all configurations.
-# NOTE: we use macros and go through temporary private variables
-# because it's apparently impossible to append to an internal
+# NOTE: we use macros because it's apparently impossible to append to an internal
 # CACHEd list.
 macro(_YACMA_CHECK_ENABLE_CXX_FLAG flag)
     set(CMAKE_REQUIRED_QUIET TRUE)
-    check_cxx_compiler_flag("${flag}" YACMA_CHECK_CXX_FLAG)
+    check_cxx_compiler_flag("${flag}" YACMA_CHECK_CXX_FLAG::${flag})
     unset(CMAKE_REQUIRED_QUIET)
-    if(YACMA_CHECK_CXX_FLAG)
+    if(YACMA_CHECK_CXX_FLAG::${flag})
         message(STATUS "'${flag}': flag is supported by the compiler, enabling.")
         list(APPEND _YACMA_CXX_FLAGS "${flag}")
     else()
         message(STATUS "'${flag}': flag is not supported by the compiler.")
     endif()
-    # NOTE: check_cxx_compiler stores variables in the cache.
-    unset(YACMA_CHECK_CXX_FLAG CACHE)
 endmacro()

 # Enable conditionally a debug CXX flag, is supported by the compiler.
 # This is for flags intended to be enabled in debug mode.
 macro(_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG flag)
     set(CMAKE_REQUIRED_QUIET TRUE)
-    check_cxx_compiler_flag("${flag}" YACMA_CHECK_DEBUG_CXX_FLAG)
+    check_cxx_compiler_flag("${flag}" YACMA_CHECK_DEBUG_CXX_FLAG::${flag})
     unset(CMAKE_REQUIRED_QUIET)
-    if(YACMA_CHECK_DEBUG_CXX_FLAG)
+    if(YACMA_CHECK_DEBUG_CXX_FLAG::${flag})
         message(STATUS "'${flag}': debug flag is supported by the compiler, enabling.")
         list(APPEND _YACMA_CXX_FLAGS_DEBUG "${flag}")
     else()
         message(STATUS "'${flag}': debug flag is not supported by the compiler.")
     endif()
-    unset(YACMA_CHECK_DEBUG_CXX_FLAG CACHE)
 endmacro()

 # What we want to avoid is to re-run the expensive flag checks. We will set cache variables


Added missing OpenCV dependency

Added missing OpenCV dependency


Also adding OSX_COMMANDS to mitk configure

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -217,12 +217,15 @@
 )

 if(APPLE)
+  set(MAC_OSX_ARCHITECTURE_ARGS
+        -DCMAKE_OSX_ARCHITECTURES:PATH=${CMAKE_OSX_ARCHITECTURES}
+        -DCMAKE_OSX_DEPLOYMENT_TARGET:PATH=${CMAKE_OSX_DEPLOYMENT_TARGET}
+        -DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
+  )
   set(ep_common_args
-       -DCMAKE_OSX_ARCHITECTURES:PATH=${CMAKE_OSX_ARCHITECTURES}
-       -DCMAKE_OSX_DEPLOYMENT_TARGET:PATH=${CMAKE_OSX_DEPLOYMENT_TARGET}
-       -DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
-       ${ep_common_args}
-      )
+        ${MAC_OSX_ARCHITECTURE_ARGS}
+        ${ep_common_args}
+  )
 endif()

 # Include external projects
@@ -419,6 +422,7 @@
     -DQxt_DIR:PATH=${Qxt_DIR}
   CMAKE_ARGS
     ${mitk_initial_cache_arg}
+    ${MAC_OSX_ARCHITECTURE_ARGS}

   SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
   BINARY_DIR ${CMAKE_BINARY_DIR}/MITK-build


Only list SIRF and Gadgetron as main dependencies (rest will follow)

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -29,13 +29,6 @@
 option(BUILD_GADGETRON "Build Gadgetron" ON)

 set(${PRIMARY_PROJECT_NAME}_DEPENDENCIES
-    Boost
-    googletest
-    SWIG
-    HDF5
-    FFTW3
-    ISMRMRD
-    STIR
     SIRF
 )
 if (BUILD_GADGETRON)


Fix Boost variable usage, Boost is in lower case

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -168,7 +168,7 @@
   ${CEGUI_INCLUDE_DIRS}
   ${OIS_INCLUDE_DIRS}
   ${Cg_INCLUDE_DIRS}
-  ${BOOST_INCLUDE_DIRS}
+  ${Boost_INCLUDE_DIRS}
   ${X11_INCLUDE_DIR}
   ${DirectX_INCLUDE_DIRS}
   ${CppUnit_INCLUDE_DIRS}
@@ -178,7 +178,7 @@
 link_directories(
   ${OPENGL_LIBRARY_DIRS}
   ${Cg_LIBRARY_DIRS}
-  ${BOOST_LIBRARY_DIRS}
+  ${Boost_LIBRARY_DIRS}
   ${X11_LIBRARY_DIRS}
   ${DirectX_LIBRARY_DIRS}
   ${CppUnit_LIBRARY_DIRS}


They released a new version of Boost. Add it to the list.

--HG--
branch : v1-8


Remove unused cache variable

Remove unused cache variable

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -66,7 +66,6 @@
         -DCMAKE_DEBUG_POSTFIX:STRING=
         -DCTK_QT_VERSION:STRING=5
         -DQt5_DIR=${Qt5_DIR}
-        -DGit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
         -DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
         -DCTK_BUILD_QTDESIGNER_PLUGINS:BOOL=ON
         -DCTK_LIB_CommandLineModules/Backend/LocalProcess:BOOL=ON


COMP: MinGW: In the VTK superbuild, CMAKE_USE_PTHREADS and CMAKE_USE_WIN32THREADS is enabled, leading to errors during compilation. Setting CMAKE_USE_PTHREADS to OFF for MinGW.

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -10,6 +10,11 @@
     MESSAGE(FATAL_ERROR "VTK_DIR variable is defined but corresponds to non-existing directory")
   ENDIF()

+  SET(additional_vtk_cmakevars )
+  IF(MINGW)
+    SET(additional_vtk_cmakevars "-DCMAKE_USE_PTHREADS:BOOL=OFF")
+  ENDIF()
+
   IF(NOT DEFINED VTK_DIR)
     SET(proj VTK)
 #     MESSAGE(STATUS "Adding project:${proj}")
@@ -20,6 +25,7 @@
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
         ${ep_common_args}
+        ${additional_vtk_cmakevars}
         -DVTK_WRAP_TCL:BOOL=OFF
         -DVTK_WRAP_PYTHON:BOOL=OFF
         -DVTK_WRAP_JAVA:BOOL=OFF


COMP: Fix GCC_VERSION check.

COMP: Fix GCC_VERSION check.

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -50,7 +50,7 @@

   include(mitkFunctionGetGccVersion)
   mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
-  if(NOT ${GCC_VERSION} VERSION_LESS "4.6")
+  if(GCC_VERSION AND NOT ${GCC_VERSION} VERSION_LESS "4.6")
     if(NOT MITK_USE_VTK_5_8_IN_SUPERBUILD)
       message("Forcing VTK 5.8 since we're using gcc ${GCC_VERSION}")
     endif()


ENH: warning message in ImportGDAL about Jpeg2000 drivers not necessary

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -45,7 +45,7 @@
       message(STATUS "  GDAL is built with a suitable Jpeg2000 driver (OpenJpeg, Kakadu, ECW).")
       set(GDAL_HAS_J2K ON)
     else()
-      message(WARNING "GDAL has no suitable Jpeg2000 driver (compatible drivers are : OpenJpeg, Kakadu, ECW).")
+      message(STATUS "  GDAL has no suitable Jpeg2000 driver (compatible drivers are : OpenJpeg, Kakadu, ECW).")
     endif()

   else()


THRIFT-5086 CMake target thrift::thrift has no INTERFACE_INCLUDE_DIRECTORIES property
Client: cpp
Patch: SmartNet Club

This closes #2003

--- build/cmake/ThriftMacros.cmake
+++ build/cmake/ThriftMacros.cmake
@@ -25,6 +25,7 @@

 macro(ADD_LIBRARY_THRIFT name)
     add_library(${name} ${ARGN})
+    target_include_directories(${name} INTERFACE $<INSTALL_INTERFACE:include>)
     set_target_properties(${name} PROPERTIES
         OUTPUT_NAME ${name}${THRIFT_RUNTIME_POSTFIX}   # windows link variants (/MT, /MD, /MTd, /MDd) get different names
         VERSION ${thrift_VERSION} )


Fix test build script

Fix test build script

--- test/util/testsuite.cmake
+++ test/util/testsuite.cmake
@@ -52,6 +52,11 @@
   target_link_libraries(${test_target}_testrunner
     ${driver_dep}
     ${TEST_TARGET_DEPS}
+  )
+
+  target_include_directories(${test_target}_testrunner PUBLIC
+    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/>
+    $<INSTALL_INTERFACE:${PROJECT_SOURCE_DIR}/include/>
   )

   # Runs the test and generates a stamp file on success.


[cmake] copy gtest libraries to output folder

--- scripts/cmake/hackerrank_setup_test_project.cmake
+++ scripts/cmake/hackerrank_setup_test_project.cmake
@@ -35,4 +35,7 @@
     set_target_properties(${ProjectTest} PROPERTIES FOLDER "${ProjectFolder}")

     add_test(${ProjectTest} ${ProjectTest})
+
+    file(GLOB GTEST_BINARIES "${PROJECT_BINARY_DIR}/bin/gtest*")
+    file(COPY ${GTEST_BINARIES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 endmacro()


Fix InstallHeaders to use CURRENT source/bin dir

--- standard/InstallHeaders.cmake
+++ standard/InstallHeaders.cmake
@@ -50,18 +50,20 @@
     # 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_SOURCE_DIR} ${src})
+    file(RELATIVE_PATH src_rel ${CMAKE_CURRENT_SOURCE_DIR} ${src})
     get_filename_component(src_rel ${src_rel} DIRECTORY)
-    string(LENGTH ${src_rel} src_rel_len)
+    if(src_rel)
+      string(LENGTH ${src_rel} src_rel_len)
+      set(actual_rel ${src_rel})
+    endif()

-    file(RELATIVE_PATH bin_rel ${CMAKE_BINARY_DIR} ${src})
+    file(RELATIVE_PATH bin_rel ${CMAKE_CURRENT_BINARY_DIR} ${src})
     get_filename_component(bin_rel ${bin_rel} DIRECTORY)
-    string(LENGTH ${bin_rel} bin_rel_len)
-
-    if(src_rel_len LESS bin_rel_len)
-      set(actual_rel ${src_rel})
-    else()
-      set(actual_rel ${bin_rel})
+    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)


updating FindEigen2.cmake for proper search order

--- bench/btl/cmake/FindEigen2.cmake
+++ bench/btl/cmake/FindEigen2.cmake
@@ -16,10 +16,10 @@
 else (EIGEN2_INCLUDE_DIR)

 find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
-     PATHS
+     PATH_SUFFIXES eigen2
+     HINTS
      ${INCLUDE_INSTALL_DIR}
      ${KDE4_INCLUDE_DIR}
-     PATH_SUFFIXES eigen2
    )

 include(FindPackageHandleStandardArgs)


Missing header checks

Missing header checks

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -20,6 +20,7 @@
 vlc_check_include_files (stdio.h stdint.h inttypes.h)
 vlc_check_include_files (signal.h unistd.h dirent.h)
 vlc_check_include_files (netinet/in.h netinet/udplite.h)
+vlc_check_include_files (arpa/inet.h net/if.h)
 vlc_check_include_files (netdb.h fcntl.h sys/time.h poll.h)
 vlc_check_include_files (errno.h time.h)


minor change in Eigen3 module (additional search directory for windows /local)

--- cmake/Modules/FindEigen3.cmake
+++ cmake/Modules/FindEigen3.cmake
@@ -75,6 +75,7 @@
 		/usr/include/eigen*
 		/usr/include
 		/opt/local/include/eigen*
+		/local/eigen*
 		$ENV{ProgramW6432}/eigen*/include/eigen3
 		$ENV{ProgramFiles}/eigen*/include/eigen3
 		$ENV{ProgramW6432}/eigen*


#31 Fix finding of external FFmpeg libraries for Visual Studio

--- cmake/Modules/FindFFMPEG.cmake
+++ cmake/Modules/FindFFMPEG.cmake
@@ -44,7 +44,6 @@
         PATH_SUFFIXES ffmpeg
         DOC "Location of FFMPEG Headers"
     )
-
     FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername}
         PATHS
         ${FFMPEG_ROOT}/include
@@ -61,7 +60,6 @@
         PATH_SUFFIXES ffmpeg
         DOC "Location of FFMPEG Headers"
     )
-
     FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
         NAMES ${shortname}
         PATHS
@@ -107,6 +105,7 @@
         /opt/csw/include # Blastwave
         /opt/include
         /usr/freeware/include
+        ${CMAKE_SOURCE_DIR}/deps/headers/msvc
         PATH_SUFFIXES ffmpeg
         DOC "Location of FFMPEG stdint.h Header"
     )


* fix for #506: CMake gives no warning for missing libusb1 (with Nizar's help!)

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@3998 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -6,15 +6,32 @@
 # OPENNI_INCLUDE_DIRS - Directories containing the OPENNI include files.
 # OPENNI_LIBRARIES - Libraries needed to use OPENNI.
 # OPENNI_DEFINITIONS - Compiler flags for OPENNI.
+#
+# For libusb-1.0, add USB_10_ROOT if not found

 find_package(PkgConfig)
+# Find LibUSB
+if(NOT WIN32)
+  pkg_check_modules(PC_USB_10 libusb-1.0)
+  find_path(USB_10_INCLUDE_DIR libusb-1.0/libusb.h
+            HINTS ${PC_USB_10_INCLUDEDIR} ${PC_USB_10_INCLUDE_DIRS} "${USB_10_ROOT}" "$ENV{USB_10_ROOT}"
+            PATH_SUFFIXES libusb-1.0)
+
+  find_library(USB_10_LIBRARY
+               NAMES usb-1.0
+               HINTS ${PC_USB_10_LIBDIR} ${PC_USB_10_LIBRARY_DIRS} "${USB_10_ROOT}" "$ENV{USB_10_ROOT}"
+               PATH_SUFFIXES lib)
+   include(FindPackageHandleStandardArgs)
+   find_package_handle_standard_args(USB_10 DEFAULT_MSG USB_10_LIBRARY USB_10_INCLUDE_DIR)
+endif(NOT WIN32)
+
 if(${CMAKE_VERSION} VERSION_LESS 2.8.2)
   pkg_check_modules(PC_OPENNI openni-dev)
 else()
   pkg_check_modules(PC_OPENNI QUIET openni-dev)
 endif()

-set(OPENNI_DEFINITIONS ${PC_OPENNI_CFLAGS_OTHER})
+set(OPENNI_DEFINITIONS ${PC_OPENNI_CFLAGS_OTHER} ${PC_USB_10_CFLAGS_OTHER})

 #add a hint so that it can find it without the pkg-config
 find_path(OPENNI_INCLUDE_DIR XnStatus.h
@@ -40,9 +57,17 @@
     OPENNI_LIBRARY OPENNI_INCLUDE_DIR)

 mark_as_advanced(OPENNI_LIBRARY OPENNI_INCLUDE_DIR)
+if(NOT WIN32 AND NOT USB_10_FOUND)
+  message(STATUS "OpeNI disabled because libusb-1.0 not found.")
+  set(HAVE_OPENNI OFF)
+  return()
+endif(NOT WIN32 AND NOT USB_10_FOUND)
+
 if(OPENNI_FOUND)
   set(HAVE_OPENNI ON)
+  # Add the include directories
+  set(OPENNI_INCLUDE_DIRS ${OPENNI_INCLUDE_DIRS} ${USB_10_INCLUDE_DIR})
   include_directories(${OPENNI_INCLUDE_DIRS})
-  message(STATUS "OpenNI found (include: ${OPENNI_INCLUDE_DIR}, lib: ${OPENNI_LIBRARY})")
+  message(STATUS "OpenNI found (include: ${OPENNI_INCLUDE_DIRS}, lib: ${OPENNI_LIBRARY})")
 endif(OPENNI_FOUND)


Require exact version of libelf, 0.8.13 #58

--- cmake/Modules/Findlibelf.cmake
+++ cmake/Modules/Findlibelf.cmake
@@ -1,5 +1,5 @@
 find_package(PkgConfig)
-pkg_check_modules(PC_libelf libelf>=0.8)
+pkg_check_modules(PC_libelf libelf=0.8.13)

 find_path(libelf_INCLUDE_DIR libelf.h
           HINTS ${PC_libelf_INCLUDEDIR} ${PC_libelf_INCLUDE_DIRS})


upgrade pybind11 to fix the compliance issue. (#271)

--- cmake/externals/pybind11.cmake
+++ cmake/externals/pybind11.cmake
@@ -1,7 +1,7 @@
 FetchContent_Declare(
   pybind11
   GIT_REPOSITORY https://github.com/pybind/pybind11.git
-  GIT_TAG        v2.6.0
+  GIT_TAG        v2.6.2
 )

 FetchContent_GetProperties(pybind11)


cmake: fix typo

cmake: fix typo

--- cmake/modules/Findmpi4py.cmake
+++ cmake/modules/Findmpi4py.cmake
@@ -18,7 +18,7 @@
   )

 if(NOT exit_code EQUAL "0")
-    message( FATAL_ERROR "Not able to import mpi4py in python interpreter: ${pyinter}. Did you install mpi4py?")
+    message( FATAL_ERROR "Not able to import mpi4py in python interpreter: ${pyinterp}. Did you install mpi4py?")
 endif()


[cmake] simplify include dirs handling in ROOT_GENERATE_DICTIONARY

Keep list with plain directories names,
only for rootcling executable provide list with prefixed -I

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -286,8 +286,10 @@
     set(libprefix "")
   endif()

+   # list of include directories for dictionary generation
+   set(incdirs)
+
   if((CMAKE_PROJECT_NAME STREQUAL ROOT) AND (TARGET ${ARG_MODULE}))
-    set(incdirs)
     set(headerdirs)

     get_target_property(target_incdirs ${ARG_MODULE} INCLUDE_DIRECTORIES)
@@ -325,17 +327,6 @@

     # this instruct rootcling do not store such paths in dictionary
     set(excludepaths ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/ginclude ${CMAKE_BINARY_DIR}/externals ${CMAKE_BINARY_DIR}/builtins)
-
-    if(incdirs)
-       list(REMOVE_DUPLICATES incdirs)
-    endif()
-
-    set(includedirs)
-    foreach(dir ${incdirs})
-       list(APPEND includedirs -I${dir})
-    endforeach()
-
-    set(pureincdirs ${incdirs})

     set(headerfiles)
     set(_list_of_header_dependencies)
@@ -427,11 +418,9 @@
                OR ${incdir} MATCHES "^${_source_dir}"
                OR ${incdir} MATCHES "^${_binary_dir}"
                OR ${incdir} MATCHES "^${_curr_binary_dir}")
-              list(APPEND incdirs_in_build
-                   ${incdir})
+              list(APPEND incdirs_in_build ${incdir})
             else()
-              list(APPEND incdirs_in_prefix
-                   ${incdir})
+              list(APPEND incdirs_in_prefix ${incdir})
             endif()
           endforeach()
           if(incdirs_in_build)
@@ -468,34 +457,21 @@
     endif()

     if(CMAKE_PROJECT_NAME STREQUAL ROOT)
-      list(APPEND includedirs -I${CMAKE_BINARY_DIR}/include)
-      list(APPEND includedirs -I${CMAKE_BINARY_DIR}/etc/cling) # This is for the RuntimeUniverse
-      # list(APPEND includedirs -I${CMAKE_SOURCE_DIR})
+      list(APPEND incdirs ${CMAKE_BINARY_DIR}/include)
+      list(APPEND incdirs ${CMAKE_BINARY_DIR}/etc/cling) # This is for the RuntimeUniverse
+      # list(APPEND incdirs ${CMAKE_SOURCE_DIR})
       set(excludepaths ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
     elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inc)
-      set(includedirs -I${CMAKE_CURRENT_SOURCE_DIR}/inc)
-    endif()
-    foreach( d ${incdirs})
-      list(APPEND includedirs -I${d})
-    endforeach()
+      set(incdirs ${CMAKE_CURRENT_SOURCE_DIR}/inc)
+    endif()

     foreach(dep ${ARG_DEPENDENCIES})
       if(TARGET ${dep})
         get_property(dep_include_dirs TARGET ${dep} PROPERTY INCLUDE_DIRECTORIES)
         foreach(d ${dep_include_dirs})
-          list(APPEND includedirs -I${d})
+          list(APPEND incdirs ${d})
         endforeach()
       endif()
-    endforeach()
-
-    if(includedirs)
-      list(REMOVE_DUPLICATES includedirs)
-    endif()
-
-    set(pureincdirs)
-    foreach(dir ${includedirs})
-      string(SUBSTRING ${dir} 2 -1 dir0)
-      set(pureincdirs ${pureincdirs} ${dir0})
     endforeach()

     ####################### old-style includes/headers generation - end  ##################
@@ -635,6 +611,15 @@
       set(module_defs $<TARGET_PROPERTY:${ARG_MODULE},COMPILE_DEFINITIONS>)
     endif()
   endif()
+
+  # provide list of includes for dictionary
+  set(includedirs)
+  if(incdirs)
+     list(REMOVE_DUPLICATES incdirs)
+     foreach(dir ${incdirs})
+        list(APPEND includedirs -I${dir})
+     endforeach()
+  endif()

   #---call rootcint------------------------------------------
   add_custom_command(OUTPUT ${dictionary}.cxx ${pcm_name} ${rootmap_name} ${cpp_module_file}
@@ -664,15 +649,8 @@
     target_compile_definitions(${dictionary} PRIVATE
       ${definitions} $<TARGET_PROPERTY:${ARG_MODULE},COMPILE_DEFINITIONS>)

-    # remove all -I prefixes from list of include dirs
-    set(pureincdirs)
-    foreach(dir ${includedirs})
-      string(SUBSTRING ${dir} 2 -1 dir0)
-      set(pureincdirs ${pureincdirs} ${dir0})
-    endforeach()
-
     target_include_directories(${dictionary} PRIVATE
-      ${pureincdirs} $<TARGET_PROPERTY:${ARG_MODULE},INCLUDE_DIRECTORIES>)
+      ${incdirs} $<TARGET_PROPERTY:${ARG_MODULE},INCLUDE_DIRECTORIES>)
   else()
     add_custom_target(${dictionary} DEPENDS ${dictionary}.cxx ${pcm_name} ${rootmap_name} ${cpp_module_file})
   endif()


fix cmake error in case zlib dirs are empty

--- cmakemodules/script_zlib.cmake
+++ cmakemodules/script_zlib.cmake
@@ -12,8 +12,8 @@
 			add_library(imp_zlib INTERFACE IMPORTED)
 			set_target_properties(imp_zlib
 				PROPERTIES
-				INTERFACE_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIR}
-				INTERFACE_LINK_LIBRARIES ${ZLIB_LIBRARIES}
+				INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIR}"
+				INTERFACE_LINK_LIBRARIES "${ZLIB_LIBRARIES}"
 				)

 			set(CMAKE_MRPT_HAS_ZLIB_SYSTEM 1)


Fix compilation error C1128 on windows

Fix compilation error C1128 on windows

--- cmake/CompileFlags.cmake
+++ cmake/CompileFlags.cmake
@@ -73,6 +73,7 @@
     #              See https://github.com/cginternals/glbinding/blob/master/cmake/CompileOptions.cmake and
     #              and https://github.com/cginternals/glbinding/issues/141#issuecomment-174511579
     # /EHsc  : enable exceptions
+	# /bigobj: fixes C1128

     # disable secure CRT warnings
     add_definitions(-D_CRT_SECURE_NO_WARNINGS)
@@ -84,7 +85,7 @@
     string( REGEX REPLACE "/M(T|D)(d)*" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
     string( REGEX REPLACE "/M(T|D)(d)*" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")

-    set(CMAKE_CXX_FLAGS                "/arch:AVX2 /MP /wd4251 /EHsc ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS                "/arch:AVX2 /MP /wd4251 /EHsc /bigobj ${CMAKE_CXX_FLAGS}")
     set(CMAKE_CXX_FLAGS_DEBUG          "/D_DEBUG /DCORE_DEBUG /Od /Zi ${CMAKE_CXX_FLAGS_DEBUG} /MDd")
     set(CMAKE_CXX_FLAGS_RELEASE        "/DNDEBUG /Ox /fp:fast ${CMAKE_CXX_FLAGS_RELEASE} /MT")
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi ${CMAKE_CXX_FLAGS_RELEASE}")


Updated Dependencies.cmake

Updated Dependencies.cmake

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -5,11 +5,11 @@
   Core    src/core       SS    REQUIRED
   )

-SET(LIB_REQUIRED_DEP_PACKAGES)
+SET(LIB_REQUIRED_DEP_PACKAGES Teuchos Tpetra)
 SET(LIB_OPTIONAL_DEP_PACKAGES)
 SET(TEST_REQUIRED_DEP_PACKAGES)
 SET(TEST_OPTIONAL_DEP_PACKAGES)
 SET(LIB_REQUIRED_DEP_TPLS)
-SET(LIB_OPTIONAL_DEP_TPLS)
+SET(LIB_OPTIONAL_DEP_TPLS MPI)
 SET(TEST_REQUIRED_DEP_TPLS)
 SET(TEST_OPTIONAL_DEP_TPLS)


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

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

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


Search for libexslt.

Search for libexslt.

--- cmake/FindLibExslt.cmake
+++ cmake/FindLibExslt.cmake
@@ -32,7 +32,7 @@
    ${PC_LIBEXSLT_INCLUDE_DIRS}
   )

-FIND_LIBRARY(LIBEXSLT_LIBRARIES NAMES exslt elibxslt
+FIND_LIBRARY(LIBEXSLT_LIBRARIES NAMES libexslt exslt elibxslt
     HINTS
    ${PC_LIBEXSLT_LIBDIR}
    ${PC_LIBEXSLT_LIBRARY_DIRS}


update dependency: fifechan

update dependency: fifechan

https://ci.appveyor.com/project/jakoch/fifechan/build/dev-2e7fbd5

--- cmake/get-fifechan.cmake
+++ cmake/get-fifechan.cmake
@@ -35,8 +35,8 @@
       PREFIX              ${DEPENDENCY_EXTRACT_DIR}
       DOWNLOAD_DIR        ${DEPENDENCY_DOWNLOAD_DIR}
       #URL                 https://github.com/fifengine/fifechan/releases/tag/${FIFECHAN_VERSION}/fifechan-v${FIFECHAN_VERSION}-VC14.zip
-      URL                 https://ci.appveyor.com/api/buildjobs/2vap0jpct9vcdklw/artifacts/fifechan-shared-VC14.zip
-      URL_MD5             81faa795627270fbef18ee0f0f8a9280
+      URL                 https://ci.appveyor.com/api/buildjobs/lel0aaieaa4cgnmv/artifacts/fifechan-shared-VC14.zip
+      URL_MD5             3bc2c39b9c0842b4bcc6eaddf84d4525
       CONFIGURE_COMMAND   ""
       BUILD_COMMAND       ""
       INSTALL_COMMAND
@@ -68,4 +68,4 @@
     CMAKE_ARGS          ${FIFECHAN_CMAKE_ARGS}
   )

-endif()+endif()


Refix the linkage condition (#2091)

Refix the linkage condition (#2091)

Merging as the test failure is a known issue and it's not relevant (linux vs mac).

--- cmake/public/utils.cmake
+++ cmake/public/utils.cmake
@@ -9,7 +9,7 @@
   # link command for the specific SRC library.
   if (${__src_target_type} STREQUAL "STATIC_LIBRARY")
     # In the case of static library, we will need to add whole-static flags.
-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+    if(APPLE)
       target_link_libraries(
           ${DST} INTERFACE -Wl,-force_load,$<TARGET_FILE:${SRC}>)
     elseif(MSVC)


Add glib-2.0 as dependency to librepo.pc

--- librepo/librepo.pc.cmake
+++ librepo/librepo.pc.cmake
@@ -5,6 +5,7 @@
 Name: librepo
 Description: Repodata downloading library.
 Version: @VERSION@
+Requires: glib-2.0
 Requires.private: libcurl openssl
 Libs: -L${libdir} -lrepo
 Libs.private: -lexpat -gpgme -gpg-error


COMP: Address missing fftw include in CurvatureRegistrationFilter

When FFTW is enable the CurvatureRegistrationFilter is dependent upon
the ITKFFTW module.

--- Modules/Registration/PDEDeformable/itk-module.cmake
+++ Modules/Registration/PDEDeformable/itk-module.cmake
@@ -2,8 +2,15 @@
 registration based on intensity differences by solving the PDE, optical flow
 problem.  This includes Thirion's popular \"demons\" algorithm.")

+
+set(_FFTW_DEPENDS )
+if( ITK_USE_FFTWF OR ITK_USE_FFTWD )
+  set(_FFTW_DEPENDS "ITKFFT")
+endif()
+
 itk_module(ITKPDEDeformableRegistration
   DEPENDS
+    ${_FFTW_DEPENDS}
     ITKRegistrationCommon
     ITKFiniteDifference
   TEST_DEPENDS


Minor fix for Fortran

Minor fix for Fortran

--- Tools/CMake/PatchR.cmake
+++ Tools/CMake/PatchR.cmake
@@ -96,13 +96,10 @@

     execute_process(
       WORKING_DIRECTORY ${R_HOME_PATH}/etc
-      COMMAND sed -i.bak -e "/FC = gfortran / s/$/ -mmacosx-version-min=11.0/"
-              Makeconf)
-
-    execute_process(
-      WORKING_DIRECTORY ${R_HOME_PATH}/etc
-      COMMAND sed -i.bak -e
-              "/FC = \\/usr\\/local / s/$/ -mmacosx-version-min=11.0/" Makeconf)
+      COMMAND
+        sed -i.bak -e
+        "/FC = \\/opt\\/R\\/arm64\\/bin\\/gfortran / s/$/ -mmacosx-version-min=11.0/"
+        Makeconf)

     execute_process(
       WORKING_DIRECTORY ${R_HOME_PATH}/etc


fixing conda forge builds

fixing conda forge builds

Former-commit-id: 9ff751eaf097f30ae42b30687a105459202f6f58

--- cmake-modules/Fetch_gflags.cmake
+++ cmake-modules/Fetch_gflags.cmake
@@ -1,5 +1,5 @@

-if(NOT BUILD_SHARED_LIBS)
+if(NOT BUILD_SHARED_LIBS AND NOT DMRG_PREFER_CONDA_LIBS)
     set(COMPONENTS COMPONENTS)
     set(ITEMS nothreads_static)
 endif()


Reverted spdlog changes

Reverted spdlog changes

Former-commit-id: 155950bcf2df62ad85da90bb4af20b645531a561

--- cmake-modules/Fetch_spdlog.cmake
+++ cmake-modules/Fetch_spdlog.cmake
@@ -1,24 +1,23 @@
-include(GNUInstallDirs)
-find_package(spdlog 1.3 NO_DEFAULT_PATH PATHS ${INSTALL_DIRECTORY}/spdlog/${CMAKE_INSTALL_LIBDIR}/spdlog/cmake ${spdlog_DIR} )
+
+
+find_package(spdlog 1.3 NO_DEFAULT_PATH HINTS ${INSTALL_DIRECTORY}/spdlog/lib/cmake/spdlog ${spdlog_DIR} )
+
 if(spdlog_FOUND)
-    get_target_property(spdlog_LIBRARIES spdlog::spdlog   IMPORTED_LOCATION_RELEASE)
-    set_target_properties(spdlog::spdlog PROPERTIES INTERFACE_LINK_LIBRARIES "${spdlog_LIBRARIES}")
-    message(STATUS "SPDLOG FOUND IN SYSTEM: ${spdlog_LIBRARIES}")
-
+    get_target_property(SPDLOG_INCLUDE_DIR spdlog::spdlog INTERFACE_INCLUDE_DIRECTORIES)
+    message(STATUS "SPDLOG FOUND IN SYSTEM: ${SPDLOG_INCLUDE_DIR}")

 elseif (DOWNLOAD_SPDLOG OR DOWNLOAD_ALL)
     message(STATUS "Spdlog will be installed into ${INSTALL_DIRECTORY}/spdlog on first build.")
     include(ExternalProject)
     ExternalProject_Add(external_SPDLOG
             GIT_REPOSITORY https://github.com/gabime/spdlog.git
-            GIT_TAG v1.x
+            GIT_TAG v1.3.1
             GIT_PROGRESS 1
             UPDATE_COMMAND ""
             TEST_COMMAND ""
             PREFIX      ${BUILD_DIRECTORY}/spdlog
             INSTALL_DIR ${INSTALL_DIRECTORY}/spdlog
             CMAKE_ARGS
-            -DSPDLOG_BUILD_TESTS:BOOL=ON
             -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
             )

@@ -26,12 +25,9 @@
     ExternalProject_Get_Property(external_SPDLOG INSTALL_DIR)
     add_library(spdlog INTERFACE)
     add_library(spdlog::spdlog ALIAS spdlog)
-    set(spdlog_DIR ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/spdlog/cmake)
-
+    set(spdlog_DIR ${INSTALL_DIR}/lib/cmake/spdlog)
     add_dependencies(spdlog external_SPDLOG)
-    target_include_directories(spdlog INTERFACE ${INSTALL_DIR}/${CMAKE_INSTALL_INCLUDEDIR})
-    target_link_libraries(spdlog INTERFACE ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/spdlog/libspdlog${CMAKE_STATIC_LIBRARY_SUFFIX})
-    target_link_libraries (spdlog INTERFACE ${PTHREAD_LIBRARY})
+    target_include_directories(spdlog INTERFACE ${INSTALL_DIR}/include)
 else()
     message("WARNING: Dependency spdlog not found and DOWNLOAD_SPDLOG is OFF. Build will fail.")


PATH-181 and PATH-194: Starting to put back the ability to build the viewer using the stub libraries.

--- indra/cmake/LLPhysicsExtensions.cmake
+++ indra/cmake/LLPhysicsExtensions.cmake
@@ -1,31 +1,25 @@
 # -*- cmake -*-
 include(Prebuilt)

-use_prebuilt_binary(llphysicsextensions)
 set(LLPHYSICS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/lib/include)

-set(LLPHYSICS_DEBUG_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug)
-set(LLPHYSICS_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release)
+if (INSTALL_PROPRIETARY AND NOT STANDALONE)
+   use_prebuilt_binary(llphysicsextensions)

-find_library(LL_PHYSICS_DEBUG_LIB llphysicsextensions PATHS ${LLPHYSICS_DEBUG_LIBRARY_PATH})
-find_library(LL_PHYSICS_RELEASE_LIB llphysicsextensions PATHS ${LLPHYSICS_RELEASE_LIBRARY_PATH})
+   set(LLPHYSICS_DEBUG_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug)
+   set(LLPHYSICS_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release)

-set(LLPHYSICS_LIBRARIES
+   find_library(LL_PHYSICS_DEBUG_LIB llphysicsextensions PATHS ${LLPHYSICS_DEBUG_LIBRARY_PATH})
+   find_library(LL_PHYSICS_RELEASE_LIB llphysicsextensions PATHS ${LLPHYSICS_RELEASE_LIBRARY_PATH})

-    debug     ${LL_PHYSICS_DEBUG_LIB}
-    optimized ${LL_PHYSICS_RELEASE_LIB}
-)
+   set(LLPHYSICS_LIBRARIES
+       debug     ${LL_PHYSICS_DEBUG_LIB}
+       optimized ${LL_PHYSICS_RELEASE_LIB}
+   )

-if (LINUX)
-    list(INSERT LLPHYSICS_LIBRARIES 0 -Wl,--start-group)
-    list(APPEND LLPHYSICS_LIBRARIES -Wl,--end-group)
-endif (LINUX)
-
-# if (INSTALL_PROPRIETARY AND NOT STANDALONE)
-#   use_prebuilt_binary(llconvexdecomposition)
-#   set(LLCONVEXDECOMP_LIBRARY llconvexdecomposition)
-# else (INSTALL_PROPRIETARY AND NOT STANDALONE)
-#  use_prebuilt_binary(llconvexdecompositionstub)
-#  set(LLCONVEXDECOMP_LIBRARY llconvexdecompositionstub)
-# endif (INSTALL_PROPRIETARY AND NOT STANDALONE)
-
+   if (LINUX)
+       list(INSERT LLPHYSICS_LIBRARIES 0 -Wl,--start-group)
+       list(APPEND LLPHYSICS_LIBRARIES -Wl,--end-group)
+   endif (LINUX)
+else (INSTALL_PROPRIETARY AND NOT STANDALONE)
+endif (INSTALL_PROPRIETARY AND NOT STANDALONE)


BUG: LabelErodeDilate remote module repositories are out of sync

LabelErodeDilate upstream module is:
https://github.com/richardbeare/LabelErodeDilate.git
This repository is cloned in the InsightSoftwareConsortium:
https://github.com/InsightSoftwareConsortium/LabelErodeDilate.git

The two repository are out of sync. The latest commits are in upstream. While
a solution is being found to synchronize these two repositories again, the
remote module will use the upstream version of the module.

Change-Id: Ib814eb6a23cb471447e784a57fbb05625a544371

--- Modules/Remote/LabelErodeDilate.remote.cmake
+++ Modules/Remote/LabelErodeDilate.remote.cmake
@@ -6,7 +6,9 @@
   structuring elements are supported.
   http://www.insight-journal.org/browse/publication/228
   https://hdl.handle.net/10380/3399"
-  #UPSTREAM_GIT_REPOSITORY ${git_protocol}://github.com/richardbeare/LabelErodeDilate.git
-  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/LabelErodeDilate.git
-  GIT_TAG efccdb0b6c8c3dab4d3e6782626ced48b4fc1042
+  #UPSTREAM_GIT_REPOSITORY
+  GIT_REPOSITORY ${git_protocol}://github.com/richardbeare/LabelErodeDilate.git
+  # Clone is not synchronized correctly with upstream.
+  #GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/LabelErodeDilate.git
+  GIT_TAG 55fdb464ad2ea325a6260c997280dc5a1bb029e2
   )


add sml

add sml

Former-commit-id: 0141c6821df848019b23c979dc5e5130118f5a3e

--- applications/plugins/SofaPython/python/python.cmake
+++ applications/plugins/SofaPython/python/python.cmake
@@ -4,4 +4,5 @@
     python/SofaPython/Quaternion.py
     python/SofaPython/units.py
     python/SofaPython/console.py
+    python/SofaPython/sml.py
 )


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}"


adds unit test to boost libs variable

adds unit test to boost libs variable

--- boost.cmake
+++ boost.cmake
@@ -22,7 +22,7 @@
     6a1f32d902203ac70fbec78af95b3cf8
     http://downloads.sourceforge.net/project/boost/boost/1.51.0)

-set (boost_LIBS     ${BUILDEM_LIB_DIR}/libboost_thread.so  ${BUILDEM_LIB_DIR}/libboost_system.so ${BUILDEM_LIB_DIR}/libboost_program_options.so ${BUILDEM_LIB_DIR}/libboost_python.so)
+set (boost_LIBS     ${BUILDEM_LIB_DIR}/libboost_thread.so  ${BUILDEM_LIB_DIR}/libboost_system.so ${BUILDEM_LIB_DIR}/libboost_program_options.so ${BUILDEM_LIB_DIR}/libboost_python.so ${BUILDEM_LIB_DIR}/libboost_unit_test_framework.so)

 # Add layout=tagged param to first boost install to explicitly create -mt libraries
 # some libraries require.  TODO: Possibly shore up all library find paths to only


===GT=== #1924 ===VersionHistory===  Removed support for GCB

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -431,7 +431,6 @@
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/coredumper/0.2)
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/unicoregahp/1.2.0)
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/expat/2.0.1)
-	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/gcb/1.5.6)
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libxml2/2.7.3)
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libvirt/0.6.2)
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libdeltacloud/0.6)
@@ -529,8 +528,8 @@
 ###########################################
 # order of the below elements is important, do not touch unless you know what you are doing.
 # otherwise you will break due to stub collisions.
-set (CONDOR_LIBS "procd_client;daemon_core;daemon_client;procapi;cedar;privsep;${CLASSADS_FOUND};sysapi;ccb;utils;${VOMS_FOUND};${GLOBUS_FOUND};${GCB_FOUND};${EXPAT_FOUND};${PCRE_FOUND}")
-set (CONDOR_TOOL_LIBS "procd_client;daemon_client;procapi;cedar;privsep;${CLASSADS_FOUND};sysapi;ccb;utils;${VOMS_FOUND};${GLOBUS_FOUND};${GCB_FOUND};${EXPAT_FOUND};${PCRE_FOUND}")
+set (CONDOR_LIBS "procd_client;daemon_core;daemon_client;procapi;cedar;privsep;${CLASSADS_FOUND};sysapi;ccb;utils;${VOMS_FOUND};${GLOBUS_FOUND};${EXPAT_FOUND};${PCRE_FOUND}")
+set (CONDOR_TOOL_LIBS "procd_client;daemon_client;procapi;cedar;privsep;${CLASSADS_FOUND};sysapi;ccb;utils;${VOMS_FOUND};${GLOBUS_FOUND};${EXPAT_FOUND};${PCRE_FOUND}")
 set (CONDOR_SCRIPT_PERMS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

 message(STATUS "----- Begin compiler options/flags check -----")


Ticket #2062: Update to only use /scratch when NON-PROPER, otherwise use old loc in BINARY_DIR

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -421,13 +421,17 @@
 if (WINDOWS)
 	set (EXTERNAL_STAGE C:/temp/condor)
 else()
-	# temporarily disable AFS cache.
-	#if ( EXISTS /p/condor/workspaces/externals  )
-	#	set (EXTERNAL_STAGE /p/condor/workspaces/externals/cmake/${OS_NAME}/${SYS_ARCH})
-	#else()
-		# in case someone tries something funky insert OS & ARCH in path
-		set (EXTERNAL_STAGE /scratch/condor_externals) #${OS_NAME}/${SYS_ARCH})
-	#endif()
+	if (PROPER)
+		set (EXTERNAL_STAGE ${CMAKE_CURRENT_BINARY_DIR}/externals/stage/root/${PACKAGE_NAME}_${PACKAGE_VERSION})
+	else()
+		# temporarily disable AFS cache.
+		#if ( EXISTS /p/condor/workspaces/externals  )
+		#	set (EXTERNAL_STAGE /p/condor/workspaces/externals/cmake/${OS_NAME}/${SYS_ARCH})
+		#else()
+			# in case someone tries something funky insert OS & ARCH in path
+			set (EXTERNAL_STAGE /scratch/condor_externals) #${OS_NAME}/${SYS_ARCH})
+		#endif()
+	endif()
 endif(WINDOWS)

 dprint("EXTERNAL_STAGE=${EXTERNAL_STAGE}")


(#4891) Don't include RPATH in PROPER builds

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -600,7 +600,7 @@

 #####################################
 # RPATH option
-if (LINUX)
+if (LINUX AND NOT PROPER)
 	option(CMAKE_SKIP_RPATH "Skip RPATH on executables" OFF)
 else()
 	option(CMAKE_SKIP_RPATH "Skip RPATH on executables" ON)


CELIX-335: Fix for wrong dependency setup for deploy targets

--- cmake/cmake_celix/Packaging.cmake
+++ cmake/cmake_celix/Packaging.cmake
@@ -538,19 +538,25 @@
     get_target_property(DEPS ${DEPLOY_NAME} "DEPLOY_TARGET_DEPS")

     foreach(BUNDLE IN ITEMS ${BD_BUNDLES})
-        set(OUT "${DEPLOY_LOC}/${BD_DIR_NAME}/${BUNDLE}.zip")
-        list(APPEND DEPS "${OUT}")
-
         if (IS_ABSOLUTE ${BUNDLE} AND EXISTS ${BUNDLE})
+            get_filename_component(BUNDLE_FILENAME ${BUNDLE} NAME)
+            set(OUT "${DEPLOY_LOC}/${BD_DIR_NAME}/${BUNDLE_FILENAME}.zip")
             add_custom_command(OUTPUT ${OUT}
                 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${BUNDLE} ${OUT}
+                COMMENT "Copying bundle '${BUNDLE}' to '${DEPLOY_LOC}/${BD_DIR_NAME}'"
+                DEPENDS ${BUNDLE}
             )
         else()
+            set(OUT "${DEPLOY_LOC}/${BD_DIR_NAME}/${BUNDLE}.zip")
             add_custom_command(OUTPUT ${OUT}
                 COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_PROPERTY:${BUNDLE},BUNDLE_FILE>" ${OUT}
-                DEPENDS ${BUNDLE}_bundle
+                COMMENT "Copying bundle '${BUNDLE}' to '${DEPLOY_LOC}/${BD_DIR_NAME}'"
+                DEPENDS ${BUNDLE} #Note cannot directly depends on ${BUNDLE}_bundle, depending in ${BUNDLE} triggering build instead.
             )
+            add_dependencies(${DEPLOY_NAME} ${BUNDLE}_bundle) #ensure the the deploy depends on the _bundle target, custom_command depends on add_library
         endif()
+        list(APPEND DEPS "${OUT}")
+
     endforeach()

     set_target_properties(${DEPLOY_NAME} PROPERTIES "DEPLOY_TARGET_DEPS" "${DEPS}")


Fix cmake TBB lib path on Windows.

Fix cmake TBB lib path on Windows.

--- cmake/external_tbb_prebuilt.cmake
+++ cmake/external_tbb_prebuilt.cmake
@@ -40,16 +40,15 @@
 ExternalProject_Get_Property(ext_tbb SOURCE_DIR)
 set(SOURCE_DIR ${SOURCE_DIR}/${ARCHIVE_FILE_BASE})

+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+    set(TBB_LIB_NAME tbb_debug)
+else()
+    set(TBB_LIB_NAME tbb)
+endif()
+
 if (WIN32)
-    set(TBB_LINK_LIBS
-        ${SOURCE_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}clangTooling${CMAKE_SHARED_LIBRARY_SUFFIX}
-    )
+    set(TBB_LINK_LIBS ${SOURCE_DIR}/lib/intel64/vc14/${TBB_LIB_NAME}.lib)
 elseif(APPLE)
-    if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-        set(TBB_LIB_NAME tbb_debug)
-    else()
-        set(TBB_LIB_NAME tbb)
-    endif()
     set(TBB_LINK_LIBS
         ${NGRAPH_BUILD_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${TBB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
     )


Work around CLion providing -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="".

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -279,7 +279,7 @@
   endif()

   #---Set the library output directory-----------------------
-  if(DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
+  if(DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY AND NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY MATCHES "")
     set(library_output_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
   else()
     set(library_output_dir ${CMAKE_CURRENT_BINARY_DIR})


Revert "[CMake] Unbreak unified builds on Linux"

--- cmake/modules/SwiftExternal.cmake
+++ cmake/modules/SwiftExternal.cmake
@@ -41,24 +41,25 @@
                        swiftSwiftOnoneSupport-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}
                        swiftCore-swiftmodule-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}
                        swiftSwiftOnoneSupport-swiftmodule-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH})
+  endif()

-    ExternalProject_Get_Property(libdispatch install_dir)
-    add_library(dispatch SHARED IMPORTED)
-    set_target_properties(dispatch
-                          PROPERTIES
-                            IMPORTED_LOCATION
-                              ${SWIFT_PATH_TO_LIBDISPATCH_BUILD}/src/${CMAKE_SHARED_LIBRARY_PREFIX}dispatch${CMAKE_SHARED_LIBRARY_SUFFIX}
-                            INTERFACE_INCLUDE_DIRECTORIES
-                              ${install_dir}/include
-                            IMPORTED_LINK_INTERFACE_LIBRARIES
-                              swiftCore-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH})
+  ExternalProject_Get_Property(libdispatch install_dir)
+  add_library(dispatch SHARED IMPORTED)
+  set_target_properties(dispatch
+                        PROPERTIES
+                          IMPORTED_LOCATION
+                            ${SWIFT_PATH_TO_LIBDISPATCH_BUILD}/src/${CMAKE_SHARED_LIBRARY_PREFIX}dispatch${CMAKE_SHARED_LIBRARY_SUFFIX}
+                          INTERFACE_INCLUDE_DIRECTORIES
+                            ${install_dir}/include
+                          IMPORTED_LINK_INTERFACE_LIBRARIES
+                            swiftCore-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH})

-    add_library(BlocksRuntime STATIC IMPORTED)
-    set_target_properties(BlocksRuntime
-                          PROPERTIES
-                            IMPORTED_LOCATION
-                              ${SWIFT_PATH_TO_LIBDISPATCH_BUILD}/${CMAKE_STATIC_LIBRARY_PREFIX}BlocksRuntime${CMAKE_STATIC_LIBRARY_SUFFIX}
-                            INTERFACE_INCLUDE_DIRECTORIES
-                              ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}/src/BlocksRuntime)
-  endif()
+  add_library(BlocksRuntime STATIC IMPORTED)
+  set_target_properties(BlocksRuntime
+                        PROPERTIES
+                          IMPORTED_LOCATION
+                            ${SWIFT_PATH_TO_LIBDISPATCH_BUILD}/${CMAKE_STATIC_LIBRARY_PREFIX}BlocksRuntime${CMAKE_STATIC_LIBRARY_SUFFIX}
+                          INTERFACE_INCLUDE_DIRECTORIES
+                            ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}/src/BlocksRuntime)
 endif()
+


Fix post merge test. This doesn't get triggered as part of gated PR checks. (#3277)

--- cmake/onnxruntime_unittests.cmake
+++ cmake/onnxruntime_unittests.cmake
@@ -360,9 +360,6 @@
 set(all_tests ${onnxruntime_test_common_src} ${onnxruntime_test_ir_src} ${onnxruntime_test_optimizer_src} ${onnxruntime_test_framework_src} ${onnxruntime_test_providers_src})
 if(NOT TARGET onnxruntime)
   list(APPEND all_tests ${onnxruntime_shared_lib_test_SRC})
-  if (NOT onnxruntime_USE_NNAPI)
-    list(APPEND all_tests ${onnxruntime_global_thread_pools_test_SRC})
-  endif()
 endif()
 set(all_dependencies ${onnxruntime_test_providers_dependencies} )


Fix onnxruntime_unittests.cmake after merge.

--- cmake/onnxruntime_unittests.cmake
+++ cmake/onnxruntime_unittests.cmake
@@ -185,6 +185,8 @@
       )
     list(APPEND onnxruntime_test_providers_src ${orttraining_test_trainingops_cuda_src})
   endif()
+endif()
+
 if (onnxruntime_USE_DNNL)
   file(GLOB_RECURSE onnxruntime_test_providers_dnnl_src CONFIGURE_DEPENDS
     "${TEST_SRC_DIR}/providers/dnnl/*"


remove pkg_config from linux config file

--- cmake_includes/config_linux.cmake
+++ cmake_includes/config_linux.cmake
@@ -1,9 +1,3 @@
-option(BUILD_PKG_CONFIG "set BUILD_PKG_CONFIG to ON if pkg-config tool should be built, set to OFF to skip it" OFF)
-if(BUILD_PKG_CONFIG)
-    include(cmake_includes/pkg_config)
-endif(BUILD_PKG_CONFIG)
-
-
 set(COMPILE_DEFINITIONS -Wall -Wno-write-strings -Wno-comment -Wno-unknown-pragmas -Wno-unused-function -Wno-unused-variable -Wno-reorder -Werror)
 set(PTHREAD pthread)
 set(DL dl)


Fixed indentation

Fixed indentation

--- runtime/Cpp/cmake/FindANTLR.cmake
+++ runtime/Cpp/cmake/FindANTLR.cmake
@@ -119,6 +119,6 @@

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(
-  ANTLR
-  REQUIRED_VARS ANTLR_EXECUTABLE Java_JAVA_EXECUTABLE
-  VERSION_VAR ANTLR_VERSION)
+    ANTLR
+    REQUIRED_VARS ANTLR_EXECUTABLE Java_JAVA_EXECUTABLE
+    VERSION_VAR ANTLR_VERSION)


ENH: decrease boost version to 1.54 to avoid incompat with qt

--- CMake/External_boost.cmake
+++ CMake/External_boost.cmake
@@ -17,8 +17,8 @@
   if(UNIX)
     ExternalProject_Add(${proj}
         PREFIX ${proj}
-        URL "http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz/download"
-        URL_MD5 25f9a8ac28beeb5ab84aa98510305299
+        URL "http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz/download"
+        URL_MD5 efbfbff5a85a9330951f243d0a46e4b9
         BINARY_DIR ${BOOST_SB_BUILD_DIR}
         INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
         CMAKE_CACHE_ARGS


COMP: Python version might contain letters as well as numbers

Change-Id: I3c3ac6dd80c19fc9d0dbe650d5a68b47852c8602

--- CMake/FindPythonLibs.cmake
+++ CMake/FindPythonLibs.cmake
@@ -8,6 +8,12 @@
 #  PYTHON_INCLUDE_PATH        - path to where Python.h is found (deprecated)
 #  PYTHON_INCLUDE_DIRS        - path to where Python.h is found
 #  PYTHON_DEBUG_LIBRARIES     - path to the debug library
+#  PYTHON_VERSION             - python version string e.g. 2.7.1
+#  PYTHON_MAJOR_VERSION       - python major version number
+#  PYTHON_MINOR_VERSION       - python minor version number
+#  PYTHON_MICRO_VERSION       - python release version number
+#
+# This code uses the following variables:
 #  Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for

 #=============================================================================
@@ -102,7 +108,7 @@
 # PYTHON_MAJOR_VERSION, PYTHON_MINOR_VERSION, PYTHON_MICRO_VERSION.
 IF(PYTHON_INCLUDE_DIR)
   SET(_VERSION_REGEX
-      "^#define[ \t]+PY([A-Z_]*_VERSION)[ \t]+[\"]*([0-9\\.]+)[\"]*[ \t]*$")
+      "^#define[ \t]+PY([A-Z_]*_VERSION)[ \t]+[\"]*([[0-9A-Za-z\\.]+)[\"]*[ \t]*$")
   FILE(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" _VERSION_STRINGS
        LIMIT_COUNT 10 REGEX ${_VERSION_REGEX})
   FOREACH(_VERSION_STRING ${_VERSION_STRINGS})


From Kristofer Tingdahl, Added missing core OSG libraries.

--- CMakeModules/FindOSG.cmake
+++ CMakeModules/FindOSG.cmake
@@ -96,12 +96,17 @@
         [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
         /usr/freeware/lib64
     )
-
+
     IF( NOT ${MYLIBRARY}_DEBUG)
         IF(MYLIBRARY)
             SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
-         ENDIF(MYLIBRARY)
-    ENDIF( NOT ${MYLIBRARY}_DEBUG)
+        ENDIF(MYLIBRARY)
+    ELSE()
+        IF( NOT MYLIBRARY )
+            SET(${MYLIBRARY} ${${MYLIBRARY}_DEBUG} )
+        ENDIF(NOT MYLIBRARY)
+
+    ENDIF( NOT ${MYLIBRARY}_DEBUG )

 ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)

@@ -111,11 +116,19 @@
 FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
 FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
 FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
+FIND_OSG_LIBRARY(OSGQT_LIBRARY osgQt)
 FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
 FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
 FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
 FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
+FIND_OSG_LIBRARY(OSGMANIPULATOR_LIBRARY osgManipulator)
+FIND_OSG_LIBRARY(OSGANIMATION_LIBRARY osgAnimation)
+FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle)
+FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
+FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation)
+FIND_OSG_LIBRARY(OSGSIM osgSim)
 FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
+

 SET(OSG_FOUND "NO")
 IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)


From Jean-Sebastien Guay, added new version of feetype into search list

--- CMakeModules/Find3rdPartyDependencies.cmake
+++ CMakeModules/Find3rdPartyDependencies.cmake
@@ -52,7 +52,7 @@

 MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
         FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D")
-        FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype219;freetype234;freetype234MT" ${OSG_3RDPARTY_BIN} "_D")
+        FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype219;freetype234;freetype234MT;freetype235" ${OSG_3RDPARTY_BIN} "_D")
         IF(FREETYPE_FOUND)
             #forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
             SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "")


Quick fix to allow app to link against SHARED lib with OpenMP on ARM.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -132,6 +132,11 @@
 if (ARM AND CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_CROSSCOMPILING)
     # Cannot do this in the toolchain file because CMAKE_LIBRARY_ARCHITECTURE is not yet defined when CMake is processing toolchain file
     set (INDIRECT_DEPS_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} -Wl,-rpath-link,\"${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}\":\"${CMAKE_SYSROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE}\"")
+    # Quick fix for linking against SHARED library type with Bullet's OpenMP enabled as it depends on library user to supply the CMake variable expliticly
+    # TODO: Recheck this as it is not needed in other platforms so perhaps this is just an issue with the current Linaro's GCC cross-compiler that we use for CI
+    if (BT_USE_OPENMP)
+        set (INDIRECT_DEPS_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} -fopenmp")
+    endif ()
 endif ()
 set (CMAKE_REQUIRED_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} ${CMAKE_REQUIRED_FLAGS}")
 set (CMAKE_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")


Remove CUDA_cuda_LIBRARY from cmake for now

This isn't building in ubuntu docker images. Will re-evaluate it later
when we update the jit module for v3.

--- CMake/hoomd/FindCUDALibs.cmake
+++ CMake/hoomd/FindCUDALibs.cmake
@@ -91,22 +91,25 @@
     add_library(CUDA::nvrtc UNKNOWN IMPORTED)
 endif()

-if (HIP_PLATFORM STREQUAL "nvcc")
-    # find libraries that go with this compiler
-    find_library(CUDA_cuda_LIBRARY cuda HINTS ${CUDA_LIB_PATH})
-    mark_as_advanced(CUDA_cuda_LIBRARY)
-    if(CUDA_cuda_LIBRARY AND NOT TARGET CUDA::cuda)
-      add_library(CUDA::cuda UNKNOWN IMPORTED)
-      set_target_properties(CUDA::cuda PROPERTIES
-        IMPORTED_LOCATION "${CUDA_cuda_LIBRARY}"
-        INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}"
-      )
-    endif()
-    list(APPEND REQUIRED_CUDA_LIB_VARS "CUDA_cuda_LIBRARY")
-else()
-    # define empty target
-    add_library(CUDA::cuda UNKNOWN IMPORTED)
-endif()
+# Temporarily remove, this is only used in JIT which doesn't build now
+# We should evaluate if it is necessary. Some OS installations store
+# libcuda.so in different locations as it installs with the driver, not the runtime
+# if (HIP_PLATFORM STREQUAL "nvcc")
+#     # find libraries that go with this compiler
+#     find_library(CUDA_cuda_LIBRARY cuda HINTS ${CUDA_LIB_PATH})
+#     mark_as_advanced(CUDA_cuda_LIBRARY)
+#     if(CUDA_cuda_LIBRARY AND NOT TARGET CUDA::cuda)
+#       add_library(CUDA::cuda UNKNOWN IMPORTED)
+#       set_target_properties(CUDA::cuda PROPERTIES
+#         IMPORTED_LOCATION "${CUDA_cuda_LIBRARY}"
+#         INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}"
+#       )
+#     endif()
+#     list(APPEND REQUIRED_CUDA_LIB_VARS "CUDA_cuda_LIBRARY")
+# else()
+#     # define empty target
+#     add_library(CUDA::cuda UNKNOWN IMPORTED)
+# endif()

 endif()


CMake: Fix FIND_SYSTEM_LIBRARY macro

CMake: Fix FIND_SYSTEM_LIBRARY macro

--- cmake/macros/macro_find_system_library.cmake
+++ cmake/macros/macro_find_system_library.cmake
@@ -42,7 +42,7 @@
       ENDIF()
     ENDFOREACH()

-    IF(NOT _variable)
+    IF(NOT ${_variable})
       SET(${_variable} "${_variable}-NOTFOUND")
     ENDIF()
   ENDIF()


build: remove superfluous options

build: remove superfluous options

These options were already being enabled through the use of `-Wall` or
`-Wextra`.  This shrinks the command line and reduces build file
generation times.

--- cmake/modules/DispatchCompilerWarnings.cmake
+++ cmake/modules/DispatchCompilerWarnings.cmake
@@ -8,21 +8,9 @@
     add_compile_options(-Werror)
     add_compile_options(-Wall)
     add_compile_options(-Wextra)
-    add_compile_options(-Wmissing-field-initializers)
     add_compile_options(-Wmissing-prototypes)
     add_compile_options(-Wdocumentation)
     add_compile_options(-Wunreachable-code)
-    add_compile_options(-Wmissing-braces)
-    add_compile_options(-Wparentheses)
-    add_compile_options(-Wswitch)
-    add_compile_options(-Wunused-function)
-    add_compile_options(-Wunused-label)
-    add_compile_options(-Wunused-parameter)
-    add_compile_options(-Wunused-variable)
-    add_compile_options(-Wunused-value)
-    add_compile_options(-Wempty-body)
-    add_compile_options(-Wuninitialized)
-    add_compile_options(-Wunknown-pragmas)
     add_compile_options(-Wshadow)
     add_compile_options(-Wconversion)
     add_compile_options(-Wconstant-conversion)
@@ -30,9 +18,7 @@
     add_compile_options(-Wbool-conversion)
     add_compile_options(-Wenum-conversion)
     add_compile_options(-Wassign-enum)
-    add_compile_options(-Wsign-compare)
     add_compile_options(-Wshorten-64-to-32)
-    add_compile_options(-Wpointer-sign)
     add_compile_options(-Wnewline-eof)
     add_compile_options(-Wdeprecated-declarations)
     add_compile_options(-Wsign-conversion)
@@ -49,8 +35,6 @@
     add_compile_options(-Wexpansion-to-defined)
     add_compile_options(-Wfloat-equal)
     add_compile_options(-Widiomatic-parentheses)
-    add_compile_options(-Wignored-qualifiers)
-    add_compile_options(-Wimplicit-fallthrough)
     add_compile_options(-Wnullable-to-nonnull-conversion)
     add_compile_options(-Wobjc-interface-ivars)
     add_compile_options(-Wover-aligned)
@@ -60,7 +44,6 @@
     add_compile_options(-Wstatic-in-inline)
     add_compile_options(-Wsuper-class-method-mismatch)
     add_compile_options(-Wswitch-enum)
-    add_compile_options(-Wtautological-compare)
     add_compile_options(-Wunguarded-availability)
     add_compile_options(-Wunused)


tabs -> spaces :-)

tabs -> spaces :-)

--- cmakemodules/script_show_final_summary.cmake
+++ cmakemodules/script_show_final_summary.cmake
@@ -128,7 +128,7 @@
 SHOW_CONFIG_LINE_SYSTEM("Has PCL (Pointscloud library)           " CMAKE_MRPT_HAS_PCL  "[Version: ${PCL_VERSION}]")
 IF(NOT UNIX)	# In fact, it's not "support for Bumblebee" but for it thru PGR vendor libraries.
 SHOW_CONFIG_LINE("Has PGR Digiclops/Triclops              " CMAKE_MRPT_HAS_BUMBLEBEE)
-SHOW_CONFIG_LINE("Has DUO3D Camera libs             	  	" CMAKE_MRPT_HAS_DUO3D)
+SHOW_CONFIG_LINE("Has DUO3D Camera libs                   " CMAKE_MRPT_HAS_DUO3D)
 ENDIF(NOT UNIX)
 SHOW_CONFIG_LINE("Has PGR FlyCapture2                     " CMAKE_MRPT_HAS_FLYCAPTURE2)
 SHOW_CONFIG_LINE("Has SuiteSparse                         " CMAKE_MRPT_HAS_SUITESPARSE)


COMP: 57 - Properly reset GeneratedSource list in cache

The SimpleITKBasicFiltersGeneratedSource list was not getting cleared out in
the cache between configurations, so it was continuously being added to. This
was directly causing a problem when switch what filters were being generated on
different branches, but it was also a problem because the cache was growing
out of control even with out fixing branches. All fixed now

SIMPLEITK-57

--- CMake/generate_filter_source.cmake
+++ CMake/generate_filter_source.cmake
@@ -39,6 +39,9 @@

   # Get the name of the current directory
   get_filename_component(directory_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+
+  # Clear out the GeneratedSource list in the cache
+  set (SimpleITK${directory_name}GeneratedSource "" CACHE INTERNAL "")

   ######
   # Perform template expansion


minor changes

minor changes

--- cmaki.cmake
+++ cmaki.cmake
@@ -287,25 +287,27 @@
 		# 	SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lgomp -lrt")
 		# endif()
 	else()
-		# c++ exceptions and RTTI
-		#add_definitions(/D_HAS_EXCEPTIONS=0)
-		#add_definitions(/GR-)
-		add_definitions(/wd4251)
-		add_definitions(/wd4275)
-		# Avoid warning as error with / WX / W4
-		# conversion from 'std::reference_wrapper<Chunk>' to 'std::reference_wrapper<Chunk> &
-		add_definitions(/wd4239)
-		# warning C4316: 'PhysicsManager' : object allocated on the heap may not be aligned 16
-		add_definitions(/wd4316)
-		# conditional expression is constant
-		add_definitions(/wd4127)
-		# conversion from 'int' to 'unsigned int', signed/unsigned mismatch
-		add_definitions(/wd4245)
-		# declaration of 'next' hides class membe
-		add_definitions(/wd4458)
-
-		add_definitions(/WX /W4)
-		add_definitions(-Zm200)
+		if(NOT MINGW AND NOT MSYS)
+			# c++ exceptions and RTTI
+			#add_definitions(/D_HAS_EXCEPTIONS=0)
+			#add_definitions(/GR-)
+			add_definitions(/wd4251)
+			add_definitions(/wd4275)
+			# Avoid warning as error with / WX / W4
+			# conversion from 'std::reference_wrapper<Chunk>' to 'std::reference_wrapper<Chunk> &
+			add_definitions(/wd4239)
+			# warning C4316: 'PhysicsManager' : object allocated on the heap may not be aligned 16
+			add_definitions(/wd4316)
+			# conditional expression is constant
+			add_definitions(/wd4127)
+			# conversion from 'int' to 'unsigned int', signed/unsigned mismatch
+			add_definitions(/wd4245)
+			# declaration of 'next' hides class membe
+			add_definitions(/wd4458)
+
+			add_definitions(/WX /W4)
+			add_definitions(-Zm200)
+		endif()
 	endif()

 	# include_directories(BEFORE ${TOOLCHAIN_ROOT}/include)
@@ -316,9 +318,11 @@
 macro(enable_modern_cpp)

 	if(WIN32)
-		add_definitions(/EHsc)
-		#add_definitions(/GR-)
-		#add_definitions(/D_HAS_EXCEPTIONS=0)
+		if(NOT MINGW AND NOT MSYS)
+			add_definitions(/EHsc)
+			#add_definitions(/GR-)
+			#add_definitions(/D_HAS_EXCEPTIONS=0)
+		endif()
 	else()
 		# add_definitions(-fno-rtti -fno-exceptions )
 		# activate all warnings and convert in errors
@@ -395,7 +399,7 @@
 	endif()

 	if (NOT DEFINED EXTRA_DEF)
-		if(NOT WIN32)
+		if(NOT WIN32 OR MINGW OR MSYS)
 			include(CheckCXXCompilerFlag)
 			CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
 			CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)


modify readilwork test for new command line args

--- phSolver/common/test/testing.cmake
+++ phSolver/common/test/testing.cmake
@@ -9,10 +9,10 @@

 common_parallel_test(readHeader 4 ${CASES}/incompressible
   ${PHASTA_BINARY_DIR}/bin/phIOreadheader 2)
-common_parallel_test(readIlwork 1
+common_parallel_test(readIlwork 4
   ${CASES}/crossflow/4-1chef/4-procs_case
   ${PHASTA_BINARY_DIR}/bin/phIOreadIlwork
-  geombc.dat.1 1)
+  . 0 0 foo)
 common_parallel_test(readHeaderMultiTopo 4
   ${CASES}/crossflow/4-1chef/4-procs_case
   ${PHASTA_BINARY_DIR}/bin/phIOposixMultiTopo)


modules: updated FindCorrade.cmake.

modules: updated FindCorrade.cmake.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -50,10 +50,6 @@
 #  CORRADE_TARGET_EMSCRIPTEN    - Defined if compiled for Emscripten
 #  CORRADE_TARGET_ANDROID       - Defined if compiled for Android
 #
-# If CORRADE_BUILD_DEPRECATED is defined, the CORRADE_INCLUDE_DIR variable also
-# contains path directly to Corrade directory (i.e. for includes without
-# Corrade/ prefix).
-#
 # Corrade provides these macros and functions:
 #
 #
@@ -169,7 +165,7 @@
 find_program(CORRADE_RC_EXECUTABLE corrade-rc)

 # Include dir
-find_path(_CORRADE_INCLUDE_DIR
+find_path(CORRADE_INCLUDE_DIR
     NAMES Corrade/PluginManager Corrade/Utility)

 # CMake module dir
@@ -183,7 +179,7 @@
     CORRADE_INTERCONNECT_LIBRARY
     CORRADE_PLUGINMANAGER_LIBRARY
     CORRADE_TESTSUITE_LIBRARY
-    _CORRADE_INCLUDE_DIR
+    CORRADE_INCLUDE_DIR
     CORRADE_RC_EXECUTABLE
     _CORRADE_MODULE_DIR)

@@ -192,7 +188,7 @@
 endif()

 # Read flags from fonfiguration
-file(READ ${_CORRADE_INCLUDE_DIR}/Corrade/configure.h _corradeConfigure)
+file(READ ${CORRADE_INCLUDE_DIR}/Corrade/configure.h _corradeConfigure)
 set(_corradeFlags
     GCC47_COMPATIBILITY
     BUILD_DEPRECATED
@@ -229,15 +225,7 @@
     set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARIES} log)
 endif()

-mark_as_advanced(_CORRADE_INCLUDE_DIR
-    _CORRADE_MODULE_DIR)
-
-# Add Corrade dir to include path if this is deprecated build
-if(CORRADE_BUILD_DEPRECATED)
-    set(CORRADE_INCLUDE_DIR ${_CORRADE_INCLUDE_DIR} ${CORRADE_INCLUDE_DIR}/Corrade)
-else()
-    set(CORRADE_INCLUDE_DIR ${_CORRADE_INCLUDE_DIR})
-endif()
+mark_as_advanced(_CORRADE_MODULE_DIR)

 # Finalize the finding process
 include(${CORRADE_USE_MODULE})


BUG: Update the Strain remote module to 2017-05-05

Change-Id: Icaeed766276f6b9c3eee5ac2a4ba8c7d8716dc1b

--- Modules/Remote/Strain.remote.cmake
+++ Modules/Remote/Strain.remote.cmake
@@ -12,5 +12,5 @@
   http://insight-journal.org/browse/publication/984
 "
   GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/ITKStrain.git
-  GIT_TAG 1a9787759bb54068f759a56a0651a87c6c7fa8d1
+  GIT_TAG f309a9efe43f472f14de4bf376b22e99ed377b79
   )


boost use script: interprocess dependency

see issue https://github.com/smanders/externpro/issues/308#issuecomment-904214709

--- projects/use/usexp-boost-config.cmake
+++ projects/use/usexp-boost-config.cmake
@@ -24,6 +24,27 @@
 set(boostPath ${XP_ROOTDIR}/lib/cmake/Boost-${BOOST_VER})
 find_package(Boost ${BOOST_VER} REQUIRED ALL PATHS ${boostPath} NO_DEFAULT_PATH)
 mark_as_advanced(Boost_DIR)
+if(UNIX)
+  include(CheckLibraryExists)
+  function(checkLibraryConcat lib symbol liblist)
+    string(TOUPPER ${lib} LIB)
+    check_library_exists("${lib}" "${symbol}" "" XP_BOOST_HAS_${LIB})
+    if(XP_BOOST_HAS_${LIB})
+      list(APPEND ${liblist} ${lib})
+      set(${liblist} ${${liblist}} PARENT_SCOPE)
+    endif()
+  endfunction()
+  checkLibraryConcat(rt shm_open headersDeps) # req'd by interprocess
+  if(DEFINED headersDeps AND TARGET Boost::headers)
+    get_target_property(libs Boost::headers INTERFACE_LINK_LIBRARIES)
+    if(libs)
+      list(APPEND libs ${headersDeps})
+    else()
+      set(libs ${headersDeps})
+    endif()
+    set_target_properties(Boost::headers PROPERTIES INTERFACE_LINK_LIBRARIES "${libs}")
+  endif()
+endif()
 set(${PRJ}_LIBRARIES ${Boost_LIBRARIES})
 set(reqVars ${PRJ}_VERSION ${PRJ}_LIBRARIES)
 include(FindPackageHandleStandardArgs)


Fixing indenting

Fixing indenting

Change-Id: I0fd467dd296642bf54ca2c19d36a307c4c99605d

--- SuperBuild/External_SimpleITKExamples.cmake
+++ SuperBuild/External_SimpleITKExamples.cmake
@@ -8,24 +8,24 @@

 if (${BUILD_EXAMPLES} )

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

-ExternalProject_Add(${proj}
-  DOWNLOAD_COMMAND ""
-  UPDATE_COMMAND ""
-  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../Examples
-  BINARY_DIR ${proj}-build
-  CMAKE_GENERATOR ${gen}
-  CMAKE_ARGS
-    --no-warn-unused-cli
-    -C "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt"
-    ${ep_common_args}
-    -DSimpleITK_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SimpleITK-0.9/
-    -DCMAKE_SKIP_RPATH:BOOL=ON
-    -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-  BUILD_COMMAND ${BUILD_COMMAND_STRING}
-  INSTALL_COMMAND ""
-  DEPENDS "${SimpleITKExamples_DEPENDENCIES}"
-  )
+  ExternalProject_Add(${proj}
+    DOWNLOAD_COMMAND ""
+    UPDATE_COMMAND ""
+    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../Examples
+    BINARY_DIR ${proj}-build
+    CMAKE_GENERATOR ${gen}
+    CMAKE_ARGS
+      --no-warn-unused-cli
+      -C "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt"
+      ${ep_common_args}
+      -DSimpleITK_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SimpleITK-0.9/
+      -DCMAKE_SKIP_RPATH:BOOL=ON
+      -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+    BUILD_COMMAND ${BUILD_COMMAND_STRING}
+    INSTALL_COMMAND ""
+    DEPENDS "${SimpleITKExamples_DEPENDENCIES}"
+    )

 endif()


only set /Zc:__cplusplus in msvc 15.7 or upper

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -156,9 +156,12 @@
 elseif(MSVC)
     add_definitions(/MP /W4 /wd"4100" /wd"4125" /EHsc)
     if (MSVC_VERSION GREATER_EQUAL 1910)
-        # 设置 __cplusplus 宏为标准值, @see https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/
-        add_definitions(/std:c++17 /Zc:__cplusplus)
+        add_definitions(/std:c++17)
         message(STATUS "MSVC ${MSVC_VERSION} found. using /std:c++17")
+    endif()
+    # 设置 __cplusplus 宏为标准值, @see https://docs.microsoft.com/zh-cn/cpp/build/reference/zc-cplusplus
+    if (MSVC_VERSION GREATER_EQUAL 1914)
+        add_definitions(/Zc:__cplusplus)
     endif()
 endif()


PKG: check MVD and OTB dependencies only if OTB_OF_SOURCE_BUILD is false

--- SuperBuild/Packaging/PMacros.cmake
+++ SuperBuild/Packaging/PMacros.cmake
@@ -57,18 +57,27 @@
       COMMAND ${CMAKE_COMMAND} --build "." --target install
       WORKING_DIRECTORY "${Monteverdi_BINARY_DIR}"
       )
-  else() #Unxies Using SuperBuild
-    if(ENABLE_MONTEVERDI)
+  else() #Using SuperBuild
+    #For out of source build,
+    #we assume the otb is built correctly with superbuild
+    if(OUT_OF_SOURCE_BUILD)
       add_custom_target(PACKAGE-${pkg}-check
-        COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check"
-	DEPENDS MVD
-        )
+        COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check")
+    else(OUT_OF_SOURCE_BUILD)
+      if(ENABLE_MONTEVERDI)
+        add_custom_target(PACKAGE-${pkg}-check
+          COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check"
+	  DEPENDS MVD
+          WORKING_DIRECTORY ${SUPERBUILD_BINARY_DIR}
+          )
       else(ENABLE_MONTEVERDI)
-      add_custom_target(PACKAGE-${pkg}-check
-        COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check"
-	DEPENDS OTB
-        )
-    endif(ENABLE_MONTEVERDI)
+        add_custom_target(PACKAGE-${pkg}-check
+          COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check"
+	  DEPENDS OTB
+          WORKING_DIRECTORY ${SUPERBUILD_BINARY_DIR}
+          )
+      endif(ENABLE_MONTEVERDI)
+    endif(OUT_OF_SOURCE_BUILD)
   endif()

   add_dependencies(PACKAGE-${pkg}-check PACKAGE-TOOLS)


Not sure but we have a problem on it. To be checked by cmake Guru \!

--- salome_adm/cmake_files/FindSalomeVTK.cmake
+++ salome_adm/cmake_files/FindSalomeVTK.cmake
@@ -26,7 +26,6 @@

 # List the required components:
 SET(SalomeVTK_COMPONENTS
-  vtkRenderingFreeTypeOpenGL
   vtkRenderingLOD
   vtkRenderingAnnotation
   vtkFiltersParallel


BUG: typo CMAE -> CMAKE

BUG: typo CMAE -> CMAKE

--- SuperBuild/CMake/External_geotiff.cmake
+++ SuperBuild/CMake/External_geotiff.cmake
@@ -49,7 +49,7 @@
   -DBUILD_TESTING:BOOL=OFF
   -DPROJ4_OSGEO4W_HOME:PATH=${SB_INSTALL_PREFIX}
   ${GEOTIFF_SB_CONFIG}
-  CMAKE_COMMAND ${SB_CMAE_COMMAND}
+  CMAKE_COMMAND ${SB_CMAKE_COMMAND}
   LOG_DOWNLOAD 1
   LOG_CONFIGURE 1
   LOG_BUILD 1


Added extra hints for finding Tesseract includes

--- src/cmake_modules/FindTesseract.cmake
+++ src/cmake_modules/FindTesseract.cmake
@@ -14,28 +14,36 @@
 find_path(Tesseract_INCLUDE_BASEAPI_DIR
   NAMES tesseract/baseapi.h
   HINTS "/usr/include"
+        "/usr/include/tesseract"
         "/usr/local/include"
+        "/usr/local/include/tesseract"
         ${Tesseract_PKGCONF_INCLUDE_DIRS}
 		${CMAKE_SOURCE_DIR}/../libraries/tesseract-ocr/api/
 )
 find_path(Tesseract_INCLUDE_CCSTRUCT_DIR
   NAMES publictypes.h
   HINTS "/usr/include"
+        "/usr/include/tesseract"
         "/usr/local/include"
+        "/usr/local/include/tesseract"
         ${Tesseract_PKGCONF_INCLUDE_DIRS}
 		${CMAKE_SOURCE_DIR}/../libraries/tesseract-ocr/ccstruct/
 )
 find_path(Tesseract_INCLUDE_CCMAIN_DIR
   NAMES thresholder.h
   HINTS "/usr/include"
+        "/usr/include/tesseract"
         "/usr/local/include"
+        "/usr/local/include/tesseract"
         ${Tesseract_PKGCONF_INCLUDE_DIRS}
 		${CMAKE_SOURCE_DIR}/../libraries/tesseract-ocr/ccmain/
 )
 find_path(Tesseract_INCLUDE_CCUTIL_DIR
   NAMES platform.h
   HINTS "/usr/include"
+        "/usr/include/tesseract"
         "/usr/local/include"
+        "/usr/local/include/tesseract"
         ${Tesseract_PKGCONF_INCLUDE_DIRS}
 		${CMAKE_SOURCE_DIR}/../libraries/tesseract-ocr/ccutil/
 )


Make test depends on the transformation

Make test depends on the transformation

Part of #18

--- test/base_test.cmake
+++ test/base_test.cmake
@@ -57,6 +57,7 @@
 if(NOT IGNORE_TEST)
   # Compare reference transformed code and output of the transformation
   add_test(NAME ast-transform-${TEST_NAME} COMMAND diff ${OUTPUT_FILE} ${REFERENCE_FILE})
+  set_tests_properties(ast-transform-${TEST_NAME} PROPERTIES DEPENDS transform-${TEST_NAME})
   # Compare the output of both executable
   if(OUTPUT_TEST)
     set (TEST_PARAMETERS "<(./${EXECUTABLE_ORIGINAL}) <(./${EXECUTABLE_TRANSFORMED})")


debugging messages

debugging messages

--- PyPort/system-python.cmake
+++ PyPort/system-python.cmake
@@ -8,7 +8,9 @@

 	#find python headers
 	file(GLOB_RECURSE PYTHON_H ${PYTHON_HOME}/*Python.h)
+	message("Globbed ${PYTHON_H}")
 	string(REGEX MATCH "python3.[0-9]+m" PYTHON_VER "${PYTHON_H}")
+	message("Version string: ${PYTHON_VER}")
 	find_path(PYTHON_INCLUDE_DIRS Python.h
 		PATHS ${PYTHON_HOME}/include/${PYTHON_VER} ${PYTHON_HOME}/local/include/${PYTHON_VER}
 		NO_DEFAULT_PATH
@@ -17,12 +19,12 @@
 	if(PYTHON_INCLUDE_DIRS)
 		message("Python.h found: ${PYTHON_INCLUDE_DIRS}")
 	else()
-		message(FATAL_ERROR "Can't find Python.h in ${PYTHON_HOME}" )
+		message("Can't find Python.h in ${PYTHON_HOME}" )
 	endif()

 	#import the python lib
 	find_library(PYTHON_LIB NAMES ${PYTHON_VER} lib${PYTHON_VER}
-		PATHS ${PYTHON_HOME}/lib ${PYTHON_HOME}/local/lib
+		PATHS ${PYTHON_HOME}/lib ${PYTHON_HOME}/local/lib ${PYTHON_HOME}/lib64 ${PYTHON_HOME}/local/lib64
 		PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE}
 		NO_DEFAULT_PATH
 		CMAKE_FIND_ROOT_PATH_BOTH)


flatbuffers: use script enhancements

flatbuffers: use script enhancements

* rename FLATBUFFERS_FLATC to FLATBUFFERS_FLATC_EXECUTABLE
  * this is the name BuildFlatBuffers.cmake expects
* provide xpFlatBuffersBuild() cmake function
  * wrapper function around build_flatbuffers (from BuildFlatBuffers.cmake)
* issue https://github.com/smanders/externpro/issues/283

--- projects/use/usexp-flatbuffers-config.cmake
+++ projects/use/usexp-flatbuffers-config.cmake
@@ -1,7 +1,7 @@
 # FLATBUFFERS_FOUND - flatbuffers was found
 # FLATBUFFERS_VER - flatbuffers version
 # FLATBUFFERS_LIBRARIES - the flatbuffers libraries
-# FLATBUFFERS_FLATC - the flatbuffers compiler executable
+# FLATBUFFERS_FLATC_EXECUTABLE - the flatbuffers compiler executable
 set(prj flatbuffers)
 # this file (-config) installed to share/cmake
 get_filename_component(XP_ROOTDIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE)
@@ -11,9 +11,39 @@
 # flatbuffers installs a config file which includes all Targets.cmake files
 include(${XP_ROOTDIR}/lib/cmake/${prj}_@VER@/FlatbuffersConfig.cmake)
 set(${PRJ}_LIBRARIES xpro::flatbuffers)
-set(${PRJ}_FLATC xpro::flatc)
-set(reqVars ${PRJ}_VER ${PRJ}_LIBRARIES ${PRJ}_FLATC)
+set(${PRJ}_FLATC_EXECUTABLE xpro::flatc)
+include(${XP_ROOTDIR}/lib/cmake/${prj}_@VER@/BuildFlatBuffers.cmake) # build_flatbuffers cmake function
+set(reqVars ${PRJ}_VER ${PRJ}_LIBRARIES ${PRJ}_FLATC_EXECUTABLE)
 include(FindPackageHandleStandardArgs)
 set(FPHSA_NAME_MISMATCHED TRUE) # find_package_handle_standard_args NAME_MISMATCHED (prefix usexp-)
 find_package_handle_standard_args(${prj} REQUIRED_VARS ${reqVars})
 mark_as_advanced(${reqVars})
+function(xpFlatBuffersBuild)
+  set(options PUBLIC_INCLUDES)
+  set(oneValueArgs TARGET CUSTOM_TARGET_NAME GENERATED_INCLUDES_DIR BINARY_SCHEMAS_DIR COPY_TEXT_SCHEMAS_DIR)
+  set(multiValueArgs SCHEMAS SCHEMA_INCLUDE_DIRS ADDITIONAL_DEPS)
+  cmake_parse_arguments(P "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+  if(NOT P_CUSTOM_TARGET_NAME)
+    if(P_TARGET)
+      set(P_CUSTOM_TARGET_NAME ${P_TARGET}_fbs)
+    else()
+      set(P_CUSTOM_TARGET_NAME ${PROJECT_NAME}_fbs)
+    endif()
+  endif()
+  if(NOT P_GENERATED_INCLUDES_DIR)
+    set(P_GENERATED_INCLUDES_DIR ${CMAKE_CURRENT_BINARY_DIR}/fbs)
+  endif()
+  build_flatbuffers("${P_SCHEMAS}" "${P_SCHEMA_INCLUDE_DIRS}" ${P_CUSTOM_TARGET_NAME}
+    "${P_ADDITIONAL_DEPS}" "${P_GENERATED_INCLUDES_DIR}"
+    "${P_BINARY_SCHEMAS_DIR}" "${P_COPY_TEXT_SCHEMAS_DIR}"
+    )
+  if(P_TARGET)
+    if(P_PUBLIC_INCLUDES)
+      set(scope PUBLIC)
+    else()
+      set(scope PRIVATE)
+    endif()
+    add_dependencies(${P_TARGET} ${P_CUSTOM_TARGET_NAME})
+    target_include_directories(${P_TARGET} ${scope} ${P_GENERATED_INCLUDES_DIR})
+  endif()
+endfunction()


BUG: Write initial cache to the top level

--- CMake/DashboardScripts/cmakecache.cmake
+++ CMake/DashboardScripts/cmakecache.cmake
@@ -39,7 +39,6 @@
 set( CTEST_QMAKE_COMMAND "${SITE_QMAKE_COMMAND}" )

 set( GITCOMMAND "${SITE_GIT_COMMAND}" )
-set( CVSCOMMAND "${SITE_CVS_COMMAND}" )
 set( SVNCOMMAND "${SITE_SVN_COMMAND}" )
 set( GIT_EXECUTABLE "${SITE_GIT_COMMAND}" )

@@ -64,7 +63,7 @@

 message( "Running ${SCRIPT_NAME} script..." )

-file( WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
+file( WRITE "${TUBETK_BINARY_DIR}/CMakeCache.txt" "
   SITE:STRING=${CTEST_SITE}
   BUILDNAME:STRING=${CTEST_BUILD_NAME}
   BUILD_TESTING:BOOL=ON
@@ -79,7 +78,6 @@
   MAKECOMMAND:FILEPATH=${CTEST_BUILD_COMMAND}
   GITCOMMAND:FILEPATH=${GITCOMMAND}
   SVNCOMMAND:FILEPATH=${SVNCOMMAND}
-  CVSCOMMAND:FILEPATH=${CVSCOMMAND}
   GIT_EXECUTABLE:FILEPATH=${GITCOMMAND}
   QT_QMAKE_EXECUTABLE:FILEPATH=${CTEST_QMAKE_COMMAND}
   TubeTK_USE_SUPERBUILD:BOOL=${SCRIPT_TubeTK_USE_SUPERBUILD}
@@ -87,35 +85,35 @@
   " )

 if( EXISTS ${TUBETK_BINARY_DIR}/Insight-Build/CMakeCache.txt )
-  file( APPEND "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt"
+  file( APPEND "${TUBETK_BINARY_DIR}/CMakeCache.txt"
     "
     ITK_DIR:PATH=${TUBETK_BINARY_DIR}/Insight-Build
     " )
 endif()

 if( EXISTS ${TUBETK_BINARY_DIR}/GenerateCLP-Build/CMakeCache.txt)
-  file( APPEND "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt"
+  file( APPEND "${TUBETK_BINARY_DIR}/CMakeCache.txt"
     "
     GenerateCLP_DIR:PATH=${TUBETK_BINARY_DIR}/GenerateCLP-Build
     " )
 endif()

 if( EXISTS ${TUBETK_BINARY_DIR}/SlicerExecutionModel-Build/CMakeCache.txt)
-  file( APPEND "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt"
+  file( APPEND "${TUBETK_BINARY_DIR}/CMakeCache.txt"
     "
     SlicerExecutionModel_DIR:PATH=${TUBETK_BINARY_DIR}/SlicerExecutionModel-Build
     " )
 endif()

 if( EXISTS ${TUBETK_BINARY_DIR}/CTK-Build/CMakeCache.txt )
-  file( APPEND "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt"
+  file( APPEND "${TUBETK_BINARY_DIR}/CMakeCache.txt"
     "
     CTK_DIR:PATH=${TUBETK_BINARY_DIR}/CTK-Build
     " )
 endif()

 if( EXISTS ${TUBETK_BINARY_DIR}/VTK-Build/CMakeCache.txt )
-  file( APPEND "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt"
+  file( APPEND "${TUBETK_BINARY_DIR}/CMakeCache.txt"
     "
     VTK_DIR:PATH=${TUBETK_BINARY_DIR}/VTK-Build
     " )


add Mathematica_WSTP_FIND_VERSION_MINOR

add Mathematica_WSTP_FIND_VERSION_MINOR

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -984,7 +984,9 @@
 		endif()
 	elseif (APPLE)
 		if (Mathematica_USE_STATIC_LIBRARIES)
-			if (DEFINED Mathematica_WSTP_FIND_VERSION_MAJOR)
+			if (DEFINED Mathematica_WSTP_FIND_VERSION_MAJOR AND DEFINED Mathematica_WSTP_FIND_VERSION_MINOR)
+				set (${_outLibraryNames} "libWSTPi${Mathematica_WSTP_FIND_VERSION_MAJOR}.${Mathematica_WSTP_FIND_VERSION_MINOR}.a")
+			elseif (DEFINED Mathematica_WSTP_FIND_VERSION_MAJOR)
 				set (${_outLibraryNames} "libWSTPi${Mathematica_WSTP_FIND_VERSION_MAJOR}.a")
 			else()
 				set (${_outLibraryNames} "libWSTPi4.a" "libWSTPi3.a")
@@ -1751,9 +1753,15 @@
 		NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
 	)
 	if (APPLE AND DEFINED Mathematica_WSTP_FIND_VERSION_MAJOR AND IS_DIRECTORY "${Mathematica_WSTP_LIBRARY}")
-		set (_frameworkVersionSubDir "${Mathematica_WSTP_LIBRARY}/Versions/${Mathematica_WSTP_FIND_VERSION_MAJOR}.[0-9][0-9]")
+		if (DEFINED Mathematica_WSTP_FIND_VERSION_MINOR)
+			set (_frameworkVersionSubDir "${Mathematica_WSTP_LIBRARY}/Versions/${Mathematica_WSTP_FIND_VERSION_MAJOR}.${Mathematica_WSTP_FIND_VERSION_MINOR}")
+		else()
+			set (_frameworkVersionSubDir "${Mathematica_WSTP_LIBRARY}/Versions/${Mathematica_WSTP_FIND_VERSION_MAJOR}.[0-9]+")
+		endif()
 		file (GLOB _versionedLibrary "${_frameworkVersionSubDir}/wstp")
 		if (_versionedLibrary)
+			# use last if there are multiple
+			list (GET _versionedLibrary -1 _versionedLibrary)
 			set (Mathematica_WSTP_LIBRARY "${_versionedLibrary}" CACHE FILEPATH "WSTP library to link against." FORCE)
 		endif()
 		file (GLOB _versionedHeaderDir "${_frameworkVersionSubDir}/Headers")
@@ -2234,7 +2242,8 @@
 		message (STATUS "Find MathLink interface version: ${Mathematica_MathLink_FIND_VERSION_MAJOR}")
 		message (STATUS "Find MathLink revision number: ${Mathematica_MathLink_FIND_VERSION_MINOR}")
 		message (STATUS "Find required WSTP: ${Mathematica_FIND_REQUIRED_WSTP}")
-		message (STATUS "Find WSTP major version: ${Mathematica_WSTP_FIND_VERSION_MAJOR}")
+		message (STATUS "Find WSTP interface version: ${Mathematica_WSTP_FIND_VERSION_MAJOR}")
+		message (STATUS "Find WSTP revision number: ${Mathematica_WSTP_FIND_VERSION_MINOR}")
 		message (STATUS "Find required WolframLibrary: ${Mathematica_FIND_REQUIRED_WolframLibrary}")
 		message (STATUS "Find required J/Link: ${Mathematica_FIND_REQUIRED_JLink}")
 		message (STATUS "Find required MUnit: ${Mathematica_FIND_REQUIRED_MUnit}")
@@ -2359,6 +2368,7 @@
 		Mathematica_MathLink_ROOT_DIR
 		Mathematica_MathLink_HOST_ROOT_DIR
 		Mathematica_WSTP_FIND_VERSION_MAJOR
+		Mathematica_WSTP_FIND_VERSION_MINOR
 		Mathematica_WSTP_ROOT_DIR
 		Mathematica_WSTP_HOST_ROOT_DIR
 		Mathematica_JLink_PACKAGE_DIR
@@ -2445,7 +2455,8 @@
 		list (APPEND ${_outDependentVars}
 			Mathematica_WSTP_HOST_INCLUDE_DIR
 			Mathematica_WSTP_WSPREP_EXECUTABLE)
-	elseif ("_${_var}" STREQUAL "_Mathematica_WSTP_FIND_VERSION_MAJOR")
+	elseif ("_${_var}" STREQUAL "_Mathematica_WSTP_FIND_VERSION_MAJOR" OR
+			"_${_var}" STREQUAL "_Mathematica_WSTP_FIND_VERSION_MINOR")
 		list (APPEND ${_outDependentVars}
 			Mathematica_WSTP_VERSION
 			Mathematica_WSTP_INCLUDE_DIR


COMP: wrong CMake instruction, use elseif

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -144,7 +144,7 @@
           message(STATUS "The stack size is set to 10 Mbytes (/STACK:10000000).")
       endif()
     endif() #if (${CMAKE_VERSION..
-  else(MINGW)
+  elseif(MINGW)
     set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} -Wl,--stack,10000000")
     message(STATUS "The stack size is set to 10 Mbytes (-Wl,--stack,10000000).")
   endif() # if(MSVC)


Update FW

Update FW

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "166f9a5f96742f03e53ce186b5f07b91b0a4df98")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "e3df316f89fed6ba7e0fa33564699f055ce15891")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Build hardfault_log in px4fmu-v3 target

Build hardfault_log in px4fmu-v3 target

--- cmake/configs/nuttx_px4fmu-v3_default.cmake
+++ cmake/configs/nuttx_px4fmu-v3_default.cmake
@@ -63,6 +63,7 @@
 	systemcmds/config
 	systemcmds/dumpfile
 	systemcmds/esc_calib
+	systemcmds/hardfault_log
 	systemcmds/mixer
 	systemcmds/motor_ramp
 	systemcmds/mtd


cmake: Fix typo in common-rom.cmake

cmake: Fix typo in common-rom.cmake

ALIGN_WITH_INPUT is an argument for zephyr_linker_section, not
zephyr_linker_section_configure. Fix the calls for section .emulators
accordingly.

Signed-off-by: Abe Levkoy <2e1ad7039298f93262cf06bbb457275fb3e2ecb5@google.com>

--- cmake/linker_script/common/common-rom.cmake
+++ cmake/linker_script/common/common-rom.cmake
@@ -143,8 +143,8 @@
 zephyr_iterable_section(NAME k_p4wq_initparam KVMA RAM_REGION GROUP RODATA_REGION SUBALIGN 4)

 if(CONFIG_EMUL)
-  zephyr_linker_section(NAME emulators_section GROUP RODATA_REGION)
-  zephyr_linker_section_configure(SECTION emulators_section INPUT ".emulators" KEEP SORT NAME ${XIP_ALIGN_WITH_INPUT})
+  zephyr_linker_section(NAME emulators_section GROUP RODATA_REGION ${XIP_ALIGN_WITH_INPUT})
+  zephyr_linker_section_configure(SECTION emulators_section INPUT ".emulators" KEEP SORT NAME)
 endif()

 if(CONFIG_DNS_SD)


Add -Wundef to default warning set

Add -Wundef to default warning set

--- cmake/modules/VisionarayHandleOptions.cmake
+++ cmake/modules/VisionarayHandleOptions.cmake
@@ -18,6 +18,7 @@
     add_definitions(-Wsign-compare)
     add_definitions(-Wwrite-strings)
     add_definitions(-Woverloaded-virtual)
+    add_definitions(-Wundef)

     if(VSNRAY_ENABLE_WARNINGS)
         add_definitions(-Wall -Wextra)


Fix typo breaking NumPy includes

Fix typo breaking NumPy includes

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -88,7 +88,7 @@
 find_package(PythonLibs 2.7)
 find_package(NumPy REQUIRED)

-include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIRS})
+include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR})
 list(APPEND Caffe2_LINKER_LIBS ${PYTHON_LIBRARIES})

 # ---[ pybind11


Fix demo installation exclude pattern

Fix demo installation exclude pattern

Do not install a demo's build directory

--- cmake/Installation.cmake
+++ cmake/Installation.cmake
@@ -102,7 +102,7 @@
 #simulation template
 install(DIRECTORY util/simulation-template DESTINATION "biodynamo/" FILES_MATCHING PATTERN "*")
 # Demos.
-install(DIRECTORY demo DESTINATION "biodynamo/" PATTERN "build/" EXCLUDE)
+install(DIRECTORY demo DESTINATION "biodynamo/" PATTERN "build" EXCLUDE)

 if(LINUX)
   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/paraview-plugin/libBDMGlyphFilter.so DESTINATION ${CMAKE_INSTALL_PVPLUGINDIR})


enabled doxygen comment translation in SWIG

--- cmake/ModulePython.cmake
+++ cmake/ModulePython.cmake
@@ -1,7 +1,7 @@
 # Build Python bindings (requires SWIG installed)

 if(FAST_MODULE_Python)
-    find_package(SWIG REQUIRED)
+    find_package(SWIG 4 REQUIRED)
     message("-- SWIG found, creating python bindings...")
     include(${SWIG_USE_FILE})

@@ -51,7 +51,7 @@
     file(MAKE_DIRECTORY ${CMAKE_SWIG_OUTDIR})
     swig_add_library(fast LANGUAGE python SOURCES ${PYFAST_FILE})
     swig_link_libraries(fast ${PYTHON_LIBRARIES} FAST)
-    set_target_properties(_fast PROPERTIES SWIG_COMPILE_OPTIONS -py3) # Enable Python 3 specific features in SWIG
+    set_property(TARGET _fast PROPERTY SWIG_COMPILE_OPTIONS -py3 -doxygen) # Enable Python 3 specific features and doxygen comment translation in SWIG
     set_target_properties(_fast PROPERTIES INSTALL_RPATH "$ORIGIN/../../lib")
     target_include_directories(_fast PRIVATE ${PYTHON_NUMPY_INCLUDE_DIR})
     target_include_directories(_fast PRIVATE ${PYTHON_INCLUDE_DIRS})


Fixed issue where user supplied gmp and mpfr prefixes were ignored.

--- cmake/OriginConfig.cmake
+++ cmake/OriginConfig.cmake
@@ -39,15 +39,21 @@
 set(ORIGIN_DEFINES "")
 if (ORIGIN_USE_GMP)
 	set(ORIGIN_INCLUDE_DIRS "${ORIGIN_INCLUDE_DIRS} -I${GMP_INCLUDE_DIR}")
-  set(ORIGIN_LIBRARY_DIRS "${ORIGIN_LIBRARY_DIRS} -I${GMP_LIBRARY_DIR}")
+        set(ORIGIN_LIBRARY_DIRS "${ORIGIN_LIBRARY_DIRS} -I${GMP_LIBRARY_DIR}")
 	list(APPEND ORIGIN_LIBRARIES gmp)
 	set(ORIGIN_DEFINES "${ORIGIN_DEFINES} -DORIGIN_USE_GMP")
+
+        include_directories(${GMP_INCLUDE_DIR})
+        link_directories(${GMP_LIBRARY_DIR})
 endif()
 if (ORIGIN_USE_MPFR)
 	set(ORIGIN_INCLUDE_DIRS "${ORIGIN_INCLUDE_DIRS} -I${MPFR_INCLUDE_DIR}")
-  set(ORIGIN_LIBRARY_DIRS "${ORIGIN_LIBRARY_DIRS} -I${MPFR_LIBRARY_DIR}")
+        set(ORIGIN_LIBRARY_DIRS "${ORIGIN_LIBRARY_DIRS} -I${MPFR_LIBRARY_DIR}")
 	list(APPEND ORIGIN_LIBRARIES mpfr)
 	set(ORIGIN_DEFINES "${ORIGIN_DEFINES} -DORIGIN_USE_MPFR")
+
+        include_directories(${MPFR_INCLUDE_DIR})
+        link_directories(${MPFR_LIBRARY_DIR})
 endif()

 # Build a set of warning flags.


Try again on aiur dashboard fix...

Try again on aiur dashboard fix...

--- cmake/aiur_nightly.cmake
+++ cmake/aiur_nightly.cmake
@@ -11,7 +11,7 @@
 set(CTEST_SITE "Aiur.kitware")
 set(CTEST_BUILD_NAME "Linux-master-nightly")
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
-set(CTEST_UPDATE_COMMAND "git pull")
+set(CTEST_UPDATE_COMMAND "git")

 ctest_start("Nightly")
 ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY})


Fixed bug in new vstudio warning stuff

Fixed bug in new vstudio warning stuff

--- cmake/fips_windows.cmake
+++ cmake/fips_windows.cmake
@@ -10,7 +10,7 @@
 #
 macro(fips_vs_warning_level level)
     if (FIPS_MSVC)
-        set(CurCompileFlags "${CurCxxOptions} /W${level}")
+        set(CurCompileFlags "${CurCompileFlags} /W${level}")
     endif()
 endmacro()

@@ -21,7 +21,7 @@
 macro(fips_vs_disable_warnings warnings)
     if (FIPS_MSVC)
         foreach (warning ${ARGV})
-            set(CurCompileFlags "${CurCxxOptions} /wd${warning}")
+            set(CurCompileFlags "${CurCompileFlags} /wd${warning}")
         endforeach()
     endif()
 endmacro()


Fix using hdf5-config from HDF5

Fix using hdf5-config from HDF5

The config files require an exact version match. Also use the provided targets directly.
Define H5_BUILT_AS_DYNAMIC_LIB when HDF5 1.8 config file is used.

--- cmake/thirdParties.cmake
+++ cmake/thirdParties.cmake
@@ -1,6 +1,9 @@
 if(MATIO_WITH_HDF5)
-    find_package(HDF5 1.8)
+    find_package(HDF5)
     if(HDF5_FOUND)
+        if(HDF5_VERSION VERSION_LESS 1.8)
+            message(FATAL_ERROR "HDF5 version ${HDF5_VERSION} is unsupported, minimum of 1.8 is required")
+        endif()
         set(HAVE_HDF5 1)
     endif()
 endif()
@@ -14,10 +17,24 @@

 if(HDF5_FOUND)
     add_library(HDF5::HDF5 INTERFACE IMPORTED)
-    set_target_properties(HDF5::HDF5 PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIRS}"
-        INTERFACE_LINK_LIBRARIES "${HDF5_LIBRARIES}"
-    )
+    if(HDF5_USE_STATIC_LIBRARIES AND TARGET hdf5::hdf5-static)
+        # static target from hdf5 1.10 or 1.12 config
+        target_link_libraries(HDF5::HDF5 INTERFACE hdf5::hdf5-static)
+    elseif(NOT HDF5_USE_STATIC_LIBRARIES AND TARGET hdf5::hdf5-shared)
+        # shared target from hdf5 1.10 or 1.12 config
+        target_link_libraries(HDF5::HDF5 INTERFACE hdf5::hdf5-shared)
+    elseif(TARGET hdf5)
+        # target from hdf5 1.8 config
+        target_link_libraries(HDF5::HDF5 INTERFACE hdf5)
+        if(NOT HDF5_USE_STATIC_LIBRARIES)
+            target_compile_definitions(HDF5::HDF5 INTERFACE "H5_BUILT_AS_DYNAMIC_LIB")
+        endif()
+    else()
+        # results from CMake FindHDF5
+        target_include_directories(HDF5::HDF5 INTERFACE "${HDF5_INCLUDE_DIRS}")
+        target_link_libraries(HDF5::HDF5 INTERFACE "${HDF5_LIBRARIES}")
+        target_compile_definitions(HDF5::HDF5 INTERFACE "${HDF5_DEFINITIONS}")
+    endif()
 endif()

 if(NOT HAVE_HDF5 AND MATIO_MAT73)


fixing typo in stkmesh cmake

fixing typo in stkmesh cmake

--- packages/Adapters/STKMesh/cmake/Dependencies.cmake
+++ packages/Adapters/STKMesh/cmake/Dependencies.cmake
@@ -13,7 +13,6 @@
   TEST_REQUIRED_PACKAGES
     DataTransferKitOperators
     STKIO
-  EXAMPLE_REQUIRED_PACKAGES
     STKUnit_tests
   LIB_REQUIRED_TPLS
     MPI


Update FW with multiple fixes: - properly handle manual/auto focus with multiple cameras - fix potential init failure with same sensors (IMX378/477/214 / AR0234 / OV5645) on Left and Right sockets - fix sensor name reporting for AR0234 / IMX378/380/477/577

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "e3baa61d440ca6964dc74768140971aac5dc7fca")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "e89359595f669e066ac690799f4fb20f6af16754")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Fix for https://root-forum.cern.ch/t/24099


[cmake] Switching to builtin_tbb is STATUS like for others.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1094,7 +1094,7 @@
   else()
     find_package(TBB 2018)
     if(NOT TBB_FOUND)
-      message(WARNING "TBB not found, enabling 'builtin_tbb' option")
+      message(STATUS "TBB not found, enabling 'builtin_tbb' option")
       set(builtin_tbb ON CACHE BOOL "Enabled because imt is enabled, but TBB was not found" FORCE)
     endif()
   endif()


mark QMLModule itself RUNTIME

mark QMLModule itself RUNTIME

this reintroduces behavior as before
26d111b771a8364cef25428a7e1831bf9f291ab8 where not finding QMLModule
(which happens when qmlplugindump is not present or cannot be executed) it
will be listed as missing runtime dependency. since qmldump is only used
to check for runtime deps it itself should be considered runtime in that
if it is missing all runtime checks cannot and will not be performed
correctly anyway.

REVIEW: 124913

--- src/plugins/cmake/FindQMLModule.cmake
+++ src/plugins/cmake/FindQMLModule.cmake
@@ -41,6 +41,8 @@
     return()
 endif()

+set_package_properties(QMLModule PROPERTIES DESCRIPTION "QML Modules: checks failed or cannot be performed" TYPE RUNTIME)
+
 include(FindPackageHandleStandardArgs)
 include(FeatureSummary)


Remove (irrelevant) OpenMP stuff

Remove (irrelevant) OpenMP stuff

--- tests/find_mkl.cmake
+++ tests/find_mkl.cmake
@@ -5,12 +5,6 @@
 initialize_cookoff()

 find_package(MKL REQUIRED)
-
-# AppleClang does not yet support OpenMP
-# Mainline Clang does, but not on Legion
-if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
-  find_package(OpenMP REQUIRED)
-endif()

 add_definitions(${MKL_DEFINITIONS})
 include_directories(${MKL_INCLUDE_DIRS})
@@ -40,5 +34,4 @@
 )

 add_executable(mkl_sgemm mkl_sgemm.c)
-target_compile_options(mkl_sgemm PUBLIC ${OpenMP_C_FLAGS})
 target_link_libraries(mkl_sgemm ${MKL_LIBRARIES})