Autotools -> cmake for commit ee258ec2629024f966526e5ba0c44b18ad8bbaf1

Original commit message:
  Add ${prefix}/share/pocl/include to the --cflags of pkg-config because
  some external clients (such as TCE) of libpocl.so or pocl-standalone
  might need to refer to pocl.h.

--- pocl.pc.in.cmake
+++ pocl.pc.in.cmake
@@ -6,6 +6,6 @@
 Name: Portable Computing Language
 Description: Portable Computing Language
 Version: @POCL_VERSION@
-Libs: -L${libdir} -lpocl @LD_FLAGS_BIN@
+Libs: -L${libdir} -lpocl -I@POCL_INSTALL_PRIVATE_HEADER_DIR@ @LD_FLAGS_BIN@
 Cflags: -I${includedir}


cmake: use static gflags/glog for smfc

cmake: use static gflags/glog for smfc

➜  build git:(master) ✗ ldd smfc
        linux-vdso.so.1 (0x00007ffea6bfd000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8260ada000)
        libunwind.so.8 => /lib64/libunwind.so.8 (0x00007f8260abe000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f8260926000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f82607a2000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8260787000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f82605c1000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f8260b27000)

--- recipe/wellknown.cmake
+++ recipe/wellknown.cmake
@@ -142,9 +142,8 @@

 cooking_ingredient(GFlags
   CMAKE_ARGS
-    -DCMAKE_BUILD_TYPE=Release
     -DGFLAGS_NAMESPACE=google
-    -DBUILD_SHARED_LIBS=ON
+    -DBUILD_SHARED_LIBS=OFF
     -DBUILD_STATIC_LIBS=ON
     -DBUILD_gflags_LIB=ON
   EXTERNAL_PROJECT_ARGS
@@ -168,8 +167,7 @@
 cooking_ingredient(Glog
   REQUIRES GFlags
   CMAKE_ARGS
-    -DCMAKE_BUILD_TYPE=Release
-    -DBUILD_SHARED_LIBS=ON
+    -DBUILD_SHARED_LIBS=OFF
     -DWITH_GFLAGS=ON
   EXTERNAL_PROJECT_ARGS
     URL https://github.com/google/glog/archive/5d46e1b.tar.gz)


Windows: Added APR include path to libprocess configuration.

Partially addresses MESOS-3447, as APR is a dependency of the SVN
facilities of Stout.

On Unix builds, APR is expected to have been installed on the system
prior to building Mesos (usually by a package manager). Since Windows
does not have a package manager or a reasonble way of automatically
discovering where a package is installed (aside from the registry), our
CMake build system takes it upon itself to manage these system
dependencies.  This means that on Windows, we need to configure the
build to look for the APR headers in our custom-downloaded APR
repository.  Currently, though, we are not doing this, so when we'll
hit a compile-time error if we try to build (e.g.) `svn.hpp`.

This commit will introduce the APR include paths as part of the build
against Stout. Since Stout is a header-only library, it is (right now)
incumbent on whoever is bundling Stout up to manage the third-party
dependencies of Stout. In our current implementation, libprocess manages
the APR dependency for Stout, hence, we put this logic in libprocess.

Review: https://reviews.apache.org/r/54462/

--- 3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ 3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
@@ -62,6 +62,7 @@
 set(PICOJSON_INCLUDE_DIR    ${PICOJSON_ROOT})

 if (WIN32)
+  set(APR_INCLUDE_DIR      ${LIBAPR_ROOT}/include ${LIBAPR_ROOT}-build)
   set(CURL_INCLUDE_DIR     ${CURL_ROOT}/include)
   set(GLOG_INCLUDE_DIR     ${GLOG_ROOT}/src/windows)
   set(PROTOBUF_INCLUDE_DIR ${PROTOBUF_ROOT}/src)


Adding option to find static HDF5 libraries if possible

--- Resources/CMake/MXAFindHDF5.cmake
+++ Resources/CMake/MXAFindHDF5.cmake
@@ -10,17 +10,12 @@
 #  HDF5_LIBRARIES - The List of HDF5 libraries that were found. This variable can be used in a LINK_LIBRARIES(...) command
 #  HDF5_LIBRARY_DEBUG - Debug Version of HDF5 library
 #  HDF5_LIBRARY_RELEASE - Release Version of HDF5 library
+# User Settable options that control which libraries will be found.
+#  HDF5_USE_STATIC_LIBS - Set this to TRUE if you want this to prefer to find static libraries
 #
 #  To make finding HDF5 easier set the "HDF5_INSTALL" environment variable to the location
 #  where HDF5 is installed.

-# MESSAGE(STATUS "Finding HDF5 Library... " )
-#
-#-- Clear the Library List
-# SET (HDF5_LIBRARIES "")
-#-- Clear the include Directories
-# SET (HDF5_INCLUDE_DIRS "")
-#
 # ------------------ START FIND HDF5 LIBS --------------------------------------
 SET (HDF5_FOUND "NO")
 SET (HDF5_HL_FOUND "NO")
@@ -53,6 +48,15 @@
     SET (HDF5_SEARCH_RELEASE_NAMES "hdf5")
 ENDIF(WIN32 AND NOT MINGW)

+IF( HDF5_USE_STATIC_LIBS )
+ SET( _hdf5_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ IF(WIN32)
+   SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ ELSE(WIN32)
+   SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ ENDIF(WIN32)
+ENDIF( HDF5_USE_STATIC_LIBS )
+
 # Look for the library.
 FIND_LIBRARY(HDF5_LIBRARY_DEBUG
   NAMES ${HDF5_SEARCH_DEBUG_NAMES}
@@ -65,7 +69,11 @@
   PATHS ${HDF5_LIB_SEARCH_DIRS}
   NO_DEFAULT_PATH
   )
-
+
+IF( HDF5_USE_STATIC_LIBS )
+  SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_hdf5_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+ENDIF( HDF5_USE_STATIC_LIBS )
+
 SET (HDF5_DUMP_PROG_NAME "h5dump")
 IF (WIN32)
     SET (HDF5_DUMP_PROG_NAME "h5dump.exe")
@@ -143,11 +151,24 @@
     #  NO_DEFAULT_PATH
   )

+  IF( HDF5_USE_STATIC_LIBS )
+   SET( _hdf5_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+   IF(WIN32)
+     SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+   ELSE(WIN32)
+     SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+   ENDIF(WIN32)
+  ENDIF( HDF5_USE_STATIC_LIBS )
+
   FIND_LIBRARY(HDF5_HL_LIBRARY
     NAMES hdf5_hl
     PATHS ${HDF5_LIB_SEARCH_DIRS}
     #  NO_DEFAULT_PATH
   )
+
+  IF( HDF5_USE_STATIC_LIBS )
+    SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_hdf5_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+  ENDIF( HDF5_USE_STATIC_LIBS )

   IF (HDF5_HL_INCLUDE_DIR )
     IF (HDF5_HL_LIBRARY)
@@ -174,9 +195,9 @@

   CHECK_SYMBOL_EXISTS(HDF5_BUILT_AS_DYNAMIC_LIB "H5config.h" HAVE_HDF5_DLL)

-    IF (HAVE_HDF5_DLL STREQUAL "TRUE")
-        SET (HAVE_HDF5_DLL "1")
-    ENDIF (HAVE_HDF5_DLL STREQUAL "TRUE")
+  IF (HAVE_HDF5_DLL STREQUAL "TRUE")
+      SET (HAVE_HDF5_DLL "1")
+  ENDIF (HAVE_HDF5_DLL STREQUAL "TRUE")

   # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables
   SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})


Fixed InstallDependencies in 1.8.1 for boost 1.50+

--HG--
branch : v1-8

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -180,7 +180,6 @@
       PATTERN "asio" EXCLUDE
       PATTERN "assign" EXCLUDE
       PATTERN "bimap" EXCLUDE
-      PATTERN "chrono" EXCLUDE
       PATTERN "circular_buffer" EXCLUDE
       PATTERN "compatibility" EXCLUDE
       PATTERN "concept_check" EXCLUDE
@@ -189,7 +188,6 @@
       PATTERN "filesystem" EXCLUDE
       PATTERN "flyweight" EXCLUDE
       PATTERN "format" EXCLUDE
-      PATTERN "functional" EXCLUDE
       PATTERN "fusion" EXCLUDE
       PATTERN "geometry" EXCLUDE
       PATTERN "gil" EXCLUDE
@@ -214,18 +212,15 @@
       PATTERN "ptr_container" EXCLUDE
       PATTERN "python" EXCLUDE
       PATTERN "random" EXCLUDE
-      PATTERN "ratio" EXCLUDE
       PATTERN "regex" EXCLUDE
       PATTERN "serialization" EXCLUDE
       PATTERN "signals" EXCLUDE
       PATTERN "signals2" EXCLUDE
       PATTERN "spirit" EXCLUDE
       PATTERN "statechart" EXCLUDE
-      PATTERN "system" EXCLUDE
       PATTERN "test" EXCLUDE
       PATTERN "timer" EXCLUDE
       PATTERN "tr1" EXCLUDE
-      PATTERN "typeof" EXCLUDE
       PATTERN "units" EXCLUDE
       PATTERN "unordered" EXCLUDE
       PATTERN "uuid" EXCLUDE


CMake: Disable CSharp by default since it is still experimental.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -77,7 +77,7 @@
 option                (URHO3D_URHO2D             "2D subsystem enabled"                                  ${URHO3D_ENABLE_ALL})

 # Features
-cmake_dependent_option(URHO3D_CSHARP             "Enable C# support"                                     ${URHO3D_ENABLE_ALL} "BUILD_SHARED_LIBS"             OFF)
+cmake_dependent_option(URHO3D_CSHARP             "Enable C# support"                                     OFF                  "BUILD_SHARED_LIBS"             OFF)
 if (WIN32)
     cmake_dependent_option(URHO3D_WITH_MONO      "Use Mono runtime"                                      OFF                  "URHO3D_CSHARP"                 OFF)
 else ()


ENH: fixed small pb during config step

ENH: fixed small pb during config step

--- CMake/OTBModuleHeaderTest.cmake
+++ CMake/OTBModuleHeaderTest.cmake
@@ -21,7 +21,7 @@

-SET(BANNED_HEADERS)
+SET(BANNED_HEADERS 'dummy')
 if(NOT OTB_USE_OPENCV)
 	SET(BANNED_HEADERS "${BANNED_HEADERS} otbDecisionTreeMachineLearningModelFactory.h otbDecisionTreeMachineLearningModel.h otbKNearestNeighborsMachineLearningModelFactory.h otbKNearestNeighborsMachineLearningModel.h otbRandomForestsMachineLearningModelFactory.h otbRandomForestsMachineLearningModel.h otbSVMMachineLearningModelFactory.h otbSVMMachineLearningModel.h otbGradientBoostedTreeMachineLearningModelFactory.h otbGradientBoostedTreeMachineLearningModel.h otbBoostMachineLearningModelFactory.h otbBoostMachineLearningModel.h otbNeuralNetworkMachineLearningModelFactory.h otbNeuralNetworkMachineLearningModel.h otbNormalBayesMachineLearningModelFactory.h otbNormalBayesMachineLearningModel.h otbRequiresOpenCVCheck.h")
 endif()


Android: use discovered path everywhere instead of guessing it

--HG--
branch : nostaticzlib

--- CMake/Utils/AndroidMacros.cmake
+++ CMake/Utils/AndroidMacros.cmake
@@ -59,7 +59,7 @@
 	endif()

 	if(OGRE_CONFIG_ENABLE_FREEIMAGE)
-        add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_NDK_ABI_NAME@" "FreeImage")
+	    add_static_libs_from_paths(${FreeImage_LIBRARY_REL})
     endif()

     if(OGRE_USE_BOOST)
@@ -67,7 +67,7 @@
 	   add_static_libs_from_paths(${Boost_LIBRARIES})
     endif()

-    add_static_libs("${OGRE_DEPENDENCIES_DIR}/lib/@ANDROID_NDK_ABI_NAME@" "OIS" "freetype" "zzip")
+    add_static_libs_from_paths(${OIS_LIBRARY_REL} ${FREETYPE_LIBRARY_REL} ${ZZip_LIBRARY_REL})

     if(APPLE OR WIN32)
       SET(ANDROID_EXECUTABLE "android")


ENH: Added KWSYS_PLATFORM_CXX_TEST_RUN macro.

--- kwsysPlatformCxxTests.cmake
+++ kwsysPlatformCxxTests.cmake
@@ -43,3 +43,75 @@
     ENDIF(${var}_COMPILED)
   ENDIF(${invert} MATCHES INVERT)
 ENDMACRO(KWSYS_PLATFORM_CXX_TEST)
+
+MACRO(KWSYS_PLATFORM_CXX_TEST_RUN var description invert)
+  IF("${var}" MATCHES "^${var}$")
+    MESSAGE(STATUS "${description}")
+    TRY_RUN(${var} ${var}_COMPILED
+      ${CMAKE_CURRENT_BINARY_DIR}
+      ${CMAKE_CURRENT_SOURCE_DIR}/kwsysPlatformCxxTests.cxx
+      COMPILE_DEFINITIONS -DTEST_${var} ${KWSYS_PLATFORM_CXX_TEST_DEFINES}
+      OUTPUT_VARIABLE OUTPUT)
+
+    # Note that ${var} will be a 0 return value on success.
+    IF(${var}_COMPILED)
+      IF(${var})
+        FILE(APPEND
+          ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+          "${description} compiled but failed to run with the following output:\n${OUTPUT}\n\n")
+      ELSE(${var})
+        FILE(APPEND
+          ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+          "${description} compiled and ran with the following output:\n${OUTPUT}\n\n")
+      ENDIF(${var})
+    ELSE(${var}_COMPILED)
+      FILE(APPEND
+        ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+        "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
+    ENDIF(${var}_COMPILED)
+
+    IF(${invert} MATCHES INVERT)
+      IF(${var}_COMPILED)
+        IF(${var})
+          MESSAGE(STATUS "${description} - yes")
+        ELSE(${var})
+          MESSAGE(STATUS "${description} - no")
+        ENDIF(${var})
+      ELSE(${var}_COMPILED)
+        MESSAGE(STATUS "${description} - failed to compile")
+      ENDIF(${var}_COMPILED)
+    ELSE(${invert} MATCHES INVERT)
+      IF(${var}_COMPILED)
+        IF(${var})
+          MESSAGE(STATUS "${description} - no")
+        ELSE(${var})
+          MESSAGE(STATUS "${description} - yes")
+        ENDIF(${var})
+      ELSE(${var}_COMPILED)
+        MESSAGE(STATUS "${description} - failed to compile")
+      ENDIF(${var}_COMPILED)
+    ENDIF(${invert} MATCHES INVERT)
+  ENDIF("${var}" MATCHES "^${var}$")
+
+  IF(${invert} MATCHES INVERT)
+    IF(${var}_COMPILED)
+      IF(${var})
+        SET(${var} 1)
+      ELSE(${var})
+        SET(${var} 0)
+      ENDIF(${var})
+    ELSE(${var}_COMPILED)
+      SET(${var} 1)
+    ENDIF(${var}_COMPILED)
+  ELSE(${invert} MATCHES INVERT)
+    IF(${var}_COMPILED)
+      IF(${var})
+        SET(${var} 0)
+      ELSE(${var})
+        SET(${var} 1)
+      ENDIF(${var})
+    ELSE(${var}_COMPILED)
+      SET(${var} 0)
+    ENDIF(${var}_COMPILED)
+  ENDIF(${invert} MATCHES INVERT)
+ENDMACRO(KWSYS_PLATFORM_CXX_TEST_RUN)


update

update

--- modules/HdrHistogram.cmake
+++ modules/HdrHistogram.cmake
@@ -14,9 +14,10 @@
   if(CMAKE_MAKE_PROGRAM MATCHES "(MSBuild|devenv|msdev|nmake)")
     set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "/wd4146 /wd4200 /wd4244")
   elseif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
-    set(CMAKE_TEMP_C_FLAGS ${CMAKE_C_FLAGS})
-    string(REPLACE "-pedantic" "" CMAKE_TEMP_C_FLAGS ${CMAKE_TEMP_C_FLAGS})
-    set_source_files_properties(${SOURCE_FILES} PROPERTIES CMAKE_C_FLAGS ${CMAKE_TEMP_C_FLAGS})
+    set(CMAKE_OLD_C_FLAGS ${CMAKE_C_FLAGS})
+    set(CMAKE_OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT} -Wall -Werror")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} -Wall -Werror")
   endif()

   # Add module library
