PARQUET-962: [C++] GTEST_MAIN_STATIC_LIB is not defined in FindGTest.cmake

Author: Deepak Majeti <deepak.majeti@hpe.com>

Closes #306 from majetideepak/PARQUET-962 and squashes the following commits:

07926af [Deepak Majeti] mark as advanced
74a62b9 [Deepak Majeti] define GTEST_MAIN_STATIC_LIB in FindGTest.cmake

--- cmake_modules/FindGTest.cmake
+++ cmake_modules/FindGTest.cmake
@@ -28,6 +28,7 @@
 #  GTEST_INCLUDE_DIR, directory containing headers
 #  GTEST_LIBS, directory containing gtest libraries
 #  GTEST_STATIC_LIB, path to libgtest.a
+#  GTEST_MAIN_STATIC_LIB, path to libgtest_main.a
 #  GTEST_SHARED_LIB, path to libgtest's shared library
 #  GTEST_FOUND, whether gtest has been found

@@ -43,7 +44,7 @@
     find_path( GTEST_INCLUDE_DIR NAMES gtest/gtest.h
         PATHS ${_gtest_roots} NO_DEFAULT_PATH
         PATH_SUFFIXES "include" )
-    find_library( GTEST_LIBRARIES NAMES gtest
+    find_library( GTEST_LIBRARIES NAMES gtest gtest_main
         PATHS ${_gtest_roots} NO_DEFAULT_PATH
         PATH_SUFFIXES "lib" )
 else ()
@@ -57,6 +58,7 @@
   get_filename_component( GTEST_LIBS ${GTEST_LIBRARIES} PATH )
   set(GTEST_LIB_NAME libgtest)
   set(GTEST_STATIC_LIB ${GTEST_LIBS}/${GTEST_LIB_NAME}.a)
+  set(GTEST_MAIN_STATIC_LIB ${GTEST_LIBS}/${GTEST_LIB_NAME}_main.a)
   set(GTEST_SHARED_LIB ${GTEST_LIBS}/${GTEST_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
 else ()
   set(GTEST_FOUND FALSE)
@@ -87,5 +89,6 @@
   GTEST_LIBS
   GTEST_LIBRARIES
   GTEST_STATIC_LIB
+  GTEST_MAIN_STATIC_LIB
   GTEST_SHARED_LIB
 )


PROTON-1944: update .so version to account for changes

--- cpp/versions.cmake
+++ cpp/versions.cmake
@@ -1,4 +1,4 @@
 set(PN_LIB_CPP_MAJOR_VERSION 12)
-set(PN_LIB_CPP_MINOR_VERSION 3)
+set(PN_LIB_CPP_MINOR_VERSION 4)
 set(PN_LIB_CPP_PATCH_VERSION 0)
 set(PN_LIB_CPP_VERSION "${PN_LIB_CPP_MAJOR_VERSION}.${PN_LIB_CPP_MINOR_VERSION}.${PN_LIB_CPP_PATCH_VERSION}")


Add cmake cross-build support

Add cmake cross-build support

Don't overwrite CPP_PLATFORM so cross-builds compile the right platform
dependent file.

--- cmake/Modules/CppUTestConfigurationOptions.cmake
+++ cmake/Modules/CppUTestConfigurationOptions.cmake
@@ -6,7 +6,9 @@
       ADD_DEFINITIONS(-DSTDC_WANT_SECURE_LIB)
     endif(STDC_WANT_SECURE_LIB)
 elseif (STD_C)
-    set(CPP_PLATFORM Gcc)
+    if(NOT CPP_PLATFORM)
+        set(CPP_PLATFORM Gcc)
+    endif(NOT CPP_PLATFORM)
 else (MSVC)
     set(STD_CPP False)
     set(MEMORY_LEAK_DETECTION False)


disable RTCc

disable RTCc

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -76,9 +76,9 @@
         /wd4201       # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
         # /wd4127     # -> disable warning: conditional expression is constant (caused by Qt)

-        $<$<CONFIG:Debug>:
-        /RTCc         # -> value is assigned to a smaller data type and results in a data loss
-        >
+        #$<$<CONFIG:Debug>:
+        #/RTCc         # -> value is assigned to a smaller data type and results in a data loss
+        #>

         $<$<CONFIG:Release>:
         /Gw           # -> whole program global optimization


Fix FP constants

Fix FP constants

--- cmake/FindFpclassify.cmake
+++ cmake/FindFpclassify.cmake
@@ -41,7 +41,7 @@
               COMPILE_DEFINITIONS -DC_${KEYWORD}=${KEYWORD} -DHAVE_MATH_H=${_HAVE_MATH_H} -DHAVE_FLOAT_H=${_HAVE_FLOAT_H})
             IF (C_HAS_${KEYWORD})
               MESSAGE(STATUS "Looking for ${KEYWORD} - found")
-              SET (C_${KEYWORD} "${_C_${KEYWORD}}" CACHE STRING "C ${KEYWORD} implementation")
+              SET (C_${KEYWORD} ${KEYWORD} CACHE STRING "C ${KEYWORD} implementation")
               MARK_AS_ADVANCED (C_${KEYWORD})
             ENDIF ()
           ENDFOREACH ()


Add test to check

Add test to check

--- cmake/MyPackageCheck.cmake
+++ cmake/MyPackageCheck.cmake
@@ -37,6 +37,7 @@
     ADD_TEST (NAME ${_name}
       COMMAND ${CMAKE_COMMAND} -E env "PATH=${_test_path}" ${_name}
       WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH})
+    ADD_DEPENDENCIES(check ${_name})
   ENDFOREACH ()

 ENDMACRO()


Cleaned up the MSVC runtime passing to subbuild.

--- cmake/external_rules.cmake
+++ cmake/external_rules.cmake
@@ -136,72 +136,51 @@

   if (CMAKE_BUILD_TYPE)
     # If Release or Debug were specified, pass it along.
-    set(CMAKE_SUB_CONFIGURE_OPTIONS
-        ${CMAKE_SUB_CONFIGURE_OPTIONS}
+    set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
         -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}")
   endif()

   if(APPLE)
     # Propagate MacOS build flags.
     if(CMAKE_OSX_ARCHITECTURES)
-      set(CMAKE_SUB_CONFIGURE_OPTIONS
-          ${CMAKE_SUB_CONFIGURE_OPTIONS}
+      set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
           -DCMAKE_OSX_ARCHITECTURES="${CMAKE_OSX_ARCHITECTURES}")
     endif()
   elseif(MSVC)
     # Propagate MSVC build flags.
+    set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
+        -A "${CMAKE_GENERATOR_PLATFORM}")
     if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-      set(CMAKE_SUB_BUILD_OPTIONS ${CMAKE_SUB_BUILD_OPTIONS} --config Debug)
-      if(MSVC_RUNTIME_LIBRARY_STATIC)
-        set(SUBBUILD_MSVC_RUNTIME_FLAG "/MTd")
-        set(CMAKE_SUB_CONFIGURE_OPTIONS
-            ${CMAKE_SUB_CONFIGURE_OPTIONS}
-            -DCMAKE_C_FLAGS_RELEASE="/MT"
-            -DCMAKE_C_FLAGS_DEBUG="/MTd"
-            -DCMAKE_CXX_FLAGS_RELEASE="/MT"
-            -DCMAKE_CXX_FLAGS_DEBUG="/MTd"
-            -MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
+      set(CMAKE_SUB_BUILD_OPTIONS ${CMAKE_SUB_BUILD_OPTIONS}
+          --config Debug)
+    endif()
+    if(MSVC_RUNTIME_LIBRARY_STATIC)
+      set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
+          -DCMAKE_C_FLAGS_RELEASE="/MT"
+          -DCMAKE_CXX_FLAGS_RELEASE="/MT"
+          -DCMAKE_C_FLAGS_DEBUG="/MTd"
+          -DCMAKE_CXX_FLAGS_DEBUG="/MTd")
+      if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+        set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
             -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug)
       else()
-        set(SUBBUILD_MSVC_RUNTIME_FLAG "/MDd")
-        set(CMAKE_SUB_CONFIGURE_OPTIONS
-            ${CMAKE_SUB_CONFIGURE_OPTIONS}
-            -DCMAKE_C_FLAGS_RELEASE="/MD"
-            -DCMAKE_C_FLAGS_DEBUG="/MDd"
-            -DCMAKE_CXX_FLAGS_RELEASE="/MD"
-            -DCMAKE_CXX_FLAGS_DEBUG="/MDd"
-            -DMSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL
+        set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
+            -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded)
+      endif()
+    else()  // dynamic (DLL) runtime
+      set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
+          -DCMAKE_C_FLAGS_RELEASE="/MD"
+          -DCMAKE_CXX_FLAGS_RELEASE="/MD"
+          -DCMAKE_C_FLAGS_DEBUG="/MDd"
+          -DCMAKE_CXX_FLAGS_DEBUG="/MDd")
+      if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+        set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
             -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL)
-      endif()
-    else()
-      set(CMAKE_SUB_BUILD_OPTIONS ${CMAKE_SUB_BUILD_OPTIONS} --config Release)
-      if(MSVC_RUNTIME_LIBRARY_STATIC)
-        set(SUBBUILD_MSVC_RUNTIME_FLAG "/MT")
-        set(CMAKE_SUB_CONFIGURE_OPTIONS
-            ${CMAKE_SUB_CONFIGURE_OPTIONS}
-            -DCMAKE_C_FLAGS_RELEASE="/MT"
-            -DCMAKE_C_FLAGS_DEBUG="/MTd"
-            -DCMAKE_CXX_FLAGS_RELEASE="/MT"
-            -DCMAKE_CXX_FLAGS_DEBUG="/MTd"
-            -DMSVC_RUNTIME_LIBRARY=MultiThreaded
-            -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded)
       else()
-        set(SUBBUILD_MSVC_RUNTIME_FLAG "/MD")
-        set(CMAKE_SUB_CONFIGURE_OPTIONS
-            ${CMAKE_SUB_CONFIGURE_OPTIONS}
-            -DCMAKE_C_FLAGS_RELEASE="/MD"
-            -DCMAKE_C_FLAGS_DEBUG="/MDd"
-            -DCMAKE_CXX_FLAGS_RELEASE="/MD"
-            -DCMAKE_CXX_FLAGS_DEBUG="/MDd"
-            -DMSVC_RUNTIME_LIBRARY=MultiThreaded
+        set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
             -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL)
       endif()
     endif()
-    set(CMAKE_SUB_CONFIGURE_OPTIONS
-        ${CMAKE_SUB_CONFIGURE_OPTIONS}
-        -DCMAKE_C_FLAGS=${SUBBUILD_MSVC_RUNTIME_FLAG}
-        -DCMAKE_CXX_FLAGS=${SUBBUILD_MSVC_RUNTIME_FLAG}
-        -A "${CMAKE_GENERATOR_PLATFORM}")
   else()
     # Propagate Linux build flags.
     if("${CMAKE_CXX_FLAGS}" MATCHES "-D_GLIBCXX_USE_CXX11_ABI=0")
@@ -209,17 +188,16 @@
     else()
       set(SUBBUILD_USE_CXX11_ABI 1)
     endif()