@@ -26,4 +27,10 @@
   # Set module folder
   set_target_properties(histogram PROPERTIES FOLDER modules/HdrHistogram)

+  # Restore default warnings
+  if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
+    set(CMAKE_C_FLAGS ${CMAKE_OLD_C_FLAGS})
+    set(CMAKE_CXX_FLAGS ${CMAKE_OLD_CXX_FLAGS})
+  endif()
+
 endif()


CI: Set TLS_VERIFY to OFF for NiftyReg official repo

--- SuperBuild/ExternalNiftyreg.cmake
+++ SuperBuild/ExternalNiftyreg.cmake
@@ -27,6 +27,7 @@
 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${NIFTYREG_GIT_REPOSITORY}
   GIT_TAG ${NIFTYREG_GIT_TAG}
+  TLS_VERIFY OFF
   UPDATE_COMMAND ""
   PATCH_COMMAND "${GIT_EXECUTABLE}" reset --hard && "${GIT_EXECUTABLE}" clean --force && "${GIT_EXECUTABLE}" apply --whitespace=fix "${CMAKE_SOURCE_DIR}/Patches/niftyreg_strtof.patch" && "${GIT_EXECUTABLE}" apply --whitespace=fix "${CMAKE_SOURCE_DIR}/Patches/niftyreg_eigen_assignment.patch"
   SOURCE_DIR ${proj}


updated modserial external project

updated modserial external project

--- firmware/mbed/modserial.cmake
+++ firmware/mbed/modserial.cmake
@@ -3,7 +3,7 @@

 ExternalProject_Add(modserial_library
     HG_REPOSITORY       https://developer.mbed.org/users/Sissors/code/MODSERIAL
-    HG_TAG              39:8ef4f91813fd
+    HG_TAG              41:d8422efe4761
     CONFIGURE_COMMAND   ""
     BUILD_COMMAND       ""
     INSTALL_COMMAND     ""


removing a bunch of dependencies. which is nice

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -65,7 +65,7 @@

 set(fovis-git_url https://svn.csail.mit.edu/drc/trunk/software/externals/fovis-git)
 set(fovis-git_revision 8298)
-set(fovis-git_depends libbot-drc Eigen_pod kinect)
+set(fovis-git_depends libbot-drc Eigen_pod )

 set(estimate-pose_url https://svn.csail.mit.edu/rrg_pods/estimate-pose)
 set(estimate-pose_revision 827)
@@ -128,19 +128,19 @@
   octomap-drc
   occ-map
   common_utils
-  scanmatch
+  #scanmatch
   jpeg-utils
   isam_include
   visualization
-  velodyne
-  kinect
+  #velodyne
+  #kinect
   microstrain_comm
   fovis-git
   estimate-pose
   vicon
-  vicon-drc
-  camunits-wrapper
-  camunits-extra-wrapper
+  #vicon-drc
+  #camunits-wrapper
+  #camunits-extra-wrapper
   apriltags
   flycapture
   )


Android(x86)のコンパイルターゲットが64bitになっていたのを32bitに修正

--- AndroidX86.cmake
+++ AndroidX86.cmake
@@ -3,7 +3,7 @@
 set(ANDROID_TOOLCHAIN "x86")
 set(ANDROID_ARCH_SHORT "x86")
 set(ANDROID_ARCH_LONG "x86")
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -funwind-tables -no-canonical-prefixes -fstack-protector")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -target i686-linux-android -ffunction-sections -funwind-tables -no-canonical-prefixes -fstack-protector")
 set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fstrict-aliasing -funswitch-loops")
 if(NOT USE_CLANG)
 	set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -finline-limit=300")


ENH: Updating superbuild ITK to 4.1 Release Canidate 1

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -14,7 +14,7 @@
 set(proj ITK)  ## Use ITK convention of calling it ITK
 set(ITK_REPOSITORY git://itk.org/ITK.git)
 set(ITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.1)
-set(ITK_TAG_COMMAND GIT_TAG 1e725da525ade3c18a91ec2cf6dbf7dcdefe149c ) # Tue Jan 31 nightly-master
+set(ITK_TAG_COMMAND GIT_TAG v4.1rc01 ) # Tue Jan 31 nightly-master
 set(WrapITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.0/WrapITK)

 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_languages_cache}\n${ep_common_cache}" )
@@ -37,7 +37,7 @@
   -DITK_LEGACY_REMOVE:BOOL=ON
   -DITK_BUILD_ALL_MODULES:BOOL=ON
   -DITK_USE_REVIEW:BOOL=ON
-  -DUSE_WRAP_ITK:BOOL=${ITK_WRAPPING}
+  -DUSE_WRAP_ITK:BOOL=${ITK_WRAPPING}
   -DINSTALL_WRAP_ITK_COMPATIBILITY:BOOL=OFF
   -DWRAP_float:BOOL=ON
   -DWRAP_unsigned_char:BOOL=ON


COMP:  Add current ITKv4 git tag.

COMP:  Add current ITKv4 git tag.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -73,7 +73,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG 1f822a072ec2b525a28557f3f9028d8d527453b3) #2012-08-13
+  set(${proj}_GIT_TAG 827b8f9c50d43b97f1f52b1c9598de68aae3f7dd) #2012-08-15
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


Updating ITK revision in Superbuild

Updating ITK revision in Superbuild

This updated revision is needed for the Logical operator functors.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -17,7 +17,7 @@
 # NOTE: it is very important to update the ITK_DIR path with the
 # A version in the ITK 4.3 development which contains a patch for
 # SignedDanielssonDistanceMap
-set(ITK_TAG_COMMAND GIT_TAG af8d6ee5f9fa46a916b8b46e03a0b10b38b23e80 )
+set(ITK_TAG_COMMAND GIT_TAG 13413feff842253c98304886e34e3e6a434c37f8 )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


COMP:  Add current ITKv4 git tag.

COMP:  Add current ITKv4 git tag.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -73,7 +73,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG 827b8f9c50d43b97f1f52b1c9598de68aae3f7dd) #2012-08-15
+  set(${proj}_GIT_TAG I610d626d13964bf3fd620e23fc5b4b8a75d4bed3) #2012-08-15
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


Not overwriting the PROJECT_ISSUES_URL if already set.

--- GithubInfo.cmake
+++ GithubInfo.cmake
@@ -38,6 +38,8 @@
   string(REPLACE "github.com" "travis-ci.org" CI_ROOT_URL ${GIT_ROOT_URL})
   string(REPLACE ".git" "" CI_ROOT_URL ${CI_ROOT_URL})
   set(CI_ROOT_PNG ${CI_ROOT_URL}.png)
-  string(REPLACE ".git" "/issues"
-         ${UPPER_PROJECT_NAME}_ISSUES_URL ${GIT_ROOT_URL})
+  if(NOT ${UPPER_PROJECT_NAME}_ISSUES_URL)
+    string(REPLACE ".git" "/issues"
+           ${UPPER_PROJECT_NAME}_ISSUES_URL ${GIT_ROOT_URL})
+  endif()
 endif()


Update init.cmake

Update init.cmake

--- CMake/init.cmake
+++ CMake/init.cmake
@@ -120,7 +120,7 @@
     message(STATUS "** Command 'ccache' detected => Will use 'ccache' to speed up compilation and link" )
     set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
     set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK    ccache)
-    # TODO(Oliver): Use "CMAKE_{C,CXX}_COMPILER_LAUNCHER=ccmake" with cmake-v3.4
+    # TODO(olibre): Use "CMAKE_{C,CXX}_COMPILER_LAUNCHER=ccmake" with cmake-v3.4
 endif()

 # Output directories


python: eliminate DeprecationWarning: SO -> EXT_SUFFIX

- https://python.readthedocs.io/en/stable/whatsnew/3.4.html
- The `sysconfig` key `SO` is deprecated, it has been replaced by `EXT_SUFFIX`

--- modules/python/common.cmake
+++ modules/python/common.cmake
@@ -43,7 +43,11 @@
 if(DEFINED ${PYTHON}_CVPY_SUFFIX)
   set(CVPY_SUFFIX "${${PYTHON}_CVPY_SUFFIX}")
 else()
-  execute_process(COMMAND ${${PYTHON}_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('SO'))"
+  set(__python_ext_suffix_var "EXT_SUFFIX")
+  if("${${PYTHON}_VERSION_MAJOR}" STREQUAL "2")
+    set(__python_ext_suffix_var "SO")
+  endif()
+  execute_process(COMMAND ${${PYTHON}_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('${__python_ext_suffix_var}'))"
                   RESULT_VARIABLE PYTHON_CVPY_PROCESS
                   OUTPUT_VARIABLE CVPY_SUFFIX
                   OUTPUT_STRIP_TRAILING_WHITESPACE)


cmake: set CMAKE_CXX_FLAGS in FBCompilerSettingsUnix.cmake

Summary:
It looks like the various CMAKE_CXX_FLAGS_* are simply ineffective, and I'm not
sure why, setting CMAKE_CXX_FLAGS does work though, and CMake appears to add
some release/debug flags to it when generating Ninja files.

Reviewed By: fanzeyi

Differential Revision: D27862117

fbshipit-source-id: a89f6182b5bae9a087f8fcfd4c5f9526f91e2adf

--- build/fbcode_builder/CMake/FBCompilerSettingsUnix.cmake
+++ build/fbcode_builder/CMake/FBCompilerSettingsUnix.cmake
@@ -6,6 +6,4 @@
 # to these shared compiler settings in order to avoid accidentally
 # breaking a build in another project!

-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations")
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations")


Update FindDCMTK.cmake module to support NO_MODULE mode

This will allow to build CTK against the patched-3 branch available on
github.com/commontk/DCMTK [1]

[1] https://github.com/commontk/DCMTK/tree/patched-3

Contributed-by: Kent Williams <f696b9b26fbad6178f3aa6dcac4b89f0442e28ab@uiowa.edu>

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -34,16 +34,26 @@
 # Modified for EasyViz by Thomas Sondergaard.
 #

+#
+# First, try to use NO_MODULE
+set(_DCMTK_REQUIRED)
+set(_DCMTK_QUIET)
+if(DCMTK_FIND_QUIETLY)
+  set(_DCMTK_QUIET QUIET)
+endif()
+if(DCMTK_FIND_REQUIRED)
+  set(_DCMTK_REQUIRED REQUIRED)
+endif()
+find_package(DCMTK ${_DCMTK_REQUIRED} ${_DCMTK_QUIET} NO_MODULE)
+if(DCMTK_FOUND
+    AND NOT "x" STREQUAL "x${DCMTK_LIBRARIES}"
+    AND NOT "x" STREQUAL "x${DCMTK_INCLUDE_DIRS}")
+  return()
+endif()
+
 # prefer DCMTK_DIR over default system paths like /usr/lib
-set(CMAKE_PREFIX_PATH ${DCMTK_DIR}/lib ${CMAKE_PREFIX_PATH}) # this is given to FIND_LIBRARY or FIND_PATH
-
-if(NOT DCMTK_FOUND AND NOT DCMTK_DIR)
-  set(DCMTK_DIR
-    "/usr/include/dcmtk/"
-    CACHE
-    PATH
-    "Root of DCMTK source tree (optional).")
-  mark_as_advanced(DCMTK_DIR)
+if(DCMTK_DIR)
+  set(CMAKE_PREFIX_PATH ${DCMTK_DIR}/lib ${CMAKE_PREFIX_PATH}) # this is given to FIND_LIBRARY or FIND_PATH
 endif()

 # Find all libraries, store debug and release separately
@@ -118,6 +128,20 @@
   list(APPEND DCMTK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
 endif()

+#
+# SPECIFIC CASE FOR DCMTK BUILD DIR as DCMTK_DIR
+# (as opposed to a DCMTK install dir)
+# Have to find the source directory.
+if(EXISTS ${DCMTK_DIR}/CMakeCache.txt)
+          load_cache(${DCMTK_DIR} READ_WITH_PREFIX "EXT"
+          DCMTK_SOURCE_DIR)
+  if(NOT EXISTS ${EXTDCMTK_SOURCE_DIR})
+    message(FATAL_ERROR
+      "DCMTK build directory references
+nonexistant DCMTK source directory ${EXTDCMTK_SOURCE_DIR}")
+  endif()
+endif()
+
 set(DCMTK_config_TEST_HEADER osconfig.h)
 set(DCMTK_dcmdata_TEST_HEADER dctypes.h)
 set(DCMTK_dcmimage_TEST_HEADER dicoimg.h)
@@ -130,6 +154,10 @@
 set(DCMTK_dcmsr_TEST_HEADER dsrtree.h)
 set(DCMTK_dcmtls_TEST_HEADER tlslayer.h)
 set(DCMTK_ofstd_TEST_HEADER ofstdinc.h)
+set(DCMTK_oflog_TEST_HEADER oflog.h)
+set(DCMTK_dcmjpls_TEST_HEADER djlsutil.h)
+
+set(DCMTK_INCLUDE_DIR_NAMES)

 foreach(dir
     config
@@ -137,28 +165,43 @@
     dcmimage
     dcmimgle
     dcmjpeg
+    dcmjpls
     dcmnet
     dcmpstat
     dcmqrdb
     dcmsign
     dcmsr
     dcmtls
-    ofstd)
+    ofstd
+    oflog)
+  if(EXTDCMTK_SOURCE_DIR)
+    set(SOURCE_DIR_PATH
+      ${EXTDCMTK_SOURCE_DIR}/${dir}/include/dcmtk/${dir})
+  endif()
   find_path(DCMTK_${dir}_INCLUDE_DIR
     ${DCMTK_${dir}_TEST_HEADER}
     PATHS
     ${DCMTK_DIR}/${dir}/include
     ${DCMTK_DIR}/${dir}
     ${DCMTK_DIR}/include/dcmtk/${dir}
-    ${DCMTK_DIR}/include/${dir})
+    ${DCMTK_DIR}/${dir}/include/dcmtk/${dir}
+    ${DCMTK_DIR}/include/${dir}
+    ${SOURCE_DIR_PATH}
+    )

   mark_as_advanced(DCMTK_${dir}_INCLUDE_DIR)
-  #message("** DCMTKs ${dir} found at ${DCMTK_${dir}_INCLUDE_DIR}")
+  list(APPEND DCMTK_INCLUDE_DIR_NAMES DCMTK_${dir}_INCLUDE_DIR)

   if(DCMTK_${dir}_INCLUDE_DIR)
+    # add the 'include' path so eg
+    #include "dcmtk/dcmimgle/dcmimage.h"
+    # works
+    get_filename_component(_include ${DCMTK_${dir}_INCLUDE_DIR} PATH)
+    get_filename_component(_include ${_include} PATH)
     list(APPEND
       DCMTK_INCLUDE_DIRS
-      ${DCMTK_${dir}_INCLUDE_DIR})
+      ${DCMTK_${dir}_INCLUDE_DIR}
+      ${_include})
   endif()
 endforeach()

@@ -179,3 +222,8 @@

 # Compatibility: This variable is deprecated
 set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})
+
+find_package_handle_standard_args(DCMTK
+  REQUIRED_VARS ${DCMTK_INCLUDE_DIR_NAMES} DCMTK_LIBRARIES
+  FAIL_MESSAGE "Please set DCMTK_DIR and re-run configure")
+


Changement de l'heure des nightly.

Changement de l'heure des nightly.

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -1,6 +1,6 @@
 # Dashboard is opened for submissions for a 24 hour period starting at
 # the specified NIGHLY_START_TIME. Time is specified in 24 hour format.
-SET (NIGHTLY_START_TIME "01:00:00 CET")
+SET (NIGHTLY_START_TIME "20:00:00 CET")

 SET (BUILDNAME "${BUILDNAME}")


document fc module

document fc module

--- modules/fc.cmake
+++ modules/fc.cmake
@@ -5,9 +5,21 @@
 # If environment variable FCFLAGS is set, then the FCFLAGS are used
 # and no other flags are used or appended.
 #
-# Defines::
+# Environment variables used::
+#
+#   FCFLAGS
+#
+# CMake variables used::
+#
+#   EXTRA_FCFLAGS
+#
+# CMake variables defined::
 #
 #   CMAKE_Fortran_MODULE_DIRECTORY (${PROJECT_BINARY_DIR}/include/fortran)
+#
+# CMake variables modified::
+#
+#   CMAKE_Fortran_FLAGS
 #
 # Example autocmake.cfg entry::
 #


update link to AUTHORS.md

update link to AUTHORS.md

--- include/version.hpp.cmake
+++ include/version.hpp.cmake
@@ -36,7 +36,7 @@
               << PROG_NAME << " is licensed under the GPLv3+ license, "
               << "see <http://www.gnu.org/licenses/gpl.html>.\n"
               << "This if free software: you are free to change and redistribute it.\n\n"
-              << "Written by Tmplt and others, see <https://github.com/Tmplt/bookwyrm/blob/cpp/master/AUTHORS.md>."
+              << "Written by Tmplt and others, see <https://github.com/Tmplt/bookwyrm/blob/master/AUTHORS.md>."
               << std::endl;
 };


BUG: tentative to fix the test-on-install config

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -315,6 +315,7 @@
   Fusion
   GeospatialAnalysis
   Testing
+  UtilitiesAdapters/OssimAdapters
   OBIA
   Fuzzy
   ObjectDetection


Squashed 'CMakeModules/' changes from e83ac80..2979d55

2979d55 Fix install when version string is empty.

git-subtree-dir: CMakeModules
git-subtree-split: 2979d55e3ab903070e022c1154acd1a4cf4517e0

--- export_package.cmake
+++ export_package.cmake
@@ -1,16 +1,16 @@
- #######################################################################################
- # export_package.cmake - Functions for easy package exporting	     		       #
- # 								     		       #
- # export_package - Takes a package name and the following optional arguments: 	       #
- #   - TARGETS: A list of all the targets to export with this package 		       #
- #   - DEPENDS: A list of all the targets that this package depends                    #
- #              on from outside its directory 		                               #
- #   - VERSION: A version string for the package			     	       #
- #   - INCLUDE_DIRS: The include directories to export.		     		       #
- #   - LINK_DIRS: The link directories where libraries can be found   		       #
- #   - LIBRARIES: The libraries to export in ${package}_LIBRARIES		       #
- #   - LIBRARY: A library to export in ${package}_LIBRARY    		               #
- #######################################################################################
+#######################################################################################
+# export_package.cmake - Functions for easy package exporting	     		       #
+# 								     		       #
+# export_package - Takes a package name and the following optional arguments: 	       #
+#   - TARGETS: A list of all the targets to export with this package 		       #
+#   - DEPENDS: A list of all the targets that this package depends                    #
+#              on from outside its directory 		                               #
+#   - VERSION: A version string for the package			     	       #
+#   - INCLUDE_DIRS: The include directories to export.		     		       #
+#   - LINK_DIRS: The link directories where libraries can be found   		       #
+#   - LIBRARIES: The libraries to export in ${package}_LIBRARIES		       #
+#   - LIBRARY: A library to export in ${package}_LIBRARY    		               #
+#######################################################################################
 include(CMakeParseArguments)

 get_filename_component(modules_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
@@ -28,6 +28,7 @@
     "${ARGN}"
     )

+  set(CMAKECONFIG_INSTALL_DIR "lib/cmake/${package}")
   option(EXPORT_${package}
     "Should the ${package} package be exported for use by other software" ON)

@@ -35,6 +36,9 @@
   if(PACKAGE_VERSION)
     configure_file(${modules_dir}/PackageConfigVersion.cmake.in
       "${CMAKE_CURRENT_BINARY_DIR}/${package}ConfigVersion.cmake" @ONLY)
+    install(FILES
+      "${CMAKE_CURRENT_BINARY_DIR}/${package}ConfigVersion.cmake"
+      DESTINATION ${CMAKECONFIG_INSTALL_DIR} )
   endif()

   # Build tree config
@@ -52,7 +56,6 @@
     export(PACKAGE ${package})
   endif()

-  set(CMAKECONFIG_INSTALL_DIR "lib/cmake/${package}")
   file(RELATIVE_PATH REL_INCLUDE_DIR
     "${CMAKE_INSTALL_PREFIX}/${CMAKECONFIG_INSTALL_DIR}"
     "${CMAKE_INSTALL_PREFIX}/include")
@@ -69,6 +72,5 @@

   install(FILES
     "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${package}Config.cmake"
-    "${CMAKE_CURRENT_BINARY_DIR}/${package}ConfigVersion.cmake"
     DESTINATION ${CMAKECONFIG_INSTALL_DIR} )
 endfunction()


Project_URL does not propagate correctly through CMAKE, will not use it

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -12,7 +12,7 @@
   "http://${DROP_SITE}/cgi-bin/Submit-CTC-TestingResults.cgi")

 # Project Home Page
-SET (PROJECT_URL "http://www.bsl.ece.vt.edu")
+# SET (PROJECT_URL "http://www.bsl.ece.vt.edu")

 # Dart server configuration
 #SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/insight-rollup-dashboard.sh")


Update to 1.5.0-rc1

Update to 1.5.0-rc1