-    set(CMAKE_SUB_CONFIGURE_OPTIONS
-        ${CMAKE_SUB_CONFIGURE_OPTIONS}
+    set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
           -DCMAKE_C_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=${SUBBUILD_USE_CXX11_ABI}"
           -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=${SUBBUILD_USE_CXX11_ABI}")
     if(CMAKE_TOOLCHAIN_FILE)
-      set(CMAKE_SUB_CONFIGURE_OPTIONS
-          ${CMAKE_SUB_CONFIGURE_OPTIONS}
+      set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
           -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
     endif()
   endif()
-  message("Sub-build options: ${CMAKE_SUB_CONFIGURE_OPTIONS}")
+  message("Sub-configure options: ${CMAKE_SUB_CONFIGURE_OPTIONS}")
+  message("Sub-build options: ${CMAKE_SUB_BUILD_OPTIONS}")

   if(NOT ANDROID AND NOT IOS)
     execute_process(


build: bump sinsp, scap and the drivers to 5c0b863ddade7a45568c0ac97d037422c9efb750

Signed-off-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>

--- cmake/modules/sysdig.cmake
+++ cmake/modules/sysdig.cmake
@@ -29,8 +29,8 @@
 # default below In case you want to test against another sysdig version just pass the variable - ie., `cmake
 # -DSYSDIG_VERSION=dev ..`
 if(NOT SYSDIG_VERSION)
-  set(SYSDIG_VERSION "fntlnz/sinsp-fixes")
-  set(SYSDIG_CHECKSUM "SHA256=30343d50a756cfa1d97939733e3177b6e3f78652555538c3ce4aa4890229d5e5")
+  set(SYSDIG_VERSION "5c0b863ddade7a45568c0ac97d037422c9efb750")
+  set(SYSDIG_CHECKSUM "SHA256=9de717b3a4b611ea6df56afee05171860167112f74bb7717b394bcc88ac843cd")
 endif()
 set(PROBE_VERSION "${SYSDIG_VERSION}")


Update: enable finding recent versions of boost
Note that this doesn't change the requested version of boost it just
allows finding boost with version higher than 1.42

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@1834 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -3,6 +3,12 @@
 if(NOT PCL_SHARED_LIBS OR WIN32)
   set(Boost_USE_STATIC_LIBS ON)
 endif(NOT PCL_SHARED_LIBS OR WIN32)
+
+if(${CMAKE_VERSION} VERSION_LESS 2.8.5)
+  SET(Boost_ADDITIONAL_VERSIONS "1.43" "1.43.0" "1.44" "1.44.0" "1.45" "1.45.0" "1.46.1" "1.46.0" "1.46" "1.47" "1.47.0")
+else(${CMAKE_VERSION} VERSION_LESS 2.8.5)
+  SET(Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0")
+endif(${CMAKE_VERSION} VERSION_LESS 2.8.5)

 find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time)


Squashed '3rdparty/github/cmake-utils/' changes from 1138c45d..fe1ec0ee

fe1ec0ee Use ADD_DEFINITIONS together with CMAKE_REQUIRED_DEFINITIONS (the later is used when checking features)

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: fe1ec0eea1a9136bbdcd4b9c309ab563fa42454c

--- cmake/MyPackageStart.cmake
+++ cmake/MyPackageStart.cmake
@@ -127,6 +127,7 @@
       IF (MYPACKAGE_DEBUG)
         MESSAGE (STATUS "[${PROJECT_NAME}-START-STATUS] Adding compile definition D_GNU_SOURCE")
       ENDIF ()
+      ADD_DEFINITIONS("-D_GNU_SOURCE")
       LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
     ENDIF ()
   ENDIF ()
@@ -145,6 +146,7 @@
         MESSAGE (STATUS "[${PROJECT_NAME}-START-STATUS] Adding compile definition ${_definition}")
       ENDIF ()
       ADD_DEFINITIONS("-D${_definition}")
+      LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -D${_definition})
     ENDIF ()
   ENDFOREACH ()
   #


fixed: FXC_COMPILE empty SOURCES check location added: ADDITONAL sources argument for TEST_SETUP fixed: TEST_SETUP using the same target again

--- cmake/SetupFunctions.cmake
+++ cmake/SetupFunctions.cmake
@@ -22,6 +22,11 @@
   SET(SARGS)
   SET(MARGS SOURCES INCLUDES DEPENDENCIES)
   CMAKE_PARSE_ARGUMENTS(FXC "${OARGS}" "${SARGS}" "${MARGS}" ${ARGN})
+
+  IF(NOT FXC_SOURCES)
+    MESSAGE(SEND_ERROR "Error: FXC_COMPILE() called without any source files")
+    RETURN()
+  ENDIF()

   # note: fxc does't like spaces between options and arguments, i.e.
   #       '/X x' will not work, while '/Xx' is ok
@@ -75,11 +80,6 @@
       "   FXC_DEPENDENCIES_ABS = ${FXC_DEPENDENCIES_ABS}\n"
       "   FXC_FLAGS            = ${FXC_FLAGS}")
   ENDIF()
-
-  IF(NOT FXC_SOURCES)
-    MESSAGE(SEND_ERROR "Error: FXC_COMPILE() called without any source files")
-    RETURN()
-  ENDIF()

   SET(${FXC_RESULT})

@@ -170,12 +170,12 @@
   ENDIF()
 ENDFUNCTION()

-# TEST_SETUP(PREFIX SOURCES .. [DEPENDENCIES ..] [DEBUG])
+# TEST_SETUP(PREFIX SOURCES .. [ADDITIONAL ..] [DEPENDENCIES ..] [DEBUG])

 FUNCTION(TEST_SETUP TST_PREFIX)
   SET(OARGS DEBUG)
   SET(SARGS)
-  SET(MARGS SOURCES DEPENDENCIES)
+  SET(MARGS SOURCES ADDITIONAL DEPENDENCIES)
   CMAKE_PARSE_ARGUMENTS(TST "${OARGS}" "${SARGS}" "${MARGS}" ${ARGN})

   IF(NOT TST_SOURCES)
@@ -187,6 +187,7 @@
     MESSAGE(STATUS "TEST_SETUP(${TST_PREFIX}) variable setup:\n"
       "   TST_PREFIX       = ${TST_PREFIX}\n"
       "   TST_SOURCES      = ${TST_SOURCES}\n"
+      "   TST_ADDITIONAL   = ${TST_ADDITIONAL}\n"
       "   TST_DEPENDENCIES = ${TST_DEPENDENCIES}")
   ENDIF()

@@ -195,14 +196,14 @@

   FOREACH(APP ${TST_SOURCES})
     GET_FILENAME_COMPONENT(EXE "test_${TST_PREFIX}_${APP}" NAME_WE)
-    ADD_EXECUTABLE(${EXE} EXCLUDE_FROM_ALL ${APP})
+    ADD_EXECUTABLE(${EXE} EXCLUDE_FROM_ALL ${APP} ${TST_ADDITIONAL})
     SET_PROPERTY(TARGET ${EXE} PROPERTY FOLDER "Tests/${TST_PREFIX}")
     TARGET_LINK_LIBRARIES(${EXE} ${TST_DEPENDENCIES})
     ADD_TEST(${EXE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXE})
     LIST(APPEND TST_EXES ${EXE})

     GET_FILENAME_COMPONENT(TEST "unit_test_${TST_PREFIX}_${APP}" NAME_WE)
-    ADD_CUSTOM_TARGET(${TEST} COMMAND ${EXE} DEPENDS ${EXE} SOURCES ${APP})
+    ADD_CUSTOM_TARGET(${TEST} COMMAND ${EXE} DEPENDS ${EXE} SOURCES ${APP} ${TST_ADDITIONAL})
     LIST(APPEND TST_TESTS ${TEST})
   ENDFOREACH(APP)

@@ -214,11 +215,23 @@

   IF(DCS08961_BLD_UTEST)
     IF(DCS08961_RUN_CTEST)
-      ADD_CUSTOM_TARGET(test_${TST_PREFIX} COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS ${TST_EXES})
+      IF(TARGET test_${TST_PREFIX})
+	ADD_DEPENDENCIES(test_${TST_PREFIX} ${TST_EXES})
+      ELSE()
+	ADD_CUSTOM_TARGET(test_${TST_PREFIX} COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS ${TST_EXES})
+      ENDIF()
     ELSEIF(DCS08961_RUN_UTEST)
-      ADD_CUSTOM_TARGET(test_${TST_PREFIX} DEPENDS ${TST_TESTS})
+      IF(TARGET test_${TST_PREFIX})
+	ADD_DEPENDENCIES(test_${TST_PREFIX} ${TST_TESTS})
+      ELSE()
+	ADD_CUSTOM_TARGET(test_${TST_PREFIX} DEPENDS ${TST_TESTS})
+      ENDIF()
     ELSE()
-      ADD_CUSTOM_TARGET(test_${TST_PREFIX} DEPENDS ${TST_EXES})
+      IF(TARGET test_${TST_PREFIX})
+	ADD_DEPENDENCIES(test_${TST_PREFIX} ${TST_EXES})
+      ELSE()
+	ADD_CUSTOM_TARGET(test_${TST_PREFIX} DEPENDS ${TST_EXES})
+      ENDIF()
     ENDIF()
     SET_PROPERTY(TARGET test_${TST_PREFIX} PROPERTY FOLDER "Tests/${TST_PREFIX}")
     ADD_DEPENDENCIES(test_libs test_${TST_PREFIX})


[compiler-rt][cmake][mips] Use -mabi option to select target architecture

The `--target` option is rejected by GCC starting from version 7.0.
It's shorter and more portable to use `mabi` option to select MIPS ABI
for testing target architecture. Clang supports that starting from r343169.

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

--- cmake/base-config-ix.cmake
+++ cmake/base-config-ix.cmake
@@ -191,11 +191,11 @@
       # clang's default CPU's. In the 64-bit case, we must also specify the ABI
       # since the default ABI differs between gcc and clang.
       # FIXME: Ideally, we would build the N32 library too.
-      test_target_arch(mipsel "" "-mips32r2" "--target=mipsel-linux-gnu")
-      test_target_arch(mips64el "" "-mips64r2" "--target=mips64el-linux-gnu" "-mabi=64")
+      test_target_arch(mipsel "" "-mips32r2" "-mabi=32")
+      test_target_arch(mips64el "" "-mips64r2" "-mabi=64")
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips")
-      test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu")
-      test_target_arch(mips64 "" "-mips64r2" "--target=mips64-linux-gnu" "-mabi=64")
+      test_target_arch(mips "" "-mips32r2" "-mabi=32")
+      test_target_arch(mips64 "" "-mips64r2" "-mabi=64")
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm")
       if(WIN32)
         test_target_arch(arm "" "" "")


improve doc about catkin_package(CFG_EXTRAS) (#805)

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -36,8 +36,10 @@
 # :param CFG_EXTRAS: a CMake file containing extra stuff that should
 #   be accessible to users of this package after
 #   ``find_package``\ -ing it.  This file must live in the
-#   subdirectory ``cmake`` or be an absolute path.  Various additional
-#   file extension are possible:
+#   subdirectory ``cmake`` or be an absolute path.
+#   All passed extra files must have unique basenames since they are
+#   being installed into a single folder.
+#   Various additional file extension are possible:
 #   for a plain cmake file just ``.cmake``, for files expanded using
 #   CMake's ``configure_file()`` use ``.cmake.in`` or for files expanded
 #   by empy use ``.cmake.em``.  The templates can distinguish between


Fix optimization flag on icx Windows Release build (#513)

Signed-off-by: Mishin, Ilya <5b380e8454a88bd3da38768d18f550c382eb6640@intel.com>

--- cmake/compilers/MSVC.cmake
+++ cmake/compilers/MSVC.cmake
@@ -69,14 +69,15 @@
     set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D _UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__)
 endif()

-set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:/GL>)
-set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-LTCG> $<$<NOT:$<CONFIG:Debug>>:-INCREMENTAL:NO>)
-
 if (CMAKE_CXX_COMPILER_ID MATCHES "(Clang|IntelLLVM)")
     if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
         set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg)
     endif()
     set(TBB_OPENMP_NO_LINK_FLAG TRUE)
+    set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
+else()
+    set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:/GL>)
+    set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-LTCG> $<$<NOT:$<CONFIG:Debug>>:-INCREMENTAL:NO>)
 endif()

 set(TBB_OPENMP_FLAG /openmp)


DEBUG_CMD should default to nothing rather than "." which generates an
"ELF: command not found" error message.

svn path=/trunk/; revision=8984

--- plplot_test/plplot-test.sh.cmake
+++ plplot_test/plplot-test.sh.cmake
@@ -37,7 +37,6 @@
 EXAMPLES_DIR=${EXAMPLES_DIR:-.}
 SRC_EXAMPLES_DIR=${SRC_EXAMPLES_DIR:-.}
 OUTPUT_DIR=${OUTPUT_DIR:-.}
-DEBUG_CMD=${DEBUG_CMD:-.}
 device=${DEVICE:-psc}
 export EXAMPLES_DIR SRC_EXAMPLES_DIR OUTPUT_DIR device DEBUG_CMD


restored FindTBB.cmake from v251 branch as the current one does not work on MacOSX

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -14,20 +14,12 @@
 ## limitations under the License.                                           ##
 ## ======================================================================== ##

-FIND_PATH(TBB_ROOT include/tbb/task_scheduler_init.h
+IF (WIN32)
+  FIND_PATH(TBB_ROOT include/tbb/task_scheduler_init.h
     DOC "Root of TBB installation"
-    PATHS ${PROJECT_SOURCE_DIR}/tbb
-          "C:/Program Files (x86)/Intel/Composer XE/tbb"
-          /opt/intel/composerxe/tbb
-          /share/apps/intel/2015.1.133/tbb
-          NO_DEFAULT_PATH
-)
-UNSET(TBB_INCLUDE_DIR CACHE)
-UNSET(TBB_LIBRARY CACHE)
-UNSET(TBB_LIBRARY_MALLOC CACHE)
+    PATHS ${PROJECT_SOURCE_DIR}/tbb "C:/Program Files (x86)/Intel/Composer XE/tbb"
+  )

-IF (WIN32)
-
   IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
     SET(TBB_ARCH intel64)
   ELSE()
@@ -51,6 +43,11 @@

 ELSE ()

+  FIND_PATH(TBB_ROOT include/tbb/task_scheduler_init.h
+    DOC "Root of TBB installation"
+    PATHS ${PROJECT_SOURCE_DIR}/tbb /opt/intel/composerxe/tbb
+  )
+
   IF (APPLE)
     IF (ENABLE_INSTALLER)
       FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h)
@@ -63,8 +60,8 @@
     ENDIF()
   ELSE()
     FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
-    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 ${TBB_ROOT}/lib/intel64/gcc4.4 NO_DEFAULT_PATH)
-    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 ${TBB_ROOT}/lib/intel64/gcc4.4 NO_DEFAULT_PATH)
+    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib/intel64/gcc4.4)
+    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib/intel64/gcc4.4)
   ENDIF()

   FIND_PATH(TBB_INCLUDE_DIR_MIC tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
@@ -102,11 +99,10 @@
   INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION bin COMPONENT tutorials)
   INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION lib COMPONENT libraries)
 ELSEIF (APPLE)
+  # install TBB with libc++ linkage for MacOSX
   IF (NOT ENABLE_INSTALLER)
+#    INSTALL(PROGRAMS ${TBB_ROOT}/lib/libc++/libtbb.dylib ${TBB_ROOT}/lib/libc++/libtbbmalloc.dylib DESTINATION bin COMPONENT tutorials)
     INSTALL(PROGRAMS ${TBB_ROOT}/lib/libc++/libtbb.dylib ${TBB_ROOT}/lib/libc++/libtbbmalloc.dylib DESTINATION lib COMPONENT libraries)
   ENDIF()
-ELSE()
-  IF (NOT ENABLE_INSTALLER)
-    INSTALL(PROGRAMS ${TBB_ROOT}/lib/intel64/gcc4.4/libtbb.so.2 ${TBB_ROOT}/lib/intel64/gcc4.4/libtbbmalloc.so.2 DESTINATION lib COMPONENT libraries)
-  ENDIF()
+
 ENDIF()


bugfix to FindTBB

bugfix to FindTBB

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -187,31 +187,31 @@

   # Create an imported library target for TBB.
   if(${TARGET}_FOUND)
-    add_library(${TARGET}::${TBB_LIBRARY_NAME} SHARED IMPORTED)
-    set_target_properties(${TARGET}::${TBB_LIBRARY_NAME} PROPERTIES
+    add_library(${TARGET}::tbb SHARED IMPORTED)
+    set_target_properties(${TARGET}::tbb PROPERTIES
       INTERFACE_INCLUDE_DIRECTORIES ${${INCLUDE_DIR_VAR}}
       INTERFACE_COMPILE_DEFINITIONS "__TBB_NO_IMPLICIT_LINKAGE=1"
     )
-    add_library(${TARGET}::${TBBMALLOC_LIBRARY_NAME} SHARED IMPORTED)
-    set_target_properties(${TARGET}::${TBBMALLOC_LIBRARY_NAME} PROPERTIES
+    add_library(${TARGET}::tbbmalloc SHARED IMPORTED)
+    set_target_properties(${TARGET}::tbbmalloc PROPERTIES
       INTERFACE_COMPILE_DEFINITIONS "__TBBMALLOC_NO_IMPLICIT_LINKAGE=1"
     )
     if(WIN32)
-      set_target_properties(${TARGET}::${TBB_LIBRARY_NAME} PROPERTIES
+      set_target_properties(${TARGET}::tbb PROPERTIES
         IMPORTED_IMPLIB ${${TBB_LIBRARY_VAR}}
       )
-      set_target_properties(${TARGET}::${TBBMALLOC_LIBRARY_NAME} PROPERTIES
+      set_target_properties(${TARGET}::tbbmalloc PROPERTIES
         IMPORTED_IMPLIB ${${TBBMALLOC_LIBRARY_VAR}}
       )
     else()
       # Note: IMPORTED_NO_SONAME must be set or cmake will attempt
       #       to link to the full path of libtbb.so. Instead, we
       #       rely on the linker to find libtbb.so.2.
-      set_target_properties(${TARGET}::${TBB_LIBRARY_NAME} PROPERTIES
+      set_target_properties(${TARGET}::tbb PROPERTIES
         IMPORTED_LOCATION ${${TBB_LIBRARY_VAR}}
         IMPORTED_NO_SONAME TRUE
       )
-      set_target_properties(${TARGET}::${TBBMALLOC_LIBRARY_NAME} PROPERTIES
+      set_target_properties(${TARGET}::tbbmalloc PROPERTIES
         IMPORTED_LOCATION ${${TBBMALLOC_LIBRARY_VAR}}
         IMPORTED_NO_SONAME TRUE
       )
@@ -275,7 +275,7 @@
     set(EMBREE_TBBMALLOC_DEBUG_LIBRARY_NAME "tbbmalloc${EMBREE_TBB_DEBUG_POSTFIX}")
   endif()
 endif()
-
+
 find_tbb(TBB
   EMBREE_TBB_ROOT
   EMBREE_TBB_INCLUDE_DIR


Remove debug message.

Remove debug message.

--- cmakemodules/FindMPI.cmake
+++ cmakemodules/FindMPI.cmake
@@ -555,10 +555,8 @@
     endif()

     if (regular_compiler_worked)
-      message("here")
       find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER)
     else()
-      message("here")
       find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH)
     endif()
   endif()


added gcc4.7 and gcc4.1 hint for finding TBB user linux

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -122,7 +122,13 @@
       FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${EMBREE_TBB_ROOT}/lib NO_DEFAULT_PATH)
     ELSE()
       FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${EMBREE_TBB_ROOT}/include NO_DEFAULT_PATH)
-      SET(TBB_HINTS HINTS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4 ${EMBREE_TBB_ROOT}/lib ${EMBREE_TBB_ROOT}/lib64 PATHS /usr/libx86_64-linux-gnu/)
+      SET(TBB_HINTS HINTS
+          ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.7
+          ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4
+          ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.1
+          ${EMBREE_TBB_ROOT}/lib
+          ${EMBREE_TBB_ROOT}/lib64
+        PATHS /usr/libx86_64-linux-gnu/)
       FIND_LIBRARY(TBB_LIBRARY tbb ${TBB_HINTS})
       FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc ${TBB_HINTS})
     ENDIF()


Update iOS version for nocodesign toolchain to 8.0 (Travis)

--- ios-nocodesign.cmake
+++ ios-nocodesign.cmake
@@ -56,7 +56,7 @@

 set(IPHONEOS_ARCHS armv7;armv7s;arm64)
 set(IPHONESIMULATOR_ARCHS i386;x86_64)
-set(IOS_SDK_VERSION 7.1)
+set(IOS_SDK_VERSION 8.0)

 include("${CMAKE_CURRENT_LIST_DIR}/os/iphone.cmake")
 include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake")


mimxrt1050_evk: Update jlink device name

A bug in the jlink application made it impossible to use OpenSDA
firmware with the mimxrt1052 device name, so we used the generic
Cortex-M7 device name as a workaround. This bug was fixed in jlink
V6.32h (2018-07-05), so now we can use the more specific device name.

Signed-off-by: Maureen Helm <87a696db5547fa477bda9f9e0f00013c839c14d3@nxp.com>

--- boards/arm/mimxrt1050_evk/board.cmake
+++ boards/arm/mimxrt1050_evk/board.cmake
@@ -4,5 +4,5 @@
 # SPDX-License-Identifier: Apache-2.0
 #

-board_runner_args(jlink "--device=Cortex-M7")
+board_runner_args(jlink "--device=MCIMXRT1052")
 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)


SuperBuild: avoid empty string in configure command (triggers a cmake build)

--- SuperBuild/CMake/External_gdal.cmake
+++ SuperBuild/CMake/External_gdal.cmake
@@ -103,7 +103,7 @@
   STRING(REGEX REPLACE "/" "\\\\" CMAKE_WIN_INSTALL_PREFIX ${CMAKE_WIN_INSTALL_PREFIX})
   configure_file(${CMAKE_SOURCE_DIR}/patches/GDAL/nmake_gdal_extra.opt.in ${CMAKE_BINARY_DIR}/nmake_gdal_extra.opt)
   set(GDAL_PATCH_COMMAND)
-  set(GDAL_CONFIGURE_COMMAND)
+  set(GDAL_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E touch  ${CMAKE_BINARY_DIR}/configure)
   set(GDAL_BUILD_COMMAND nmake
     /f ${GDAL_SB_SRC}/makefile.vc
     MSVC_VER=${MSVC_VERSION}


BUG: wrong value of _SB_TIFF_LIBRARY

BUG: wrong value of _SB_TIFF_LIBRARY

--- SuperBuild/CMake/External_tiff.cmake
+++ SuperBuild/CMake/External_tiff.cmake
@@ -66,9 +66,10 @@

 SUPERBUILD_PATCH_SOURCE(TIFF)

+#do we really need these variables?
 set(_SB_TIFF_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
 if(WIN32)
-  set(_SB_TIFF_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff.lib)
+  set(_SB_TIFF_LIBRARY ${SB_INSTALL_PREFIX}/lib/tiff.lib)
 elseif(UNIX)
   set(_SB_TIFF_LIBRARY ${SB_INSTALL_PREFIX}/lib/libtiff${CMAKE_SHARED_LIBRARY_SUFFIX})
 endif()


filtered cobatura output

filtered cobatura output

--- contrib/CodeCoverage.cmake
+++ contrib/CodeCoverage.cmake
@@ -108,7 +108,7 @@

         ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
                 # Running gcovr
-                COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/'  -o ${_outputname}.xml
+                COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -e '${CMAKE_SOURCE_DIR}/thirdparty/' -e '${CMAKE_SOURCE_DIR}/build/' -o ${_outputname}.xml
                 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
                 COMMENT "Running gcovr to produce Cobertura code coverage report. ${_testrunner} ${ARGV3}"
         )


Changed VMTK remote repository to vmtk/vmtk.git, rather than rlizzo/vmtk.git

--- SuperBuild/External_VMTK.cmake
+++ SuperBuild/External_VMTK.cmake
@@ -23,11 +23,11 @@

   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
-    #GIT_REPOSITORY "${git_protocol}://github.com/vmtk/vmtk.git"
+    GIT_REPOSITORY "${git_protocol}://github.com/vmtk/vmtk.git"
+    GIT_TAG "master"
+    # Use this repository/branch to test changes using nightly builds:
+    #GIT_REPOSITORY "${git_protocol}://github.com/rlizzo/vmtk"
     #GIT_TAG "master"
-    # Use this repository/branch to test changes using nightly builds:
-    GIT_REPOSITORY "${git_protocol}://github.com/rlizzo/vmtk"
-    GIT_TAG "master"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${proj}-build
     CMAKE_CACHE_ARGS


Switch to latest vmtk/vmtk master

Switch to latest vmtk/vmtk master

VMTK master is now compatible with VTK9.

--- SuperBuild/External_VMTK.cmake
+++ SuperBuild/External_VMTK.cmake
@@ -44,13 +44,13 @@

   ExternalProject_SetIfNotDefined(
     ${CMAKE_PROJECT_NAME}_${proj}_GIT_REPOSITORY
-    "${EP_GIT_PROTOCOL}://github.com/jcfr/vmtk.git"
+    "${EP_GIT_PROTOCOL}://github.com/vmtk/vmtk.git"
     QUIET
     )

   ExternalProject_SetIfNotDefined(
     ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG
-    "ca83ce1575e9da328efaa2f52114122869594280"
+    "b5e8d0a86c63b629fc0199ee30114efd72fcb183"
     QUIET
     )


COMP: update KWStyle (so it reports its version number)

--- Utilities/KWStyle/BuildKWStyle.cmake
+++ Utilities/KWStyle/BuildKWStyle.cmake
@@ -23,7 +23,7 @@
 if(NOT TARGET KWStyle)
 ExternalProject_add(KWStyle
   GIT_REPOSITORY "${git_protocol}://github.com/Kitware/KWStyle.git"
-  GIT_TAG 840d0f63174d6aa21089a0514ee1e733b98c0709
+  GIT_TAG c7b8a63d18ddf7e14e61874e430509c6d96c191d
   UPDATE_COMMAND ""
   DOWNLOAD_DIR ${KWStyle_SOURCE_DIR}
   SOURCE_DIR ${KWStyle_SOURCE_DIR}


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


Minor update to the filename format of shared libraries / plugins. It used to be something like libViewer.XX while now it's Viewer.XX (for the Viewer plugin).

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -122,7 +122,9 @@

     # Linker settings

-    SET_TARGET_PROPERTIES(${THIRD_PARTY_LIBRARY_NAME} PROPERTIES LINK_FLAGS "${LINK_FLAGS_PROPERTIES}")
+    SET_TARGET_PROPERTIES(${THIRD_PARTY_LIBRARY_NAME}
+        PROPERTIES PREFIX "" LINK_FLAGS "${LINK_FLAGS_PROPERTIES}"
+    )
 ENDMACRO()

 MACRO(BUILD_PLUGIN PLUGIN_NAME)
@@ -157,7 +159,9 @@

     # Linker settings

-    SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "${LINK_FLAGS_PROPERTIES}")
+    SET_TARGET_PROPERTIES(${PLUGIN_NAME}
+        PROPERTIES PREFIX "" LINK_FLAGS "${LINK_FLAGS_PROPERTIES}"
+    )
 ENDMACRO()

 MACRO(PACKAGE_THIRD_PARTY_LIBRARY)


cmake: Rework dotnet.cmake

cmake: Rework dotnet.cmake


cmake: Instruct Python to use UTF-8 on Windows

In order for CMake and Python to interact correctly when the former
invokes the latter, ensure that Python uses UTF-8 encodings when
interacting with stdout and stdin on Windows.

Signed-off-by: Carles Cufi <853081dc8dca4fe6a7e3c984752718b5db36e060@nordicsemi.no>

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -1,4 +1,13 @@
 # SPDX-License-Identifier: Apache-2.0
+
+# On Windows, instruct Python to output UTF-8 even when not
+# interacting with a terminal. This is required since Python scripts
+# are invoked by CMake code and, on Windows, standard I/O encoding defaults
+# to the current code page if not connected to a terminal, which is often
+# not what we want.
+if (WIN32)
+  set(ENV{PYTHONIOENCODING} "utf-8")
+endif()

 # The 'FindPythonInterp' that is distributed with CMake 3.8 has a bug
 # that we need to work around until we upgrade to 3.13. Until then we


c++11x -> c++0x on UNIX so it will build on gcc 4.6

--- cmake/gdx.cmake
+++ cmake/gdx.cmake
@@ -37,7 +37,7 @@
         add_library(${target_name} SHARED ${sources})

     elseif(UNIX)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
         if (${target_type} STREQUAL "application")
             add_executable(${target_name} ${sources})
         else()


[ROCm] add gfx908 support for AMD MI100, test=develop (#42560)

--- cmake/hip.cmake
+++ cmake/hip.cmake
@@ -71,8 +71,10 @@
 # host linker to link.
 list(APPEND HIP_HCC_FLAGS -fno-gpu-rdc)
 list(APPEND HIP_HCC_FLAGS --amdgpu-target=gfx906)
+list(APPEND HIP_HCC_FLAGS --amdgpu-target=gfx908)
 list(APPEND HIP_CLANG_FLAGS -fno-gpu-rdc)
 list(APPEND HIP_CLANG_FLAGS --amdgpu-target=gfx906)
+list(APPEND HIP_CLANG_FLAGS --amdgpu-target=gfx908)

 if(HIP_COMPILER STREQUAL clang)


cmake: Fix search_python_module (Fix #2814)

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -27,8 +27,8 @@
 list(APPEND CMAKE_SWIG_FLAGS "-py3" "-DPY3")

 # Find if python module MODULE_NAME is available,
-# if not install it to the Python 3 user install directory.
-function(search_python_module MODULE_NAME)
+# if not install it (PACKAGE_NAME) to the Python3 user install directory.
+function(search_python_module MODULE_NAME PACKAGE_NAME)
   execute_process(
     COMMAND ${Python3_EXECUTABLE} -c "import ${MODULE_NAME}; print(${MODULE_NAME}.__version__)"
     RESULT_VARIABLE _RESULT
@@ -41,7 +41,7 @@
   else()
     message(WARNING "Can't find python module \"${MODULE_NAME}\", install it using pip...")
     execute_process(
-      COMMAND ${Python3_EXECUTABLE} -m pip install --user ${MODULE_NAME}
+      COMMAND ${Python3_EXECUTABLE} -m pip install --user ${PACKAGE_NAME}
       OUTPUT_STRIP_TRAILING_WHITESPACE
       )
   endif()
@@ -59,12 +59,12 @@
   if(${_RESULT} STREQUAL "0")
     message(STATUS "Found python internal module: ${MODULE_NAME}")
   else()
-    message(FATAL_ERROR "Can't find python internal module \"${MODULE_NAME}\", please install it using your system package manger")
+    message(FATAL_ERROR "Can't find python internal module \"${MODULE_NAME}\", please install it using your system package manager")
   endif()
 endfunction()

 # Generate Protobuf py sources with mypy support
-search_python_module(mypy-protobuf)
+search_python_module(mypy_protobuf mypy-protobuf)
 set(PROTO_PYS)
 file(GLOB_RECURSE proto_py_files RELATIVE ${PROJECT_SOURCE_DIR}
   "ortools/constraint_solver/*.proto"
@@ -157,8 +157,8 @@
   COPYONLY)

 # Look for python module wheel
-search_python_module(setuptools)
-search_python_module(wheel)
+search_python_module(setuptools setuptools)
+search_python_module(wheel wheel)

 # Main Target
 add_custom_target(python_package ALL
@@ -199,7 +199,7 @@
 # Test
 if(BUILD_TESTING)
   # Look for python module venv
-  search_python_module(absl-py)
+  search_python_module(absl absl-py)
   search_python_internal_module(venv)
   # Testing using a vitual environment
   set(VENV_EXECUTABLE ${Python3_EXECUTABLE} -m venv)


Add sha1sum for source package

Add sha1sum for source package

--- build/Package.cmake
+++ build/Package.cmake
@@ -22,10 +22,21 @@

 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FULLNAME}_${CPACK_PACKAGE_VERSION}")

-
 # Sources
 set(CPACK_SOURCE_GENERATOR "TGZ")
 set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR};\\\\.git/;\\\\.git$;\\\\.gitignore$;\\\\.gitmodules$;.*\\\\.swp;.*\\\\.pyc;__pycache__/;/make/;/workspace/")
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_source")

 include(CPack)
+
+find_program(SHA1SUM_COMMAND sha1sum)
+if(NOT SHA1SUM_COMMAND)
+	message(WARNING "Cannot find sha1sum command")
+else()
+	add_custom_target(package_source_sha
+		COMMAND $(MAKE) package_source
+		COMMAND sha1sum ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_source.tar.gz > ${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_source.tar.gz.sha1.txt
+		WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+		COMMENT "Build source package" VERBATIM
+	)
+endif()


Fix web assembly.

Fix web assembly.

--- build/cmake/arch-user.cmake
+++ build/cmake/arch-user.cmake
@@ -1,8 +1,6 @@
 if(WEB)
   set(KERNEL_EXE_NAME "kernel.html")
-endif()
-
-if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm")
+elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm")
   set(REAL_ARCH "arm")
 elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
   set(REAL_ARCH "x86")


findig protobuf with find_library

findig protobuf with find_library

--- CMake/FindCaffe2.cmake
+++ CMake/FindCaffe2.cmake
@@ -4,6 +4,8 @@
 set(Caffe2_CMAKE_DEBUG_POSTFIX d)

 set(Caffe2_LIBRARIES)
+
+find_library (PROTOBUF_LIB protobuf)

 FOREACH(POSTFIX _CPU;_GPU)

@@ -36,17 +38,17 @@

   if(Caffe2_LIBRARY_RELEASE)
     list(APPEND Caffe2_LIBRARIES optimized ${Caffe2_LIBRARY_RELEASE})
-    list(APPEND Caffe2_LIBRARIES optimized /usr/lib/x86_64-linux-gnu/libprotobuf.so)
+    list(APPEND Caffe2_LIBRARIES optimized ${PROTOBUF_LIB})
   endif()

   if(Caffe2_LIBRARY_DEBUG)
     list(APPEND Caffe2_LIBRARIES debug ${Caffe2_LIBRARY_DEBUG})
-    list(APPEND Caffe2_LIBRARIES debug /usr/lib/x86_64-linux-gnu/libprotobuf.so)
+    list(APPEND Caffe2_LIBRARIES debug ${PROTOBUF_LIB})
   endif()

 ENDFOREACH()

 find_package_handle_standard_args(Caffe2
   FOUND_VAR Caffe2_FOUND
-  REQUIRED_VARS Caffe2_INCLUDE_DIR Caffe2_LIBRARIES
+  REQUIRED_VARS Caffe2_INCLUDE_DIR Caffe2_LIBRARIES PROTOBUF_LIB
 )


TEST: Dashboard configuration

TEST: Dashboard configuration

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -7,6 +7,8 @@
 set(CTEST_PROJECT_NAME "OTB")
 set(CTEST_NIGHTLY_START_TIME "20:00:00 CEST")

+set(CTEST_NIGHTLY_IDENT_LOCATION "http://www.orfeo-toolbox.org/nightly/libNightlyNumber")
+
 set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "www.orfeo-toolbox.org")
 set(CTEST_DROP_LOCATION "/Dashboard/submit.php?project=OTB")


COMP Fixed cdash script path for windows

--- CMake/MITKDashboardSetup.cmake
+++ CMake/MITKDashboardSetup.cmake
@@ -67,7 +67,7 @@
   else()
     set(CMAKE_LIBRARY_ARCHITECTURE x86)
   endif()
-  find_path(OPENCV_BIN_DIR opencv_core248.dll
+  find_path(OPENCV_BIN_DIR opencv_core2411.dll
     PATHS "${CTEST_BINARY_DIRECTORY}/ep/${CMAKE_LIBRARY_ARCHITECTURE}"
     PATH_SUFFIXES vc10/bin vc11/bin vc12/bin vc13/bin vc14/bin
     NO_DEFAULT_PATH


Move creation logic for resource checker back to setup_main_executable.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -1473,14 +1473,14 @@
     # Need to check if the destination variable is defined first because this macro could be called by downstream project that does not wish to install anything
     if (NOT ARG_PRIVATE)
         if (WEB AND DEST_BUNDLE_DIR)
-            set (LOCATION $<TARGET_FILE_DIR:${TARGET_NAME}>)
-            unset (FILES)
             set (EXTS data html.map html.mem js wasm)
             if (SELF_EXECUTABLE_SHELL)
                 install (PROGRAMS $<TARGET_FILE:${TARGET_NAME}> DESTINATION ${DEST_BUNDLE_DIR})
             else ()
                 list (APPEND EXTS html)
             endif ()
+            set (LOCATION $<TARGET_FILE_DIR:${TARGET_NAME}>)
+            unset (FILES)
             foreach (EXT ${EXTS})
                 list (APPEND FILES ${LOCATION}/${TARGET_NAME}.${EXT})
             endforeach ()
@@ -1650,7 +1650,55 @@
         endif ()
         setup_executable (${EXE_TYPE} ${ARG_UNPARSED_ARGUMENTS})
     endif ()
-    # Only need to install the resource directories once in case  they are referenced by multiple targets
+    # Setup custom resource checker target
+    if ((EXE_TYPE STREQUAL MACOSX_BUNDLE OR URHO3D_PACKAGING) AND RESOURCE_DIRS)
+        if (URHO3D_PACKAGING)
+            # Urho3D project builds the PackageTool as required; downstream project uses PackageTool found in the Urho3D build tree or Urho3D SDK
+            find_Urho3d_tool (PACKAGE_TOOL PackageTool
+                HINTS ${CMAKE_BINARY_DIR}/bin/tool ${URHO3D_HOME}/bin/tool
+                DOC "Path to PackageTool" MSG_MODE WARNING)
+            if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
+                set (PACKAGING_DEP DEPENDS PackageTool)
+            endif ()
+            set (PACKAGING_COMMENT " and packaging")
+        endif ()
+        # Share a same custom target that checks for a same resource dirs list
+        foreach (DIR ${RESOURCE_DIRS})
+            string (MD5 MD5 ${DIR})
+            set (MD5ALL ${MD5ALL}${MD5})
+            if (CMAKE_HOST_WIN32)
+                # On Windows host, always assumes there are changes so resource dirs would be repackaged in each build, however, still make sure the *.pak timestamp is not altered unnecessarily
+                if (URHO3D_PACKAGING)
+                    set (PACKAGING_COMMAND && echo Packaging ${DIR}... && ${PACKAGE_TOOL} ${DIR} ${RESOURCE_${DIR}_PATHNAME}.new -c -q && ${CMAKE_COMMAND} -E copy_if_different ${RESOURCE_${DIR}_PATHNAME}.new ${RESOURCE_${DIR}_PATHNAME} && ${CMAKE_COMMAND} -E remove ${RESOURCE_${DIR}_PATHNAME}.new)
+                endif ()
+                list (APPEND COMMANDS COMMAND ${CMAKE_COMMAND} -E touch ${DIR} ${PACKAGING_COMMAND})
+            else ()
+                # On Unix-like hosts, detect the changes in the resource directory recursively so they are only repackaged and/or rebundled (Xcode only) as necessary
+                if (URHO3D_PACKAGING)
+                    set (PACKAGING_COMMAND && echo Packaging ${DIR}... && ${PACKAGE_TOOL} ${DIR} ${RESOURCE_${DIR}_PATHNAME} -c -q)
+                    set (OUTPUT_COMMAND test -e ${RESOURCE_${DIR}_PATHNAME} || \( true ${PACKAGING_COMMAND} \))
+                else ()
+                    set (OUTPUT_COMMAND true)   # Nothing to output
+                endif ()
+                list (APPEND COMMANDS COMMAND echo Checking ${DIR}... && bash -c \"\(\( `find ${DIR} -newer ${DIR} |wc -l` \)\)\" && touch -cm ${DIR} ${PACKAGING_COMMAND} || ${OUTPUT_COMMAND})
+            endif ()
+        endforeach ()
+        string (MD5 MD5ALL ${MD5ALL})
+        # Ensure the resource check is done before building the main executable target
+        if (NOT RESOURCE_CHECK_${MD5ALL})
+            set (RESOURCE_CHECK RESOURCE_CHECK)
+            while (TARGET ${RESOURCE_CHECK})
+                string (RANDOM RANDOM)
+                set (RESOURCE_CHECK RESOURCE_CHECK_${RANDOM})
+            endwhile ()
+            set (RESOURCE_CHECK_${MD5ALL} ${RESOURCE_CHECK} CACHE INTERNAL "Resource check hash map")
+        endif ()
+        if (NOT TARGET ${RESOURCE_CHECK_${MD5ALL}})
+            add_custom_target (${RESOURCE_CHECK_${MD5ALL}} ALL ${COMMANDS} ${PACKAGING_DEP} COMMENT "Checking${PACKAGING_COMMENT} resource directories")
+        endif ()
+        add_dependencies (${TARGET_NAME} ${RESOURCE_CHECK_${MD5ALL}})
+    endif ()
+    # Only need to install the resource directories once in case they are referenced by multiple targets
     if (RESOURCE_DIRS AND DEST_SHARE_DIR)
         foreach (DIR ${RESOURCE_DIRS})
             list (FIND INSTALLED_RESOURCE_DIRS ${DIR} FOUND_INDEX)
@@ -1748,54 +1796,6 @@
         set_target_properties (${TARGET_NAME} PROPERTIES ${TARGET_PROPERTIES})
         unset (TARGET_PROPERTIES)
     endif ()
-    # Setup custom resource checker target
-    if ((EXE_TYPE STREQUAL MACOSX_BUNDLE OR URHO3D_PACKAGING) AND RESOURCE_DIRS)
-        if (URHO3D_PACKAGING)
-            # Urho3D project builds the PackageTool as required; downstream project uses PackageTool found in the Urho3D build tree or Urho3D SDK
-            find_Urho3d_tool (PACKAGE_TOOL PackageTool
-                HINTS ${CMAKE_BINARY_DIR}/bin/tool ${URHO3D_HOME}/bin/tool
-                DOC "Path to PackageTool" MSG_MODE WARNING)
-            if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
-                set (PACKAGING_DEP DEPENDS PackageTool)
-            endif ()
-            set (PACKAGING_COMMENT " and packaging")
-        endif ()
-        # Share a same custom target that checks for a same resource dirs list
-        foreach (DIR ${RESOURCE_DIRS})
-            string (MD5 MD5 ${DIR})
-            set (MD5ALL ${MD5ALL}${MD5})
-            if (CMAKE_HOST_WIN32)
-                # On Windows host, always assumes there are changes so resource dirs would be repackaged in each build, however, still make sure the *.pak timestamp is not altered unnecessarily
-                if (URHO3D_PACKAGING)
-                    set (PACKAGING_COMMAND && echo Packaging ${DIR}... && ${PACKAGE_TOOL} ${DIR} ${RESOURCE_${DIR}_PATHNAME}.new -c -q && ${CMAKE_COMMAND} -E copy_if_different ${RESOURCE_${DIR}_PATHNAME}.new ${RESOURCE_${DIR}_PATHNAME} && ${CMAKE_COMMAND} -E remove ${RESOURCE_${DIR}_PATHNAME}.new)
-                endif ()
-                list (APPEND COMMANDS COMMAND ${CMAKE_COMMAND} -E touch ${DIR} ${PACKAGING_COMMAND})
-            else ()
-                # On Unix-like hosts, detect the changes in the resource directory recursively so they are only repackaged and/or rebundled (Xcode only) as necessary
-                if (URHO3D_PACKAGING)
-                    set (PACKAGING_COMMAND && echo Packaging ${DIR}... && ${PACKAGE_TOOL} ${DIR} ${RESOURCE_${DIR}_PATHNAME} -c -q)
-                    set (OUTPUT_COMMAND test -e ${RESOURCE_${DIR}_PATHNAME} || \( true ${PACKAGING_COMMAND} \))
-                else ()
-                    set (OUTPUT_COMMAND true)   # Nothing to output
-                endif ()
-                list (APPEND COMMANDS COMMAND echo Checking ${DIR}... && bash -c \"\(\( `find ${DIR} -newer ${DIR} |wc -l` \)\)\" && touch -cm ${DIR} ${PACKAGING_COMMAND} || ${OUTPUT_COMMAND})
-            endif ()
-        endforeach ()
-        string (MD5 MD5ALL ${MD5ALL})
-        # Ensure the resource check is done before building the main executable target
-        if (NOT RESOURCE_CHECK_${MD5ALL})
-            set (RESOURCE_CHECK RESOURCE_CHECK)
-            while (TARGET ${RESOURCE_CHECK})
-                string (RANDOM RANDOM)
-                set (RESOURCE_CHECK RESOURCE_CHECK_${RANDOM})
-            endwhile ()
-            set (RESOURCE_CHECK_${MD5ALL} ${RESOURCE_CHECK} CACHE INTERNAL "Resource check hash map")
-        endif ()
-        if (NOT TARGET ${RESOURCE_CHECK_${MD5ALL}})
-            add_custom_target (${RESOURCE_CHECK_${MD5ALL}} ALL ${COMMANDS} ${PACKAGING_DEP} COMMENT "Checking${PACKAGING_COMMENT} resource directories")
-        endif ()
-        add_dependencies (${TARGET_NAME} ${RESOURCE_CHECK_${MD5ALL}})
-    endif ()
     # Create symbolic links in the build tree
     if (ANDROID)
         foreach (I AndroidManifest.xml build.xml custom_rules.xml project.properties src res assets jni)


CMake: proper mklink presence check (although probably not needed any more..)

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -116,7 +116,9 @@
         else ()
             unset (SLASH_D)
         endif ()
-        set (HAS_MKLINK ON)
+        if(${CMAKE_SYSTEM_VERSION} GREATER_EQUAL 6.0)
+            set (HAS_MKLINK ON)
+        endif ()
         if (HAS_MKLINK)
             if (NOT EXISTS ${ABS_DESTINATION})
                 # Have to use string-REPLACE as file-TO_NATIVE_PATH does not work as expected with MinGW on "backward slash" host system


Fix missing braces

Fix missing braces

--- GitExternal.cmake
+++ GitExternal.cmake
@@ -33,11 +33,11 @@

   if(IS_DIRECTORY "${DIR}/.git")
     foreach(GIT_EXTERNAL_RESET_FILE ${GIT_EXTERNAL_RESET})
-      common_process("git reset ${GIT_EXTERNAL_RESET_FILE" STATUS
+      common_process("git reset ${GIT_EXTERNAL_RESET_FILE}" STATUS
         COMMAND "${GIT_EXECUTABLE}" reset -q "${GIT_EXTERNAL_RESET_FILE}"
         RESULT_VARIABLE nok ERROR_VARIABLE error
         WORKING_DIRECTORY "${DIR}")
-      common_process("git checkout -- ${GIT_EXTERNAL_RESET_FILE" STATUS
+      common_process("git checkout -- ${GIT_EXTERNAL_RESET_FILE}" STATUS
         COMMAND "${GIT_EXECUTABLE}" checkout -q -- "${GIT_EXTERNAL_RESET_FILE}"
         RESULT_VARIABLE nok ERROR_VARIABLE error
         WORKING_DIRECTORY "${DIR}")


COMP: Pass SimpleITK_DIR into TubeTK build

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -113,6 +113,7 @@
         "Insight"
       )
       set( TubeTK_DEPENDS ${TubeTK_DEPENDS} "SimpleITK" )
+      set( SimpleITK_DIR "${base}/SimpleITK-Build" )
   else( TubeTK_USE_ITKV4 )
     set( proj Insight )
     ExternalProject_Add( ${proj}
@@ -393,6 +394,7 @@
 ##
 ## TubeTK - Normal Build
 ##
+if( NOT TubeTK_USE_ITKV4 )
 set( proj TubeTK )
 ExternalProject_Add( ${proj}
   DOWNLOAD_COMMAND ""
@@ -428,3 +430,45 @@
   DEPENDS
     ${TubeTK_DEPENDS}
  )
+
+##
+## TubeTK - ITKv4 Build
+##
+else( NOT TubeTK_USE_ITKV4 )
+set( proj TubeTK )
+ExternalProject_Add( ${proj}
+  DOWNLOAD_COMMAND ""
+  SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
+  BINARY_DIR TubeTK-Build
+  CMAKE_GENERATOR ${gen}
+  CMAKE_ARGS
+    -DBUILDNAME:STRING=${BUILDNAME}
+    -DSITE:STRING=${SITE}
+    -DMAKECOMMAND:STRING=${MAKECOMMAND}
+    -DCMAKE_BUILD_TYPE:STRING=${build_type}
+    -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+    -DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
+    -DBUILD_TESTING:BOOL=${BUILD_TESTING}
+    -DBUILD_DOCUMENTATION:BOOL=${BUILD_DOCUMENTATION}
+    -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
+    -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
+    -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
+    -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
+    -DTubeTK_USE_SUPERBUILD:BOOL=FALSE
+    -DTubeTK_USE_VTK:BOOL=${TubeTK_USE_VTK}
+    -DTubeTK_USE_KWSTYLE:BOOL=${TubeTK_USE_KWSTYLE}
+    -DTubeTK_USE_CTK:BOOL=${TubeTK_USE_CTK}
+    -DTubeTK_USE_QT:BOOL=${TubeTK_USE_QT}
+    -DTubeTK_USE_ITKV4:BOOL=${TubeTK_USE_ITKV4}
+    -DTubeTK_EXECUTABLE_DIRS:BOOL=${TubeTK_EXECUTABLE_DIRS}
+    -DITK_DIR:PATH=${ITK_DIR}
+    -DSimpleITK_DIR:PATH=${SimpleITK_DIR}
+    -DVTK_DIR:PATH=${VTK_DIR}
+    -DGenerateCLP_DIR:PATH=${GenerateCLP_DIR}
+    -DCTK_DIR:PATH=${CTK_DIR}
+    -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+  INSTALL_COMMAND ""
+  DEPENDS
+    ${TubeTK_DEPENDS}
+ )
+endif( NOT TubeTK_USE_ITKV4 )


Fix FindLZO.cmake Detecting liblzo on darwin was not working and the linking flags were not exported properly

--- cmake/FindLZO.cmake
+++ cmake/FindLZO.cmake
@@ -6,9 +6,9 @@

 find_path(LZO_INCLUDE_DIR NAMES lzo/lzoconf.h)

-find_library(LZO_LIB NAMES liblzo2.so)
+find_library(LZO_LIBS NAMES lzo2)

-if (LZO_LIB)
+if (LZO_LIBS)
   if (LZO_INCLUDE_DIR)
     set(LZO_FOUND TRUE)
   else ()
@@ -20,7 +20,7 @@

 if (LZO_FOUND)
   if (NOT LZO_FIND_QUIETLY)
-    message(STATUS "Lzo Library ${LZO_LIB}")
+    message(STATUS "Lzo Library ${LZO_LIBS}")
     message(STATUS "Lzo Include Found in ${LZO_INCLUDE_DIR}")
   endif ()
 else ()


Fixes for clang and SSE

Fixes for clang and SSE

--- cmake/FindSSE.cmake
+++ cmake/FindSSE.cmake
@@ -29,6 +29,12 @@
 # error if SSE support is missing.
 #
 set(SSE_FLAGS)
+set(SSE_FOUND)
+set(DETECTED_SSE_41)
+set(DETECTED_SSE_42)
+set(DETECTED_SSE_10)
+set(DETECTED_SSE_20)
+set(DETECTED_SSE_30)

 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
   execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion" OUTPUT_VARIABLE GCC_VERSION_STRING)
@@ -76,7 +82,7 @@

 # Check for SSE 4.2 support.
 if(_SSE_TEST_42)
-  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     set(CMAKE_REQUIRED_FLAGS "-msse4.2")
   endif()
   check_cxx_source_runs("
@@ -102,7 +108,7 @@

 # Check for SSE 4.1 support.
 if(_SSE_TEST_41)
-  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     set(CMAKE_REQUIRED_FLAGS "-msse4.1")
   endif()
   check_cxx_source_runs("
@@ -127,7 +133,7 @@

 # Check for SSE 3 support.
 if(_SSE_TEST_30)
-  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     set(CMAKE_REQUIRED_FLAGS "-msse3")
   endif()
   check_cxx_source_runs("
@@ -158,7 +164,7 @@

 # Check for SSE2 support.
 if(_SSE_TEST_20)
-  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     set(CMAKE_REQUIRED_FLAGS "-msse2")
   elseif(MSVC AND NOT CMAKE_CL_64)
     set(CMAKE_REQUIRED_FLAGS "/arch:SSE2")
@@ -185,7 +191,7 @@

 # Check for SSE support.
 if(_SSE_TEST_10)
-  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     set(CMAKE_REQUIRED_FLAGS "-msse")
   elseif(MSVC AND NOT CMAKE_CL_64)
     set(CMAKE_REQUIRED_FLAGS "/arch:SSE")
@@ -211,7 +217,7 @@

 set(CMAKE_REQUIRED_FLAGS)

-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   if(DETECTED_SSE_42)
       SET(SSE_FLAGS "${SSE_FLAGS} -msse4.2 -mfpmath=sse")
       set(SSE_VERSION "4.2")


Fix custom op build

Fix custom op build

--- cmake/Util/Op.cmake
+++ cmake/Util/Op.cmake
@@ -24,6 +24,7 @@

   include_directories("${CMAKE_CURRENT_BINARY_DIR}")

+  # Build protobuf files if they exist
   if(NOT("${args_PROTO_SRC}" STREQUAL ""))
     find_package(SaneProtobuf REQUIRED)
     set(PROTOBUF_IMPORT_DIRS "${SCANNER_PATH}")
@@ -38,7 +39,15 @@
     add_library(${args_LIB_NAME} SHARED ${args_CPP_SRCS})
   endif()

+  # NO_FLAGS is primarily for special treatment of libstdlib right now
   if("${args_NO_FLAGS}" STREQUAL "")
+    # Explictly link libscanner.so
+    execute_process(
+      OUTPUT_VARIABLE SCANNER_LIB_PATH
+      COMMAND
+      python -c "import scannerpy.stdlib.build_flags as b; b.print_lib()")
+    target_link_libraries(${args_LIB_NAME} PUBLIC "${SCANNER_LIB_PATH}/libscanner.so")
+
     execute_process(
       OUTPUT_VARIABLE BUILD_FLAGS
       COMMAND
@@ -46,8 +55,5 @@
     set_target_properties(
       ${args_LIB_NAME} PROPERTIES
       COMPILE_FLAGS "${BUILD_FLAGS}")
-    set_target_properties(
-      ${args_LIB_NAME} PROPERTIES
-      LINK_FLAGS "${BUILD_FLAGS}")
   endif()
 endfunction()


workaround c++11 flags

workaround c++11 flags

Former-commit-id: 5cacc0294574b0e827165b50000d708088d470ef

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -191,14 +191,32 @@
 endif()

-if( NOT WIN32 )
+if( NOT WIN32 ) # TODO detect visual studio versions? some are c++11 compatible
+
     # Even if SOFA code should remain C++98 compatible (so it can be compiled with most compilers),
     # it can be interesting to compile it with a C++11 STL.
     sofa_option(SOFA-MISC_C++11 BOOL OFF "Compile as C++11 (more optimized STL)")
     if(SOFA-MISC_C++11)
+
 #        add_definitions(-std=c++11) # is also adding the flag to the C compiler...
-        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+
+        if(CMAKE_COMPILER_IS_GNUCXX)
+            execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+            if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+            elseif(GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+                message(WARNING "c++0x activated. g++ compiler with a version >= 4.7 is needed to fully support c++11.")
+                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+            else ()
+                message("Warning: a g++ compiler with a version >= 4.3 is needed to support c++11.")
+            endif()
+
+        else() # not gcc -> clang?
+            # TODO detect clang versions ?
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+        endif()
     endif()
+
 endif()


[numerics] tagged as failed for some ADMM examples

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -322,7 +322,9 @@
   # The following tests are failing alternatively with a nonconstant rho based on the norm-inf of W
   #  SET(fc3d__ADMM_Tol_1e-5_Max_10000_inTol_0_inMax_0_Confeti-ex13-Fc3D-SBM_PROPERTIES WILL_FAIL TRUE)
   SET(fc3d__ADMM_Tol_1e-5_Max_10000_inTol_0_inMax_0_Capsules-i122-1617_PROPERTIES WILL_FAIL TRUE)
-
+  SET(fc3d__ADMM_Tol_1e-5_Max_10000_inTol_0_inMax_0_IPARAM_SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_RESIDUAL_BALANCING_Capsules-i122-1617_PROPERTIES WILL_FAIL TRUE)
+  SET(fc3d__ADMM_Tol_1e-5_Max_10000_inTol_0_inMax_0_IPARAM_SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_CONSTANT_Confeti-ex13-Fc3D-SBM_PROPERTIES WILL_FAIL TRUE)
+  SET(fc3d__ADMM_Tol_1e-5_Max_10000_inTol_0_inMax_0_IPARAM_SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_RESIDUAL_BALANCING_Confeti-ex13-Fc3D-SBM_PROPERTIES WILL_FAIL TRUE)

   IF(WITH_MUMPS)
     SET(fc3d__NSN_AC_Tol_1e-5_Max_1000_inTol_0_inMax_0_IPARAM_1_Capsules-i100-1090_PROPERTIES WILL_FAIL TRUE)


default to osgeo4w64 for OSGEO4W_DIR

default to osgeo4w64 for OSGEO4W_DIR

--- cmake/modules/BuildOSGeo4W.cmake
+++ cmake/modules/BuildOSGeo4W.cmake
@@ -5,7 +5,7 @@
 ###############################################################################

-set(OSGEO4W_DIR osgeo4w)
+set(OSGEO4W_DIR osgeo4w64)
 set(OSGEO4W_LIB_DIR ${OSGEO4W_DIR}/lib)
 set(OSGEO4W_BIN_DIR ${OSGEO4W_DIR}/bin)
 set(OSGEO4W_INCLUDE_DIR ${OSGEO4W_DIR}/include/laszip)


CMake: sample-based-testing: work in build dir.

In particular, affects where the intstrumentation reports are dumped.

--- cmake/sample-based-testing.cmake
+++ cmake/sample-based-testing.cmake
@@ -34,7 +34,7 @@
 add_custom_target(rstest-create)
 add_custom_command(TARGET rstest-create
   COMMAND rstest -c ${REFERENCE_SAMPLES}
-  WORKING_DIRECTORY "${REFERENCE_SAMPLE_ARCHIVE}"
+  WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Running rstest on all the samples in the sample set to generate the missing hashes"
   VERBATIM
   USES_TERMINAL)
@@ -42,7 +42,7 @@
 add_custom_target(rstest-recreate)
 add_custom_command(TARGET rstest-recreate
   COMMAND rstest -c -f ${REFERENCE_SAMPLES}
-  WORKING_DIRECTORY "${REFERENCE_SAMPLE_ARCHIVE}"
+  WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Running rstest on all the samples in the sample set to [re]generate all the hashes"
   VERBATIM
   USES_TERMINAL)
@@ -50,7 +50,7 @@
 add_custom_target(rstest-test) # hashes must exist beforehand
 add_custom_command(TARGET rstest-test
   COMMAND rstest ${REFERENCE_SAMPLES}
-  WORKING_DIRECTORY "${REFERENCE_SAMPLE_ARCHIVE}"
+  WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Running rstest on all the samples in the sample set to check for regressions"
   VERBATIM
   USES_TERMINAL)
@@ -58,7 +58,7 @@
 add_custom_target(rstest-check) # hashes should exist beforehand if you want to check for regressions
 add_custom_command(TARGET rstest-check
   COMMAND rstest -f ${REFERENCE_SAMPLES}
-  WORKING_DIRECTORY "${REFERENCE_SAMPLE_ARCHIVE}"
+  WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Trying to decode all the samples in the sample set"
   VERBATIM
   USES_TERMINAL)
@@ -66,6 +66,6 @@
 add_custom_target(rstest-clean)
 add_custom_command(TARGET rstest-clean
   COMMAND "${CMAKE_COMMAND}" -E remove ${REFERENCE_SAMPLE_HASHES}
-  WORKING_DIRECTORY "${REFERENCE_SAMPLE_ARCHIVE}"
+  WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
   COMMENT "Removing *.hash, *.hash.failed for the each sample in the set"
   VERBATIM)


fixes to schism_platform.cmake

fixes to schism_platform.cmake

- /MP for vc12
- prevent multiple -std=c++0x additions for GCC

--- build/cmake/custom_scripts/schism_platform.cmake
+++ build/cmake/custom_scripts/schism_platform.cmake
@@ -57,17 +57,22 @@
         SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /D_SECURE_SCL=0")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
     ENDIF (MSVC80 OR MSVC90)
-    if (MSVC10 OR MSVC11)
+    if (MSVC10 OR MSVC11 OR MSVC12)
         add_definitions(-D_SCL_SECURE_NO_WARNINGS)
         add_definitions(-D_CRT_SECURE_NO_WARNINGS)
         add_definitions(-DBOOST_ALL_NO_LIB)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
-    endif (MSVC10 OR MSVC11)
+    endif (MSVC10 OR MSVC11 OR MSVC12)
     ADD_DEFINITIONS(-DNOMINMAX)
 ENDIF (WIN32)

 if (UNIX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+    if (NOT _SCM_DONE_APPEND_CXX_FLAGS)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SCM_EXT_CFLAGS}")
+
+        set (_SCM_DONE_APPEND_CXX_FLAGS TRUE)
+    endif (NOT _SCM_DONE_APPEND_CXX_FLAGS)
 endif (UNIX)

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


- Fix for find_package(Gluon REQUIRED), results in

CMake Error at /usr/share/cmake/Modules/FindGluon.cmake:20 (find_package):
  find_package called with invalid argument "_gluonReq"

--- core/cmake/FindGluon.cmake
+++ core/cmake/FindGluon.cmake
@@ -17,11 +17,11 @@
     set(_gluonReq "REQUIRED")
 endif(Gluon_FIND_REQUIRED)

-find_package(GluonCore _gluonReq)
-find_package(GluonAudio _gluonReq)
-find_package(GluonInput _gluonReq)
-find_package(GluonGraphics _gluonReq)
-find_package(GluonEngine _gluonReq)
+find_package(GluonCore ${_gluonReq})
+find_package(GluonAudio ${_gluonReq})
+find_package(GluonInput ${_gluonReq})
+find_package(GluonGraphics ${_gluonReq})
+find_package(GluonEngine ${_gluonReq})

 set(GLUON_INCLUDES
     ${GLUON_CORE_INCLUDES}


PROJECT_DIRECTORY for FindConfigurePackage.cmake of cmake

--- project/cmake/modules/FindConfigurePackage.cmake
+++ project/cmake/modules/FindConfigurePackage.cmake
@@ -117,7 +117,7 @@
 macro (FindConfigurePackage)
     include(CMakeParseArguments)
     set(optionArgs BUILD_WITH_CONFIGURE BUILD_WITH_CMAKE BUILD_WITH_SCONS BUILD_WITH_CUSTOM_COMMAND)
-    set(oneValueArgs PACKAGE WORKING_DIRECTORY BUILD_DIRECTORY PREFIX_DIRECTORY SRC_DIRECTORY_NAME ZIP_URL TAR_URL SVN_URL GIT_URL GIT_BRANCH)
+    set(oneValueArgs PACKAGE WORKING_DIRECTORY BUILD_DIRECTORY PREFIX_DIRECTORY SRC_DIRECTORY_NAME PROJECT_DIRECTORY ZIP_URL TAR_URL SVN_URL GIT_URL GIT_BRANCH)
     set(multiValueArgs CONFIGURE_CMD CONFIGURE_FLAGS CMAKE_FLAGS SCONS_FLAGS MAKE_FLAGS CUSTOM_BUILD_COMMAND PREBUILD_COMMAND)
     cmake_parse_arguments(FindConfigurePackage "${optionArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )

@@ -266,9 +266,9 @@
             # init build dir
             if (NOT FindConfigurePackage_BUILD_DIRECTORY)
                 set(FindConfigurePackage_BUILD_DIRECTORY ${FindConfigurePackage_DOWNLOAD_SOURCE_DIR})
-                if (NOT EXISTS ${FindConfigurePackage_BUILD_DIRECTORY})
-                    file(MAKE_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY})
-                endif()
+            endif()
+            if (NOT EXISTS ${FindConfigurePackage_BUILD_DIRECTORY})
+                file(MAKE_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY})
             endif()

             # prebuild commands
@@ -282,7 +282,11 @@

             # build using configure and make
             if(FindConfigurePackage_BUILD_WITH_CONFIGURE)
-                file(RELATIVE_PATH CONFIGURE_EXEC_FILE ${FindConfigurePackage_BUILD_DIRECTORY} "${FindConfigurePackage_WORKING_DIRECTORY}/${FindConfigurePackage_SRC_DIRECTORY_NAME}/configure")
+                if(FindConfigurePackage_PROJECT_DIRECTORY)
+                    file(RELATIVE_PATH CONFIGURE_EXEC_FILE ${FindConfigurePackage_BUILD_DIRECTORY} "${FindConfigurePackage_PROJECT_DIRECTORY}/configure")
+                else()
+                    file(RELATIVE_PATH CONFIGURE_EXEC_FILE ${FindConfigurePackage_BUILD_DIRECTORY} "${FindConfigurePackage_WORKING_DIRECTORY}/${FindConfigurePackage_SRC_DIRECTORY_NAME}/configure")
+                endif()
                 if ( ${CONFIGURE_EXEC_FILE} STREQUAL "configure")
                     set(CONFIGURE_EXEC_FILE "./configure")
                 endif()
@@ -298,27 +302,36 @@

             # build using cmake and make
             elseif(FindConfigurePackage_BUILD_WITH_CMAKE)
-                file(RELATIVE_PATH BUILD_WITH_CMAKE_PROJECT_DIR ${FindConfigurePackage_BUILD_DIRECTORY} ${FindConfigurePackage_DOWNLOAD_SOURCE_DIR})
+                if(FindConfigurePackage_PROJECT_DIRECTORY)
+                    file(RELATIVE_PATH BUILD_WITH_CMAKE_PROJECT_DIR ${FindConfigurePackage_BUILD_DIRECTORY} ${FindConfigurePackage_PROJECT_DIRECTORY})
+                else()
+                    file(RELATIVE_PATH BUILD_WITH_CMAKE_PROJECT_DIR ${FindConfigurePackage_BUILD_DIRECTORY} ${FindConfigurePackage_DOWNLOAD_SOURCE_DIR})
+                endif()
                 if ( NOT BUILD_WITH_CMAKE_PROJECT_DIR)
                     set(BUILD_WITH_CMAKE_PROJECT_DIR ".")
                 endif()
+                message(STATUS "@${FindConfigurePackage_BUILD_DIRECTORY} Run: ${CMAKE_COMMAND} ${BUILD_WITH_CMAKE_PROJECT_DIR} -G '${CMAKE_GENERATOR}' -DCMAKE_INSTALL_PREFIX=${FindConfigurePackage_PREFIX_DIRECTORY} ${FindConfigurePackage_CMAKE_FLAGS}")
                 execute_process(
                     COMMAND
-                        "cmake" ${BUILD_WITH_CMAKE_PROJECT_DIR}
+                        ${CMAKE_COMMAND} ${BUILD_WITH_CMAKE_PROJECT_DIR}
                         -G "${CMAKE_GENERATOR}"
                         "-DCMAKE_INSTALL_PREFIX=${FindConfigurePackage_PREFIX_DIRECTORY}" ${FindConfigurePackage_CMAKE_FLAGS}
-                    WORKING_DIRECTORY "${FindConfigurePackage_BUILD_DIRECTORY}"
+                    WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                 )

                 # cmake --build and install
                 execute_process(
-                    COMMAND "cmake" --build . --target install
-                    WORKING_DIRECTORY "${FindConfigurePackage_BUILD_DIRECTORY}"
+                    COMMAND ${CMAKE_COMMAND} --build . --target install
+                    WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                 )

             # build using scons
             elseif(FindConfigurePackage_BUILD_WITH_SCONS)
-                file(RELATIVE_PATH BUILD_WITH_SCONS_PROJECT_DIR ${FindConfigurePackage_BUILD_DIRECTORY} ${FindConfigurePackage_DOWNLOAD_SOURCE_DIR})
+                if(FindConfigurePackage_PROJECT_DIRECTORY)
+                    file(RELATIVE_PATH BUILD_WITH_SCONS_PROJECT_DIR ${FindConfigurePackage_BUILD_DIRECTORY} ${FindConfigurePackage_PROJECT_DIRECTORY})
+                else()
+                    file(RELATIVE_PATH BUILD_WITH_SCONS_PROJECT_DIR ${FindConfigurePackage_BUILD_DIRECTORY} ${FindConfigurePackage_DOWNLOAD_SOURCE_DIR})
+                endif()
                 if ( NOT BUILD_WITH_SCONS_PROJECT_DIR)
                     set(BUILD_WITH_SCONS_PROJECT_DIR ".")
                 endif()
@@ -327,7 +340,7 @@
                 set(ENV{prefix} ${FindConfigurePackage_PREFIX_DIRECTORY})
                 execute_process(
                     COMMAND "scons" ${FindConfigurePackage_SCONS_FLAGS} ${BUILD_WITH_SCONS_PROJECT_DIR}
-                    WORKING_DIRECTORY "${FindConfigurePackage_BUILD_DIRECTORY}"
+                    WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                 )
                 set(ENV{prefix} ${OLD_ENV_PREFIX})

@@ -336,7 +349,7 @@
                 foreach(cmd ${FindConfigurePackage_CUSTOM_BUILD_COMMAND})
                     execute_process(
                         COMMAND ${cmd}
-                        WORKING_DIRECTORY "${FindConfigurePackage_BUILD_DIRECTORY}"
+                        WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                     )
                 endforeach()


cmake-rust: merge two RustStaticLibrary.cmake and add feature support

Summary:
We somehow have two different RustStaticLibrary.cmake in different places (one in eden repo and the other one in the shared opensource builder).

This diff merges them and switches Eden into using the shared CMake function (for the features option).

This diff also adds the features option for rust_executable funciton, which will be used in the next diff.

Reviewed By: kmancini

Differential Revision: D39038491

fbshipit-source-id: 99d61a1d5450010b345107a9ec5c761b62004aa6

--- build/fbcode_builder/CMake/RustStaticLibrary.cmake
+++ build/fbcode_builder/CMake/RustStaticLibrary.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
+# Copyright (c) Meta Platforms, Inc. and affiliates.

 include(FBCMakeParseArgs)

@@ -26,7 +26,7 @@

 if("${GENERATE_CARGO_VENDOR_CONFIG}" STREQUAL "AUTO")
   set(GENERATE_CARGO_VENDOR_CONFIG "${USE_CARGO_VENDOR}")
-endif()
+endif()

 if(GENERATE_CARGO_VENDOR_CONFIG)
   if(NOT EXISTS "${RUST_VENDORED_CRATES_DIR}")
@@ -78,7 +78,7 @@
 # Cargo build static library.
 #
 # ```cmake
-# rust_static_library(<TARGET> [CRATE <CRATE_NAME>])
+# rust_static_library(<TARGET> [CRATE <CRATE_NAME>] [FEATURES <FEATURE_NAME>])
 # ```
 #
 # Parameters:
@@ -88,6 +88,8 @@
 # - CRATE_NAME:
 #   Name of the crate. This parameter is optional. If unspecified, it will
 #   fallback to `${TARGET}`.
+# - FEATURE_NAME:
+#   Name of the Rust feature to enable.
 #
 # This function creates two targets:
 # - "${TARGET}": an interface library target contains the static library built
@@ -99,12 +101,17 @@
 # headers with the interface library.
 #
 function(rust_static_library TARGET)
-  fb_cmake_parse_args(ARG "" "CRATE" "" "${ARGN}")
+  fb_cmake_parse_args(ARG "" "CRATE;FEATURES" "" "${ARGN}")

   if(DEFINED ARG_CRATE)
     set(crate_name "${ARG_CRATE}")
   else()
     set(crate_name "${TARGET}")
+  endif()
+  if(DEFINED ARG_FEATURES)
+    set(features --features ${ARG_FEATURES})
+  else()
+    set(features )
   endif()

   set(cargo_target "${TARGET}.cargo")
@@ -117,7 +124,11 @@
     set(cargo_cmd cargo.exe)
   endif()

-  set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name})
+  if(DEFINED ARG_FEATURES)
+    set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
+  else()
+    set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name})
+  endif()
   if(USE_CARGO_VENDOR)
     set(extra_cargo_env "CARGO_HOME=${RUST_CARGO_HOME}")
     set(cargo_flags ${cargo_flags})
@@ -156,16 +167,18 @@
   )
 endfunction()

-# This function instructs cmake to define a target that will use `cargo build`
+# This function instructs CMake to define a target that will use `cargo build`
 # to build a bin crate referenced by the Cargo.toml file in the current source
 # directory.
 # It accepts a single `TARGET` parameter which will be passed as the package
 # name to `cargo build -p TARGET`. If binary has different name as package,
 # use optional flag BINARY_NAME to override it.
-# The cmake target will be registered to build by default as part of the
+# It also accepts a `FEATURES` parameter if you want to enable certain features
+# in your Rust binary.
+# The CMake target will be registered to build by default as part of the
 # ALL target.
 function(rust_executable TARGET)
-  fb_cmake_parse_args(ARG "" "BINARY_NAME" "" "${ARGN}")
+  fb_cmake_parse_args(ARG "" "BINARY_NAME;FEATURES" "" "${ARGN}")

   set(crate_name "${TARGET}")
   set(cargo_target "${TARGET}.cargo")
@@ -174,7 +187,12 @@
   if(DEFINED ARG_BINARY_NAME)
     set(executable_name "${ARG_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
   else()
-      set(executable_name "${crate_name}${CMAKE_EXECUTABLE_SUFFIX}")
+    set(executable_name "${crate_name}${CMAKE_EXECUTABLE_SUFFIX}")
+  endif()
+  if(DEFINED ARG_FEATURES)
+    set(features --features ${ARG_FEATURES})
+  else()
+    set(features )
   endif()

   set(cargo_cmd cargo)
@@ -182,7 +200,11 @@
     set(cargo_cmd cargo.exe)
   endif()

-  set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name})
+  if(DEFINED ARG_FEATURES)
+    set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
+  else()
+    set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name})
+  endif()
   if(USE_CARGO_VENDOR)
     set(extra_cargo_env "CARGO_HOME=${RUST_CARGO_HOME}")
     set(cargo_flags ${cargo_flags})


find SimParasolid and SimAcis

find SimParasolid and SimAcis

First find the headers and get the install path, then find the core libraries and extract the archos string.  Then use the install path and archos string to glob the SimParasolid and SimAcis libs.

--- cmake/FindSimModSuite.cmake
+++ cmake/FindSimModSuite.cmake
@@ -17,7 +17,7 @@
 endif()

 macro(simLibCheck libs isRequired)
-  foreach(lib ${libs})
+  foreach(lib ${libs})
     unset(simlib CACHE)
     find_library(simlib "${lib}" PATHS ${SIMMETRIX_LIB_DIR})
     if(simlib MATCHES "^simlib-NOTFOUND$")
@@ -33,28 +33,69 @@
   endforeach()
 endmacro(simLibCheck)

+
+macro(getSimCadLib searchPath libName lib)
+  file(GLOB cadLib
+    RELATIVE ${searchPath}/
+    ${searchPath}/lib${libName}*)
+  if( NOT cadLib )
+    message(FATAL_ERROR "lib${libName} not found")
+  endif()
+  set(${lib} "${cadLib}")
+endmacro(getSimCadLib)
+
+find_path(SIMMODSUITE_INCLUDE_DIR
+  NAMES SimUtil.h SimError.h SimModel.h
+  PATHS ${SIMMETRIX_INCLUDE_DIR})
+if(NOT EXISTS "${SIMMODSUITE_INCLUDE_DIR}")
+  message(FATAL_ERROR "simmetrix include dir not found")
+endif()
+
+string(REGEX REPLACE
+  "/include$" ""
+  SIMMODSUITE_INSTALL_DIR
+  "${SIMMODSUITE_INCLUDE_DIR}")
+
+string(REGEX MATCH
+  "[0-9]+.[0-9]+-[0-9]+"
+  SIM_VERSION
+  "${SIMMODSUITE_INCLUDE_DIR}")
+
 set(SIMMODSUITE_LIBS "")
 set(SIM_LIB_NAMES
   SimField
   SimPartitionedMesh-mpi
-  SimMeshing
+  SimMeshing
   SimMeshTools
-  SimModel
+  SimModel
   SimPartitionWrapper-${SIM_MPI})
+
+simLibCheck("${SIM_LIB_NAMES}" TRUE)
+set(SIM_LIB_NAMES)
+
+string(FIND "${SIMMODSUITE_LIBS}" "/lib/" archStart)
+string(FIND "${SIMMODSUITE_LIBS}" "/libSim" archEnd)
+math(EXPR archStart "${archStart}+5")
+math(EXPR len "${archEnd}-${archStart}")
+string(SUBSTRING "${SIMMODSUITE_LIBS}" "${archStart}" "${len}" SIM_ARCHOS)
+message(STATUS "SIM_ARCHOS ${SIM_ARCHOS}")

 option(SIM_PARASOLID "Use Parasolid through Simmetrix" OFF)
 if (SIM_PARASOLID)
-  set(SIM_PARASOLID_VERSION "260" CACHE STRING "Simmetrix Parasolid version number")
+  getSimCadLib("${SIMMODSUITE_INSTALL_DIR}/lib/${SIM_ARCHOS}"
+    SimParasolid simParaLib)
   set(SIM_LIB_NAMES
-      ${SIM_LIB_NAMES}
-      SimParasolid${SIM_PARASOLID_VERSION}
-      pskernel)
+    ${simParaLib}
+    pskernel)
 endif()
+
 option(SIM_ACIS "Use Acis through Simmetrix" OFF)
 if (SIM_ACIS)
+  getSimCadLib("${SIMMODSUITE_INSTALL_DIR}/lib/${SIM_ARCHOS}"
+    SimAcis simAcisLib)
   set(SIM_LIB_NAMES
-      ${SIM_LIB_NAMES}
-      SimAcis240
+      ${SIM_LIB_NAMES}
+      ${simAcisLib}
       SpaACIS)
 endif()

@@ -63,30 +104,6 @@

 simLibCheck("${SIM_OPT_LIB_NAMES}" FALSE)
 simLibCheck("${SIM_LIB_NAMES}" TRUE)
-
-string(FIND "${SIMMODSUITE_LIBS}" "/lib/" archStart)
-string(FIND "${SIMMODSUITE_LIBS}" "/libSim" archEnd)
-math(EXPR archStart "${archStart}+5")
-math(EXPR len "${archEnd}-${archStart}")
-string(SUBSTRING "${SIMMODSUITE_LIBS}" "${archStart}" "${len}" SIM_ARCHOS)
-message(STATUS "SIM_ARCHOS ${SIM_ARCHOS}")
-
-find_path(SIMMODSUITE_INCLUDE_DIR
-  NAMES SimUtil.h SimError.h SimModel.h
-  PATHS ${SIMMETRIX_INCLUDE_DIR})
-if(NOT EXISTS "${SIMMODSUITE_INCLUDE_DIR}")
-  message(FATAL_ERROR "simmetrix include dir not found")
-endif()
-
-string(REGEX REPLACE
-  "/include$" ""
-  SIMMODSUITE_INSTALL_DIR
-  "${SIMMODSUITE_INCLUDE_DIR}")
-
-string(REGEX MATCH
-  "[0-9]+.[0-9]+-[0-9]+"
-  SIM_VERSION
-  "${SIMMODSUITE_INCLUDE_DIR}")

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set SIMMODSUITE_FOUND to TRUE
@@ -101,7 +118,7 @@
   set(SIM_LINK_LIBS "${SIM_LINK_LIBS} -l${lib}")
 endforeach()

-#pkgconfig
+#pkgconfig
 set(prefix "${SIMMODSUITE_INSTALL_DIR}")
 set(includedir "${SIMMODSUITE_INCLUDE_DIR}")
 configure_file(


* Removed `JAVA_AWT_INCLUDE_PATH` from FindJNI.cmake

--- cmake/Modules/FindJNI.cmake
+++ cmake/Modules/FindJNI.cmake
@@ -41,8 +41,6 @@
   the include path to jni.h
 ``JAVA_INCLUDE_PATH2``
   the include path to jni_md.h and jniport.h
-``JAVA_AWT_INCLUDE_PATH``
-  the include path to jawt.h
 #]=======================================================================]

 # Expand {libarch} occurrences to java_libarch subdirectory(-ies) and set ${_var}
@@ -376,10 +374,6 @@
   ${JAVA_INCLUDE_PATH}/aix
 )

-find_path(JAVA_AWT_INCLUDE_PATH jawt.h
-  ${JAVA_INCLUDE_PATH}
-)
-
 # Restore CMAKE_FIND_FRAMEWORK
 if(DEFINED _JNI_CMAKE_FIND_FRAMEWORK)
   set(CMAKE_FIND_FRAMEWORK ${_JNI_CMAKE_FIND_FRAMEWORK})
@@ -398,7 +392,6 @@
 mark_as_advanced(
   JAVA_AWT_LIBRARY
   JAVA_JVM_LIBRARY
-  JAVA_AWT_INCLUDE_PATH
   JAVA_INCLUDE_PATH
   JAVA_INCLUDE_PATH2
 )
@@ -411,5 +404,4 @@
 set(JNI_INCLUDE_DIRS
   ${JAVA_INCLUDE_PATH}
   ${JAVA_INCLUDE_PATH2}
-  ${JAVA_AWT_INCLUDE_PATH}
 )


cmake(tbb): fix target_compile_definitions() with "UNKNOWN" target

- https://gitlab.kitware.com/cmake/cmake/-/issues/19434

--- cmake/OpenCVDetectTBB.cmake
+++ cmake/OpenCVDetectTBB.cmake
@@ -85,7 +85,11 @@
     if(NOT (TBB_INTERFACE_VERSION LESS 12000))  # >= 12000, oneTBB 2021+
       # avoid "defaultlib" requirement of tbb12.lib (we are using absolute path to 'tbb.lib' only)
       # https://github.com/oneapi-src/oneTBB/blame/2dba2072869a189b9fdab3ffa431d3ea49059a19/include/oneapi/tbb/detail/_config.h#L334
-      target_compile_definitions(tbb INTERFACE "__TBB_NO_IMPLICIT_LINKAGE=1")
+      if(NOT (CMAKE_VERSION VERSION_LESS "3.16.0"))  # https://gitlab.kitware.com/cmake/cmake/-/issues/19434
+        target_compile_definitions(tbb INTERFACE "__TBB_NO_IMPLICIT_LINKAGE=1")
+      else()
+        set_target_properties(tbb PROPERTIES INTERFACE_COMPILE_OPTIONS "__TBB_NO_IMPLICIT_LINKAGE=1")
+      endif()
     endif()
     message(STATUS "Found TBB (env): ${TBB_ENV_LIB}")
     set(${_found} TRUE PARENT_SCOPE)


Update ITK to for python 3

Update ITK to for python 3

--- versions.cmake
+++ versions.cmake
@@ -131,8 +131,8 @@

 if (WIN32)
   add_revision(itk
-    URL "http://www.tomviz.org/files/itk-4.9.0-windows-64bit.zip"
-    URL_MD5 "b81cba618d3be3594438d77c92aeb569")
+    URL "http://www.tomviz.org/files/itk-4.11.0-windows-64bit.zip"
+    URL_MD5 "8357ebd1ccce7d2366a96c569e2b3d11")
   add_revision(fftw
     URL "http://www.tomviz.org/files/fftw-3.3.4-windows-64bit.zip"
     URL_MD5 "90ca2a2cd26c62bc85b11ec7f165e716")


ci: debug numpy detection

ci: debug numpy detection

--- cmake/Packages/Python.cmake
+++ cmake/Packages/Python.cmake
@@ -15,6 +15,7 @@
       FIND_PACKAGE(Python COMPONENTS Interpreter Development NumPy)
       SET(NUMPY_FOUND "${Python_NumPy_FOUND}")
       SET(NUMPY_INCLUDE_DIR ${Python_NumPy_INCLUDE_DIR} CACHE STRING "Numpy directory")
+      MESSAGE(STATUS "  * numpy:    version ${Python_NumPy_VERSION}; headers ${NUMPY_INCLUDE_DIR}")
     ENDIF()
     SET(PYTHON_FOUND "${Python_FOUND}")
     SET(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
@@ -51,4 +52,4 @@
     ELSE()
       SET(NUMPY_FOUND FALSE CACHE BOOL "Numpy found successfully" FORCE)
     ENDIF()
-ENDIF(PYTHON_FOUND)
+ENDIF()


Switch from using a lit.cfg-generator variable that happens to be found
due to strange scoping rules to the actual canonical variable name
within the LLVM CMake build.

No functionality changed.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -259,7 +259,7 @@
   separate_arguments(LIT_ARGS)
   set(LIT_COMMAND
     ${PYTHON_EXECUTABLE}
-    ${LLVM_SOURCE_DIR}/utils/lit/lit.py
+    ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py
     --param build_config=${CMAKE_CFG_INTDIR}
     --param build_mode=${RUNTIME_BUILD_MODE}
     ${LIT_ARGS}


Don't pass -O3 to the linker in debug builds.

This takes linking clang in a debug build with gold form 19.518925697 to
16.406388685 seconds.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -159,8 +159,10 @@

 function(add_link_opts target_name)
   # Pass -O3 to the linker. This enabled different optimizations on different
-  # linkers.
-  if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32))
+  # linkers. Don't do it in debug builds since it slows down the linker
+  # in a context where the optimizations are not important.
+  if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32) AND
+     NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
     set_property(TARGET ${target_name} APPEND_STRING PROPERTY
                  LINK_FLAGS " -Wl,-O3")
   endif()


Another windows build fix attempt.

Another windows build fix attempt.

Inspired by http://public.kitware.com/pipermail/cmake-developers/2012-March/003768.html

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -45,7 +45,7 @@
       VERBATIM
       COMMENT "Creating export file for ${target_name}")
     set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                 LINK_FLAGS " ${CMAKE_CURRENT_BINARY_DIR}/symbol.def")
+                 LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/symbol.def")
   endif()

   add_custom_target(${target_name}_exports DEPENDS ${native_export_file})


Fix spelling mistake.

svn path=/trunk/; revision=6904

--- cmake/modules/docbook.cmake
+++ cmake/modules/docbook.cmake
@@ -74,7 +74,7 @@

   if (NOT OPENJADE)
     set(BUILD_HTML OFF)
-    message("Not building htmldocumentation - required programs are missing")
+    message("Not building html documentation - required programs are missing")
   endif (NOT OPENJADE)

   if (NOT OPENJADE OR NOT JADETEX OR NOT PDFJADETEX OR NOT DVIPS OR NOT GZIP)


lcov: don't include examples in coverage report

Signed-off-by: Tobias Olausson <e5abfa285347082f76013504c37f988d1046765a@pelagicore.com>

--- cmake_modules/AddLCov.cmake
+++ cmake_modules/AddLCov.cmake
@@ -24,6 +24,7 @@
             COMMAND ${LCOV} --remove ${COV_DIR}/baseline.info \"gtest*\" --no-checksum --directory . --base-directory . --output-file ${COV_DIR}/baseline.info
             COMMAND ${LCOV} --remove ${COV_DIR}/baseline.info \"unit-test*\" --no-checksum --directory . --base-directory . --output-file ${COV_DIR}/baseline.info
             COMMAND ${LCOV} --remove ${COV_DIR}/baseline.info \"build*\" --no-checksum --directory . --base-directory . --output-file ${COV_DIR}/baseline.info
+            COMMAND ${LCOV} --remove ${COV_DIR}/baseline.info \"examples*\" --no-checksum --directory . --base-directory . --output-file ${COV_DIR}/baseline.info
             COMMENT "Getting lcov baseline data"
             WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
         )
@@ -43,6 +44,7 @@
             COMMAND ${LCOV} --remove ${COV_DIR}/testrun.info \"gtest*\" --no-checksum --directory . --base-directory . --output-file ${COV_DIR}/testrun.info
             COMMAND ${LCOV} --remove ${COV_DIR}/testrun.info \"unit-test*\" --no-checksum --directory . --base-directory . --output-file ${COV_DIR}/testrun.info
             COMMAND ${LCOV} --remove ${COV_DIR}/testrun.info \"build*\" --no-checksum --directory . --base-directory . --output-file ${COV_DIR}/testrun.info
+            COMMAND ${LCOV} --remove ${COV_DIR}/testrun.info \"examples*\" --no-checksum --directory . --base-directory . --output-file ${COV_DIR}/testrun.info
             COMMENT "Running tests (${testCommand}) and lcov"
             WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
         )