--- tensorflow_cc/cmake/TensorflowBase.cmake
+++ tensorflow_cc/cmake/TensorflowBase.cmake
@@ -3,7 +3,7 @@
 ExternalProject_Add(
   tensorflow_base
   GIT_REPOSITORY http://github.com/tensorflow/tensorflow.git
-  GIT_TAG v1.4.1
+  GIT_TAG v1.5.0-rc1
   TMP_DIR "/tmp"
   STAMP_DIR "tensorflow-stamp"
   DOWNLOAD_DIR "tensorflow"


Upgrade to Go 1.3

Upgrade to Go 1.3

--- golang.cmake
+++ golang.cmake
@@ -11,10 +11,10 @@
 include (BuildSupport)

 external_source (golang
-    1.2.1
-    go1.2.1.src.tar.gz
-    6232fa4417004fc9dde823ad1eaf597c
-    http://go.googlecode.com/files)
+    1.3
+    go1.3.src.tar.gz
+    4b66d7249554181c314f139ea78920b1
+    http://golang.org/dl)

 message ("Installing ${golang_NAME} into build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${golang_NAME}


cmake: relax package compatibility constraints

This relaxes the compatibility constraints to what cmake calls
"SameMajorVersion", ie., the version found must be >= than the
version requested, and major has to match exactly.

This essentially uses the same code as cmake's
`write_basic_package_version_file()`.

--- thrust/cmake/thrust-config-version.cmake
+++ thrust/cmake/thrust-config-version.cmake
@@ -10,24 +10,20 @@
 math(EXPR THRUST_VERSION_MINOR "(${THRUST_VERSION_FLAT} / 100) % 1000")
 math(EXPR THRUST_VERSION_PATCH "${THRUST_VERSION_FLAT} % 100") # Thrust: "subminor" CMake: "patch"

-# Build comparison versions:
-set(THRUST_COMPAT "${THRUST_VERSION_MAJOR}.${THRUST_VERSION_MINOR}.${THRUST_VERSION_PATCH}")
-set(THRUST_EXACT "${THRUST_COMPAT}.${THRUST_VERSION_TWEAK}")
-set(FIND_COMPAT "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH}")
-set(FIND_EXACT "${FIND_COMPAT}.${PACKAGE_FIND_VERSION_TWEAK}")
+set(THRUST_VERSION "${THRUST_VERSION_MAJOR}.${THRUST_VERSION_MINOR}.${THRUST_VERSION_PATCH}.${THRUST_VERSION_TWEAK}")

-# Set default results
-set(PACKAGE_VERSION ${THRUST_EXACT})
-set(PACKAGE_VERSION_UNSUITABLE FALSE)
-set(PACKAGE_VERSION_COMPATIBLE FALSE)
-set(PACKAGE_VERSION_EXACT FALSE)
+set(PACKAGE_VERSION ${THRUST_VERSION})

-# Test for compatibility (ignores tweak)
-if (FIND_COMPAT VERSION_EQUAL THRUST_COMPAT)
-  set(PACKAGE_VERSION_COMPATIBLE TRUE)
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
+  set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+  if(PACKAGE_FIND_VERSION_MAJOR STREQUAL THRUST_VERSION_MAJOR)
+    set(PACKAGE_VERSION_COMPATIBLE TRUE)
+  else()
+    set(PACKAGE_VERSION_COMPATIBLE FALSE)
+  endif()
+
+  if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+    set(PACKAGE_VERSION_EXACT TRUE)
+  endif()
 endif()
-
-# Test for exact (does not ignore tweak)
-if (FIND_EXACT VERSION_EQUAL THRUST_EXACT)
-  set(PACKAGE_VERSION_EXACT TRUE)
-endif()


More corrections to FindArrow

More corrections to FindArrow

--- cmake_scripts/FindArrow.cmake
+++ cmake_scripts/FindArrow.cmake
@@ -83,7 +83,7 @@
   PATHS
   ${ARROW_SEARCH_LIB_PATH}
   NO_DEFAULT_PATH)
-message("Found ${ARROW_LIB_PATH} in ${ARROW_SEARCH_LIB_PATH}")
+message(STATUS "Found ${ARROW_LIB_PATH} in ${ARROW_SEARCH_LIB_PATH}")
 get_filename_component(ARROW_LIBS ${ARROW_LIB_PATH} DIRECTORY)

 find_library(ARROW_PYTHON_LIB_PATH NAMES arrow_python
@@ -94,13 +94,16 @@
 if (ARROW_INCLUDE_DIR AND ARROW_LIBS)
   set(ARROW_FOUND TRUE)

+  set(ARROW_LIB_NAME arrow)
+  set(ARROW_PYTHON_LIB_NAME arrow_python)
+
   if (MSVC)
     set(ARROW_STATIC_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}${ARROW_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
     set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIBS}/${ARROW_PYTHON_LIB_NAME}${ARROW_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
-    set(ARROW_SHARED_LIB ${ARROW_SHARED_LIBS}/${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(ARROW_PYTHON_SHARED_LIB ${ARROW_PYTHON_SHARED_LIBS}/${ARROW_PYTHON_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+    set(ARROW_SHARED_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+    set(ARROW_PYTHON_SHARED_LIB ${ARROW_LIBS}/${ARROW_PYTHON_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
     set(ARROW_SHARED_IMP_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}.lib)
-    set(ARROW_PYTHON_SHARED_IMP_LIB ${ARROW_PYTHON_LIBS}/${ARROW_PYTHON_LIB_NAME}.lib)
+    set(ARROW_PYTHON_SHARED_IMP_LIB ${ARROW_LIBS}/${ARROW_PYTHON_LIB_NAME}.lib)
   else()
     set(ARROW_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow.a)
     set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_python.a)


Use Nuttx defconfig defines to determine arch (#9516)

These hard coded paths assume all Nuttx targets are ARMv7-M targets. Updating them to use ${CONFIG_ARCH} and ${CONFIG_ARCH_FAMILY} instead allows for the architecture defined by the incoming Nuttx defconfig to be correctly targeted.

--- platforms/nuttx/cmake/px4_impl_os.cmake
+++ platforms/nuttx/cmake/px4_impl_os.cmake
@@ -182,9 +182,9 @@
 	)

 	include_directories(
-		${PX4_BINARY_DIR}/NuttX/nuttx/arch/arm/src/armv7-m
-		${PX4_BINARY_DIR}/NuttX/nuttx/arch/arm/src/chip
-		${PX4_BINARY_DIR}/NuttX/nuttx/arch/arm/src/common
+		${PX4_BINARY_DIR}/NuttX/nuttx/arch/${CONFIG_ARCH}/src/${CONFIG_ARCH_FAMILY}
+		${PX4_BINARY_DIR}/NuttX/nuttx/arch/${CONFIG_ARCH}/src/chip
+		${PX4_BINARY_DIR}/NuttX/nuttx/arch/${CONFIG_ARCH}/src/common

 		${PX4_BINARY_DIR}/NuttX/apps/include
 		)


COMP: Must remove incomplete ITKDoxygenTAG_DIR

The rename "${ITKDoxygenTAG_TEMP_DIR}" "${ITKDoxygenTAG_DIR}" command
failed if  "${ITKDoxygenTAG_DIR}" existed without the proper structure.

--- CMake/ITKDoxygenTAG.cmake
+++ CMake/ITKDoxygenTAG.cmake
@@ -6,8 +6,11 @@
 add_custom_command( OUTPUT ${ITKDoxygenTAG_DIR}/InsightDoxygen.tag
   COMMAND ${CMAKE_COMMAND} -DITKDoxygenTAG_TEMP_DIR="${ITKDoxygenTAG_TEMP_DIR}" -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/DownloadDoxygenTAG.cmake
   COMMAND ${PYTHON_EXECUTABLE} "${ITKExamples_SOURCE_DIR}/Utilities/GUnzip.py" "${ITKDoxygenTAG_TEMP_DIR}/InsightDoxygen.tag.gz"
+
+  COMMAND ${CMAKE_COMMAND} -E remove_directory "${ITKDoxygenTAG_DIR}"
   COMMAND ${CMAKE_COMMAND} -E rename "${ITKDoxygenTAG_TEMP_DIR}" "${ITKDoxygenTAG_DIR}"
   COMMAND ${CMAKE_COMMAND} -E remove_directory "${ITKDoxygenTAG_TEMP_DIR}"
+
   COMMENT "Downloading and unpacking the Doxygen TAG"
   )
 add_custom_target( ITKDoxygenTAG ${CMAKE_COMMAND} -E echo "Finished obtaining Doxygen TAG"


Fix output and volume concatenation

Fix output and volume concatenation

--- CMakeModules/Docker.cmake
+++ CMakeModules/Docker.cmake
@@ -40,7 +40,9 @@
       ENDIF()

       IF(DOCKER_RUN_OUTPUT OR DOCKER_RUN_VOLUME)
-          LIST(APPEND ${DOCKER_RUN_VOLUME} ${DOCKER_RUN_OUTPUT})
+          FOREACH(MAPPING IN ITEMS ${DOCKER_RUN_OUTPUT})
+              STRING(CONCAT DOCKER_RUN_OUTPUT_TMP "${DOCKER_RUN_OUTPUT_TMP}" "-v " ${MAPPING} " ")
+          ENDFOREACH()
           FOREACH(MAPPING IN ITEMS ${DOCKER_RUN_VOLUME})
               STRING(CONCAT DOCKER_RUN_OUTPUT_TMP "${DOCKER_RUN_OUTPUT_TMP}" "-v " ${MAPPING} " ")
           ENDFOREACH()


Update to build Fermi cubins when CUDA 3.0 is present.

git-svn-id: 4ba210d0a933e3fb1aa9ab096f190cd38965d92a@2924 fa922fa7-2fde-0310-acd8-f43f465a7996

--- CMake_build_options.cmake
+++ CMake_build_options.cmake
@@ -79,7 +79,15 @@
     endif (NOT _cuda_arch_ok)

     add_definitions(-DCUDA_ARCH=${CUDA_ARCH})
-    list(APPEND CUDA_NVCC_FLAGS -arch "sm_${CUDA_ARCH}")
+    if (CUDA_VERSION VERSION_GREATER 2.99)
+        message(STATUS "Enabling Fermi compilation with CUDA 3.0")
+        list(APPEND CUDA_NVCC_FLAGS "-gencode=arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}")
+        list(APPEND CUDA_NVCC_FLAGS "-gencode=arch=compute_${CUDA_ARCH},code=compute_${CUDA_ARCH}")
+        list(APPEND CUDA_NVCC_FLAGS "-gencode=arch=compute_20,code=sm_20")
+        list(APPEND CUDA_NVCC_FLAGS "-gencode=arch=compute_20,code=compute_20")
+    else (CUDA_VERSION VERSION_GREATER 2.99)
+        list(APPEND CUDA_NVCC_FLAGS -arch "sm_${CUDA_ARCH}")
+    endif (CUDA_VERSION VERSION_GREATER 2.99)

     # ULF bug workaround disable option
     option(DISABLE_ULF_WORKAROUND "Set to ON to enable higher performace at the cost of stability on pre C1060 GPUs" off)


Another fetch --all killed

Another fetch --all killed

--- SubProject.cmake
+++ SubProject.cmake
@@ -121,7 +121,7 @@
       list(GET __subproject_list 1 __subproject_repo)
       set(__subproject_dir "${CMAKE_SOURCE_DIR}/${__subproject_name}")
       file(APPEND "${GIT_SUBPROJECTS_SCRIPT}"
-        "execute_process(COMMAND ${GIT_EXECUTABLE} fetch --all -q\n"
+        "execute_process(COMMAND ${GIT_EXECUTABLE} fetch origin -q\n"
         "  WORKING_DIRECTORY ${__subproject_dir})\n"
         "execute_process(COMMAND \n"
         "  ${GIT_EXECUTABLE} show-ref --hash=7 refs/remotes/origin/master\n"


pkgconfig: dont hardcode boost and freeimage lib names (#2525)

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -172,11 +172,19 @@
     set(OGRE_ADDITIONAL_LIBS "${OGRE_ADDITIONAL_LIBS} -lpthread")
   endif ()
   if (OGRE_STATIC)
-    if (OGRE_CONFIG_THREADS)
-      set(OGRE_ADDITIONAL_LIBS "${OGRE_ADDITIONAL_LIBS} -lboost-thread-mt")
+    if (OGRE_CONFIG_THREADS AND OGRE_CONFIG_THREAD_PROVIDER STREQUAL "boost")
+      if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+        set(OGRE_ADDITIONAL_LIBS "${OGRE_ADDITIONAL_LIBS} ${Boost_THREAD_LIBRARY_DEBUG}")
+      else()
+        set(OGRE_ADDITIONAL_LIBS "${OGRE_ADDITIONAL_LIBS} ${Boost_THREAD_LIBRARY_RELEASE}")
+      endif()
     endif ()
     # there is no pkgconfig file for freeimage, so we need to add that lib manually
-    set(OGRE_ADDITIONAL_LIBS "${OGRE_ADDITIONAL_LIBS} -lfreeimage")
+    if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+      set(OGRE_ADDITIONAL_LIBS "${OGRE_ADDITIONAL_LIBS} ${FreeImage_LIBRARY_DBG}")
+    else()
+      set(OGRE_ADDITIONAL_LIBS "${OGRE_ADDITIONAL_LIBS} ${FreeImage_LIBRARY_REL}")
+    endif()
     configure_file(${OGRE_TEMPLATES_DIR}/OGREStatic.pc.in ${PROJECT_BINARY_DIR}/pkgconfig/OGRE.pc @ONLY)
   else ()
     configure_file(${OGRE_TEMPLATES_DIR}/OGRE.pc.in ${PROJECT_BINARY_DIR}/pkgconfig/OGRE.pc @ONLY)


Do not enable libiconv in DCMTK by default

Closes #178

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -57,6 +57,7 @@
           -DDCMTK_WITH_PNG:BOOL=OFF # see github issue #25
           -DDCMTK_WITH_TIFF:BOOL=OFF  # see github issue #25
           -DDCMTK_WITH_XML:BOOL=OFF  # see github issue #25
+          -DDCMTK_WITH_ICONV:BOOL=OFF  # see github issue #178
           -DDCMTK_FORCE_FPIC_ON_UNIX:BOOL=ON
           -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS:BOOL=OFF
         )


updated FindMKL

updated FindMKL

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -1,339 +1,280 @@
-# CMake script to detect Intel(R) Math Kernel Library (MKL)
-#
-# This will try to find Intel MKL libraries, and include path by automatic
-# search through typical install locations and if failed it will
-# examine MKLROOT environment variable.
-# Note, MKLROOT is not set by IPP installer, it should be set manually.
-#
-# Usage example:
-#   set(MKL_USE_STATIC_LIBS ON)
-#   find_package(MKL)
-#   if (MKL_FOUND)
-#      include_directories(${MKL_INCLUDE_DIRS})
-#      add_executable(foo foo.cc)
-#      target_link_libraries(foo ${MKL_LIBRARIES})
-#   endif()
-#
-# Variables used by this module, they can change the default behaviour and
-# need to be set before calling find_package:
-#
-#   MKL_ADDITIONAL_VERSIONS      A list of version numbers to use for searching
-#                                the MKL include directory.
-#
-#   MKL_USE_STATIC_LIBS          Can be set to ON to force the use of the static
-#                                boost libraries. Defaults to OFF.
-#
-#   MKL_FIND_DEBUG               Set this to TRUE to enable debugging output
-#                                of FindMKL.cmake if you are having problems.
-#
-# On return this will define:
-#   MKL_FOUND                   Indicates whether MKL was found (True/False)
-#   MKL_INCLUDE_DIRS            MKL include folder
-#   MKL_LIBRARY_DIRS            MKL libraries folder
-#   MKL_LIBRARIES               MKL libraries names
-#
-# NOTE: this script has only been tested with Intel(R) Parallel Studio XE 2011
-# and may need changes for compatibility with older versions.
-#
-# Adapted from OpenCV IPP detection script
-#   https://code.ros.org/trac/opencv/browser/trunk/opencv/OpenCVFindIPP.cmake
-# Many portions taken from FindBoost.cmake
-
-# TODO:
-# - caller needs to link with libiomp5md.lib or /Qopenmp...
-# - runtime DLLs:
-#   <Composer XE directory> -> C:\Program Files\Intel\ComposerXE-2011
-#     redist\ia32\mkl
-#     redist\intel64\mkl
-
-set(_MKL_IA32 FALSE)
-set(_MKL_INTEL64 FALSE)
-if (CMAKE_SIZEOF_VOID_P EQUAL 4)
-    set(_MKL_IA32 TRUE)
-elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
-    set(_MKL_INTEL64 TRUE)
+# Copyright (c) 2018, ArrayFire
+# All rights reserved.
+#
+# This file is distributed under 3-clause BSD license. The complete license
+# agreement can be obtained at: http://arrayfire.com/licenses/BSD-3-Clause
+#
+# A FindMKL script based on the recommendations by the Intel's Link Line
+# Advisor. It currently only tested on the 2018 version of MKL on Windows,
+# Linux, and OSX but it should work on older versions.
+#
+# To use this module call the mklvars.(sh,bat) script before you call cmake. This
+# script is located in the bin folder of your mkl installation. This will set the
+# MKLROOT environment variable which will be used to find the libraries on your system.
+#
+# Example:
+# set(MKL_THREAD_LAYER "TBB")
+# find_package(MKL)
+#
+# add_executable(myapp main.cpp)
+# target_link_libraries(myapp PRIVATE MKL::MKL)
+#
+# This module bases its behavior based on the following variables:
+#
+# ``MKL_THREAD_LAYER``
+#   The threading layer that needs to be used by the MKL library. This
+#   Defines which library will be used to parallelize the MKL kernels. Possible
+#   options are TBB(Default), GNU OpenMP, Intel OpenMP, Sequential
+#
+# This module provides the following :prop_tgt:'IMPORTED' targets:
+#
+# ``MKL::MKL``
+#   Target used to define and link all MKL libraries required by Intel's Link
+#   Line Advisor. This usually the only thing you need to link against unless
+#   you want to link against the single dynamic library version of MKL
+#   (libmkl_rt.so)
+#
+#  Optional:
+#
+# ``MKL::ThreadLayer{_STATIC}``
+#   Target used to define the threading layer(TBB, OpenMP, etc.) based on
+#   MKL_THREAD_LAYER variable.
+#
+# ``MKL::ThreadingLibrary``
+#   Target used to define the threading library(libtbb, libomp, etc) that the
+#   application will need to link against.
+#
+# ``MKL::Interface``
+#   Target used to determine which interface library to use(32bit int or 64bit
+#   int).
+#
+# ``MKL::Core``
+#   Target for the dynamic library dispatcher
+#
+# ``MKL::RT``
+#   Target for the single dynamic library
+#
+# ``MKL::{mkl_def;mkl_mc;mkl_mc3;mkl_avx;mkl_avx2;mkl_avx512}{_STATIC}``
+#   Targets for MKL kernel libraries.
+
+include(CheckTypeSize)
+
+check_type_size("int" INT_SIZE
+  BUILTIN_TYPES_ONLY LANGUAGE C)
+
+set(MKL_THREAD_LAYER "TBB" CACHE STRING "The thread layer to choose for MKL")
+set_property(CACHE MKL_THREAD_LAYER PROPERTY STRINGS "TBB" "GNU OpenMP" "Intel OpenMP" "Sequential")
+
+if(NOT MKL_THREAD_LAYER STREQUAL MKL_THREAD_LAYER_LAST)
+  unset(MKL::ThreadLayer CACHE)
+  unset(MKL::ThreadingLibrary CACHE)
+  unset(MKL_ThreadLayer_LINK_LIBRARY CACHE)
+  unset(MKL_ThreadLayer_STATIC_LINK_LIBRARY CACHE)
+  unset(MKL_ThreadLayer_DLL_LIBRARY CACHE)
+  unset(MKL_ThreadingLibrary_LINK_LIBRARY CACHE)
+  unset(MKL_ThreadingLibrary_STATIC_LINK_LIBRARY CACHE)
+  unset(MKL_ThreadingLibrary_DLL_LIBRARY CACHE)
+  set(MKL_THREAD_LAYER_LAST ${MKL_THREAD_LAYER} CACHE INTERNAL "" FORCE)
+endif()
+
+find_path(MKL_INCLUDE_DIR
+  NAMES
+    mkl.h
+    mkl_blas.h
+    mkl_cblas.h
+  PATHS
+    /opt/intel
+    /opt/intel/mkl
+    $ENV{MKLROOT}
+    /opt/intel/compilers_and_libraries/linux/mkl
+  PATH_SUFFIXES
+    include
+    IntelSWTools/compilers_and_libraries/windows/mkl/include
+    )
+mark_as_advanced(MKL_INCLUDE_DIR)
+
+find_path(MKL_FFTW_INCLUDE_DIR
+  NAMES
+    fftw3_mkl.h
+  HINTS
+    ${MKL_INCLUDE_DIR}/fftw)
+mark_as_advanced(MKL_FFTW_INCLUDE_DIR)
+
+
+if(WIN32)
+  if(${MSVC_VERSION} GREATER_EQUAL 1900)
+    set(msvc_dir "vc_mt")
+    set(shared_suffix "_dll")
+    set(md_suffix "md")
+  else()
+    message(WARNING "MKL: MS Version not supported for MKL")
+  endif()
+endif()
+
+# Finds and creates libraries for MKL with the MKL:: prefix
+#
+# Parameters:
+#    NAME:         A variable name describing the library
+#    LIBRARY_NAME: The library that needs to be searched
+#
+# Output Libraries:
+#    MKL::${NAME}
+#    MKL::${NAME}_STATIC
+#
+# Output Variables
+#    MKL_INCLUDE_DIR:                Include directory for MKL
+#    MKL_FFTW_INCLUDE_DIR:           Include directory for the MKL FFTW interface
+#    MKL_${NAME}_LINK_LIBRARY:        on Unix: *.so on Windows *.lib
+#    MKL_${NAME}_STATIC_LINK_LIBRARY: on Unix: *.a  on Windows *.lib
+#    MKL_${NAME}_DLL_LIBRARY:         on Unix: ""   on Windows *.dll
+function(find_mkl_library)
+  set(options "")
+  set(single_args NAME LIBRARY_NAME)
+  set(multi_args "")
+
+  cmake_parse_arguments(mkl_args "${options}" "${single_args}" "${multi_args}" ${ARGN})
+
+  add_library(MKL::${mkl_args_NAME}        SHARED IMPORTED)
+  add_library(MKL::${mkl_args_NAME}_STATIC SHARED IMPORTED)
+  find_library(MKL_${mkl_args_NAME}_LINK_LIBRARY
+    NAMES
+      ${mkl_args_LIBRARY_NAME}${shared_suffix}
+      ${mkl_args_LIBRARY_NAME}${md_suffix}
+      lib${mkl_args_LIBRARY_NAME}${md_suffix}
+      ${mkl_args_LIBRARY_NAME}
+    PATHS
+      /opt/intel/mkl/lib
+      /opt/intel/tbb/lib
+      /opt/intel/lib
+      $ENV{MKLROOT}/lib
+      /opt/intel/compilers_and_libraries/linux/mkl/lib
+    PATH_SUFFIXES
+      IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64
+      IntelSWTools/compilers_and_libraries/windows/compiler/lib/intel64
+      IntelSWTools/compilers_and_libraries/windows/tbb/lib/intel64/${msvc_dir}
+      ""
+      intel64
+      intel64/gcc4.7)
+  mark_as_advanced(MKL_${mkl_args_NAME}_LINK_LIBRARY)
+
+  #message(STATUS "NAME: ${mkl_args_NAME} LIBNAME: ${mkl_args_LIBRARY_NAME} MKL_${mkl_args_NAME}_LINK_LIBRARY  ${MKL_${mkl_args_NAME}_LINK_LIBRARY}")
+
+  # The rt library does not have a static library
+  if(NOT ${mkl_args_NAME} STREQUAL "rt")
+    find_library(MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY
+      NAMES
+        ${CMAKE_STATIC_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+      PATHS
+        /opt/intel/mkl/lib
+        /opt/intel/tbb/lib
+        /opt/intel/lib
+        $ENV{MKLROOT}/lib
+        /opt/intel/compilers_and_libraries/linux/mkl/lib
+      PATH_SUFFIXES
+        ""
+        intel64
+        intel64/gcc4.7
+        IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64
+        IntelSWTools/compilers_and_libraries/windows/compiler/lib/intel64
+        IntelSWTools/compilers_and_libraries/windows/tbb/lib/intel64/${msvc_dir}
+        )
+      mark_as_advanced(MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY)
+    endif()
+
+    set_target_properties(MKL::${mkl_args_NAME}
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR}"
+        IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_LINK_LIBRARY}"
+        IMPORTED_NO_SONAME TRUE)
+    if(WIN32)
+      find_file(MKL_${mkl_args_NAME}_DLL_LIBRARY
+        NAMES
+          ${CMAKE_SHARED_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
+          ${CMAKE_SHARED_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${md_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}
+          lib${mkl_args_LIBRARY_NAME}${md_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}
+        PATH_SUFFIXES
+          IntelSWTools/compilers_and_libraries/windows/redist/intel64/mkl
+          IntelSWTools/compilers_and_libraries/windows/redist/intel64/compiler
+          IntelSWTools/compilers_and_libraries/windows/redist/intel64/tbb/${msvc_dir}
+        NO_SYSTEM_ENVIRONMENT_PATH)
+
+      set_target_properties(MKL::${mkl_args_NAME}
+        PROPERTIES
+          IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_DLL_LIBRARY}"
+          IMPORTED_IMPLIB "${MKL_${mkl_args_NAME}_LINK_LIBRARY}")
+
+      mark_as_advanced(MKL_${mkl_args_NAME}_DLL_LIBRARY)
+    endif()
+endfunction()
+
+
+find_mkl_library(NAME Core LIBRARY_NAME mkl_core)
+find_mkl_library(NAME RT LIBRARY_NAME mkl_rt)
+
+# MKL can link against Intel OpenMP, GNU OpenMP, TBB, and Sequential
+if(MKL_THREAD_LAYER STREQUAL "Intel OpenMP")
+  find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_intel_thread)
+  find_mkl_library(NAME ThreadingLibrary LIBRARY_NAME iomp5)
+elseif(MKL_THREAD_LAYER STREQUAL "GNU OpenMP")
+  find_package(OpenMP REQUIRED)
+  find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_gnu_thread)
+  add_library(MKL::ThreadingLibrary SHARED IMPORTED)
+  set_target_properties(MKL::ThreadingLibrary
+    PROPERTIES
+      IMPORTED_LOCATION "${OpenMP_gomp_LIBRARY}"
+      INTERFACE_LINK_LIBRARIES OpenMP::OpenMP_CXX)
+elseif(MKL_THREAD_LAYER STREQUAL "TBB")
+  find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_tbb_thread)
+  find_mkl_library(NAME ThreadingLibrary LIBRARY_NAME tbb)
+elseif(MKL_THREAD_LAYER STREQUAL "Sequential")
+  find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_sequential)
+endif()
+
+if("${INT_SIZE}" EQUAL 4)
+  find_mkl_library(NAME Interface LIBRARY_NAME mkl_intel_lp64)
 else()
-    message(FATAL_ERROR "Unsupported 'void *' size (${SIZEOF_VOID_P})")
-endif()
-
-# Versions should be listed is decreasing order of preference
-set(_MKL_TEST_VERSIONS ${MKL_ADDITIONAL_VERSIONS}
-    "2011"
-    # alternative form: "2011.xxx.y"
-    # (y is the release-update number and xxx is the package number)
-)
-
-if (MKL_FIND_VERSION AND NOT MKL_FIND_QUIETLY)
-    message(WARNING "Requesting a specific version of Intel(R) MKL is not supported")
-endif()
-
-# Use environment variables from Intel build scripts, if available
-if (NOT MKL_ROOT AND NOT $ENV{MKLROOT} STREQUAL "")
-  set(MKL_ROOT $ENV{MKLROOT})
-endif()
-
-if (MKL_ROOT)
-  file(TO_CMAKE_PATH ${MKL_ROOT} MKL_ROOT)
-endif()
-
-if (NOT INTEL_ROOT AND NOT $ENV{INTELROOT} STREQUAL "")
-  set(INTEL_ROOT $ENV{INTELROOT})
-endif()
-
-if (INTEL_ROOT)
-  file(TO_CMAKE_PATH ${INTEL_ROOT} INTEL_ROOT)
-endif()
-
-if (MKL_FIND_DEBUG)
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "_MKL_TEST_VERSIONS = ${_MKL_TEST_VERSIONS}")
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "MKL_ADDITIONAL_VERSIONS = ${MKL_ADDITIONAL_VERSIONS}")
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "MKL_USE_STATIC_LIBS = ${MKL_USE_STATIC_LIBS}")
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "MKL_ROOT = ${MKL_ROOT}")
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "INTEL_ROOT = ${INTEL_ROOT}")
-endif()
-
-# Find MKL include directory
-
-set(_MKL_ROOT_SEARCH_DIRS
-  ${MKL_ROOT}
-)
-
-foreach (_MKL_VER ${_MKL_TEST_VERSIONS})
-    if (WIN32)
-        list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{ProgramFiles}/Intel/Composer XE/mkl")
-    else()
-        list(APPEND _MKL_ROOT_SEARCH_DIRS "/opt/intel/composerxe-${_MKL_VER}/mkl")
-    endif()
+  find_mkl_library(NAME Interface LIBRARY_NAME mkl_intel_ilp64)
+endif()
+
+set(MKL_RUNTIME_KERNEL_LIBRARIES "" CACHE FILEPATH "MKL kernel libraries targeting different CPU architectures")
+set(MKL_KernelLibraries "mkl_def;mkl_mc;mkl_mc3;mkl_avx;mkl_avx2;mkl_avx512")
+
+foreach(lib ${MKL_KernelLibraries})
+  find_mkl_library(NAME ${lib} LIBRARY_NAME ${lib})
+  if(MKL_${lib}_LINK_LIBRARY OR MKL_${lib}_DLL_LIBRARY)
+    list(APPEND MKL_RUNTIME_KERNEL_LIBRARIES $<TARGET_FILE:MKL::${lib}>)
+  endif()
 endforeach()
-
-if (MKL_FIND_DEBUG)
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "_MKL_ROOT_SEARCH_DIRS = ${_MKL_ROOT_SEARCH_DIRS}")
-endif()
-
-find_path(MKL_INCLUDE_DIR
-    NAMES mkl.h
-    PATHS ${_MKL_ROOT_SEARCH_DIRS}
-    PATH_SUFFIXES include
-    DOC "The path to Intel(R) MKL header files"
-)
-
-if (MKL_INCLUDE_DIR)
-    if (MKL_FIND_DEBUG)
-        message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                       "location of mkl.h: ${MKL_INCLUDE_DIR}/mkl.h")
-    endif()
-else()
-    if (MKL_FIND_DEBUG)
-        message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                       "unable to find Intel(R) MKL header files. Please set MKLROOT"
-                       " to the root directory containing MKL.")
-    endif()
-endif()
-
-# Find MKL library directory
-
-set(_INTEL_LIBRARY_DIR_SUFFIXES "lib")
-if (_MKL_IA32)
-    list(APPEND _INTEL_LIBRARY_DIR_SUFFIXES "lib/ia32")
-elseif (_MKL_INTEL64)
-    list(APPEND _INTEL_LIBRARY_DIR_SUFFIXES "lib/intel64")
-else()
-    message(FATAL_ERROR "unreachable")
-endif()
-
-set(_MKL_LIBRARY_SEARCH_DIRS ${_MKL_ROOT_SEARCH_DIRS})
-if (MKL_INCLUDE_DIR)
-    list(APPEND _MKL_LIBRARY_SEARCH_DIRS "${MKL_INCLUDE_DIR}/..")
-endif()
-
-if (MKL_FIND_DEBUG)
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "_INTEL_LIBRARY_DIR_SUFFIXES = ${_INTEL_LIBRARY_DIR_SUFFIXES}")
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "_MKL_LIBRARY_SEARCH_DIRS = ${_MKL_LIBRARY_SEARCH_DIRS}")
-endif()
-
-set(MKL_LIB_PREFIX "mkl_")
-if (MKL_USE_STATIC_LIBS)
-    if (_MKL_IA32)
-        if (WIN32)
-            set(_MKL_LIBRARIES intel_c)
-        else()
-            set(_MKL_LIBRARIES intel)
-        endif()
-    elseif (_MKL_INTEL64)
-        set(_MKL_LIBRARIES intel_lp64)
-    else()
-        message(FATAL_ERROR "unreachable")
-    endif()
-
-    list(APPEND _MKL_LIBRARIES intel_thread)
-    list(APPEND _MKL_LIBRARIES core)
-else()
-    set(_MKL_LIBRARIES rt)
-endif()
-
-set(_MKL_MISSING_LIBRARIES "")
-set(MKL_LIBRARIES "")
-set(MKL_LIBRARY_DIRS "")
-# Find MKL libraries
-foreach (_MKL_LIB_RAW ${_MKL_LIBRARIES})
-    set(_MKL_LIB ${MKL_LIB_PREFIX}${_MKL_LIB_RAW})
-    string(TOUPPER ${_MKL_LIB} _MKL_LIB_UPPER)
-
-    find_library(${_MKL_LIB_UPPER}_LIBRARY
-        NAMES ${_MKL_LIB}
-        PATHS ${_MKL_LIBRARY_SEARCH_DIRS}
-        PATH_SUFFIXES ${_INTEL_LIBRARY_DIR_SUFFIXES}
-        DOC "The path to Intel(R) MKL ${_MKL_LIB_RAW} library"
-    )
-    mark_as_advanced(${_MKL_LIB_UPPER}_LIBRARY)
-
-    if (NOT ${_MKL_LIB_UPPER}_LIBRARY)
-        list(APPEND _MKL_MISSING_LIBRARIES ${_MKL_LIB})
-    else()
-        list(APPEND MKL_LIBRARIES ${${_MKL_LIB_UPPER}_LIBRARY})
-        if (MKL_FIND_DEBUG)
-            message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                           "Found ${_MKL_LIB}: ${${_MKL_LIB_UPPER}_LIBRARY}")
-        endif()
-
-        get_filename_component(_MKL_LIB_PATH "${${_MKL_LIB_UPPER}_LIBRARY}" PATH)
-        list(APPEND MKL_LIBRARY_DIRS ${_MKL_LIB_PATH})
-    endif()
-endforeach()
-
-## Find OpenMP, pthread and math libraries
-
-set(_INTEL_LIBRARY_SEARCH_DIRS
-  ${INTEL_ROOT}
-  ${INTEL_ROOT}/compiler
-)
-
-foreach(_MKL_DIR ${_MKL_ROOT_SEARCH_DIRS})
-    list(APPEND _INTEL_LIBRARY_SEARCH_DIRS "${_MKL_DIR}/..")
-    list(APPEND _INTEL_LIBRARY_SEARCH_DIRS "${_MKL_DIR}/../compiler")
-endforeach()
-
-if (MKL_FIND_DEBUG)
-    message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "_INTEL_LIBRARY_SEARCH_DIRS = ${_INTEL_LIBRARY_SEARCH_DIRS}")
-endif()
-
-if (NOT WIN32)
-    find_library(PTHREAD_LIBRARY pthread DOC "Path to POSIX threads library")
-endif()
-
-set(_IOMP5_LIB iomp5)
-if (WIN32)
-  if (MKL_USE_STATIC_LIBS)
-      list(APPEND _IOMP5_LIB libiomp5mt.lib)
+mark_as_advanced(MKL_RUNTIME_KERNEL_LIBRARIES)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(MKL
+  REQUIRED_VARS MKL_INCLUDE_DIR MKL_Core_LINK_LIBRARY)
+if(NOT WIN32)
+  find_library(M_LIB m)
+  mark_as_advanced(M_LIB)
+endif()
+if(MKL_FOUND)
+  add_library(MKL::MKL SHARED IMPORTED)
+  if(MKL_THREAD_LAYER STREQUAL "Sequential")
+    set_target_properties(MKL::MKL
+      PROPERTIES
+        IMPORTED_LOCATION "${MKL_Core_LINK_LIBRARY}"
+        INTERFACE_LINK_LIBRARIES "MKL::Interface;MKL::ThreadLayer;${CMAKE_DL_LIBS};${M_LIB}"
+        INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR};${MKL_FFTW_INCLUDE_DIR}"
+        IMPORTED_NO_SONAME TRUE)
   else()
-      list(APPEND _IOMP5_LIB libiomp5md.lib)
-  endif()
-endif()
-
-find_library(IOMP5_LIBRARY
-    NAMES ${_IOMP5_LIB}
-    PATHS ${_INTEL_LIBRARY_SEARCH_DIRS}
-    PATH_SUFFIXES ${_INTEL_LIBRARY_DIR_SUFFIXES}
-    DOC "Path to OpenMP runtime library"
-)
-
-if (NOT IOMP5_LIBRARY)
-    # we could instead fallback to default library (via FindOpenMP.cmake)
-    list(APPEND _MKL_MISSING_LIBRARIES IOMP5)
-else()
-    list(APPEND MKL_LIBRARIES ${IOMP5_LIBRARY})
-    if (MKL_FIND_DEBUG)
-        message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                       "Found IOMP5_LIBRARY: ${IOMP5_LIBRARY}")
-    endif()
-
-    get_filename_component(_MKL_LIB_PATH "${IOMP5_LIBRARY}" PATH)
-    list(APPEND MKL_LIBRARY_DIRS ${_MKL_LIB_PATH})
-endif()
-
-# Optimized math library (optional)
-set(_MATH_LIB imf)  # linked by default with Intel compiler
-if (WIN32)
-  if (MKL_USE_STATIC_LIBS)
-    list(APPEND _MATH_LIB libmmds.lib)  # assumes (/MD) otherwise libmmt.lib (for /MT)
-  else()
-      list(APPEND _MATH_LIB libmmd.lib)
-  endif()
-endif()
-
-find_library(MATH_LIBRARY
-    NAMES ${_MATH_LIB}
-    PATHS ${_INTEL_LIBRARY_SEARCH_DIRS}
-    PATH_SUFFIXES ${_INTEL_LIBRARY_DIR_SUFFIXES}
-    DOC "Path to optimized math library"
-)
-
-if (NOT MATH_LIBRARY)
-    # we could instead fallback to default library (via FindOpenMP.cmake)
-    list(APPEND _MKL_MISSING_LIBRARIES MATH)
-else()
-    list(APPEND MKL_LIBRARIES ${MATH_LIBRARY})
-    if (MKL_FIND_DEBUG)
-        message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                       "Found MATH_LIBRARY: ${MATH_LIBRARY}")
-    endif()
-
-    get_filename_component(_MKL_LIB_PATH "${MATH_LIBRARY}" PATH)
-    list(APPEND MKL_LIBRARY_DIRS ${_MKL_LIB_PATH})
-endif()
-
-# Check all required libraries are available
-list(REMOVE_DUPLICATES MKL_LIBRARY_DIRS)
-
-set(MKL_INCLUDE_DIRS
-    ${MKL_INCLUDE_DIR}
-)
-
-set(MKL_FOUND TRUE)
-if (NOT MKL_INCLUDE_DIR)
-    set(MKL_FOUND FALSE)
-    if (MKL_FIND_DEBUG)
-        message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                       "MKL not found - MKL_INCLUDE_DIR was empty")
-    endif()
-elseif (_MKL_MISSING_LIBRARIES)
-    set(MKL_FOUND FALSE)
-    if (MKL_FIND_DEBUG)
-        message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                       "MKL not found - the following libraries are missing: "
-                       "${_MKL_MISSING_LIBRARIES}")
-    endif()
-endif()
-
-if (MKL_FOUND)
-    if (NOT MKL_FIND_QUIETLY OR MKL_FIND_DEBUG)
-        message(STATUS
-            "Intel(R) MKL was found:\n"
-            "  MKL_INCLUDE_DIRS: ${MKL_INCLUDE_DIRS}\n"
-            "  MKL_LIBRARY_DIRS: ${MKL_LIBRARY_DIRS}\n"
-            "  MKL_LIBRARIES: ${MKL_LIBRARIES}"
-        )
-    endif()
-else()
-    if (MKL_FIND_REQUIRED)
-        message(SEND_ERROR "Intel(R) MKL could not be found.")
-    else()
-        message(STATUS "Intel(R) MKL could not be found.")
-    endif()
-endif()
-
-mark_as_advanced(
-    MKL_INCLUDE_DIR
-    MKL_INCLUDE_DIRS
-    MKL_LIBRARY_DIRS
-)
-
+    set_target_properties(MKL::MKL
+      PROPERTIES
+        IMPORTED_LOCATION "${MKL_Core_LINK_LIBRARY}"
+        INTERFACE_LINK_LIBRARIES "MKL::Interface;MKL::ThreadLayer;MKL::ThreadingLibrary;${CMAKE_DL_LIBS};${M_LIB}"
+        INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR};${MKL_FFTW_INCLUDE_DIR}"
+        IMPORTED_NO_SONAME TRUE)
+  endif()
+  if(WIN32)
+    set_target_properties(MKL::MKL
+      PROPERTIES
+        IMPORTED_LOCATION "${MKL_Core_DLL_LIBRARY}"
+        IMPORTED_IMPLIB "${MKL_Core_LINK_LIBRARY}")
+  endif()
+endif()