Specifiy archiver and ranlib to support link time optimization.

--- linux/analyzer.cmake
+++ linux/analyzer.cmake
@@ -1,6 +1,8 @@
 # this one is important
 SET(CMAKE_SYSTEM_NAME Linux)

-SET(CMAKE_C_COMPILER "/usr/lib/clang-analyzer/scan-build/ccc-analyzer")
-SET(CMAKE_CXX_COMPILER "/usr/lib/clang-analyzer/scan-build/c++-analyzer")
+SET(CMAKE_C_COMPILER /usr/lib/clang-analyzer/scan-build/ccc-analyzer)
+SET(CMAKE_CXX_COMPILER /usr/lib/clang-analyzer/scan-build/c++-analyzer)
+SET(CMAKE_AR gcc-ar)
+SET(CMAKE_RANLIB gcc-ranlib)


Workaround powerpc processor detection.

Workaround powerpc processor detection.

--- cmake/DetermineProcessor.cmake
+++ cmake/DetermineProcessor.cmake
@@ -10,6 +10,10 @@
 		#IF("${val}" GREATER 0 OR NV_SYSTEM_PROCESSOR STREQUAL "unknown")
 			EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE NV_SYSTEM_PROCESSOR RETURN_VALUE val)
 		#ENDIF("${val}" GREATER 0 OR NV_SYSTEM_PROCESSOR STREQUAL "unknown")