BUG: Unset variables when bulding SlicerExtension

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -18,6 +18,28 @@
 #-----------------------------------------------------------------------------

 include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+
+if( DTIPrep_BUILD_SLICER_EXTENSION )
+  set( EXTERNAL_SOURCE_IN_BINARY_DIR ON)
+  set( USE_SYSTEM_VTK ON CACHE BOOL "Use system VTK" FORCE )
+  #VTK_VERSION_MAJOR is define but not a CACHE variable
+  set( VTK_VERSION_MAJOR ${VTK_VERSION_MAJOR} CACHE STRING "Choose the expected VTK major version to build Slicer (5, 6, 7).")
+  set( USE_SYSTEM_DCMTK ON CACHE BOOL "Use system DCMTK" FORCE )
+  set( USE_SYSTEM_Teem ON CACHE BOOL "Use system Teem" FORCE )
+  set( BUILD_SHARED_LIBS OFF CACHE BOOL "Use shared libraries" FORCE)
+  unsetForSlicer(NAMES CMAKE_MODULE_PATH CMAKE_C_COMPILER CMAKE_CXX_COMPILER DCMTK_DIR ITK_DIR SlicerExecutionModel_DIR VTK_DIR QT_QMAKE_EXECUTABLE ITK_VERSION_MAJOR CMAKE_CXX_FLAGS CMAKE_C_FLAGS Teem_DIR)
+  find_package(Slicer REQUIRED)
+  unsetAllForSlicerBut( NAMES VTK_DIR QT_QMAKE_EXECUTABLE DCMTK_DIR Teem_DIR )
+  resetForSlicer(NAMES CMAKE_MODULE_PATH CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS ITK_DIR SlicerExecutionModel_DIR  ITK_VERSION_MAJOR )
+  if( APPLE )
+    set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,@loader_path/../../../../../")
+  endif()
+  find_package(Subversion REQUIRED )
+else()
+  set( USE_ITK_Module_MGHIO ON )
+  set( SUPERBUILD_NOT_EXTENSION TRUE )
+  option(USE_DTIProcess "Build DTIProcess" ON)
+endif()

 if( EXTERNAL_SOURCE_IN_BINARY_DIR )
   set( EXTERNAL_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )


cmake: Fix forcebuild step

cmake: Fix forcebuild step

This commit ensures the step attempts to remove an existing file by
fixing a regression introduced in b569199 (cmake: Introduce PROJECT_NAME_LC
var to allow consistent naming of inner build dir)

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -100,9 +100,9 @@
 # version will be at least 3.1.
 #
 if(CMAKE_CONFIGURATION_TYPES)
-  set(BUILD_STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj}-stamp/${CMAKE_CFG_INTDIR}/${proj}-build")
+  set(BUILD_STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LC}-prefix/src/${proj}-stamp/${CMAKE_CFG_INTDIR}/${proj}-build")
 else()
-  set(BUILD_STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj}-stamp/${proj}-build")
+  set(BUILD_STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LC}-prefix/src/${proj}-stamp/${proj}-build")
 endif()
 ExternalProject_Add_Step(${proj} forcebuild
   COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_STAMP_FILE}


build: run garbage collection while linking plugins

Ask linker to remove symbols which are not referenced or exported.

Type: improvement
Change-Id: Iec01fda7ec5b14bab8f36d25c2652bd6fe619961
Signed-off-by: Damjan Marion <9141bba8b2efed526e55cf796d48631af330ad98@cisco.com>

--- src/cmake/plugin.cmake
+++ src/cmake/plugin.cmake
@@ -46,6 +46,9 @@
   add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_includes})
   set_target_properties(${plugin_name} PROPERTIES NO_SONAME 1)
   target_compile_options(${plugin_name} PRIVATE "-fvisibility=hidden")
+  target_compile_options (${plugin_name} PRIVATE "-ffunction-sections")
+  target_compile_options (${plugin_name} PRIVATE "-fdata-sections")
+  target_link_libraries (${plugin_name} "-Wl,--gc-sections")
   set(deps "")
   if(PLUGIN_API_FILES)
     list(APPEND deps ${plugin_name}_api_headers)


Set-up Sphinx theme depending on its version

--- salome_adm/cmake_files/FindSphinx.cmake
+++ salome_adm/cmake_files/FindSphinx.cmake
@@ -38,7 +38,18 @@
 ELSE()
   SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
 ENDIF()
+
 # Handle the standard arguments of the find_package() command:
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE)

+IF(SPHINX_EXECUTABLE)
+  EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} "--version" OUTPUT_VARIABLE SPHINX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+  STRING(REGEX REPLACE ".* ([0-9.]+)$" "\\1" SPHINX_VERSION "${SPHINX_VERSION}" )
+  MESSAGE(STATUS "Sphinx version is ${SPHINX_VERSION}")
+  IF(SPHINX_VERSION VERSION_LESS "1.3")
+    SET(SPHINX_THEME "basic")
+  ELSE()
+    SET(SPHINX_THEME "classic")
+  ENDIF()
+ENDIF(SPHINX_EXECUTABLE)


Fetch dependencies shallow

Fetch dependencies shallow

--- ExternalFetchContent.cmake
+++ ExternalFetchContent.cmake
@@ -1,6 +1,7 @@
 include(FetchContent)
 # Load external github projects
 FetchContent_Declare(CppSdl2
+	GIT_SHALLOW 1
 	GIT_REPOSITORY
 		https://github.com/mwthinker/CppSdl2.git
 	GIT_TAG
@@ -9,6 +10,7 @@
 FetchContent_MakeAvailable(CppSdl2)

 FetchContent_Declare(Signal
+	GIT_SHALLOW 1
 	GIT_REPOSITORY
 		https://github.com/mwthinker/Signal.git
 	GIT_TAG
@@ -17,6 +19,7 @@
 FetchContent_MakeAvailable(Signal)

 fetchcontent_declare(CmakeAuxiliary
+	GIT_SHALLOW 1
 	GIT_REPOSITORY
 		https://gist.github.com/mwthinker/e0539b200e3f0ac6da545af4843a6ff6
 )
@@ -40,6 +43,7 @@
 	endif ()
 	# Load data.
 	FetchContent_Declare(ZombieData
+		GIT_SHALLOW 1
 		GIT_REPOSITORY
 			${ZombieData_PrivateRepo_URL}
 		GIT_TAG


Rearrange hint order to prioritize env

Rearrange hint order to prioritize env

--- cmake/FindBinaryNinjaCore.cmake
+++ cmake/FindBinaryNinjaCore.cmake
@@ -21,9 +21,9 @@
         # User install
         list(APPEND PATH_HINTS "$ENV{LocalAppData}\\Vector35\\BinaryNinja")
     elseif(APPLE)
+        list(APPEND PATH_HINTS "$ENV{BN_INSTALL_DIR}/Contents/MacOS")
         list(APPEND PATH_HINTS "/Applications/Binary Ninja.app/Contents/MacOS")
         list(APPEND PATH_HINTS "$ENV{HOME}/Applications/Binary Ninja.app/Contents/MacOS")
-        list(APPEND PATH_HINTS "$ENV{BN_INSTALL_DIR}/Contents/MacOS")
     else()
         list(APPEND PATH_HINTS "$ENV{HOME}/binaryninja")
     endif()


cmake: require boost 1.73 for building with C++20

to address the FTBFS due to https://github.com/boostorg/test/pull/252,
we have to bump the required boost version to 1.73 if compiling with
C++20.

the fix of boost was introduced to boost v1.73 and up. see
https://github.com/boostorg/test/commit/8ac88c62dcc809d42daf8b6bef10f7adecc46dd1

Signed-off-by: Kefu Chai <cdc92d111bae0ed1ee3b3c8a1f849fcffc6b44f7@gmail.com>
Message-Id: <20220530151117.2288924-1-cdc92d111bae0ed1ee3b3c8a1f849fcffc6b44f7@gmail.com>

--- cmake/SeastarDependencies.cmake
+++ cmake/SeastarDependencies.cmake
@@ -34,8 +34,15 @@
 # - Boost::foo
 set (Boost_NO_BOOST_CMAKE ON)

+if (CMAKE_CXX_STANDARD LESS 20)
+  set (_seastar_boost_version 1.64.0)
+else ()
+  # for including the fix of https://github.com/boostorg/test/pull/252
+  set (_seastar_boost_version 1.73.0)
+endif ()
+
 # This is the minimum version of Boost we need the CMake-bundled `FindBoost.cmake` to know about.
-find_package (Boost 1.64 MODULE)
+find_package (Boost ${_seastar_boost_version} MODULE)

 #
 # Iterate through the dependency list defined below and execute `find_package`
@@ -76,7 +83,7 @@
   # without the testing library, however the component is always specified as required
   # to keep the CMake code minimalistic and easy-to-use.
   set (_seastar_dep_args_Boost
-    1.64.0
+    ${_seastar_boost_version}
     COMPONENTS
       filesystem
       program_options


CMake build process: Fix of the Perl Alien::Wx querying script.

--- cmake/modules/FindAlienWx.cmake
+++ cmake/modules/FindAlienWx.cmake
@@ -19,6 +19,15 @@
 use strict;
 use warnings;
 use Text::ParseWords;
+
+BEGIN {
+  # CMake sets the environment variables CC and CXX to the detected C compiler.
+  # There is an issue with the Perl ExtUtils::CBuilder, which does not handle whitespaces
+  # in the paths correctly on Windows, so we rather drop the CMake auto-detected paths.
+  delete \$ENV{CC};
+  delete \$ENV{CXX};
+}
+
 use Alien::wxWidgets;
 use ExtUtils::CppGuess;


Allow expert users to specify PLPLOT_ITCL_VERSION, PLPLOT_ITK_VERSION,
and IWIDGETS_VERSIONS_LIST to avoid running tclsh at the configuration
stage.  However, the values must be consistent to avoid automatic
disabling of Itcl and/or Itk. So for example,
-DIWIDGETS_VERSIONS_LIST:STRING="4.0.1;3.3;3.4"
-DPLPLOT_ITK_VERSION:STRING=3.3 -DPLPLOT_ITCL_VERSION:STRING=3.4 works
correctly on Debian Wheezy, but specifying something different than
the values that would be found automatically by "package require"
commands under tclsh would result in disabling of Itcl, and/or Itk.
So users specify these values at their own risk.

svn path=/trunk/; revision=12745

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -96,14 +96,28 @@
       else(USE_INCRTCL_VERSION_4)
 	set(SUGGESTED_ITCL_VERSION 3)
       endif(USE_INCRTCL_VERSION_4)
-      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl "puts -nonewline [package require Itcl ${SUGGESTED_ITCL_VERSION}]; exit")
-      # Refine SUGGESTED_ITCL_VERSION to exact value or fail.
-      execute_process(
-	COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl
-	RESULT_VARIABLE ITCL_RC
-	OUTPUT_VARIABLE PLPLOT_ITCL_VERSION
-	ERROR_VARIABLE ITCL_STDERR
-	)
+      if(NOT PLPLOT_ITCL_VERSION)
+	file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl "puts -nonewline [package require Itcl ${SUGGESTED_ITCL_VERSION}]; exit")
+	# Refine SUGGESTED_ITCL_VERSION to exact value or fail.
+	execute_process(
+	  COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl
+	  RESULT_VARIABLE ITCL_RC
+	  OUTPUT_VARIABLE _plplot_itcl_version
+	  )
+	if(NOT ITCL_RC)
+	  # Store result in cached variable so it will be remembered
+          # when cmake is re-run, but use type of STRING rather than
+          # INTERNAL to allow users to specify the value with a
+          # -DPLPLOT_ITCL_VERSION:STRING=<whatever> on the command
+          # line for those rare cases when "package require Itcl"
+          # would error out due to some tclsh issue.
+	  set(PLPLOT_ITCL_VERSION ${_plplot_itcl_version}
+	    CACHE STRING "Itcl version that will be used"
+	    )
+	endif(NOT ITCL_RC)
+      else(NOT PLPLOT_ITCL_VERSION)
+	set(ITCL_RC 0)
+      endif(NOT PLPLOT_ITCL_VERSION)
       if(NOT ITCL_RC)
         message(STATUS "Looking for itcl.h")
 	if(NOT USE_INCRTCL_VERSION_4)
@@ -212,14 +226,29 @@
       else(USE_INCRTCL_VERSION_4)
 	set(SUGGESTED_ITK_VERSION 3)
       endif(USE_INCRTCL_VERSION_4)
-      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl "puts -nonewline [package require Itk ${SUGGESTED_ITK_VERSION}]; exit")
-      # Refine SUGGESTED_ITK_VERSION to exact value or fail.
-      execute_process(
-	COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl
-	RESULT_VARIABLE ITK_RC
-	OUTPUT_VARIABLE PLPLOT_ITK_VERSION
-	ERROR_VARIABLE ITK_STDERR
-	)
+      if(NOT PLPLOT_ITK_VERSION)
+	file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl "puts -nonewline [package require Itk ${SUGGESTED_ITK_VERSION}]; exit")
+	# Refine SUGGESTED_ITK_VERSION to exact value or fail.
+	execute_process(
+	  COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl
+	  RESULT_VARIABLE ITK_RC
+	  OUTPUT_VARIABLE _plplot_itk_version
+	  )
+	if(NOT ITK_RC)
+	  # Store result in cached variable so it will be remembered
+          # when cmake is re-run, but use type of STRING rather than
+          # INTERNAL to allow users to specify the value with a
+          # -DPLPLOT_ITK_VERSION:STRING=<whatever> on the command line
+          # for those rare cases (e.g., autobuild environment without X)
+          # when "package require Itk" would error out due to the lack
+          # of X or some tclsh issue.
+	  set(PLPLOT_ITK_VERSION ${_plplot_itk_version}
+	    CACHE STRING "Itk version that will be used"
+	    )
+	endif(NOT ITK_RC)
+      else(NOT PLPLOT_ITK_VERSION)
+	set(ITCL_RC 0)
+      endif(NOT PLPLOT_ITK_VERSION)
       if(NOT ITK_RC)
 	message(STATUS "Looking for itk.h")
 	if(NOT USE_INCRTCL_VERSION_4)