+
+		IF(NV_SYSTEM_PROCESSOR STREQUAL "Power Macintosh")
+			SET(NV_SYSTEM_PROCESSOR "powerpc")
+		ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "Power Macintosh")

 		# processor may have double quote in the name, and that needs to be removed
 		STRING(REGEX REPLACE "\"" "" NV_SYSTEM_PROCESSOR "${NV_SYSTEM_PROCESSOR}")


Add Turing and Volta support to arch_name (#13168)

--- cmake/FirstClassLangCuda.cmake
+++ cmake/FirstClassLangCuda.cmake
@@ -185,6 +185,12 @@
       elseif(${arch_name} STREQUAL "Pascal")
         set(arch_bin 6.0 6.1)
         set(arch_ptx 6.1)
+      elseif(${arch_name} STREQUAL "Volta")
+        set(arch_bin 7.0)
+        set(arch_ptx 7.0)
+      elseif(${arch_name} STREQUAL "Turing")
+        set(arch_bin 7.5)
+        set(arch_ptx 7.5)
       else()
         message(SEND_ERROR "Unknown CUDA Architecture Name ${arch_name} in CUDA_SELECT_NVCC_ARCH_FLAGS")
       endif()


Use lua directory for include path

Use lua directory for include path

This means we'll have to include like: <lua.h>. This means we won't have to
change anything should we switch lua implementations.

--- cmake/Modules/FindLuaJit.cmake
+++ cmake/Modules/FindLuaJit.cmake
@@ -3,7 +3,7 @@
 # All rights reserved.

 find_library(LuaJit_LIBRARY luajit-5.1)
-find_path(LuaJit_INCLUDE_DIR luajit-2.0/lua.h)
+find_path(LuaJit_INCLUDE_DIR lua.h PATH_SUFFIXES luajit-2.0)

 if(APPLE)
   set(LuaJit_COMPILE_OPTIONS "-pagezero_size 10000 -image_base 100000000")


Add Test: Add missing documentation for functions

--- cmake/Modules/LibAddTest.cmake
+++ cmake/Modules/LibAddTest.cmake
@@ -67,6 +67,16 @@
 	endif(BUILD_TESTING)
 endmacro (add_gtest)

+# Add a Markdown Shell Recorder test for a certain Markdown file
+#
+# NAME: This argument specifies a postfix for the name of the CTest this function creates.
+# FILE: This argument specifies the location of the Markdown file that contains the test data.
+#
+# REQUIRED_PLUGINS:
+#	This optional variable specifies a list of plugins required to run the test.
+#
+# ENVIRONMENT:
+# 	This optional argument specifies environment variables defined while CTest executes the MSR test.
 function (add_s_test NAME FILE)
 	set (TEST_NAME testshell_markdown_${NAME})
 	set (oneValueArgs ENVIRONMENT)
@@ -89,6 +99,12 @@
 	set_property(TEST ${TEST_NAME} PROPERTY LABELS memleak kdbtests)
 endfunction ()

+# Add a Markdown Shell Recorder test for a certain plugin
+#
+# PLUGIN: This argument specifies the name of the plugin for which this function creates a MSR test.
+#
+# ENVIRONMENT:
+# 	This optional argument specifies environment variables defined while CTest executes the MSR test.
 function (add_plugin_shell_test PLUGIN)
 	add_s_test (${PLUGIN} "${CMAKE_SOURCE_DIR}/src/plugins/${PLUGIN}/README.md" ${ARGN} REQUIRED_PLUGINS ${PLUGIN})
 endfunction ()


Fix PLUGIN_DEF issue of SampPlugin modoule

The automatic .def name mechanism was not working when PLUGIN_DEF
haven't been defined.

--- cmake/Modules/SampPlugin.cmake
+++ cmake/Modules/SampPlugin.cmake
@@ -44,7 +44,7 @@

 set_target_properties(${PLUGIN_TARGET} PROPERTIES PREFIX "")

-if(NOT PLUGIN_DEF STREQUAL "")
+if(DEFINED PLUGIN_DEF)
 	if(MSVC)
 		set_target_properties(${PLUGIN_TARGET} PROPERTIES
 				LINK_FLAGS "/DEF:${PLUGIN_DEF}")


made FindGurobi find the right library file

--- cmake/modules/FindGurobi.cmake
+++ cmake/modules/FindGurobi.cmake
@@ -21,7 +21,11 @@

 IF(GUROBI_FOUND)
   SET(Gurobi_INCLUDE_DIRS ${Gurobi_INCLUDE_DIR})
-  SET(Gurobi_LIBRARIES gurobi_c++ gurobi50)
+  FILE(GLOB gurobilibs "${Gurobi_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gurobi??${CMAKE_SHARED_LIBRARY_SUFFIX}")
+  MESSAGE("Found libs with ${CMAKE_SHARED_LIBRARY_PREFIX}gurobi??${CMAKE_SHARED_LIBRARY_SUFFIX} in ${Gurobi_LIBRARY_DIR}: ${gurobilibs}")
+  STRING(REPLACE "${Gurobi_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}" "" gurobilibs "${gurobilibs}")
+  STRING(REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}" "" gurobilibs "${gurobilibs}")
+  SET(Gurobi_LIBRARIES gurobi_c++ ${gurobilibs})
 ENDIF(GUROBI_FOUND)

-MARK_AS_ADVANCED(Gurobi_INCLUDE_DIR Gurobi_LIBRARY Gurobi_INCLUDE_DIRS Gurobi_LIBRARIES)
+MARK_AS_ADVANCED(Gurobi_INCLUDE_DIR Gurobi_LIBRARY_DIR Gurobi_INCLUDE_DIRS Gurobi_LIBRARIES)


Fix FindOracle.cmake to find version 12.x

--- cmake/modules/FindOracle.cmake
+++ cmake/modules/FindOracle.cmake
@@ -12,7 +12,7 @@
 if(ORACLE_INCLUDE_DIR AND ORACLE_LIBRARY_OCCI)
   set(ORACLE_FIND_QUIETLY 1)
 endif()
-set(ORACLE_HOME $ENV{ORACLE_DIR})
+set(ORACLE_HOME $ENV{ORACLE_HOME})

 IF (ORACLE_PATH_INCLUDES)
     SET (ORACLE_INCLUDES_LOCATION ${ORACLE_PATH_INCLUDES})
@@ -55,7 +55,7 @@
 )
 FIND_LIBRARY(
     ORACLE_LIBRARY_LNNZ
-    NAMES libnnz10 nnz10 libnnz11 nnz11 ociw32
+    NAMES libnnz10 nnz10 libnnz11 nnz11 libnnz12 nnz12 ociw32
     PATHS ${ORACLE_LIB_LOCATION}
 )