@@ -278,39 +307,57 @@
 	    set(HAVE_ITK ON)

 	    # Test version consistency between iwidgets, itk, and itcl.
-	    if(USE_INCRTCL_VERSION_4)
-	      set(SUGGESTED_IWIDGETS_VERSION 4.1)
-	      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
-	      execute_process(
-		COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl
-		RESULT_VARIABLE IWIDGETS_RC
-		OUTPUT_VARIABLE IWIDGETS_VERSIONS_LIST
-		ERROR_VARIABLE IWIDGETS_STDERR
-		)
-	    else(USE_INCRTCL_VERSION_4)
-	      # Find maximum 4.0 version of iwidgets that is
-	      # available.  4.0.1 (released in 2002) is the largest
-	      # version of iwidgets4.0 (as opposed to the recently
-	      # developed iwidgets4.1) I have found on the web in
-	      # tarball form, but I have seen one reference to 4.0.2
-	      # which may have been publicly released somewhere
-	      # inaccessible to my google searches or privately made
-	      # available before all development of iwidgets4.0
-	      # stopped. So add 4.0.2 to the list just in case.
-	      foreach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
-		file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require -exact Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
+	    if(NOT IWIDGETS_VERSIONS_LIST)
+	      if(USE_INCRTCL_VERSION_4)
+		set(SUGGESTED_IWIDGETS_VERSION 4.1)
+		file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
 		execute_process(
 		  COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl
 		  RESULT_VARIABLE IWIDGETS_RC
-		  OUTPUT_VARIABLE IWIDGETS_VERSIONS_LIST
-		  ERROR_VARIABLE IWIDGETS_STDERR
+		  OUTPUT_VARIABLE _iwidgets_versions_list
 		  )
-		if(NOT IWIDGETS_RC)
-		  break()
-		endif(NOT IWIDGETS_RC)
-	      endforeach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
-	    endif(USE_INCRTCL_VERSION_4)
+	      else(USE_INCRTCL_VERSION_4)
+		# Find maximum 4.0 version of iwidgets that is
+		# available.  4.0.1 (released in 2002) is the largest
+		# version of iwidgets4.0 (as opposed to the recently
+		# developed iwidgets4.1) I have found on the web in
+		# tarball form, but I have seen one reference to 4.0.2
+		# which may have been publicly released somewhere
+		# inaccessible to my google searches or privately made
+		# available before all development of iwidgets4.0
+		# stopped. So add 4.0.2 to the list just in case.
+		foreach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
+		  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require -exact Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
+		  execute_process(
+		    COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl
+		    RESULT_VARIABLE IWIDGETS_RC
+		    OUTPUT_VARIABLE _iwidgets_versions_list
+		    ERROR_QUIET
+		    )
+		  if(NOT IWIDGETS_RC)
+		    break()
+		  endif(NOT IWIDGETS_RC)
+		endforeach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
+	      endif(USE_INCRTCL_VERSION_4)
+	      if(NOT IWIDGETS_RC)
+		# Store result in cached variable so it will be
+		# remembered when cmake is re-run, but use type of
+		# STRING rather than INTERNAL to allow users to
+		# specify the value with a
+		# -DIWIDGETS_VERSIONS_LIST:STRING=<whatever> on the
+		# command line for those rare cases (e.g., autobuild
+		# environment without X) when "package require Itk (or
+		# Itcl or IWidgets)" would error out due to the lack of
+		# X or some tclsh issue
+		set(IWIDGETS_VERSIONS_LIST ${_iwidgets_versions_list}
+		  CACHE STRING "list of Iwidgets; Itk, and Itcl versions (in that order) that will be used"
+		  )
+	      endif(NOT IWIDGETS_RC)
+	    else(NOT IWIDGETS_VERSIONS_LIST)
+	      set(IWIDGETS_RC 0)
+	    endif(NOT IWIDGETS_VERSIONS_LIST)
 	    if(NOT IWIDGETS_RC)
+	      message(STATUS "IWIDGETS_VERSIONS_LIST = ${IWIDGETS_VERSIONS_LIST}")
 	      list(GET IWIDGETS_VERSIONS_LIST 0 PLPLOT_IWIDGETS_VERSION)
 	      list(GET IWIDGETS_VERSIONS_LIST 1 CONSISTENT_ITK_VERSION)
 	      list(GET IWIDGETS_VERSIONS_LIST 2 CONSISTENT_ITCL_VERSION)


SVN_SILENT made messages (.desktop file) - always resolve ours

In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"

--- plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
+++ plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
@@ -16,6 +16,7 @@
 Comment[fr]=Interface utilisateur personnalisée pour la configuration de comptes en utilisant le gestionnaire de connexions « Morse ».
 Comment[gl]=Interface de usuario de configuración personalizada da conta para contas que empreguen o xestor de conexións Morse.
 Comment[hu]=Egyedi beállítófelület a Morse kapcsolatkezelőt használó azonosítókhoz.
+Comment[ia]=Interfacie de usator pro configuration de conto personalisate pro contos usante le gerente de connexion Morse.
 Comment[it]=Interfaccia utente personalizzata di configurazione account per account che usano il gestore di connessioni Morse.
 Comment[ko]=Morse 연결 관리자를 사용하는 계정 설정 사용자 인터페이스입니다.
 Comment[nb]=Brukerflate for å sette opp egendefinerte kontoer ved bruk av Morse tilkoblingsbehandler.


Fixed: CMake FindFBX

Fixed: CMake FindFBX

--- CMake/FindFBX.cmake
+++ CMake/FindFBX.cmake
@@ -1,4 +1,4 @@
-set(FBX_LIBNAME "libfbxsdk")
+set(FBX_LIBNAME "libfbxsdk-md")
 set(FBX_ARCH x86)

 if (CMAKE_GENERATOR MATCHES "Visual Studio 12 2013")
@@ -21,6 +21,8 @@
     PATHS ${FBX_SEARCH_PATHS}
     PATH_SUFFIXES "lib/${FBX_LIBDIR}/${FBX_ARCH}/debug")

+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FbxSdk DEFAULT_MSG FBX_LIBNAME JSONCPP_INCLUDE_DIR)

 if (FBX_INCLUDE_DIR AND FBX_LIBRARY_DEBUG AND FBX_LIBRARY_RELEASE)
 	if(NOT FBX_FOUND)


The condition to add a comma (or not) does not work anymore. Debug message removed.

--- cmake/CoverallsGenerateGcov.cmake
+++ cmake/CoverallsGenerateGcov.cmake
@@ -144,7 +144,6 @@
   GET_SOURCE_PATH_FROM_GCOV_FILENAME(_GCOV_SRC_FILE ${_GCOV_FILE})
   STRING(FIND "${_GCOV_SRC_FILE}" "${COVERAGE_SRC_PATH}" FOUND)
   IF(NOT FOUND EQUAL -1)
-    MESSAGE(STATUS "Processing: ${_GCOV_SRC_FILE}")
     FILE(RELATIVE_PATH _GCOV_SRC_REL_VAR "${COVERAGE_SRC_PATH}" "${_GCOV_SRC_FILE}")
     STRING(REGEX REPLACE "/" "_" _GCOV_SRC_REL_VAR ${_GCOV_SRC_REL_VAR})
     STRING(REGEX REPLACE "\\." "_" _GCOV_SRC_REL_VAR ${_GCOV_SRC_REL_VAR})
@@ -259,15 +258,15 @@
         SET(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}0, ")
       ENDFOREACH()
     ENDIF()
+    IF(INC GREATER 1)
+      FILE(APPEND "${COVERALLS_OUTPUT_FILE}" ", ")
+    ENDIF()
     STRING(REGEX REPLACE ",[ ]*$" "]" GCOV_FILE_COVERAGE ${GCOV_FILE_COVERAGE})
     FILE(APPEND "${COVERALLS_OUTPUT_FILE}"
       "{\n      \"name\": \"${GCOV_SRC_REL_PATH}\",\n"
          "      \"source_digest\": \"${GCOV_CONTENTS_MD5}\",\n"
          "      \"coverage\": ${GCOV_FILE_COVERAGE}\n"
       "  }")
-    IF(INC LESS COVERAGE_SRC_LENGTH)
-      FILE(APPEND "${COVERALLS_OUTPUT_FILE}" ", ")
-    ENDIF()
   ENDIF()
 ENDFOREACH()


Teach the compiler-rt custom compilation and linking CMake rules used
for sanitizers to pass the C++ compilation and exe linking flags through
from the host CMake configuration. We pass the target flags afterward,
allowing them to trump flags as needed. This is particularly important
when the flags direct Clang, even the just-built-Clang, toward the
standard library, linker, and other tools to use.

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -14,7 +14,7 @@
     parse_arguments(LIB "SOURCES;CFLAGS;DEFS" "" ${ARGN})
     add_library(${name}.${arch} OBJECT ${LIB_SOURCES})
     set_target_compile_flags(${name}.${arch}
-      ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS})
+      ${CMAKE_CXX_FLAGS} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS})
     set_property(TARGET ${name}.${arch} APPEND PROPERTY
       COMPILE_DEFINITIONS ${LIB_DEFS})
   else()
@@ -136,6 +136,8 @@
   if(NOT COMPILER_RT_STANDALONE_BUILD)
     list(APPEND TEST_DEPS clang)
   endif()
+  set(TEST_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TEST_LINK_FLAGS}")
+  separate_arguments(TEST_LINK_FLAGS)
   add_custom_target(${test_name}
     # MSVS CL doesn't allow a space between -Fe and the output file name.
     COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS}


Disable DESTDIR when moving the headers in the build area (fixes ROOT-6803)

--- cmake/scripts/local_install.cmake
+++ cmake/scripts/local_install.cmake
@@ -3,6 +3,7 @@
 #  COMPONENTS - Installation component

 set(COMPONENTS ${COMPONENTS})
+set(ENV{DESTDIR} "")
 foreach(component ${COMPONENTS})
   execute_process(
     COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${PREFIX}


Update windows installation paths to the new installercop settings (#93)

--- cmake/packaging/windows/fastcdr-config.cmake
+++ cmake/packaging/windows/fastcdr-config.cmake
@@ -14,15 +14,15 @@

 if(MSVC_VERSION EQUAL 1900)
     if(CMAKE_CL_64)
-        include("${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/fastcdr-x64Win64VS2015/fastcdr-config.cmake")
+        include("${CMAKE_CURRENT_LIST_DIR}/../share/fastcdr-x64Win64VS2015/cmake/fastcdr-config.cmake")
     else()
-        include("${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/fastcdr-i86Win32VS2015/fastcdr-config.cmake")
+        include("${CMAKE_CURRENT_LIST_DIR}/../share/fastcdr-i86Win32VS2015/cmake/fastcdr-config.cmake")
     endif()
 elseif(MSVC_VERSION GREATER 1900)
     if(CMAKE_CL_64)
-        include("${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/fastcdr-x64Win64VS2017/fastcdr-config.cmake")
+        include("${CMAKE_CURRENT_LIST_DIR}/../share/fastcdr-x64Win64VS2017/cmake/fastcdr-config.cmake")
     else()
-        include("${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/fastcdr-i86Win32VS2017/fastcdr-config.cmake")
+        include("${CMAKE_CURRENT_LIST_DIR}/../share/fastcdr-i86Win32VS2017/cmake/fastcdr-config.cmake")
     endif()
 else()
     message(FATAL_ERROR "Not supported version of Visual Studio")


Fixed Cmake build for Nvidia GPU support on Linux in libprocess.

Review: https://reviews.apache.org/r/48883/

--- 3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ 3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
@@ -24,6 +24,7 @@
 EXTERNAL("libev"       ${LIBEV_VERSION}       "${MESOS_3RDPARTY_BIN}")
 EXTERNAL("libevent"    ${LIBEVENT_VERSION}    "${MESOS_3RDPARTY_BIN}")
 EXTERNAL("libapr"      ${LIBAPR_VERSION}      "${MESOS_3RDPARTY_BIN}")
+EXTERNAL("nvml"        ${NVML_VERSION}        "${MESOS_3RDPARTY_BIN}")
 EXTERNAL("protobuf"    ${PROTOBUF_VERSION}    "${MESOS_3RDPARTY_BIN}")

 if (NOT WIN32)
@@ -55,6 +56,7 @@
 set(GPERFTOOLS_INCLUDE_DIR  ${GPERFTOOLS}/src)
 set(HTTP_PARSER_INCLUDE_DIR ${HTTP_PARSER_ROOT})
 set(LIBEV_INCLUDE_DIR       ${LIBEV_ROOT})
+set(NVML_INCLUDE_DIR        ${NVML_ROOT})
 set(PICOJSON_INCLUDE_DIR    ${PICOJSON_ROOT})

 if (WIN32)


CMake: Use `list(APPEND x ...)` over `set(x ${x} ...)`.

This removes a CMake anti-pattern where `set` was used to append to a
variable, instead of the more explicit `list(APPEND)` or
`string(APPEND)` alternatives.

Review: https://reviews.apache.org/r/59156/

--- cmake/CompilationConfigure.cmake
+++ cmake/CompilationConfigure.cmake
@@ -41,7 +41,6 @@
   # a single source file to reduce the number of files that need to be opened
   # and read. We disable "unity" builds for now.
   set(COTIRE_ADD_UNITY_BUILD FALSE)
-
   set(COTIRE_VERBOSE ${VERBOSE})
 endif (ENABLE_PRECOMPILED_HEADERS)

@@ -212,7 +211,7 @@
       "flag. Please use a different C++ compiler.")
   endif (NOT COMPILER_SUPPORTS_CXX11)

-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+  string(APPEND CMAKE_CXX_FLAGS " -std=c++11")

   # Directory structure for some build artifacts.
   # This is defined for use in tests.
@@ -242,15 +241,15 @@

   # COFF/PE and friends are somewhat limited in the number of sections they
   # allow for an object file. We use this to avoid those problems.
-  set(CMAKE_CXX_FLAGS
-    "${CMAKE_CXX_FLAGS} /bigobj -DGOOGLE_GLOG_DLL_DECL= -DCURL_STATICLIB /vd2")
+  string(APPEND CMAKE_CXX_FLAGS
+    " /bigobj -DGOOGLE_GLOG_DLL_DECL= -DCURL_STATICLIB /vd2")

   # Enable multi-threaded compilation.
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+  string(APPEND CMAKE_CXX_FLAGS " /MP")

   # Build against the multi-threaded, static version of the runtime library.
-  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
-  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
+  string(APPEND CMAKE_CXX_FLAGS_DEBUG " /MTd")
+  string(APPEND CMAKE_CXX_FLAGS_RELEASE " /MT")

   # Convenience flags to simplify Windows support in C++ source; used to
   # `#ifdef` out some platform-specific parts of Mesos.  We choose to define
@@ -258,18 +257,13 @@
   # to give the build system fine-grained control over what code is #ifdef'd
   # out in the future.  Using only flags defined by our build system to control
   # this logic is the clearest and most stable way of accomplishing this.
-  set(MESOS_CPPFLAGS
-    ${MESOS_CPPFLAGS}
-    -D__WINDOWS__
-    -DHAVE_LIBZ
-    )
+  list(APPEND MESOS_CPPFLAGS -D__WINDOWS__ -DHAVE_LIBZ)

   # Defines to disable warnings generated by Visual Studio when using
   # deprecated functions in CRT and the use of insecure functions in CRT.
   # TODO(dpravat): Once the entire codebase is changed to use secure CRT
   # functions, these defines should be removed.
-  set(MESOS_CPPFLAGS
-    ${MESOS_CPPFLAGS}
+  list(APPEND MESOS_CPPFLAGS
     -D_SCL_SECURE_NO_WARNINGS
     -D_CRT_SECURE_NO_WARNINGS
     -D_CRT_NONSTDC_NO_WARNINGS
@@ -295,11 +289,7 @@
   #
   # [1] https://google-glog.googlecode.com/svn/trunk/doc/glog.html#windows
   # [2] https://code.google.com/p/google-glog/source/browse/trunk/src/windows/glog/logging.h?r=113
-  set(MESOS_CPPFLAGS
-    ${MESOS_CPPFLAGS}
-    -DNOGDI
-    -DNOMINMAX
-    )
+  list(APPEND MESOS_CPPFLAGS -DNOGDI -DNOMINMAX)
 endif (WIN32)

 # GLOBAL CONFIGURATION.
@@ -309,10 +299,7 @@
   # `-DHAS_AUTHENTICATION=${HAS_AUTHENTICATION}`, as this will define the
   # symbol, and our intention is to only define it if the CMake variable
   # `HAS_AUTHENTICATION` is set.
-  set(MESOS_CPPFLAGS
-    ${MESOS_CPPFLAGS}
-    -DHAS_AUTHENTICATION=1
-    )
+  list(APPEND MESOS_CPPFLAGS -DHAS_AUTHENTICATION=1)
 endif (HAS_AUTHENTICATION)

 # Enable the INT64 support for PicoJSON.
@@ -320,14 +307,9 @@
 # 'inttypes.h'.  Since other libraries may also import this header, it must
 # be globally defined so that PicoJson has access to the macros, regardless
 # of the order of inclusion.
-set(MESOS_CPPFLAGS
-  ${MESOS_CPPFLAGS}
-  -DPICOJSON_USE_INT64
-  -D__STDC_FORMAT_MACROS
-  )
-
-set(MESOS_CPPFLAGS
-  ${MESOS_CPPFLAGS}
+list(APPEND MESOS_CPPFLAGS -DPICOJSON_USE_INT64 -D__STDC_FORMAT_MACROS)
+
+list(APPEND MESOS_CPPFLAGS
   -DPKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}"
   -DLIBDIR="${LIB_INSTALL_DIR}"
   -DVERSION="${PACKAGE_VERSION}"
@@ -335,10 +317,7 @@
   )

 if (ENABLE_SSL)
-  set(MESOS_CPPFLAGS
-    ${MESOS_CPPFLAGS}
-    -DUSE_SSL_SOCKET=1
-    )
+  list(APPEND MESOS_CPPFLAGS -DUSE_SSL_SOCKET=1)
 endif (ENABLE_SSL)

 # Calculate some build information.
@@ -370,8 +349,7 @@
 # NOTE: The quotes in these definitions are necessary. Without them, the
 # preprocessor will interpret the symbols as (e.g.) int literals and uquoted
 # identifiers, rather than the string values our code expects.
-set(MESOS_CPPFLAGS
-  ${MESOS_CPPFLAGS}
+list(APPEND MESOS_CPPFLAGS
   -DUSE_STATIC_LIB
   -DUSE_CMAKE_BUILD_CONFIG
   -DBUILD_JAVA_JVM_LIBRARY="${BUILD_JAVA_JVM_LIBRARY}"


andriod: removed unecessary config option

--- cmake/ConfigOptionsAndroid.cmake
+++ cmake/ConfigOptionsAndroid.cmake
@@ -27,4 +27,3 @@
 set(ANDROID_APP_TARGET_SDK 11 CACHE STRING "Application target android SDK")
 set(ANDROID_APP_MIN_SDK 9 CACHE STRING "Application minimum android SDK requirement")
 set(ANDROID_APP_GOOGLE_TARGET_SDK "16" CACHE STRING "Application target google SDK")
-set(ANDROID_NATIVE_API_LEVEL "9" CACHE STRING "Android API level for native code")


Update cpp_resource.cmake

Update cpp_resource.cmake

--- cmake/modules/cpp_resource.cmake
+++ cmake/modules/cpp_resource.cmake
@@ -11,8 +11,7 @@

     get_property(RSC_BIN_FOLDER TARGET cpp_rsc_prj PROPERTY _EP_BINARY_DIR)
-    message(STATUS "Resource compiler bf: " ${RSC_BIN_FOLDER})
-    set_property(GLOBAL PROPERTY CPPRSC_CMD ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/cpp_rsc)
+    set_property(GLOBAL PROPERTY CPPRSC_CMD ${RSC_BIN_FOLDER}/src/${CMAKE_CFG_INTDIR}/cpp_rsc)
   else()
     set_property(GLOBAL PROPERTY CPPRSC_CMD cpp_rsc)
   endif()


Re-enable implicit-fallthrough warning

Re-enable implicit-fallthrough warning

--- cmake/px4_add_common_flags.cmake
+++ cmake/px4_add_common_flags.cmake
@@ -87,7 +87,6 @@
 		-Wunused-variable

 		# disabled warnings
-		-Wno-implicit-fallthrough # set appropriate level and update
 		-Wno-missing-field-initializers
 		-Wno-missing-include-dirs # TODO: fix and enable
 		-Wno-unused-parameter


Fix SDL2main library name

Fix SDL2main library name

--- cmake/Modules/FindSDL2.cmake
+++ cmake/Modules/FindSDL2.cmake
@@ -105,7 +105,7 @@
     # seem to provide SDLmain for compatibility even though they don't
     # necessarily need it.
     FIND_LIBRARY(SDLMAIN_LIBRARY
-      NAMES SDLmain2
+      NAMES SDL2main
       HINTS
       $ENV{SDLDIR}
       PATH_SUFFIXES lib64 lib


build: remove `FILE_DEPENDS` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -680,7 +680,6 @@
 #     [ARCHITECTURE architecture]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
 #     [SWIFT_COMPILE_FLAGS flag1...]
-#     [FILE_DEPENDS target1 ...]
 #     INSTALL_IN_COMPONENT comp
 #     source1 [source2 source3 ...])
 #
@@ -707,9 +706,6 @@
 #
 # SWIFT_COMPILE_FLAGS
 #   Extra compile flags (Swift).
-#
-# FILE_DEPENDS
-#   Additional files this library depends on.
 #
 # INSTALL_IN_COMPONENT comp
 #   The Swift installation component that this library belongs to.
@@ -730,7 +726,6 @@
         DARWIN_INSTALL_NAME_DIR
         SDK)
   set(SWIFTLIB_SINGLE_multiple_parameter_options
-        FILE_DEPENDS
         GYB_SOURCES
         LLVM_LINK_COMPONENTS
         SWIFT_COMPILE_FLAGS)
@@ -831,7 +826,6 @@
       SWIFTLIB_SINGLE_EXTERNAL_SOURCES ${name}
       DEPENDS
         ${gyb_dependency_targets}
-        ${SWIFTLIB_SINGLE_FILE_DEPENDS}
       SDK ${SWIFTLIB_SINGLE_SDK}
       ARCHITECTURE ${SWIFTLIB_SINGLE_ARCHITECTURE}
       MODULE_NAME ${module_name}
@@ -1109,7 +1103,6 @@
 #     [SHARED]
 #     [STATIC]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
-#     [FILE_DEPENDS target1 ...]
 #     source1 [source2 source3 ...])
 #
 # name
@@ -1123,9 +1116,6 @@
 #
 # LLVM_LINK_COMPONENTS
 #   LLVM components this library depends on.
-#
-# FILE_DEPENDS
-#   Additional files this library depends on.
 #
 # source1 ...
 #   Sources to add into this library.


update commit tag id for lua

update commit tag id for lua

--- cmake/modules/BuildLua.cmake
+++ cmake/modules/BuildLua.cmake
@@ -8,7 +8,7 @@
   ExternalProject_Add(
     lua
     GIT_REPOSITORY https://github.com/RavenX8/lua.git
-    GIT_TAG 2fcfa77c2c1d3787d706923771f8846a635a7920
+    GIT_TAG e3f46c3bee3d6b62f9ea9a36c86249978504e404
     CMAKE_ARGS -G ${CMAKE_GENERATOR} -Dlua_MSVC_STATIC_RUNTIME=ON
     INSTALL_DIR ${LUA_INSTALL_DIR}
     BUILD_BYPRODUCTS ${_byproducts}


Minor formatting changes to DeployQt.

Minor formatting changes to DeployQt.

--- cmake/modules/DeployQt.cmake
+++ cmake/modules/DeployQt.cmake
@@ -32,16 +32,20 @@
 find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")

 function(windeployqt target)
-    set(script "${CMAKE_CURRENT_BINARY_DIR}/install_${target}.cmake")
+    set(script "${CMAKE_CURRENT_BINARY_DIR}/windeployqt_${target}.cmake")
     file(
         GENERATE OUTPUT "${script}"
-        CONTENT "execute_process(
-            COMMAND \"\${CMAKE_COMMAND}\" -E env PATH=\"${_qt_bin_dir}\"
-                \"${WINDEPLOYQT_EXECUTABLE}\"
-                    --no-compiler-runtime
-                    --dir \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\"
-                    \"$<TARGET_FILE:${target}>\"
-        )"
+        CONTENT "
+message(STATUS \"Deploying Qt for ${target}...\")
+execute_process(
+    COMMAND \"\${CMAKE_COMMAND}\" -E env PATH=\"${_qt_bin_dir}\"
+        \"${WINDEPLOYQT_EXECUTABLE}\"
+            --verbose 0
+            --no-compiler-runtime
+            --dir \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}\"
+            \"$<TARGET_FILE:${target}>\"
+)
+        "
     )
     install(SCRIPT "${script}")
 endfunction()


adapt for older cmake versions

adapt for older cmake versions

--- cmake/modules/FindRuby.cmake
+++ cmake/modules/FindRuby.cmake
@@ -224,7 +224,7 @@

 FIND_LIBRARY(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )

-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+INCLUDE(FindPackageHandleStandardArgs)
 SET(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY)
 IF(_RUBY_VERSION_SHORT_NODOT GREATER 18)
    LIST(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR)


fix auto path finding

fix auto path finding

--- cmake_modules/FindOCCT.cmake
+++ cmake_modules/FindOCCT.cmake
@@ -69,10 +69,10 @@
 	set(OCCT_FOUND TRUE)

 else(OCCT_INCLUDE_DIR AND OCCT_LIBRARIES)
-	find_path(OCCT_INCLUDE_DIR gp_pnt.hxx
-		/usr/include
-		/usr/local/include
-		/opt/local/include
+	find_path(OCCT_INCLUDE_DIR gp_Pnt.hxx
+		/usr/include/opencascade
+		/usr/local/include/opencascade
+		/opt/local/include/opencascade
     )

 	foreach(libName ${OCCT_LIB_NAMES})
@@ -101,6 +101,8 @@

+	message(STATUS "OCCT_INCLUDE_DIR: ${OCCT_INCLUDE_DIR}")
+	message(STATUS "OCCT_LIBRARIES: ${OCCT_LIBRARIES}")
 if(OCCT_INCLUDE_DIR AND OCCT_LIBRARIES)
 	set(OCCTM_FOUND TRUE)
 	message(STATUS "OCCT installation found.")