Fix for very old versions of XROOTD (reported by mikolaj krzewicki)

--- cmake/modules/FindXROOTD.cmake
+++ cmake/modules/FindXROOTD.cmake
@@ -55,7 +55,7 @@

   if ( ${xrdversnum} LESS 300010000 )
      set(XROOTD_OLDPACK TRUE)
-     set(XROOTD_INCLUDE_DIRS ${XROOTD_ROOT_DIR})
+     set(XROOTD_INCLUDE_DIRS ${XROOTD_INCLUDE_DIR})
      message(STATUS "Setting OLDPACK TRUE")
   else()
      set(XROOTD_OLDPACK FALSE)


Qt 5.12.3

Qt 5.12.3

--- cmake/projects/Qt/hunter.cmake
+++ cmake/projects/Qt/hunter.cmake
@@ -258,6 +258,17 @@
     "https://download.qt.io/official_releases/qt/5.11/5.11.3/single/qt-everywhere-src-5.11.3.tar.xz"
     SHA1
     3f6c0df4fa7524ed11557ed55db35ef551cd2782
+)
+
+hunter_add_version(
+    PACKAGE_NAME
+    Qt
+    VERSION
+    "5.12.3"
+    URL
+    "https://download.qt.io/official_releases/qt/5.12/5.12.3/single/qt-everywhere-src-5.12.3.tar.xz"
+    SHA1
+    cf1bbdf0e69a651a67738e9b3e616e0dd9cf3087
 )

 hunter_cacheable(Qt)


Use xcode-select to find compiler

Use xcode-select to find compiler

--- toolchain/iOS.cmake
+++ toolchain/iOS.cmake
@@ -126,7 +126,8 @@

 # Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT
 # Note Xcode 4.3 changed the installation location, choose the most recent one available
-set (XCODE_POST_43_ROOT "/Applications/Xcode.app/Contents/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
+exec_program(/usr/bin/xcode-select ARGS -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR)
+set (XCODE_POST_43_ROOT "${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
 set (XCODE_PRE_43_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
 if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
 	if (EXISTS ${XCODE_POST_43_ROOT})


one more try

one more try

--- Toolchain-mingw32.cmake
+++ Toolchain-mingw32.cmake
@@ -4,14 +4,37 @@
 #remove the runtime dependency for libgcc_s_sjlj-1.dll
 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")

+# Which compilers to use for C and C++, and location of target
+# environment.
+if(EXISTS /usr/i586-mingw32msvc)
+# First look in standard location as used by Debian/Ubuntu/etc.
+set(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
+set(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
+set(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
+set(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
+elseif(EXISTS /usr/i686-w64-mingw32)
+# First look in standard location as used by Debian/Ubuntu/etc.
+set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
+set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
+set(CMAKE_AR:FILEPATH /usr/bin/i686-w64-mingw32-ar)
+elseif(EXISTS /opt/mingw)
 # You can get a MinGW environment using the script at <http://mxe.cc>.
 # It downloads and builds MinGW and most of the dependencies for you.
 # You can use the toolchain file generated by MXE called `mxe-conf.cmake'
 # or you can use this file by adjusting the above and following paths.
-set(CMAKE_C_COMPILER i686-pc-mingw32-gcc)
-set(CMAKE_CXX_COMPILER i686-pc-mingw32-g++)
-set(CMAKE_RC_COMPILER i686-pc-mingw32-windres)
-set(CMAKE_FIND_ROOT_PATH i686-pc-mingw32)
+set(CMAKE_C_COMPILER /opt/mingw/usr/bin/i686-pc-mingw32-gcc)
+set(CMAKE_CXX_COMPILER /opt/mingw/usr/bin/i686-pc-mingw32-g++)
+set(CMAKE_RC_COMPILER /opt/mingw/usr/bin/i686-pc-mingw32-windres)
+set(CMAKE_FIND_ROOT_PATH /opt/mingw/usr/i686-pc-mingw32)
+else()
+# Else fill in local path which the user will likely adjust.
+# This is the location assumed by <http://www.libsdl.org/extras/win32/cross/>
+set(CMAKE_C_COMPILER /usr/local/cross-tools/bin/i386-mingw32-gcc)
+set(CMAKE_CXX_COMPILER /usr/local/cross-tools/bin/i386-mingw32-g++)
+set(CMAKE_RC_COMPILER /usr/local/cross-tools/bin/i386-mingw32-windres)
+set(CMAKE_FIND_ROOT_PATH /usr/local/cross-tools)
+endif()

 # Adjust the default behaviour of the FIND_XXX() commands:
 # search headers and libraries in the target environment, search