Updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -5,10 +5,20 @@
 # This module tries to find Corrade library and then defines:
 #  CORRADE_FOUND                    - True if Corrade library is found
 #  CORRADE_INCLUDE_DIR              - Include dir for Corrade
-#  CORRADE_LIBRARIES                - All Corrade libraries
-#  CORRADE_UTILITY_LIBRARY          - Corrade Utility library
-#  CORRADE_PLUGINMANAGER_LIBRARY    - Corrade Plugin manager library
+#  CORRADE_UTILITY_LIBRARIES        - Corrade Utility library and dependent
+#   libraries
+#  CORRADE_PLUGINMANAGER_LIBRARIES  - Corrade Plugin manager library and
+#   dependent libraries
+#  CORRADE_TESTSUITE_LIBRARIES      - Corrade TestSuite library and dependent
+#   libraries
 #  CORRADE_RC_EXECUTABLE            - Corrade resource compiler executable
+# Additionally these variables are defined for internal usage:
+#  CORRADE_UTILITY_LIBRARY          - Corrade Utility library (w/o
+#   dependencies)
+#  CORRADE_PLUGINMANAGER_LIBRARY    - Corrade Plugin manager library (w/o
+#   dependencies)
+#  CORRADE_TESTSUITE_LIBRARY        - Corrade TestSuite library (w/o
+#   dependencies)
 # If Corrade library is found, these macros and functions are defined:
 #
 #
@@ -17,8 +27,9 @@
 #                    sources...
 #                    [LIBRARIES libraries...])
 # Test name is also executable name. You can also specify libraries to link
-# with instead of using target_link_libraries(). Note that the
-# enable_testing() must be called explicitly.
+# with instead of using target_link_libraries(). CORRADE_TESTSUITE_LIBRARIES
+# are linked atuomatically to each test. Note that the enable_testing()
+# function must be called explicitly.
 #
 #
 # Add QtTest unit test.
@@ -98,6 +109,7 @@
 # Libraries
 find_library(CORRADE_UTILITY_LIBRARY CorradeUtility)
 find_library(CORRADE_PLUGINMANAGER_LIBRARY CorradePluginManager)
+find_library(CORRADE_TESTSUITE_LIBRARY CorradeTestSuite)

 # RC executable
 find_program(CORRADE_RC_EXECUTABLE corrade-rc)
@@ -111,6 +123,7 @@
 find_package_handle_standard_args(Corrade DEFAULT_MSG
     CORRADE_UTILITY_LIBRARY
     CORRADE_PLUGINMANAGER_LIBRARY
+    CORRADE_TESTSUITE_LIBRARY
     CORRADE_INCLUDE_DIR
     CORRADE_RC_EXECUTABLE)

@@ -118,6 +131,19 @@
     return()
 endif()

+# Configuration
+file(READ ${CORRADE_INCLUDE_DIR}/corradeConfigure.h _corradeConfigure)
+
+# Compatibility?
+string(FIND "${_corradeConfigure}" "#define CORRADE_GCC46_COMPATIBILITY" _GCC46_COMPATIBILITY)
+if(NOT _GCC46_COMPATIBILITY EQUAL -1)
+    set(CORRADE_GCC46_COMPATIBILITY 1)
+endif()
+
+set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARY})
+set(CORRADE_PLUGINMANAGER_LIBRARIES ${CORRADE_PLUGINMANAGER_LIBRARY} ${CORRADE_UTILITY_LIBRARIES})
+set(CORRADE_TESTSUITE_LIBRARIES ${CORRADE_TESTSUITE_LIBRARY} ${CORRADE_UTILITY_LIBRARIES})
+mark_as_advanced(CORRADE_UTILITY_LIBRARY CORRADE_PLUGINMANAGER_LIBRARY CORRADE_TESTSUITE_LIBRARY)
+
 include(CorradeMacros)
 include(CorradeLibSuffix)
-set(CORRADE_LIBRARIES ${CORRADE_UTILITY_LIBRARY} ${CORRADE_PLUGINMANAGER_LIBRARY})


add quotes

add quotes

--- modules/boost/boost.cmake
+++ modules/boost/boost.cmake
@@ -71,7 +71,7 @@
 #     - "'-DBOOST_LIBRARYDIR=\"{0}\"'.format(arguments['--boost-libraries'])"
 #     - "'-DFORCE_CUSTOM_BOOST={0}'.format(arguments['--build-boost'])"
 #     - "'-DBOOST_MINIMUM_REQUIRED=\"%(major).%(minor).%(patch)\"'"
-#     - "'-DBOOST_COMPONENTS_REQUIRED=%(components)'"
+#     - "'-DBOOST_COMPONENTS_REQUIRED=\"%(components)\"'"

 # FIXME Maintainer should be able to choose between fail (end-user has to satisfy dependency
 #       on its own) and soft-fail (self-build of Boost)


[ioninja] release 3.4.1

[ioninja] release 3.4.1

[jancy] release 1.5.4

two critical bugfixes

--- version.cmake
+++ version.cmake
@@ -1,6 +1,6 @@
 set (VERSION_MAJOR     1)
 set (VERSION_MINOR     5)
-set (VERSION_REVISION  3)
+set (VERSION_REVISION  4)
 set (VERSION_TAG)

 set (VERSION_FILE_SUFFIX "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")


Split off 8.0.24

Split off 8.0.24

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 23 )
+set ( HPCC_POINT 25 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Nagios Monitoring 5.0.2-rc1 Release Candidate 1

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -3,7 +3,7 @@
 ###
 set ( HPCC_NM_MAJOR 5 )
 set ( HPCC_NM_MINOR 0 )
-set ( HPCC_NM_POINT 0 )
-set ( HPCC_NM_MATURITY "release" )
+set ( HPCC_NM_POINT 2 )
+set ( HPCC_NM_MATURITY "rc" )
 set ( HPCC_NM_SEQUENCE 1 )
 ###


Split off 7.12.96

Split off 7.12.96

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 12 )
-set ( HPCC_POINT 95 )
+set ( HPCC_POINT 97 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


[jancy] rollback version to 1.7.9

[jancy] rollback version to 1.7.9

--- version.cmake
+++ version.cmake
@@ -10,8 +10,8 @@
 #...............................................................................

 set (JANCY_VERSION_MAJOR     1)
-set (JANCY_VERSION_MINOR     8)
-set (JANCY_VERSION_REVISION  0)
+set (JANCY_VERSION_MINOR     7)
+set (JANCY_VERSION_REVISION  9)
 set (JANCY_VERSION_TAG)

 set (JANCY_VERSION_FILE_SUFFIX "${JANCY_VERSION_MAJOR}.${JANCY_VERSION_MINOR}.${JANCY_VERSION_REVISION}")


[ioninja] release 3.2.0

[ioninja] release 3.2.0

--- version.cmake
+++ version.cmake
@@ -1,6 +1,6 @@
 set (VERSION_MAJOR     5)
-set (VERSION_MINOR     0)
-set (VERSION_REVISION  1)
+set (VERSION_MINOR     1)
+set (VERSION_REVISION  0)
 set (VERSION_TAG)

 set (VERSION_FILE_SUFFIX "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")


Split off 7.8.80

Split off 7.8.80

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 8 )
-set ( HPCC_POINT 79 )
+set ( HPCC_POINT 81 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 8.0.12

Split off 8.0.12

Signed-off-by: Gavin Halliday <2edfa8aca9fb78974188e5b35be8b52d4e4967ae@lexisnexis.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 11 )
+set ( HPCC_POINT 13 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Fix broken CURL on windows

Fix broken CURL on windows

--- deps/CURL/CURL.cmake
+++ deps/CURL/CURL.cmake
@@ -3,17 +3,18 @@
   -DENABLE_VERSIONED_SYMBOLS:BOOL=ON
   -DENABLE_THREADED_RESOLVER:BOOL=ON

-  -DCURL_DISABLE_LDAP:BOOL=ON
-  -DCURL_DISABLE_LDAPS:BOOL=ON
+  # -DCURL_DISABLE_LDAP:BOOL=ON
+  # -DCURL_DISABLE_LDAPS:BOOL=ON
   -DENABLE_MANUAL:BOOL=OFF
-  -DCURL_DISABLE_RTSP:BOOL=ON
-  -DCURL_DISABLE_DICT:BOOL=ON
-  -DCURL_DISABLE_TELNET:BOOL=ON
-  -DCURL_DISABLE_POP3:BOOL=ON
-  -DCURL_DISABLE_IMAP:BOOL=ON
-  -DCURL_DISABLE_SMB:BOOL=ON
-  -DCURL_DISABLE_SMTP:BOOL=ON
-  -DCURL_DISABLE_GOPHER:BOOL=ON
+  # -DCURL_DISABLE_RTSP:BOOL=ON
+  # -DCURL_DISABLE_DICT:BOOL=ON
+  # -DCURL_DISABLE_TELNET:BOOL=ON
+  # -DCURL_DISABLE_POP3:BOOL=ON
+  # -DCURL_DISABLE_IMAP:BOOL=ON
+  # -DCURL_DISABLE_SMB:BOOL=ON
+  # -DCURL_DISABLE_SMTP:BOOL=ON
+  # -DCURL_DISABLE_GOPHER:BOOL=ON
+  -DHTTP_ONLY=ON

   -DCMAKE_USE_GSSAPI:BOOL=OFF
   -DCMAKE_USE_LIBSSH2:BOOL=OFF
@@ -22,7 +23,9 @@
   -DUSE_MBEDTLS:BOOL=OFF
 )

-if (APPLE)
+if (WIN32)
+  set(_curl_platform_flags  ${_curl_platform_flags} -DCMAKE_USE_SCHANNEL=ON)
+elseif (APPLE)
   set(_curl_platform_flags

     ${_curl_platform_flags}
@@ -52,8 +55,10 @@
 endif()

 prusaslicer_add_cmake_project(CURL
-  GIT_REPOSITORY      https://github.com/curl/curl.git
-  GIT_TAG             curl-7_75_0
+  # GIT_REPOSITORY      https://github.com/curl/curl.git
+  # GIT_TAG             curl-7_75_0
+  URL                 https://github.com/curl/curl/archive/refs/tags/curl-7_75_0.zip
+  URL_HASH            SHA256=a63ae025bb0a14f119e73250f2c923f4bf89aa93b8d4fafa4a9f5353a96a765a
   DEPENDS             ${ZLIB_PKG}
   # PATCH_COMMAND       ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
   #                     ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/curl-mods.patch


Dump gmock version to 1.7.0

Dump gmock version to 1.7.0

--- cmake/external/GoogleTestNMock.cmake
+++ cmake/external/GoogleTestNMock.cmake
@@ -8,13 +8,11 @@
 include(ExternalProject)
 ExternalProject_Add(
 	GoogleMock
-	SVN_REPOSITORY http://googlemock.googlecode.com/svn/trunk
-	SVN_REVISION -r ${GMOCK_REVISION}
-	UPDATE_COMMAND ""
+	URL http://googlemock.googlecode.com/files/gmock-1.7.0.zip
+	URL_MD5 073b984d8798ea1594f5e44d85b20d66
     TIMEOUT 10
 	PREFIX ${CMAKE_BINARY_DIR}/GoogleMock
 	DOWNLOAD_DIR ${THIRD_PARTY_DIR}/GoogleMock
-	SOURCE_DIR ${THIRD_PARTY_DIR}/GoogleMock
 	INSTALL_COMMAND ""
 	CMAKE_ARGS 	-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${THIRD_PARTY_DIR}/libs/gmock
 		-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${THIRD_PARTY_DIR}/libs/gmock
@@ -23,21 +21,22 @@
 		-DCMAKE_CXX_COMPILER:STRING=${CXX_COMPILER}
 )

-ExternalProject_Get_Property(GoogleMock STAMP_DIR)
-ExternalProject_Get_Property(GoogleMock SOURCE_DIR)
+# only when using svn repository
+#ExternalProject_Get_Property(GoogleMock STAMP_DIR)
+#ExternalProject_Get_Property(GoogleMock SOURCE_DIR)

-ExternalProject_Add_Step(
-	GoogleMock check_revision
-	COMMAND ${CMAKE_COMMAND} -D STAMP_DIR=${STAMP_DIR}
-                     		 -D SRC_DIR=${SOURCE_DIR}
-                     		 -D SVN_EXEC=${Subversion_SVN_EXECUTABLE}
-                     		 -D REVISION=${GMOCK_REVISION}
-                     		 -D PROJECT_NAME=GoogleMock
-                     		 -P ${CMAKE_MODULE_PATH}/CheckSVNRevision.cmake
-	COMMENT "Checking Google Mock checked out revision"
-	DEPENDERS download
-	DEPENDEES mkdir
-)
+#ExternalProject_Add_Step(
+#	GoogleMock check_revision
+#	COMMAND ${CMAKE_COMMAND} -D STAMP_DIR=${STAMP_DIR}
+#                     		 -D SRC_DIR=${SOURCE_DIR}
+#                     		 -D SVN_EXEC=${Subversion_SVN_EXECUTABLE}
+#                     		 -D REVISION=${GMOCK_REVISION}
+#                     		 -D PROJECT_NAME=GoogleMock
+#                     		 -P ${CMAKE_MODULE_PATH}/CheckSVNRevision.cmake
+#	COMMENT "Checking Google Mock checked out revision"
+#	DEPENDERS download
+#	DEPENDEES mkdir
+#)

 UNSET(C_COMPILER)
 UNSET(CXX_COMPILER)


Build system: set target property POSITION_INDEPENDENT_CODE ON for all PLplot libraries

This change should allow shared libraries from foreign software
packages (or user's code) to link properly to static PLplot libraries.
The cost of this gain is there is a small amount of inefficiency
(e.g., the more complicated addressing code that apparently occurs on
Linux for all code compiled with the -fPIC flag) introduced for the
static PLplot libraries.

Tested by: Alan W. Irwin <airwin@users.sourceforge.net> on Linux using

scripts/comprehensive_test.sh --do_ctest no --do_test_interactive no --do_test_build_tree no

--- cmake/modules/plplot_functions.cmake
+++ cmake/modules/plplot_functions.cmake
@@ -332,6 +332,9 @@
     SOVERSION ${${library}_SOVERSION}
     VERSION ${${library}_VERSION}
     INSTALL_NAME_DIR "${LIB_DIR}"
+    # This allows PLplot static library builds to
+    # be linked by shared libraries.
+    POSITION_INDEPENDENT_CODE ON
     )

 endfunction(set_library_properties library)


updated version again

updated version again

--- cmake/projects/Protobuf/hunter.cmake
+++ cmake/projects/Protobuf/hunter.cmake
@@ -21,11 +21,11 @@
     PACKAGE_NAME
     Protobuf
     VERSION
-    "3.1.0-p3"
+    "3.1.0-p4"
     URL
-    "https://github.com/hunter-packages/protobuf/releases/download/v3.1.0-hunter-2/protobuf-3.1.0-hunter-2.tar.gz"
+    "https://github.com/hunter-packages/protobuf/releases/download/v3.1.0-hunter-4/protobuf-3.1.0-hunter-4.tar.gz"
     SHA1
-    6dd8996c36adcbc39d4eaa87c2492b27820b5899
+    8f58f2cbe6d3fae61451a5e29b703686fe4bc9d6
 )


ENH: Let the choice to change INSTALL_* directories

--- DTIProcess.cmake
+++ DTIProcess.cmake
@@ -36,10 +36,10 @@
   set( INSTALL_RUNTIME_DESTINATION ${Slicer_INSTALL_ROOT}${Slicer_BUNDLE_EXTENSIONS_LOCATION}${Slicer_LIB_DIR} )
   set( INSTALL_LIBRARY_DESTINATION ${Slicer_INSTALL_ROOT}${Slicer_BUNDLE_EXTENSIONS_LOCATION}${Slicer_LIB_DIR} )
 else()
-  set(INSTALL_RUNTIME_DESTINATION bin)
-  set(INSTALL_LIBRARY_DESTINATION bin)
+  SETIFEMPTY(INSTALL_RUNTIME_DESTINATION bin)
+  SETIFEMPTY(INSTALL_LIBRARY_DESTINATION bin)
 endif()
-set(INSTALL_ARCHIVE_DESTINATION lib/static)
+SETIFEMPTY(INSTALL_ARCHIVE_DESTINATION lib/static)

 option(BUILD_dwiAtlas "Build dwiAtlas or not.  Requires boost." OFF)
 option(BUILD_TESTING "Build the testing tree" ON)


Add NDEBUG to release flags

Add NDEBUG to release flags

--- flags/sanitize_address.cmake
+++ flags/sanitize_address.cmake
@@ -14,7 +14,7 @@

 set(
     CMAKE_CXX_FLAGS_RELEASE
-    "-O1"
+    "-O1 -DNDEBUG"
     CACHE
     STRING
     "C++ compiler flags"
@@ -26,7 +26,7 @@

 set(
     CMAKE_C_FLAGS_RELEASE
-    "-O1"
+    "-O1 -DNDEBUG"
     CACHE
     STRING
     "C compiler flags"


Fix issue with multiple installed GLM versions by querying the local ext-version first

--- ext/FindGLM.cmake
+++ ext/FindGLM.cmake
@@ -49,8 +49,8 @@
 ENDIF(GLM_ROOT_DIR)

 # locate header
-FIND_PATH(GLM_INCLUDE_DIR "glm/glm.hpp"
-    PATHS ${_glm_HEADER_SEARCH_DIRS})
+FIND_PATH(GLM_INCLUDE_DIR "glm/glm.hpp" PATHS ${_glm_HEADER_SEARCH_DIRS} NO_DEFAULT_PATH)
+FIND_PATH(GLM_INCLUDE_DIR "glm/glm.hpp" PATHS ${_glm_HEADER_SEARCH_DIRS})

 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLM DEFAULT_MSG


Update FindHIP.cmake

Update FindHIP.cmake

Adding another flag.

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -28,6 +28,7 @@
 ###############################################################################
 # Copy the invocation styles from CXX to HIP
 set(CMAKE_HIP_ARCHIVE_CREATE ${CMAKE_CXX_ARCHIVE_CREATE})
+set(CMAKE_HIP_ARCHIVE_APPEND ${CMAKE_CXX_ARCHIVE_APPEND})
 set(CMAKE_HIP_ARCHIVE_FINISH ${CMAKE_CXX_ARCHIVE_FINISH})
 set(CMAKE_SHARED_LIBRARY_SONAME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG})
 set(CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})


FindMKL bug fix for Linux OS configuration

--- cmake/FindMKL.cmake
+++ cmake/FindMKL.cmake
@@ -112,10 +112,10 @@
 else()
 	foreach (_MKL_VER ${_MKL_TEST_VERSIONS})
 		list(APPEND _MKL_ROOT_SEARCH_DIRS "/opt/intel/composerxe-${_MKL_VER}/mkl") # default until ParallelStudioXE2015 (root permissions)
-		list(APPEND _MKL_ROOT_SEARCH_DIRS "$HOME/intel/composerxe-${_MKL_VER}/mkl") # default until ParallelStudioXE2015 (no root permissions)
+		list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{HOME}/intel/composerxe-${_MKL_VER}/mkl") # default until ParallelStudioXE2015 (no root permissions)
 	endforeach()
 	list(APPEND _MKL_ROOT_SEARCH_DIRS "/opt/intel/compilers_and_libraries/linux/mkl") # default for ParallelStudioXE2016 and later (root permissions)
-	list(APPEND _MKL_ROOT_SEARCH_DIRS "$HOME/intel/compilers_and_libraries/linux/mkl") # default for ParallelStudioXE2016 and later (no root permissions)
+	list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{HOME}/intel/compilers_and_libraries/linux/mkl") # default for ParallelStudioXE2016 and later (no root permissions)
 endif()


Improved detection of sip module.

Improved detection of sip module.

--- cmake/FindSIP.cmake
+++ cmake/FindSIP.cmake
@@ -41,11 +41,14 @@
   # Use the path to the python installation as a hint for finding sip
   GET_FILENAME_COMPONENT(SIP_POSSIBLE_LIB_DIRS "${PYTHON_LIBRARIES}"  ABSOLUTE)

-  FIND_FILE(SIP_LIBRARIES
+	SET(OLD_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}" CACHE INTERNAL "")
+	SET(CMAKE_FIND_LIBRARY_PREFIXES "")
+  FIND_LIBRARY(SIP_LIBRARIES
     NAMES sip libsip
     PATHS ${SIP_POSSIBLE_LIB_DIRS}
     PATH_SUFFIXES lib dlls
     DOC "SIP module")
+	SET(CMAKE_FIND_LIBRARY_PREFIXES "${OLD_CMAKE_FIND_LIBRARY_PREFIXES}")

   # (c) Try to find the sip executable:


mingw32 needs libgcc statically linked...

--- cmake/mingw32.cmake
+++ cmake/mingw32.cmake
@@ -15,3 +15,5 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+# We want libgcc being statically linked. Everything else is annoying
+set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -static-libgcc")


add shared library support to add_fbthrift_cpp_library

Summary:
`add_fbthrift_cpp_library` should honor `BUILD_SHARED_LIBS`, and call
`add_library` with the right setting (`SHARED` if enabled, `STATIC` otherwise)

Reviewed By: yns88

Differential Revision: D24911124

fbshipit-source-id: 79df7640a758a592a3df3e9e79bb129dd57f2d47

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -127,8 +127,14 @@
   )

   # Now emit the library rule to compile the sources
+  if (BUILD_SHARED_LIBS)
+    set(LIB_TYPE SHARED)
+  else ()
+    set(LIB_TYPE STATIC)
+  endif ()
+
   add_library(
-    "${LIB_NAME}" STATIC
+    "${LIB_NAME}" ${LIB_TYPE}
     ${generated_sources}
   )


Don't assume that all generators have an 'all' target.

The better alternative is to just treat the all target as
special and not specify a --target to cmake --build. Just don't
specify anything and do what the buildsystem does by default

--- CMakeUnitRunner.cmake
+++ CMakeUnitRunner.cmake
@@ -256,11 +256,24 @@

     endif (BUILD_STEP_ALLOW_FAIL)

+    # The "all" target is special. It means "do whatever happens by
+    # default". Some build systems literally have a target called
+    # "all", but others (Xcode) don't, so in that case, just don't
+    # add a --target.
+    if ("${TARGET}" STREQUAL "all")
+
+        set (TARGET_OPTION "")
+
+    else ("${TARGET}" STREQUAL "all")
+
+        set (TARGET_OPTION --target ${TARGET})
+
+    endif ("${TARGET}" STREQUAL "all")
+
     set (BUILD_COMMAND ${CMAKE_COMMAND}
                        --build
                        ${TEST_WORKING_DIRECTORY_NAME}
-                       --target
-                       ${TARGET})
+                       ${TARGET_OPTION})
     _add_driver_step (${DRIVER_SCRIPT} BUILD
                       COMMAND ${BUILD_COMMAND}
                       ${ALLOW_FAIL_OPTION})


build with KDE4_DEFINITONS,which might contain -D_FILE_OFFSET_BITS=64

svn path=/trunk/KDE/kdepimlibs/; revision=1042999

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -4,6 +4,7 @@
 if ( GPGME_FOUND )

 set(CMAKE_REQUIRED_INCLUDES ${GPGME_INCLUDES})
+set(CMAKE_REQUIRED_DEFINITIONS ${KDE4_DEFINITIONS})
 set(CMAKE_REQUIRED_LIBRARIES)
 foreach( _FLAVOUR VANILLA PTHREAD QT PTH GLIB )
   if ( NOT CMAKE_REQUIRED_LIBRARIES )


Make gpgme++ play nice with FindKDEWIN.cmake and possibly others.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -3,6 +3,8 @@

 if ( GPGME_FOUND )

+set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
+set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
 set(CMAKE_REQUIRED_INCLUDES ${GPGME_INCLUDES})
 set(CMAKE_REQUIRED_DEFINITIONS ${KDE4_DEFINITIONS})
 set(CMAKE_REQUIRED_LIBRARIES)
@@ -426,7 +428,9 @@
   }
 " HAVE_GPGME_CONF_ARG_NEW_WITH_CONST_VALUE )

-set(CMAKE_REQUIRED_INCLUDES)
-set(CMAKE_REQUIRED_LIBRARIES)
+set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
+set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+set(CMAKE_REQUIRED_INCLUDES_SAVE)
+set(CMAKE_REQUIRED_LIBRARIES_SAVE)

 endif()


Unconditionally rebuild "CTK-build" inner project. See #32

Since the superbuild project doesn't have any dependency on CTK source
files, adding the "forcerebuild" step will ensure CTK build tree
is always up-to-date.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -279,6 +279,13 @@
     DEPENDS
       "CTK-Configure"
     )
+  # This custom external project step forces the build and later
+  # steps to run whenever a top level build is done...
+  ExternalProject_Add_Step(${proj} forcebuild
+    DEPENDEES configure
+    DEPENDERS build
+    ALWAYS 1
+    )
 ENDIF()

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


Pass CMAKE_FRAMEWORK_PATH to MITK-build

Pass CMAKE_FRAMEWORK_PATH to MITK-build

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -343,6 +343,12 @@
 if(OPENSSL_ROOT_DIR)
   list(APPEND mitk_optional_cache_args
     "-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}"
+  )
+endif()
+
+if(CMAKE_FRAMEWORK_PATH)
+  list(APPEND mitk_optional_cache_args
+    "-DCMAKE_FRAMEWORK_PATH:PATH=${CMAKE_FRAMEWORK_PATH}"
   )
 endif()


Fix bug in checking python libraries var

related #473

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -139,11 +139,11 @@
   # set PYTHONLIBS_CMAKE_ARGS to be used in the ExternalProject_add calls
   # note: Find_package(PythonLibs) takes PYTHON_INCLUDE_DIR and PYTHON_LIBRARY as input
   set (PYTHONLIBS_CMAKE_ARGS -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE})
-  if (EXISTS ${PYTHON_INCLUDE_DIR})
+  if (EXISTS "${PYTHON_INCLUDE_DIR}")
     set (PYTHONLIBS_CMAKE_ARGS ${PYTHONLIBS_CMAKE_ARGS}
       -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR})
   endif()
-  if (EXISTS ${PYTHON_LIBRARY})
+  if (EXISTS "${PYTHON_LIBRARY}")
     set (PYTHONLIBS_CMAKE_ARGS ${PYTHONLIBS_CMAKE_ARGS}
       -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY})
   endif()


Fix finding of static libs and fallback to dynamic where that makes sense.

--HG--
branch : v0-8

--- cmake/CEGUIFindHelpers.cmake
+++ cmake/CEGUIFindHelpers.cmake
@@ -13,7 +13,7 @@
         set(_STATIC "_STATIC")

         if(UNIX)
-            set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+            set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dynlib")
         endif()

     else()
@@ -23,8 +23,8 @@
     # decide which libs to look for, prefer list we get from pkg-config rather
     # than making idiotic assumptions or guesses (which we resort to if
     # pkg-config did not tell us anything).
-    if (PC_${_PREFIX}_LIBRARIES)
-        set(_FINDLIBS ${PC_${_PREFIX}_LIBRARIES})
+    if (PC_${_PREFIX}${_STATIC}_LIBRARIES)
+        set(_FINDLIBS ${PC_${_PREFIX}${_STATIC}_LIBRARIES})
     else()
         set(_FINDLIBS ${_FALLBACKLIBS})
     endif()
@@ -34,7 +34,7 @@
     set(${_PREFIX}_FOUND_ALL_LIBS${_LIBS_VAR_EXT} TRUE)
     foreach(_L ${_FINDLIBS})
         string(TOUPPER "${_L}" _UL)
-        find_library(${_UL}_LIBRARY${_LIBS_VAR_EXT} NAMES ${_L} HINTS ${PC_${_PREFIX}_LIBDIR} ${PC_${_PREFIX}_LIBRARY_DIRS}${_STATIC} PATH_SUFFIXES ${_PATH_SUFFIXES})
+        find_library(${_UL}_LIBRARY${_LIBS_VAR_EXT} NAMES ${_L} HINTS ${PC_${_PREFIX}_LIBDIR} ${PC_${_PREFIX}${_STATIC}_LIBRARY_DIRS} PATH_SUFFIXES ${_PATH_SUFFIXES})
         if(${_UL}_LIBRARY${_LIBS_VAR_EXT})
             list(APPEND ${_PREFIX}_LIBRARIES${_LIBS_VAR_EXT} ${${_UL}_LIBRARY}${_LIBS_VAR_EXT})
         else()


cmake(cuda): update handling of -std=c++11/14 flags

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -336,7 +336,14 @@
     endif()

     if(UNIX OR APPLE)
-      set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC --std=c++11)
+      set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC)
+      if(NOT " ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_DEBUG} ${CUDA_NVCC_FLAGS}" MATCHES "-std=")
+        if(CUDA_VERSION VERSION_LESS "11.0")
+          list(APPEND CUDA_NVCC_FLAGS "--std=c++11")
+        else()
+          list(APPEND CUDA_NVCC_FLAGS "--std=c++14")
+        endif()
+      endif()
     endif()
     if(APPLE)
       set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fno-finite-math-only)


Fixed regular expression for finding Matlab in Windows PATH

--- cmake/OpenCVFindMatlab.cmake
+++ cmake/OpenCVFindMatlab.cmake
@@ -91,8 +91,12 @@
   # --- WINDOWS ---
   elseif (WIN32)
 		# search the path to see if Matlab exists there
-		# fingers crossed it is, otherwise we have to start hunting through the registry :/
+    # Contrary to EVERY OTHER REGEX IMPLEMENTATION ON EARTH, cmake returns
+    # the entire input string if no matches for the capture group are found.
 		string(REGEX REPLACE ".*[;=](.*[Mm][Aa][Tt][Ll][Aa][Bb][^;]*)\\\\bin.*" "\\1" MATLAB_ROOT_DIR_ "$ENV{PATH}")
+    if ("${MATLAB_ROOT_DIR_}" STREQUAL "$ENV{PATH}")
+      set(MATLAB_ROOT_DIR_)
+    endif()

 	  # registry-hacking
     # determine the available Matlab versions
@@ -115,7 +119,7 @@
 		# request the MATLABROOT from the registry
 		foreach(REG_ROOT_ ${REG_ROOTS_})
 			get_filename_component(QUERY_RESPONSE_ [${REG_ROOT_}\\${REG_EXTENSION_}\\${VERSION_};MATLABROOT] ABSOLUTE)
-			if (NOT ${MATLAB_ROOT_DIR_} AND NOT ${QUERY_RESPONSE_} MATCHES "registry$")
+			if ("${MATLAB_ROOT_DIR_}" STREQUAL "" AND NOT ${QUERY_RESPONSE_} MATCHES "registry$")
 				set(MATLAB_ROOT_DIR_ ${QUERY_RESPONSE_})
 			endif()
 		endforeach()


Added TODO for the future of Matlab version sorting

--- cmake/OpenCVFindMatlab.cmake
+++ cmake/OpenCVFindMatlab.cmake
@@ -66,6 +66,8 @@
       if (MATLAB_ROOT_DIR_)
         # sort in order from highest to lowest
         # normally it's in the format MATLAB_R[20XX][A/B]
+        # TODO: numerical rather than lexicographic sort. However,
+        # CMake does not support floating-point MATH(EXPR ...) at this time.
         list(SORT MATLAB_ROOT_DIR_)
         list(REVERSE MATLAB_ROOT_DIR_)
         list(GET MATLAB_ROOT_DIR_ 0 MATLAB_ROOT_DIR_)


FindTBB update for debug/release versions of component libraries

--- cmake/Packages/FindTBB.cmake
+++ cmake/Packages/FindTBB.cmake
@@ -147,22 +147,16 @@
     PATH_SUFFIXES ${_TBB_POSSIBLE_LIB_SUFFIXES}
     DOC "TBB debug library")

+# decide if we should use debug version
+SET (_USE_DEBUG OFF)
+STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE)
+IF ("${_BUILD_TYPE}" STREQUAL "DEBUG" OR
+    "${_BUILD_TYPE}" STREQUAL "RELWITHDEBINFO")
+    SET (_USE_DEBUG ON)
+ENDIF ("${_BUILD_TYPE}" STREQUAL "DEBUG" OR
+    "${_BUILD_TYPE}" STREQUAL "RELWITHDEBINFO")
+
 IF (TBB_LIBRARY_RELEASE AND TBB_LIBRARY_DEBUG)
-    # decide if we should use debug version
-    SET (_USE_DEBUG OFF)
-    STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE)
-    IF ("${_BUILD_TYPE}" STREQUAL "DEBUG" OR
-        "${_BUILD_TYPE}" STREQUAL "RELWITHDEBINFO" OR
-        "${CMAKE_CXX_FLAGS}" MATCHES " -g " OR
-        "${CMAKE_CXX_FLAGS}" MATCHES " -DDEBUG " OR
-        "${CMAKE_CXX_FLAGS}" MATCHES " -debug ")
-        SET (_USE_DEBUG ON)
-    ENDIF ("${_BUILD_TYPE}" STREQUAL "DEBUG" OR
-        "${_BUILD_TYPE}" STREQUAL "RELWITHDEBINFO" OR
-        "${CMAKE_CXX_FLAGS}" MATCHES " -g " OR
-        "${CMAKE_CXX_FLAGS}" MATCHES " -DDEBUG " OR
-        "${CMAKE_CXX_FLAGS}" MATCHES " -debug ")
-
     IF (NOT TBB_LIBRARY)
         IF (_USE_DEBUG)
             SET (TBB_LIBRARY ${TBB_LIBRARY_DEBUG} CACHE DOC "TBB library" FORCE)
@@ -170,8 +164,6 @@
             SET (TBB_LIBRARY ${TBB_LIBRARY_RELEASE} CACHE DOC "TBB library" FORCE)
         ENDIF (_USE_DEBUG)
     ENDIF (NOT TBB_LIBRARY)
-
-    UNSET (_USE_DEBUG)
 ELSEIF (TBB_LIBRARY_RELEASE)
     IF (NOT TBB_LIBRARY)
         SET (TBB_LIBRARY ${TBB_LIBRARY_RELEASE} CACHE DOC "TBB library" FORCE)
@@ -216,10 +208,13 @@
     SET (TBB_${_TBB_COMPONENT_UPPER}_FOUND TRUE)

     IF (${_TBB_LIBRARY_BASE}_DEBUG AND ${_TBB_LIBRARY_BASE}_RELEASE)
-        SET (${_TBB_LIBRARY_BASE}
-            debug ${${_TBB_LIBRARY_BASE}_DEBUG}
-            optimized ${${_TBB_LIBRARY_BASE}_RELEASE} CACHE DOC
-            "TBB ${_TBB_COMPONENT} library")
+        IF (_USE_DEBUG)
+            SET (${_TBB_LIBRARY_BASE} ${${_TBB_LIBRARY_BASE}_DEBUG}
+                CACHE DOC "TBB ${_TBB_COMPONENT} library")
+        ELSE (_USE_DEBUG)
+            SET (${_TBB_LIBRARY_BASE} ${${_TBB_LIBRARY_BASE}_RELEASE}
+                CACHE DOC "TBB ${_TBB_COMPONENT} library")
+        ENDIF (_USE_DEBUG)
     ELSEIF (${_TBB_LIBRARY_BASE}_DEBUG)
         SET (${_TBB_LIBRARY_BASE} ${${_TBB_LIBRARY_BASE}_DEBUG})
     ELSEIF (${_TBB_LIBRARY_BASE}_RELEASE)
@@ -368,6 +363,8 @@
     LIST (APPEND _TBB_FPHSA_ADDITIONAL_ARGS VERSION_VAR TBB_VERSION)
 ENDIF (CMAKE_VERSION VERSION_GREATER 2.8.2)

+UNSET (_USE_DEBUG)
+
 #------------------------------------------------------------------------------#
 # Set package find results and handle arguments (QUIET, REQUIRED, etc.)
 #------------------------------------------------------------------------------#


Fix compilation for gcc 4.9.1 on Linux

Fix compilation for gcc 4.9.1 on Linux

--- cmake/PlatformLinuxGCC.cmake
+++ cmake/PlatformLinuxGCC.cmake
@@ -55,6 +55,7 @@
       -Wconversion

       -Wno-error=float-equal
+      -Wno-error=float-conversion
       -Wno-error=conversion
       -Wno-error=switch


[cmake] Fix some errors in the cmake code that enables LTO.

When I originally committed the LTO code, I tried to match the coding style of
the code right above it that enabled code coverage. Turns out that the code
coverage code did not have a weird coding style and instead just had a bug.

I fixed both of the issues and also enabled the LTO flag on non-Darwin.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -89,14 +89,14 @@
       "-F" "${SWIFT_SDK_${CFLAGS_SDK}_PATH}/../../../Developer/Library/Frameworks"
       "-m${SWIFT_SDK_${CFLAGS_SDK}_VERSION_MIN_NAME}-version-min=${DEPLOYMENT_VERSION}")

-    if(analyze_code_coverage)
+    if(CFLAGS_ANALYZE_CODE_COVERAGE)
       list(APPEND result "-fprofile-instr-generate"
                          "-fcoverage-mapping")
     endif()
-
-    if(enable_lto)
-      list(APPEND result "-flto")
-    endif()
+  endif()
+
+  if(CFLAGS_ENABLE_LTO)
+    list(APPEND result "-flto")
   endif()

   set("${CFLAGS_RESULT_VAR_NAME}" "${result}" PARENT_SCOPE)
@@ -117,7 +117,7 @@
     ARCH "${CFLAGS_ARCH}"
     BUILD_TYPE "${CFLAGS_BUILD_TYPE}"
     ENABLE_ASSERTIONS "${CFLAGS_ENABLE_ASSERTIONS}"
-    SWIFT_ENABLE_LTO "${SWIFT_ENABLE_LTO}"
+    ENABLE_LTO "${SWIFT_ENABLE_LTO}"
     ANALYZE_CODE_COVERAGE FALSE
     DEPLOYMENT_VERSION_IOS "${CFLAGS_DEPLOYMENT_VERSION_IOS}"
     RESULT_VAR_NAME result)


Revert "Most swift targets should depend on SwiftOnoneSupport, except Core and SwiftOnoneSupport"

This reverts commit a374d1b0fa06d0ccd2d18a904379b8ac73ce8362.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1344,18 +1344,13 @@
   # All Swift code depends on the standard library, except for the standard
   # library itself.
   if(SWIFTLIB_TARGET_LIBRARY AND NOT SWIFTLIB_IS_STDLIB_CORE)
-    list(APPEND SWIFTLIB_SWIFT_MODULE_DEPENDS Core SwiftOnoneSupport)
-  endif()
-
-  if("${name}" STREQUAL "swiftSwiftOnoneSupport")
-    list(REMOVE_ITEM SWIFTLIB_SWIFT_MODULE_DEPENDS
-      SwiftOnoneSupport)
+    list(APPEND SWIFTLIB_SWIFT_MODULE_DEPENDS Core)
   endif()

   if((NOT "${SWIFT_BUILD_STDLIB}") AND
      (NOT "${SWIFTLIB_SWIFT_MODULE_DEPENDS}" STREQUAL ""))
     list(REMOVE_ITEM SWIFTLIB_SWIFT_MODULE_DEPENDS
-      Core SwiftOnoneSupport)
+        Core)
   endif()

   translate_flags(SWIFTLIB "${SWIFTLIB_options}")


Remove redundant module.

Remove redundant module.

--- cmake/modules/FindCURL.cmake
+++ cmake/modules/FindCURL.cmake
@@ -1,68 +0,0 @@
-#.rst:
-# FindCURL
-# --------
-#
-# Find curl
-#
-# Find the native CURL headers and libraries.
-#
-# ::
-#
-#   CURL_INCLUDE_DIRS   - where to find curl/curl.h, etc.
-#   CURL_LIBRARIES      - List of libraries when using curl.
-#   CURL_FOUND          - True if curl found.
-#   CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8)
-
-#=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
-# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# Look for the header file.
-find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
-mark_as_advanced(CURL_INCLUDE_DIR)
-
-# Look for the library (sorted from most current/relevant entry to least).
-find_library(CURL_LIBRARY NAMES
-    curl
-  # Windows MSVC prebuilts:
-    curllib
-    libcurl_imp
-    curllib_static
-  # Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
-    libcurl
-)
-mark_as_advanced(CURL_LIBRARY)
-
-if(CURL_INCLUDE_DIR)
-  foreach(_curl_version_header curlver.h curl.h)
-    if(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
-      file(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
-
-      string(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
-      unset(curl_version_str)
-      break()
-    endif()
-  endforeach()
-endif()
-
-# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
-# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
-                                  REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
-                                  VERSION_VAR CURL_VERSION_STRING)
-
-if(CURL_FOUND)
-  set(CURL_LIBRARIES ${CURL_LIBRARY})
-  set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
-endif()


cmake: Add regex pattern for POWER architecture (#7494)

This patch helps to set architecture as power, when processor
check output matches ppc64le*.

Co-authored-by: Rajalakshmi Srinivasaraghavan <0350fbcf6bc3e939658a84075ba74b8807481167@linux.ibm.com>

--- cmake/onnxruntime_mlas.cmake
+++ cmake/onnxruntime_mlas.cmake
@@ -162,7 +162,7 @@
       set(ARM TRUE)
     elseif(dumpmachine_output MATCHES "^aarch64.*")
       set(ARM64 TRUE)
-    elseif(dumpmachine_output MATCHES "^powerpc.*")
+    elseif(dumpmachine_output MATCHES "^(powerpc.*|ppc.*)")
       set(POWER TRUE)
     elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86?)$")
       set(X86 TRUE)


Updated LIBXSMM (fetch).

Updated LIBXSMM (fetch).

--- cmake/third_party/xsmm.cmake
+++ cmake/third_party/xsmm.cmake
@@ -6,21 +6,15 @@
 if(LIBXSMMROOT AND NOT LIBXSMMFETCH)
   message(STATUS "Found LIBXSMM (${LIBXSMMROOT})")
   file(GLOB XSMM_SRCS LIST_DIRECTORIES false CONFIGURE_DEPENDS ${LIBXSMMROOT}/include/libxsmm/*.c)
-
-  if(XSMM_SRCS)
-    list(REMOVE_ITEM XSMM_SRCS ${LIBXSMMROOT}/include/libxsmm/libxsmm_generator_gemm_driver.c)
-  else()
-    file(GLOB XSMM_SRCS LIST_DIRECTORIES false CONFIGURE_DEPENDS ${LIBXSMMROOT}/src/*.c)
-    list(REMOVE_ITEM XSMM_SRCS ${LIBXSMMROOT}/src/libxsmm_generator_gemm_driver.c)
-  endif()
+  list(REMOVE_ITEM XSMM_SRCS ${LIBXSMMROOT}/include/libxsmm/libxsmm_generator_gemm_driver.c)
 else()
   message(STATUS "Fetching LIBXSMM")
   include(FetchContent)

   FetchContent_Declare(
     xsmm
-    URL https://github.com/libxsmm/libxsmm/archive/e6eedc0ef1f34aa640375b93bd9e964e4823abd8.tar.gz
-    URL_HASH SHA256=fa6615a4ed6dc35cf344301acd868165ae4416eaff81614f12a8c384b7c1e84d
+    URL https://github.com/libxsmm/libxsmm/archive/efa1502f13f7ed0c447351496c66abd0e729e80c.tar.gz
+    URL_HASH SHA256=ca5a508c6127d78ea068a73c632035a30583bba96dd5f0514238d249c60dedfc
   )

   FetchContent_GetProperties(xsmm)
@@ -29,9 +23,13 @@
   endif()

   set(LIBXSMMROOT ${xsmm_SOURCE_DIR})
+endif()
+
+if(NOT XSMM_SRCS)
   file(GLOB XSMM_SRCS LIST_DIRECTORIES false CONFIGURE_DEPENDS ${LIBXSMMROOT}/src/*.c)
   list(REMOVE_ITEM XSMM_SRCS ${LIBXSMMROOT}/src/libxsmm_generator_gemm_driver.c)
 endif()
+
 set(XSMM_INCLUDE_DIRS ${LIBXSMMROOT}/include)

 add_library(xsmm STATIC ${XSMM_SRCS})


Update compiler.cmake

Update compiler.cmake

Fixed typo in flag

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -206,7 +206,7 @@
                      " -Wno-conditional-uninitialized"
                      " -Wno-exit-time-destructors"
                      " -Wno-undefined-func-template"
-                     " -Wnoc++98-compat"
+                     " -Wno-c++98-compat"
                      )
              string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
              #endif ()


Remove deleted images from cmake list. Todo: Check which images are still needed.

--- Plugins/org.mitk.gui.qt.igtexamples/files.cmake
+++ Plugins/org.mitk.gui.qt.igtexamples/files.cmake
@@ -29,18 +29,18 @@
 )

 set(QRC_FILES
-  resources/QmitkIGTTrackingLabView.qrc
+  #resources/QmitkIGTTrackingLabView.qrc
   #resources/QmitkIGTTutorialView.qrc
 )

 set(CACHED_RESOURCE_FILES
-  resources/IgtTrackingLab.png
+  #resources/IgtTrackingLab.png
   resources/start_rec.png
   resources/stop_rec.png
-  resources/IGTTutorial.png
-  resources/icon.xpm
-  resources/example.png
-  resources/provider.png
+  #resources/IGTTutorial.png
+  #resources/icon.xpm
+  #resources/example.png
+  #resources/provider.png
   resources/icon_igt_simple_example.svg
   resources/icon_igt_tracking_lab.svg
   resources/icon_openigtlink_client_example.svg


link pthread on clang and gcc for boost::thread

--- cmake/CaneyImportBoost.cmake
+++ cmake/CaneyImportBoost.cmake
@@ -17,3 +17,11 @@
 _CaneyAddBoostCompoment(system)
 _CaneyAddBoostCompoment(thread system)
 _CaneyAddBoostCompoment(unit_test_framework system)
+
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+	set(CANEY_BOOST_LINK_THREAD_SUPPORT "pthread" CACHE STRING "extra libraries to link for thread support")
+else()
+	set(CANEY_BOOST_LINK_THREAD_SUPPORT "" CACHE STRING "extra libraries to link for thread support")
+endif()
+
+target_link_libraries("caney::boost::thread" INTERFACE ${CANEY_BOOST_LINK_THREAD_SUPPORT})


fixed funny macOS details in naming AVX = AVX1.0 in sysctl output

--- cmake/FindCPU_FEATURES.cmake
+++ cmake/FindCPU_FEATURES.cmake
@@ -115,6 +115,9 @@
   EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE
     CPUINFO)

+  EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.leaf7_features" OUTPUT_VARIABLE
+    LEAF7_CPUINFO)
+
   EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.vendor" OUTPUT_VARIABLE
     VENDOR_TITLE)

@@ -175,7 +178,15 @@
     set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host")
   ENDIF (SSE41_TRUE)

-  if("${CPUINFO}" MATCHES ".*AVX .*")
+  STRING(REGEX REPLACE "^.*(SSE4.2).*$" "\\1" SSE_THERE ${CPUINFO})
+  STRING(COMPARE EQUAL "SSE4.2" "${SSE_THERE}" SSE42_TRUE)
+  IF (SSE42_TRUE)
+    set(SSE4_2_FOUND true CACHE BOOL "SSE4.2 available on host")
+  ELSE (SSE42_TRUE)
+    set(SSE4_2_FOUND false CACHE BOOL "SSE4.2 available on host")
+  ENDIF (SSE42_TRUE)
+
+  if("${CPUINFO}" MATCHES ".*AVX.*")
     set(AVX_FOUND true CACHE BOOL "AVX available on host")
   else()
     set(AVX_FOUND false CACHE BOOL "AVX available on host")
@@ -184,7 +195,11 @@
   if("${CPUINFO}" MATCHES ".*AVX2 .*")
     set(AVX2_FOUND true CACHE BOOL "AVX2 available on host")
   else()
-    set(AVX2_FOUND false CACHE BOOL "AVX2 available on host")
+    if("${LEAF7_CPUINFO}" MATCHES ".*AVX2 .*")
+      set(AVX2_FOUND true CACHE BOOL "AVX2 available on host")
+    else()
+      set(AVX2_FOUND false CACHE BOOL "AVX2 available on host")
+    endif()
   endif()

 ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Windows")


Squashed '3rdparty/github/cmake-utils/' changes from e6038fef1..c5dec90e7

c5dec90e7 Enable NTRACE only when exactly in Debug build mode, version 1.0.0

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

--- cmake/MyPackageLibrary.cmake
+++ cmake/MyPackageLibrary.cmake
@@ -47,7 +47,7 @@
   # ... Tracing
   #
   STRING (TOUPPER ${PROJECT_NAME} _PROJECTNAME)
-  IF ((NOT CMAKE_BUILD_TYPE MATCHES Debug) AND (NOT CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
+  IF (NOT CMAKE_BUILD_TYPE MATCHES Debug)
     FOREACH (_target ${PROJECT_NAME} ${PROJECT_NAME}_static)
       TARGET_COMPILE_DEFINITIONS(${_target} PRIVATE -D${_PROJECTNAME}_NTRACE)
     ENDFOREACH ()


fixed native Lapack detection script on Mac/iOS (where native Lapack is a part of Accelerate framework)

--- cmake/OpenCVFindLAPACK.cmake
+++ cmake/OpenCVFindLAPACK.cmake
@@ -31,11 +31,18 @@
   else()
     # adding proxy opencv_lapack.h header
     set(CBLAS_H_PROXY_PATH ${CMAKE_BINARY_DIR}/opencv_lapack.h)
-    set(_lapack_include_str "extern \"C\" {\n\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"")
+    if(APPLE)
+        set(_lapack_include_str_extern_C "")
+        set(_lapack_include_str_extern_C_end "")
+    else()
+        set(_lapack_include_str_extern_C "extern \"C\" {\n")
+        set(_lapack_include_str_extern_C_end "}\n")
+    endif()
+    set(_lapack_include_str "${_lapack_include_str_extern_C}\#include \"${OPENCV_CBLAS_H_PATH_${_lapack_impl}}\"")
     if(NOT "${OPENCV_CBLAS_H_PATH_${_lapack_impl}}" STREQUAL "${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}")
       set(_lapack_include_str "${_lapack_include_str}\n#include \"${OPENCV_LAPACKE_H_PATH_${_lapack_impl}}\"")
     endif()
-    set(_lapack_include_str "${_lapack_include_str}\n}\n")
+    set(_lapack_include_str "${_lapack_include_str}\n${_lapack_include_str_extern_C_end}")
     # update file contents (if required)
     set(__content_str "")
     if(EXISTS "${CBLAS_H_PROXY_PATH}")


Allow guile site dir overriding

Allow guile site dir overriding

--- cmake/OpenCogFunctions.cmake
+++ cmake/OpenCogFunctions.cmake
@@ -14,10 +14,12 @@
 #   for it be importable, as per guile's specification. See reference
 #   links above.

-IF(HAVE_GUILE)
-    EXECUTE_PROCESS(COMMAND guile -c "(display (%site-dir))"
-        OUTPUT_VARIABLE GUILE_SITE_DIR
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
+IF (NOT DEFINED GUILE_SITE_DIR)
+    IF(HAVE_GUILE)
+        EXECUTE_PROCESS(COMMAND guile -c "(display (%site-dir))"
+            OUTPUT_VARIABLE GUILE_SITE_DIR
+            OUTPUT_STRIP_TRAILING_WHITESPACE)
+    ENDIF()
 ENDIF()
 ADD_DEFINITIONS(-DGUILE_SITE_DIR="${GUILE_SITE_DIR}")


Remove previous load-path from ADD_GUILE_TEST function

--- cmake/OpenCogFunctions.cmake
+++ cmake/OpenCogFunctions.cmake
@@ -148,9 +148,7 @@
                 ${CMAKE_CURRENT_SOURCE_DIR})
         ENDIF()

-        ADD_TEST(${TEST_NAME} guile --use-srfi=64
-            -L ${DATADIR}/scm
-            ${FILE_PATH}
+        ADD_TEST(${TEST_NAME} guile --use-srfi=64 ${FILE_PATH}
             WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

     ENDIF()


cmake: another fix for include all header files in Xcode projects.

Header files from within the lib directory were missing.
Also: use get_filename_component instead of regex matching.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -435,15 +435,15 @@
   endif()

   if(XCODE)
-    string(REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
-    list(GET split_path -1 dir)
+    get_filename_component(base_dir ${CMAKE_CURRENT_SOURCE_DIR} NAME)

     file(GLOB_RECURSE ASHL_HEADERS
-      ${SWIFT_SOURCE_DIR}/include/swift${dir}/*.h
-      ${SWIFT_SOURCE_DIR}/include/swift${dir}/*.def
+      ${SWIFT_SOURCE_DIR}/include/swift/${base_dir}/*.h
+      ${SWIFT_SOURCE_DIR}/include/swift/${base_dir}/*.def
+      ${CMAKE_CURRENT_SOURCE_DIR}/*.h
       ${CMAKE_CURRENT_SOURCE_DIR}/*.def)
     file(GLOB_RECURSE ASHL_TDS
-      ${SWIFT_SOURCE_DIR}/include/swift${dir}/*.td)
+      ${SWIFT_SOURCE_DIR}/include/swift${base_dir}/*.td)

     set_source_files_properties(${ASHL_HEADERS} ${ASHL_TDS} PROPERTIES
       HEADER_FILE_ONLY true)


[CMake] Use precondition in _add_swift_lipo_target

Use the `precondition` CMake function added in e12fff76fd, rather than
custom logic, to check if arguments to `_add_swift_lipo_target` are not
set.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -363,13 +363,8 @@
 #                         # lipo'd into the output.
 #   )
 function(_add_swift_lipo_target target output)
-  if("${target}" STREQUAL "")
-    message(FATAL_ERROR "target is required")
-  endif()
-
-  if("${output}" STREQUAL "")
-    message(FATAL_ERROR "output is required")
-  endif()
+  precondition(target MESSAGE "target is required")
+  precondition(output MESSAGE "output is required")

   set(source_targets ${ARGN})


fixed a bug with dictionary generations

fixed a bug with dictionary generations

--- cmake/modules/FindROOT.cmake
+++ cmake/modules/FindROOT.cmake
@@ -162,8 +162,9 @@
   string(REGEX REPLACE "-DALI_DIM" "" _ddefs ${_ddefs})
   Separate_arguments(_ddefs
 		  )
+
   Add_custom_command(OUTPUT ${OUTFILES}
-     COMMAND DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}:${ROOT_LIBRARY_DIR}
+#COMMAND DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}:${ROOT_LIBRARY_DIR}
      COMMAND ${ROOTCINT}
      ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${_ddefs} ${__DATEFLAGS} ${_special_settings} ${INCLUDE_DIRS} ${infiles_nopath} ${LINKDEF_FILE}
      DEPENDS ${INFILES} ${LINKDEF_FILE})


统一预编译包区分的系统和架构名称

统一预编译包区分的系统和架构名称

--- project/cmake/FindPlatform.cmake
+++ project/cmake/FindPlatform.cmake
@@ -26,10 +26,16 @@
     ENDIF()
 endif ()

-if (ANDROID_ABI)
-    string(TOLOWER "${CMAKE_SYSTEM_NAME}-${ANDROID_ABI}" PROJECT_PREBUILT_PLATFORM_NAME)
-elseif (CMAKE_OSX_ARCHITECTURES)
-    string(TOLOWER "${CMAKE_SYSTEM_NAME}-${CMAKE_OSX_ARCHITECTURES}" PROJECT_PREBUILT_PLATFORM_NAME)
-else ()
-    string(TOLOWER "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" PROJECT_PREBUILT_PLATFORM_NAME)
+if (NOT PROJECT_PREBUILT_PLATFORM_NAME)
+    if (ANDROID_ABI)
+        string(TOLOWER "${CMAKE_SYSTEM_NAME}-${ANDROID_ABI}" PROJECT_PREBUILT_PLATFORM_NAME)
+    elseif (CMAKE_OSX_ARCHITECTURES)
+        string(TOLOWER "${CMAKE_SYSTEM_NAME}-${CMAKE_OSX_ARCHITECTURES}" PROJECT_PREBUILT_PLATFORM_NAME)
+    else ()
+        string(TOLOWER "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" PROJECT_PREBUILT_PLATFORM_NAME)
+    endif ()
 endif ()
+if (NOT PROJECT_PREBUILT_HOST_PLATFORM_NAME)
+    string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}" PROJECT_PREBUILT_HOST_PLATFORM_NAME)
+endif()
+


idl-config: Add dependency to generated files.

Change-Id: Iabb8dea8204e907963dfa8ade0b2aed0005a6d2d
Reviewed-on: http://gerrit.aldebaran.lan:8080/12530
Reviewed-by: cgestes <ddb78fe00abb42f91254c16a0860e38eb0781789@aldebaran-robotics.com>
Reviewed-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>
Tested-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>

--- codegen/src/idl-config.cmake
+++ codegen/src/idl-config.cmake
@@ -74,7 +74,7 @@
   if (ARG_PROXY)
     qi_generate_src(
       ${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp
-      SRC ${ARG_SRC}
+      SRC ${ARG_SRC}${ARG_DOXYSRC}
       COMMAND ${_python_executable} ${IDLPY}
         ${IDL}
         "${classes}"
@@ -102,6 +102,7 @@
   endforeach()
   qi_generate_src(
      ${CMAKE_CURRENT_BINARY_DIR}/${name}_bind.cpp
+     SRC ${ARG_SRC} ${ARG_DOXYSRC}
      COMMAND ${_python_executable} ${IDLPY}
        ${IDL}
        ${ARG_SRC} ${ARG_DOXYSRC}
@@ -113,6 +114,7 @@
   # Generate interface
   qi_generate_src(
      ${CMAKE_CURRENT_BINARY_DIR}/${name}_interface.hpp
+     SRC ${ARG_SRC} ${ARG_DOXYSRC}
      COMMAND ${_python_executable} ${IDLPY}
        ${IDL}
        ${ARG_SRC} ${ARG_DOXYSRC}


removed hard coded CIL_VERSION

removed hard coded CIL_VERSION

--- SuperBuild/External_CCPi-FrameworkPlugins.cmake
+++ SuperBuild/External_CCPi-FrameworkPlugins.cmake
@@ -90,7 +90,7 @@

     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
-    INSTALL_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=0.10.0 SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe PYTHON=${PYTHON_EXECUTABLE} bash ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/build.sh
+    INSTALL_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${CIL_VERSION} SRC_DIR=${${proj}_BINARY_DIR} RECIPE_DIR=${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe PYTHON=${PYTHON_EXECUTABLE} bash ${${proj}_SOURCE_DIR}/Wrappers/Python/conda-recipe/build.sh
     CMAKE_ARGS
         -DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir}
     DEPENDS


BUILD: Fix windows shortcut installation

--- Superbuild/Projects/win32/veloview.bundle.cmake
+++ Superbuild/Projects/win32/veloview.bundle.cmake
@@ -7,8 +7,8 @@
   "bin/VeloView.exe" "VeloView"
   "doc/VeloView_Developer_Guide.pdf" "Developer Guide")

-set(CPACK_PACKAGE_EXECUTABLES "bin/VeloView.exe" "VeloView" ${CPACK_PACKAGE_EXECUTABLES})
-set(CPACK_CREATE_DESKTOP_LINKS "bin/VeloView.exe" ${CPACK_CREATE_DESKTOP_LINKS})
+set(CPACK_PACKAGE_EXECUTABLES "VeloView" "VeloView" ${CPACK_PACKAGE_EXECUTABLES})
+set(CPACK_CREATE_DESKTOP_LINKS "VeloView" ${CPACK_CREATE_DESKTOP_LINKS})
 set(CPACK_NSIS_MODIFY_PATH ON)

 set(AppName VeloView)


Fix windows installer for share files

Fix windows installer for share files

--- Superbuild/Projects/win32/veloview.bundle.cmake
+++ Superbuild/Projects/win32/veloview.bundle.cmake
@@ -53,6 +53,10 @@
         COMPONENT ${AppName}
         PATTERN "*.lib" EXCLUDE)

+install(DIRECTORY "${install_location}/share"
+        DESTINATION "share"
+        USE_SOURCE_PERMISSIONS
+        COMPONENT ${AppName})

 install(FILES "${wpcap_library_dir}/wpcap.dll"  "${wpcap_library_dir}/Packet.dll"
         DESTINATION "bin"


Typo correction in STP-BV include directory name

--- include/SCD/SourcesLib.cmake
+++ include/SCD/SourcesLib.cmake
@@ -89,4 +89,4 @@
   STP-BV/STP_Torus.h
   STP-BV/STP_Feature.hxx
 )
-InstallFiles(HEADERS_STP_BV  "STP_BV")
+InstallFiles(HEADERS_STP_BV  "STP-BV")


Sort futimes correctly.

Sort futimes correctly.

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

--- include/llvm/Config/config.h.cmake
+++ include/llvm/Config/config.h.cmake
@@ -90,11 +90,11 @@
 /* Define to 1 if you have the <ffi.h> header file. */
 #cmakedefine HAVE_FFI_H ${HAVE_FFI_H}

+/* Define to 1 if you have the `futimens' function */
+#cmakedefine HAVE_FUTIMENS ${HAVE_FUTIMENS}
+
 /* Define to 1 if you have the `futimes' function. */
 #cmakedefine HAVE_FUTIMES ${HAVE_FUTIMES}
-
-/* Define to 1 if you have the `futimens' function */
-#cmakedefine HAVE_FUTIMENS ${HAVE_FUTIMENS}

 /* Define to 1 if you have the `getcwd' function. */
 #cmakedefine HAVE_GETCWD ${HAVE_GETCWD}


GC NEED_USCORE.

GC NEED_USCORE.

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

--- include/llvm/Config/config.h.cmake
+++ include/llvm/Config/config.h.cmake
@@ -463,9 +463,6 @@
    its not necessary */
 #undef NEED_DEV_ZERO_FOR_MMAP

-/* Define if dlsym() requires a leading underscore in symbol names. */
-#undef NEED_USCORE
-
 /* Define to the address where bug reports for this package should be sent. */
 #cmakedefine PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"


to test travis ci

to test travis ci

--- tests/package/package_source_tests/package_source_webarchive_test.cmake
+++ tests/package/package_source_tests/package_source_webarchive_test.cmake
@@ -25,6 +25,8 @@

   package_source_resolve_webarchive("https://github.com/toeb/cmakepp/archive/v0.0.3.tar.gz")
   ans(res)
+  json_print(res)
+  assert(res)
   assertf({res.package_descriptor.id} STREQUAL "oo-cmake")
   assertf({res.package_descriptor.license} STREQUAL "MIT")
   assertf({res.archive_descriptor.package_descriptor_path} STREQUAL "cmakepp-0.0.3/package.cmake")


ENH: Prevent header generation when unchanged.

Added CMake logic to prevent the regeneration of the headers
and .i files in the case when the list have not actually changed.
This should prevent unnecessary rebuilds after running cmake,
but still should update the .h and .i files when new filters
are added via .json files.

--- Code/BasicFilters/SourceCodeGenerator.cmake
+++ Code/BasicFilters/SourceCodeGenerator.cmake
@@ -28,9 +28,29 @@
 endforeach()

 # clear the include files
-file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "" )
-file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "" )
+file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h.tmp "" )
+file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i.tmp "" )
 foreach ( filter ${GENERATED_FILTER_LIST} )
-  file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#include \"sitk${filter}ImageFilter.h\"\n" )
-  file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "%include \"sitk${filter}ImageFilter.h\"\n" )
+  file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h.tmp "#include \"sitk${filter}ImageFilter.h\"\n" )
+  file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i.tmp "%include \"sitk${filter}ImageFilter.h\"\n" )
 endforeach()
+# Check if they have changed, and only in they have, copy them as new ones.
+file( DIFFERENT GENERATED_HEADERS_CHANGED FILES
+  ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h
+  ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h.tmp )
+file( DIFFERENT GENERATED_INTERFACES_CHANGED FILES
+  ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i
+  ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i.tmp )
+if( GENERATED_HEADERS_CHANGED )
+  configure_file(
+    ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h.tmp
+    ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h
+    COPYONLY )
+endif()
+if( GENERATED_INTERFACES_CHANGED )
+  configure_file(
+    ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i.tmp
+    ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i
+    COPYONLY )
+endif()
+


Updated scikit-image to 0.9.3

Updated scikit-image to 0.9.3

--- scikit-image.cmake
+++ scikit-image.cmake
@@ -16,10 +16,10 @@
 include (scipy)

 external_source (scikit-image
-    0.7.2
-    scikit-image-0.7.2.tar.gz
-    80eb9862fa09c7e06eda6e2a9fc4042f
-    http://pypi.python.org/packages/source/s/scikit-image)
+    0.9.3
+    scikit-image-0.9.3.tar.gz
+    f010e0cd46ee2996a6875c96b216e768
+    https://pypi.python.org/packages/source/s/scikit-image)

 message ("Installing ${scikit-image_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${scikit-image_NAME}


BUG: Libraries were missing in package

BUG: Libraries were missing in package

--- DTIPrepTools.cmake
+++ DTIPrepTools.cmake
@@ -116,10 +116,14 @@

   set( CLIToolsList
     BRAINSCreateLabelMapFromProbabilityMaps
+    libBRAINSCreateLabelMapFromProbabilityMapsLib.so
     BRAINSFitEZ
+    libBRAINSFitEZLib.so
     BRAINSResize
+    libBRAINSResizeLib.so
     compareTractInclusion
     DWIConvert
+    libDWIConvertLib.so
 #    ImageCalculator ## Causes problems when loading it in Slicer on Windows
     ImageGenerate
      )


updates to test.cmake

updates to test.cmake

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -23,10 +23,6 @@
 MACRO(update_test_models)
   IF(NOT EXISTS "${TEST_MODELS_DIRECTORY}")
     MESSAGE("cloning test models ...")
-    EXECUTE_PROCESS(
-      COMMAND "ssh" "git@git.sdvis.org"
-      WORKING_DIRECTORY $ENV{HOME}
-    )
     EXECUTE_PROCESS(
       COMMAND ${CTEST_GIT_COMMAND} "clone" "git@git.sdvis.org:embree-models.git" embree-models
       WORKING_DIRECTORY $ENV{HOME}


Annotator test: put it in the `utils` category.

--- tests/annotator/tests.cmake
+++ tests/annotator/tests.cmake
@@ -5,7 +5,7 @@
 #    ctest -R <category-label>
 # which will run the tests matching this category-label.
 # Can be left empty (or just not set)
-set(${CURRENT_TEST}_CATEGORY io)
+set(${CURRENT_TEST}_CATEGORY utils)
 list(APPEND LIBCELLML_TESTS ${CURRENT_TEST})
 # Using absolute path relative to this file
 set(${CURRENT_TEST}_SRCS


add more ctest labels to the regression test cases

--- reg_tests/CTestList.cmake
+++ reg_tests/CTestList.cmake
@@ -19,7 +19,7 @@
 #===============================================================================

 # Standard regression test
-function(of_regression testname)
+function(of_regression testname LABELS)
   file(TO_NATIVE_PATH "${PYTHON_EXECUTABLE}" PYTHON_EXECUTABLE)
   file(TO_NATIVE_PATH "${CMAKE_CURRENT_LIST_DIR}/executeOpenfastRegressionCase.py" TEST_SCRIPT)
   file(TO_NATIVE_PATH "${CTEST_OPENFAST_EXECUTABLE}" OPENFAST_EXECUTABLE)
@@ -37,7 +37,6 @@
        ${CMAKE_Fortran_COMPILER_ID}     # [Intel,GNU]
   )
   # limit each test to 45 minutes: 2700s
-  set(LABELS openfast regression)
   set_tests_properties(${testname} PROPERTIES TIMEOUT 2700 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" LABELS "${LABELS}")
 endfunction(of_regression)

@@ -66,32 +65,32 @@
 #===============================================================================

 # OpenFAST regression tests
-of_regression(Test01)
-of_regression(Test02)
-of_regression(Test03)
-of_regression(Test04)
-of_regression(Test05)
-of_regression(Test06)
-of_regression(Test07)
-of_regression(Test08)
-of_regression(Test09)
-of_regression(Test10)
-of_regression(Test11)
-of_regression(Test12)
-of_regression(Test13)
-of_regression(Test14)
-of_regression(Test15)
-of_regression(Test16)
-of_regression(Test17)
-of_regression(Test18)
-of_regression(Test19)
-of_regression(Test20)
-of_regression(Test21)
-of_regression(Test22)
-of_regression(Test23)
-of_regression(Test24)
-of_regression(Test25)
-of_regression(Test26)
+of_Regression(Test01 "elastodyn;aerodyn14;servodyn")
+of_Regression(Test02 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test03 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test04 "elastodyn;aerodyn14;servodyn")
+of_Regression(Test05 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test06 "elastodyn;aerodyn14;servodyn")
+of_Regression(Test07 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test08 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test09 "elastodyn;aerodyn14;servodyn")
+of_Regression(Test10 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test11 "elastodyn;aerodyn14;servodyn")
+of_Regression(Test12 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test13 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test14 "elastodyn;aerodyn15")
+of_Regression(Test15 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test16 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test17 "elastodyn;aerodyn14;servodyn")
+of_Regression(Test18 "elastodyn;aerodyn15;servodyn")
+of_Regression(Test19 "elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
+of_Regression(Test20 "elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
+of_Regression(Test21 "elastodyn;aerodyn15;servodyn;hydrodyn;subdyn")
+of_Regression(Test22 "elastodyn;aerodyn14;servodyn;hydrodyn;map")
+of_Regression(Test23 "elastodyn;aerodyn15;servodyn;hydrodyn;map")
+of_Regression(Test24 "elastodyn;aerodyn15;servodyn;hydrodyn;map")
+of_Regression(Test25 "elastodyn;aerodyn15;servodyn;hydrodyn;moordyn")
+of_Regression(Test26 "beamdyn;aerodyn15;servodyn")

 # BeamDyn regression tests
 bd_regression(bd_isotropic_rollup)


Remove commented-out code

Remove commented-out code

--- Shared/CMake/JamomaUtilFunctions.cmake
+++ Shared/CMake/JamomaUtilFunctions.cmake
@@ -142,15 +142,13 @@
 	function(setOutput)
 		if(DEFINED IS_EXTENSION)
 			setExtensionSuffix()
-			INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "extensions")
+			INSTALL(TARGETS ${PROJECT_NAME}
+					DESTINATION "extensions")
 		elseif(DEFINED IS_EXTERNAL)
 			setExternalSuffix()
-			INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "externals")
-		else()
-			#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "lib")
-		endif()
-
-		#INSTALL(FILES ${PROJECT_HDRS} DESTINATION "include")
+			INSTALL(TARGETS ${PROJECT_NAME}
+					DESTINATION "externals")
+		endif()
 	endFunction()
 else()
 	function(setOutput)
@@ -163,10 +161,7 @@
 			setExternalSuffix()
 			INSTALL(TARGETS ${PROJECT_NAME}
 					DESTINATION "externals")
-		else()
-			#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION "lib")
-		endif()
-		#INSTALL(FILES ${PROJECT_HDRS} DESTINATION "include/jamoma")
+		endif()
 	endFunction()
 endif()


touch class-server just once, not once per type.

This is just some really minor cleanup.

--- lib/OpenCogAtomTypes.cmake
+++ lib/OpenCogAtomTypes.cmake
@@ -39,6 +39,20 @@
 FILE(APPEND "${HEADER_FILE}"  "#include <opencog/atomspace/types.h>\nnamespace opencog\n{\n")
 FILE(WRITE "${DEFINITIONS_FILE}"  "/* File automatically generated by the macro OPENCOG_ADD_ATOM_TYPES. Do not edit */\n#include <opencog/atomspace/ClassServer.h>\n#include <opencog/atomspace/atom_types.h>\n#include <opencog/atomspace/types.h>\n#include \"atom_types.h\"\n")
 FILE(WRITE "${INHERITANCE_FILE}"  "/* File automatically generated by the macro OPENCOG_ADD_ATOM_TYPES. Do not edit */\n")
+
+# We need to touch the class-server before doing anything.
+# This is in order to guarantee that the main atomspace types
+# get created before other derived types.
+#
+# There's still a potentially nasty bug here: if some third types.script
+# file depends on types defined in a second file, but the third initializer
+# runs before the second, then any atoms in that third file that inherit
+# from the second will get a type of zero.  This will crash code later on.
+# The only fix for this is to make sure that the third script forces the
+# initailzers for the second one to run first. Hopefully, the programmer
+# will figure this out, before the bug shows up. :-)
+FILE(APPEND "${INHERITANCE_FILE}" "/* Touch the server before adding types. */\n")
+FILE(APPEND "${INHERITANCE_FILE}" "${CLASSSERVER_INSTANCE};\n")

 FILE(WRITE "${SCM_FILE}" "\n")
 FILE(APPEND "${SCM_FILE}" "; DO NOT EDIT THIS FILE! This file was automatically\n")
@@ -128,17 +142,6 @@
             FILE(APPEND "${SCM_FILE}" "\t(apply cog-new-link (append (list '${TYPE_NAME}) x)))\n")
         ENDIF (NOT ISNODE STREQUAL "NODE" AND NOT ISLINK STREQUAL "LINK")

-        # We need to touch the class-server before doing anything.
-        # This is in order to guarantee that the main atomspace types
-        # get created before other derived types.
-        #
-        # There's still a potentially nasty bug here: if some third types.script
-        # file depends on types defined in a second file, but the third initializer
-        # runs before the second, then any atoms in that third file that inherit
-        # from the second will get a type of zero.  This will crash code later on.
-        # The only fix for this is to make sure that the third script forces the
-        # initailzers for the second one to run first. :-(
-        FILE(APPEND "${INHERITANCE_FILE}" "${CLASSSERVER_INSTANCE};\n")
         IF (PARENT_TYPES)
             STRING(REGEX REPLACE "[ 	]*,[ 	]*" ";" PARENT_TYPES "${PARENT_TYPES}")
             FOREACH (PARENT_TYPE ${PARENT_TYPES})


New version: 0.5.2

New version: 0.5.2

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "5")
-SET(HAWKEY_PATCH "1")
+SET(HAWKEY_PATCH "2")


Remove setting of file compile defintions on tests/validator/validator.cpp.

--- tests/validator/tests.cmake
+++ tests/validator/tests.cmake
@@ -15,8 +15,3 @@
 #set(${CURRENT_TEST}_HDRS
 #  ${CMAKE_CURRENT_LIST_DIR}/<test_header_files.h>
 #)
-if(HAVE_LIBXML2_NAMESPACE_AWARE)
-  set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/validator.cpp PROPERTIES COMPILE_DEFINITIONS HAVE_LIBXML2_NAMESPACE_AWARE)
-elseif(HAVE_LIBXML2_NAMESPACE_UNKNOWN)
-  set_source_files_properties(${CMAKE_CURRENT_LIST_DIR}/validator.cpp PROPERTIES COMPILE_DEFINITIONS HAVE_LIBXML2_NAMESPACE_UNKNOWN)
-endif()


FindGROMACS.cmake: Only set GROMACS_DEFINITIONS if GROMACS_LIBRARY was found

--- CMakeModules/FindGROMACS.cmake
+++ CMakeModules/FindGROMACS.cmake
@@ -41,18 +41,6 @@
 endif()

 pkg_check_modules(PC_GROMACS ${GROMACS_PKG})
-if ("${GROMACS_PKG}" MATCHES "_d$")
-  list(APPEND GMX_DEFS "-DGMX_DOUBLE")
-endif ("${GROMACS_PKG}" MATCHES "_d$")
-if (PC_GROMACS_CFLAGS_OTHER)
-  foreach(DEF ${PC_GROMACS_CFLAGS_OTHER})
-    if (${DEF} MATCHES "^-D")
-      list(APPEND GMX_DEFS ${DEF})
-    endif (${DEF} MATCHES "^-D")
-  endforeach(DEF)
-  list(REMOVE_DUPLICATES GMX_DEFS)
-endif (PC_GROMACS_CFLAGS_OTHER)
-set(GROMACS_DEFINITIONS "${GMX_DEFS}" CACHE STRING "extra GROMACS definitions")

 find_library(GROMACS_LIBRARY NAMES ${GROMACS_LIBRARY_NAME} HINTS ${PC_GROMACS_LIBRARY_DIRS} )
 if (GROMACS_LIBRARY)
@@ -99,6 +87,21 @@
       ( (NOT ${GROMACS_LIBRARY} MATCHES "lib[^/]*_d\\.[^.]*$") AND (    "${GROMACS_PKG}" MATCHES "_d$") ) )
       message(WARNING "You are using ${GROMACS_LIBRARY}, but GROMACS_PKG was ${GROMACS_PKG}. There seems to be a mismatch in precision, single vs double, no ending vs. _d. If this is not the case ignore this warning otherwise enable set GROMACS_PKG correctly using -DGROMACS_PKG_OVERWRITE=lib(gmx|gromacs)(_d).")
   endif()
+
+  #Only set GROMACS_DEFINITIONS if GROMACS_LIBRARY was found
+  if ("${GROMACS_PKG}" MATCHES "_d$")
+    list(APPEND GMX_DEFS "-DGMX_DOUBLE")
+  endif ("${GROMACS_PKG}" MATCHES "_d$")
+  if (PC_GROMACS_CFLAGS_OTHER)
+    foreach(DEF ${PC_GROMACS_CFLAGS_OTHER})
+      if (${DEF} MATCHES "^-D")
+        list(APPEND GMX_DEFS ${DEF})
+      endif (${DEF} MATCHES "^-D")
+    endforeach(DEF)
+    list(REMOVE_DUPLICATES GMX_DEFS)
+  endif (PC_GROMACS_CFLAGS_OTHER)
+  set(GROMACS_DEFINITIONS "${GMX_DEFS}" CACHE STRING "extra GROMACS definitions")
+
 else(GROMACS_LIBRARY)
   set(GMX_VERSION 45)
 endif (GROMACS_LIBRARY)


Makes COMPONENT_LIB available for mock components

- COMPONENT_LIB wasn't available for parent scope

--- tools/cmake/component.cmake
+++ tools/cmake/component.cmake
@@ -564,6 +564,8 @@
                         INCLUDE_DIRS ${__INCLUDE_DIRS}
                         REQUIRES ${__REQUIRES})

+
+    set(COMPONENT_LIB ${COMPONENT_LIB} PARENT_SCOPE)
     add_custom_command(
         OUTPUT ruby_found SYMBOLIC
         COMMAND "ruby" "-v"


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/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   14)
+SET(KWSYS_DATE_STAMP_DAY   15)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/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   20)
+SET(KWSYS_DATE_STAMP_DAY   21)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

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


Fix incorrect SETTINGS_STR variable use

Fix incorrect SETTINGS_STR variable use

The SETTINGS_STR variable should be _SETTINGS ${_SETTINGS} for GCC and AppleClang sections of conan_cmake_settings function.

--- conan.cmake
+++ conan.cmake
@@ -26,13 +26,13 @@
     string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
     list(GET VERSION_LIST 0 MAJOR)
     list(GET VERSION_LIST 1 MINOR)
-    set(SETTINGS_STR -s compiler=gcc -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libstdc++)
+    set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libstdc++)
   elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
       # using AppleClang
       string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
       list(GET VERSION_LIST 0 MAJOR)
       list(GET VERSION_LIST 1 MINOR)
-      set(SETTINGS_STR -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libc++)
+      set(_SETTINGS ${_SETTINGS} -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libc++)
   elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
       # using Clang
       string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})


Sync with SPMFW

Sync with SPMFW

(Closes #40)

--- cmakemodules/FindSuiteSparse.cmake
+++ cmakemodules/FindSuiteSparse.cmake
@@ -99,11 +99,11 @@

 	## On windows : we absolutly need SuiteSparse_config.h every time for all projects
 	if(WIN32)
-		list(FIND SuiteSparse_FIND_COMPONENTS "SuiteSparse_config" SS_config_index)
+		list(FIND SuiteSparse_FIND_COMPONENTS "suitesparseconfig" SS_config_index)
 		if(${SS_config_index} MATCHES "-1")
-			list(APPEND SuiteSparse_FIND_COMPONENTS SuiteSparse_config)
+			list(APPEND SuiteSparse_FIND_COMPONENTS suitesparseconfig)
 			if(SuiteSparse_VERBOSE)
-				message(STATUS "   On windows, we absolutly need SuiteSparse_config.h every time for all projects : add SuiteSparse_config component to look for")
+				message(STATUS "   On windows, we absolutly need SuiteSparse_config.h every time for all projects : add suitesparseconfig component to look for")
 			endif()
 		endif()
 	endif()
@@ -269,7 +269,7 @@

 ## Default behavior if user don't use the COMPONENTS flag in find_package(SuiteSparse ...) command
 if(NOT SuiteSparse_FIND_COMPONENTS)
-	list(APPEND SuiteSparse_FIND_COMPONENTS AMD CAMD CCOLAMD COLAMD CHOLMOD SPQR LDL BTF KLU CXSPARSE)  ## suitesparse and metis are not searched by default (special case)
+	list(APPEND SuiteSparse_FIND_COMPONENTS AMD CAMD CCOLAMD COLAMD CHOLMOD SPQR LDL BTF KLU CXSPARSE UMFPACK)  ## suitesparse and metis are not searched by default (special case)
 endif()

 SuiteSparse_FIND_COMPONENTS()


Replaced the logic to use VARIANT variable instead.

The CMAKE_CROSSCOMPILING variable cannot be used here because it will be always false since 'buildvm-*' is only built natively (not cross-compiling).

--- Source/ThirdParty/LuaJIT/DetectTargetArchitecture.cmake
+++ Source/ThirdParty/LuaJIT/DetectTargetArchitecture.cmake
@@ -57,26 +57,25 @@
 else ()
     execute_process (COMMAND uname -s OUTPUT_VARIABLE HOST_SYS ERROR_QUIET)
 endif ()
-if (CMAKE_CROSSCOMPILING OR IOS)
-    if (IOS)
+if (VARIANT)
+    if (VARIANT MATCHES ios)
         set (TARGET_SYS iOS)
+    elseif (VARIANT MATCHES android|raspi)
+        set (TARGET_SYS Linux)
+    else ()
+        message (FATAL_ERROR "Unsupported buildvm variant: ${VARIANT}")
+    endif ()
+    # Makefile: ifneq ($(HOST_SYS),$(TARGET_SYS))
+    if (TARGET_SYS STREQUAL Windows)
+        set (HOST_XCFLAGS ${HOST_XCFLAGS} -malign-double -DLUAJIT_OS=LUAJIT_OS_WINDOWS)
+    elseif (TARGET_SYS STREQUAL Linux)
+        set (HOST_XCFLAGS ${HOST_XCFLAGS} -DLUAJIT_OS=LUAJIT_OS_LINUX)
+    elseif (TARGET_SYS MATCHES Darwin|iOS)
         set (HOST_XCFLAGS ${HOST_XCFLAGS} -DLUAJIT_OS=LUAJIT_OS_OSX)
     else ()
-        if (NOT TARGET_SYS)
-            set (TARGET_SYS ${CMAKE_SYSTEM_NAME})
-        endif ()
-        if (TARGET_SYS STREQUAL Windows)
-            set (HOST_XCFLAGS ${HOST_XCFLAGS} -malign-double -DLUAJIT_OS=LUAJIT_OS_WINDOWS)
-        elseif (TARGET_SYS STREQUAL Linux)
-            set (HOST_XCFLAGS ${HOST_XCFLAGS} -DLUAJIT_OS=LUAJIT_OS_LINUX)
-        elseif (TARGET_SYS STREQUAL Darwin)
-            set (HOST_XCFLAGS ${HOST_XCFLAGS} -DLUAJIT_OS=LUAJIT_OS_OSX)
-        else ()
-            set (HOST_XCFLAGS ${HOST_XCFLAGS} -DLUAJIT_OS=LUAJIT_OS_OTHER)
-        endif ()
+        set (HOST_XCFLAGS ${HOST_XCFLAGS} -DLUAJIT_OS=LUAJIT_OS_OTHER)
     endif ()
 else ()
-    # Not cross compiling
     set (TARGET_SYS ${HOST_SYS})
 endif ()

@@ -93,7 +92,8 @@
         set (ARCH_BITS 32)
     endif ()
 endif ()
-if (TARGET_LJARCH STREQUAL x64)
+if (VARIANT)
+    string (REGEX REPLACE "-m(32|64) *" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
     set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m${ARCH_BITS}")
 endif ()


install: remove BIT_TO_BIN from install

install: remove BIT_TO_BIN from install

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- xc/common/cmake/arch_define.cmake
+++ xc/common/cmake/arch_define.cmake
@@ -182,7 +182,6 @@
       ARCH ${ARCH}
       ROUTE_CHAN_WIDTH 500
       VPR_ARCH_ARGS ${VPR_ARCH_ARGS}
-      BIT_TO_BIN xc7frames2bit
       CONV_SCRIPT ${YOSYS_CONV_SCRIPT}
       SYNTH_SCRIPT ${YOSYS_SYNTH_SCRIPT})


Customize LINK_THIRDPARTY_xxx for FreeImage and gflags

--- ThirdParties.cmake
+++ ThirdParties.cmake
@@ -12,11 +12,20 @@
 ENDFUNCTION(LINK_THIRDPARTY_EXT)

 FUNCTION(LINK_THIRDPARTY_FREE_IMAGE project)
-  LINK_THIRDPARTY_EXT(${project} freeimage libFreeImage)
+  IF(MSVC)
+    TARGET_LINK_LIBRARIES(${project} debug FreeImaged.lib optimized FreeImage.lib)
+    ADD_DEPENDENCIES(${project} FreeImage)
+  ELSE()
+    LINK_THIRDPARTY_EXT(${project} freeimage libFreeImage)
+  ENDIF(MSVC)
 ENDFUNCTION(LINK_THIRDPARTY_FREE_IMAGE)

 FUNCTION(LINK_THIRDPARTY_GFLAGS project)
-  LINK_THIRDPARTY_EXT(${project} gflags libgflags)
+  IF(MSVC)
+    ADD_DEPENDENCIES(${project} gflags-ext)
+  ELSE()
+    LINK_THIRDPARTY_EXT(${project} gflags libgflags)
+  ENDIF(MSVC)
 ENDFUNCTION(LINK_THIRDPARTY_GFLAGS)

 FUNCTION(LINK_THIRDPARTY_GLOG project)


Easier to use local cookoff repos in other projects

--- LookUp-GreatCMakeCookOff.cmake
+++ LookUp-GreatCMakeCookOff.cmake
@@ -30,11 +30,13 @@
       OUTPUT_QUIET
     )
   endif()
+  if(NOT COOKOFF_GITREPO)
+      set(COOKOFF_GITREPO https://github.com/UCL/GreatCMakeCookOff.git)
+  endif()
   execute_process(
-    COMMAND ${GIT_EXECUTABLE} clone
-         https://github.com/UCL/GreatCMakeCookOff.git
+    COMMAND ${GIT_EXECUTABLE} clone "${COOKOFF_GITREPO}"
          -b refactor
-         ${COOKOFF_DOWNLOAD_DIR}
+         "${COOKOFF_DOWNLOAD_DIR}"
     RESULT_VARIABLE CLONING_COOKOFF
     OUTPUT_QUIET
     ERROR_VARIABLE CLONING_ERROR


Support clang 10.0 (appleclang) and higher (#4302)

--- SetFlags.cmake
+++ SetFlags.cmake
@@ -26,7 +26,7 @@
 	execute_process(
 		COMMAND "${CMAKE_CXX_COMPILER}" "--version"
 		OUTPUT_VARIABLE CLANG_VERSION_OUTPUT)
-	string(REGEX MATCH "version ([0-9]\\.[0-9])" x ${CLANG_VERSION_OUTPUT})
+	string(REGEX MATCH "version ([0-9]+\\.[0-9]+)" x ${CLANG_VERSION_OUTPUT})
 	set(CLANG_VERSION ${CMAKE_MATCH_1})
 endmacro()

@@ -91,7 +91,7 @@
 		set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11")
 		set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} -std=c++11")
 		set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11")
-
+
 		add_flags_cxx("-fsigned-char")
 	else()
 		# Let gcc / clang know that we're compiling a multi-threaded app:


DOC: Improve factory registration disablement doc

--- CMake/ITKFactoryRegistration.cmake
+++ CMake/ITKFactoryRegistration.cmake
@@ -49,8 +49,10 @@
 # Disabling static registration
 # -----------------------------
 #
-# Setting variable `ITK_NO_<factory_name_uc>_FACTORY_REGISTER_MANAGER` to `OFF` prior calling
+# Setting variable `ITK_NO_<factory_name_uc>_FACTORY_REGISTER_MANAGER` to `ON` prior calling
 # `include(${ITK_USE_FILE})` disables the static registration.
+# Here <factory_name_uc> is the upper case name of the factory. For example,
+# `IMAGEIO`, `MESHIO`, `TRANSFORMIO`, or `FFT`.
 #
 # All factories can be disabled with the following CMake code:
 #  foreach(_factory_name ${ITK_FACTORY_LIST})


Issue #12: Set installed library path.

Issue #12: Set installed library path.

--- CMake/mpCreateGuiApplication.cmake
+++ CMake/mpCreateGuiApplication.cmake
@@ -31,15 +31,20 @@
           RUNTIME DESTINATION bin COMPONENT Runtime
          )

-  set(_qt_conf_plugin_install_prefix .)
+  set(_qt_conf_plugin_install_prefix "Prefix=.")
   if(APPLE)
-    set(_qt_conf_plugin_install_prefix ./MacOS)
+    set(_qt_conf_plugin_install_prefix "Prefix=./MacOS")
   endif()

+  set(_qt_conf_lib_prefix)
+  if(NOT APPLE)
+    set(_qt_conf_lib_prefix "Libraries=.")
+  endif()
   install(CODE "
           file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"
   [Paths]
-  Prefix=${_qt_conf_plugin_install_prefix}
+  ${_qt_conf_plugin_install_prefix}
+  ${_qt_conf_lib_prefix}
   \")" COMPONENT Runtime)


Don't bother with d3d11

Don't bother with d3d11

--- CMakeModules/install/windows.cmake
+++ CMakeModules/install/windows.cmake
@@ -105,11 +105,7 @@
 if(EXISTS ${OGRE_Overlay_BINARY_REL})
     install(FILES ${OGRE_Overlay_BINARY_REL} DESTINATION bin CONFIGURATIONS Release RelWithDebInfo MinSizeRel)
 endif()
-if(EXISTS ${OGRE_RenderSystem_Direct3D11_REL})
-    install(FILES ${OGRE_RenderSystem_Direct3D11_REL} DESTINATION bin CONFIGURATIONS Release RelWithDebInfo MinSizeRel)
-else()
-    set(OGRE_COMMENT_RENDERSYSTEM_D3D11_REL "#")
-endif()
+set(OGRE_COMMENT_RENDERSYSTEM_D3D11_REL "#")
 if(EXISTS ${OGRE_RenderSystem_Direct3D9_REL})
     install(FILES ${OGRE_RenderSystem_Direct3D9_REL} DESTINATION bin CONFIGURATIONS Release RelWithDebInfo MinSizeRel)
 else()


- Fix settings for AR/LD/NM/RANLIB for NaCL toolchain

--- cmake/Toolchains/linux-nativeclient_linux.toolchain.cmake
+++ cmake/Toolchains/linux-nativeclient_linux.toolchain.cmake
@@ -36,6 +36,10 @@
 set(CMAKE_ASM_COMPILER ${NACL_PATH}/toolchain/${NACL_HOST}/bin/${NACL_TAG}-as )
 set(CMAKE_C_COMPILER   ${NACL_PATH}/toolchain/${NACL_HOST}/bin/${NACL_TAG}-clang )
 set(CMAKE_CXX_COMPILER ${NACL_PATH}/toolchain/${NACL_HOST}/bin/${NACL_TAG}-clang++ )
+set(CMAKE_AR ${NACL_PATH}/toolchain/${NACL_HOST}/bin/${NACL_TAG}-ar CACHE FILEPATH "")
+set(CMAKE_NM ${NACL_PATH}/toolchain/${NACL_HOST}/bin/${NACL_TAG}-nm CACHE FILEPATH "")
+set(CMAKE_RANLIB ${NACL_PATH}/toolchain/${NACL_HOST}/bin/${NACL_TAG}-ranlib CACHE FILEPATH "")
+set(CMAKE_LINKER ${NACL_PATH}/toolchain/${NACL_HOST}/bin/${NACL_TAG}-ld CACHE FILEPATH "")

 set(CMAKE_C_FLAGS
 #	"--prefix=${NACL_PATH}/cross/armv7a --exec_prefix=${NACL_PATH}/cross/armv7a #--with-mpfr=${NACL_PATH}/staging/i686-linux/usr"


Removed -fpermissive from visual studio builds.

git-svn-id: b7791fb0f5d07d96612766859ad70a13be88ea96@2138 305cdda6-5ce1-45b3-a98d-dfc68c8b3305

--- library/NektarCommon.cmake
+++ library/NektarCommon.cmake
@@ -163,11 +163,15 @@
         SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "/wd4521 /wd4522 /wd4351 /wd4018")
     ENDIF( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005" OR ${CMAKE_GENERATOR} STREQUAL "Visual Studio 9 2008" )

+    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DNEKTAR_DEBUG")
+
     IF ( NEKTAR_FULL_DEBUG )
-        SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DNEKTAR_DEBUG -DNEKTAR_FULLDEBUG")
-    ELSE( NEKTAR_FULL_DEBUG )
-        SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DNEKTAR_DEBUG -fpermissive")
-    ENDIF( NEKTAR_FULL_DEBUG )
+        SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DNEKTAR_FULLDEBUG")
+    ENDIF()
+
+    IF( NOT MSVC )
+        SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fpermissive")
+    ENDIF()

     SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNEKTAR_RELEASE")


Some more fixes/cleanup for zlib.

Some more fixes/cleanup for zlib.

--- VAD_ZLIB.cmake
+++ VAD_ZLIB.cmake
@@ -1,37 +1,44 @@
 set(GIT_REPO "https://github.com/madler/zlib.git")

 function(vad_live NAME)
-  git_clone(${VAD_${NAME}_GIT_REPO} ZLIB)
-  add_subdirectory("${VAD_EXTERNAL_ROOT}/ZLIB" "${VAD_EXTERNAL_ROOT}/ZLIB/build_external_dep")
-  add_library(ZLIB INTERFACE)
-  # The ZLIB library provides two public includes, zconf.h and zlib.h. In the live build
-  # they sit in different directories.
-  list(APPEND _ZLIB_INCLUDE_DIRS "${VAD_EXTERNAL_ROOT}/ZLIB" "${VAD_EXTERNAL_ROOT}/ZLIB/build_external_dep")
-  set_property(TARGET ZLIB PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_ZLIB_INCLUDE_DIRS})
-  if(VAD_PREFER_STATIC OR VAD_ZLIB_PREFER_STATIC)
-      set_target_properties(ZLIB PROPERTIES INTERFACE_LINK_LIBRARIES zlibstatic)
-  else()
-      set_target_properties(ZLIB PROPERTIES INTERFACE_LINK_LIBRARIES zlib)
-  endif()
-  add_library(ZLIB::ZLIB ALIAS ZLIB)
-  set(ZLIB_FOUND TRUE CACHE INTERNAL "")
-  message(STATUS "Setting ZLIB_INCLUDE_DIRS to '${_ZLIB_INCLUDE_DIRS}'.")
-  set(ZLIB_INCLUDE_DIRS "${_ZLIB_INCLUDE_DIRS}" CACHE PATH "")
-  message(STATUS "Setting ZLIB_LIBRARIES to the zlib target from the live dependency.")
-  if(VAD_PREFER_STATIC OR VAD_ZLIB_PREFER_STATIC)
-    set(ZLIB_LIBRARIES zlibstatic CACHE FILEPATH "")
-  else()
-    set(ZLIB_LIBRARIES zlib CACHE FILEPATH "")
-  endif()
-  # The zlib build system does not correctly set the include path for its executables when zlib
-  # is built as a sub project. Fix it by adding explicitly the missing path.
-  function(_zlib_exec_fix_include_dir TRG)
-    get_property(_include_dir TARGET ${TRG} PROPERTY INCLUDE_DIRECTORIES)
-    list(APPEND _include_dir "${VAD_EXTERNAL_ROOT}/ZLIB")
-    set_property(TARGET ${TRG} PROPERTY INCLUDE_DIRECTORIES ${_include_dir})
-  endfunction()
-  _zlib_exec_fix_include_dir(minigzip)
-  _zlib_exec_fix_include_dir(example)
-  _zlib_exec_fix_include_dir(example64)
-  _zlib_exec_fix_include_dir(minigzip64)
+    # Clone and add the subdirectory.
+    git_clone(${VAD_${NAME}_GIT_REPO} ZLIB)
+    add_subdirectory("${VAD_EXTERNAL_ROOT}/ZLIB" "${VAD_EXTERNAL_ROOT}/ZLIB/build_external_dep")
+
+    # We are now going to reconstruct the targets/variables provided by the standard FindZLIB module,
+    add_library(_VAD_ZLIB_STUB INTERFACE)
+    # The ZLIB library provides two public includes, zconf.h and zlib.h. In the live build
+    # they sit in different directories.
+    list(APPEND _ZLIB_INCLUDE_DIRS "${VAD_EXTERNAL_ROOT}/ZLIB" "${VAD_EXTERNAL_ROOT}/ZLIB/build_external_dep")
+    set_property(TARGET _VAD_ZLIB_STUB PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_ZLIB_INCLUDE_DIRS})
+    if(VAD_PREFER_STATIC OR VAD_ZLIB_PREFER_STATIC)
+        set_target_properties(_VAD_ZLIB_STUB PROPERTIES INTERFACE_LINK_LIBRARIES zlibstatic)
+    else()
+        set_target_properties(_VAD_ZLIB_STUB PROPERTIES INTERFACE_LINK_LIBRARIES zlib)
+    endif()
+    # ZLIB::ZLIB is the imported target provided by FindZLIB.
+    add_library(ZLIB::ZLIB ALIAS _VAD_ZLIB_STUB)
+    set(ZLIB_FOUND TRUE CACHE INTERNAL "")
+    # Set the global variables, ZLIB_INCLUDE_DIRS and ZLIB_LIBRARIES, provided by FindZLIB.
+    message(STATUS "Setting ZLIB_INCLUDE_DIRS to '${_ZLIB_INCLUDE_DIRS}'.")
+    set(ZLIB_INCLUDE_DIRS "${_ZLIB_INCLUDE_DIRS}" CACHE PATH "")
+    if(VAD_PREFER_STATIC OR VAD_ZLIB_PREFER_STATIC)
+        message(STATUS "Setting ZLIB_LIBRARIES to the zlibstatic target from the live dependency.")
+        set(ZLIB_LIBRARIES zlibstatic CACHE FILEPATH "")
+    else()
+        message(STATUS "Setting ZLIB_LIBRARIES to the zlib target from the live dependency.")
+        set(ZLIB_LIBRARIES zlib CACHE FILEPATH "")
+    endif()
+
+    # The zlib build system does not correctly set the include path for its executables when zlib
+    # is built as a sub project. Fix it by adding explicitly the missing path.
+    function(_zlib_exec_fix_include_dir TRG)
+        get_property(_include_dir TARGET ${TRG} PROPERTY INCLUDE_DIRECTORIES)
+        list(APPEND _include_dir "${VAD_EXTERNAL_ROOT}/ZLIB")
+        set_property(TARGET ${TRG} PROPERTY INCLUDE_DIRECTORIES ${_include_dir})
+    endfunction()
+    _zlib_exec_fix_include_dir(minigzip)
+    _zlib_exec_fix_include_dir(example)
+    _zlib_exec_fix_include_dir(example64)
+    _zlib_exec_fix_include_dir(minigzip64)
 endfunction()


[CMake] Fix typo (search for TCL)

[CMake] Fix typo (search for TCL)

--- cmake/external_projects/tcltk.cmake
+++ cmake/external_projects/tcltk.cmake
@@ -92,7 +92,7 @@

   list(APPEND NETGEN_DEPENDENCIES project_win_extlibs)
 else(WIN32)
-#     find_package(TCL 8.5 REQUIRED)
+    find_package(TCL 8.5 REQUIRED)
 #     ExternalProject_Add(project_tkdnd
 #       GIT_REPOSITORY https://github.com/petasis/tkdnd.git
 #       GIT_TAG d7cfd96087b248255da5349086ef70cc4bbfb619


Added SQLite3 unrelocatable text files

Added SQLite3 unrelocatable text files

--- cmake/projects/SQLite3/hunter.cmake
+++ cmake/projects/SQLite3/hunter.cmake
@@ -25,5 +25,8 @@
 hunter_cacheable(SQLite3)
 hunter_download(
     PACKAGE_NAME SQLite3
-    PACKAGE_INTERNAL_DEPS_ID "1"
+    PACKAGE_INTERNAL_DEPS_ID "2"
+    PACKAGE_UNRELOCATABLE_TEXT_FILES
+    "lib/libsqlite3.la"
+    "lib/pkgconfig/sqlite3.pc"
 )


Revert "Added include path for MPI when mpi conduit is active."

This reverts commit 2f60c5735cb60a80f55913bc3af2f647bca1d238.

--- cmake/FindGASNet.cmake
+++ cmake/FindGASNet.cmake
@@ -158,7 +158,6 @@
     set(MPI_C_COMPILER ${_GASNet_LD})
     find_package(MPI REQUIRED COMPONENTS C)
     list(APPEND COMPONENT_DEPS ${MPI_C_LIBRARIES})
-    list(APPEND IDIRS ${MPI_C_INCLUDE_PATH})
   endif()
   add_library(GASNet::${COMPONENT_NAME} UNKNOWN IMPORTED)
   set_target_properties(GASNet::${COMPONENT_NAME} PROPERTIES


Standardize parameter names in SurgSimUtilities

Standardaize the parameter naming for surgsim_add_library,
surgsim_add_test, surgsim_add_executable.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -134,9 +134,9 @@

 # Add an executable and store the target.
 unset(SURGSIM_EXECUTABLE_TARGETS CACHE)
-macro(surgsim_add_executable NAME SOURCES HEADERS)
-	add_executable(${NAME} ${SOURCES} ${HEADERS})
-	set(SURGSIM_EXECUTABLE_TARGETS ${SURGSIM_EXECUTABLE_TARGETS} ${NAME} CACHE INTERNAL "executable targets")
+macro(surgsim_add_executable EXECUTABLE_NAME SOURCES HEADERS)
+	add_executable(${EXECUTABLE_NAME} ${SOURCES} ${HEADERS})
+	set(SURGSIM_EXECUTABLE_TARGETS ${SURGSIM_EXECUTABLE_TARGETS} ${EXECUTABLE_NAME} CACHE INTERNAL "executable targets")
 endmacro()

 option(SURGSIM_RUN_TEST_WITHIN_BUILD "This exectutes the tests directly from the chosen build system." OFF)
@@ -144,25 +144,26 @@
 # Uses UNIT_TEST_SOURCES, UNIT_TEST_HEADERS, LIBS, UNIT_TEST_SHARED_LIBS,
 # UNIT_TEST_SHARED_RELEASE_LIBS and UNIT_TEST_SHARED_DEBUG_LIBS.
 #
-macro(surgsim_add_unit_tests TESTNAME)
-	surgsim_add_executable(${TESTNAME} "${UNIT_TEST_SOURCES}" "${UNIT_TEST_HEADERS}")
-	target_link_libraries(${TESTNAME} SurgSimTesting gmock ${LIBS})
-	add_test(NAME ${TESTNAME} COMMAND ${TESTNAME} "--gtest_output=xml")
+macro(surgsim_add_unit_tests TEST_NAME)
+	add_executable(${TEST_NAME} ${UNIT_TEST_SOURCES} ${UNIT_TEST_HEADERS})
+	set(SURGSIM_EXECUTABLE_TARGETS ${SURGSIM_EXECUTABLE_TARGETS} ${TEST_NAME} CACHE INTERNAL "executable targets")
+	target_link_libraries(${TEST_NAME} SurgSimTesting gmock ${LIBS})
+	add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} "--gtest_output=xml")

 	if(SURGSIM_RUN_TEST_WITHIN_BUILD)
-        add_custom_command(TARGET ${TESTNAME} POST_BUILD
-            COMMAND ${SURGSIM_TEST_RUN_PREFIX} $<TARGET_FILE:${TESTNAME}>
+        add_custom_command(TARGET ${TEST_NAME} POST_BUILD
+            COMMAND ${SURGSIM_TEST_RUN_PREFIX} $<TARGET_FILE:${TEST_NAME}>
                 ${SURGSIM_TEST_RUN_SUFFIX}
             VERBATIM)
     endif()

 	# copy all ${UNIT_TEST_SHARED..._LIBS} to the test executable directory:
-	surgsim_copy_to_target_directory(${TESTNAME}
+	surgsim_copy_to_target_directory(${TEST_NAME}
 		${UNIT_TEST_SHARED_LIBS})
-	surgsim_copy_to_target_directory_for_release(${TESTNAME}
+	surgsim_copy_to_target_directory_for_release(${TEST_NAME}
 		${UNIT_TEST_SHARED_RELEASE_LIBS})
-	surgsim_copy_to_target_directory_for_debug(${TESTNAME}
+	surgsim_copy_to_target_directory_for_debug(${TEST_NAME}
 		${UNIT_TEST_SHARED_DEBUG_LIBS})
 	surgsim_show_ide_folders("${UNIT_TEST_SOURCES}" "${UNIT_TEST_HEADERS}")
 endmacro()
@@ -173,11 +174,11 @@
 # the appropriate directory.
 # Note that when calling this the parameters  should be quoted to separate lists
 unset(SURGSIM_EXPORT_TARGETS CACHE)
-function(surgsim_add_library LIBRARY_NAME SOURCE_FILES HEADER_FILES HEADER_DIRECTORY)
-	if (SOURCE_FILES)
-		add_library(${LIBRARY_NAME} ${SOURCE_FILES} ${HEADER_FILES})
-
-		set_target_properties(${LIBRARY_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}")
+function(surgsim_add_library LIBRARY_NAME SOURCES HEADERS HEADER_DIRECTORY)
+	if (SOURCES)
+		add_library(${LIBRARY_NAME} ${SOURCES} ${HEADERS})
+
+		set_target_properties(${LIBRARY_NAME} PROPERTIES PUBLIC_HEADER "${HEADERS}")
 		install(TARGETS ${LIBRARY_NAME}
 			EXPORT ${PROJECT_NAME}Targets
 			RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
@@ -186,10 +187,10 @@
 			PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR}/${HEADER_DIRECTORY})

 		set(SURGSIM_EXPORT_TARGETS ${LIBRARY_NAME} ${SURGSIM_EXPORT_TARGETS} CACHE INTERNAL "export targets")
-		surgsim_show_ide_folders("${SOURCE_FILES}" "${HEADER_FILES}")
+		surgsim_show_ide_folders("${SOURCES}" "${HEADERS}")
 	else()
-		install(FILES ${HEADER_FILES} DESTINATION ${INSTALL_INCLUDE_DIR}/${HEADER_DIRECTORY})
-		surgsim_show_ide_folders("" "${HEADER_FILES}")
+		install(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDE_DIR}/${HEADER_DIRECTORY})
+		surgsim_show_ide_folders("" "${HEADERS}")
 	endif()
 endfunction()


Fix packaging error on Ubuntu with system Qt

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -137,11 +137,25 @@
       MITK_INSTALL(PROGRAMS "${_qmake_path}/../libexec/QtWebEngineProcess")
     endif()

-    MITK_INSTALL(DIRECTORY "${_qmake_path}/../resources")
+    # make sure resources and translations exist and try system location as well
+    if(EXISTS "${_qmake_path}/../resources")
+      MITK_INSTALL(DIRECTORY "${_qmake_path}/../resources")
+    elseif(EXISTS "/usr/share/qt5/resources")
+      MITK_INSTALL(DIRECTORY "/usr/share/qt5/resources")
+    else()
+      message(WARNING "No webengine resources found!")
+    endif()

     set(_install_DESTINATION "translations")
-    MITK_INSTALL(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales")
-  endif()
+    if(EXISTS "${_qmake_path}/../translations/qtwebengine_locales")
+      MITK_INSTALL(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales")
+    elseif(EXISTS "/usr/share/qt5/translations/qtwebengine_locales")
+      MITK_INSTALL(DIRECTORY "/usr/share/qt5/translations/qtwebengine_locales")
+    else()
+      message(WARNING "No webengine translations found!")
+    endif()
+
+   endif()
 endif()

 set(_install_DESTINATION "")


BAckup. Removed debug printout from sheaves/component_defs

--- sheaves/component_definitions.cmake
+++ sheaves/component_definitions.cmake
@@ -226,7 +226,7 @@
         message(STATUS "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/\$(OutDir)/${${COMPONENT}_JAVA_BINDING_JAR}")
         set_target_properties(${PROJECT_NAME}_java_binding.jar PROPERTIES FOLDER "Library Jars")
         mark_as_advanced(FORCE ${COMPONENT}_CLASSPATH)
-message(STATUS "In Sheaves, OUTDIR is: ${OUTDIR}")
+
         # Java documentation
         add_custom_target(${PROJECT_NAME}-java-docs EXCLUDE_FROM_ALL
                     COMMAND ${JDK_BIN_DIR}/javadoc -quiet -classpath ${${COMPONENT}_CLASSPATH}


changed RelWithDebInfo config on Windows to not auto-inline, for easier debugging.

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -46,7 +46,7 @@
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1"
       CACHE STRING "C++ compiler debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
-      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob2 -D_SECURE_STL=0"
+      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob0 -D_SECURE_STL=0"
       CACHE STRING "C++ compiler release-with-debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELEASE
       "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"


x11_egl: use correct cmake variable name for GLES1 include path

This commit reverts most of 7b4a66f99 that included a hack to search
for include directory next to the library path. This was invalid since
used variable name PKG_GLES1_INCLUDE_DIRS is false, correct name is
GLES1_INCLUDE_DIRS which is properly set by the PKG_CHECK_MODULES call.

This change has been succesfully tested on Fedora and Ubuntu distros by
setting up a custom PKG_CONFIG_PATH.

VK-GL-CTS issue: 1573

Change-Id: I158d816d28f5bbf30288f6226bd5c9e30cf85285
Signed-off-by: Tapani Pälli <cdcb67a5e49297de94340ca09f25994bd5e7f762@intel.com>

--- targets/x11_egl/x11_egl.cmake
+++ targets/x11_egl/x11_egl.cmake
@@ -39,16 +39,7 @@
 	set(DEQP_SUPPORT_GLES1	ON)
 	set(DEQP_GLES1_LIBRARIES ${GLES1_LIBRARIES})
 	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${GLES1_LIBRARY_DIRS}")
-	if ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
-		# PKG_GLES1_INCLUDE_DIRS empty, see if matching include
-		# path (GLES/gl.h) exists beside library directory
-		set(GLES1_INCLUDE "${GLES1_LIBDIR}/../include")
-		if (EXISTS ${GLES1_INCLUDE}/GLES/gl.h)
-			include_directories(${GLES1_INCLUDE})
-		else()
-			message(FATAL_ERROR "Could not find include path for GLES1 headers")
-		endif (EXISTS ${GLES1_INCLUDE}/GLES/gl.h)
-	endif ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
+	include_directories(${GLES1_INCLUDE_DIRS})
 endif (GLES1_LIBRARIES)

 set(DEQP_PLATFORM_LIBRARIES ${X11_LIBRARIES})


switched to forked repo to test build with GT dependecy

--- version_config.cmake
+++ version_config.cmake
@@ -178,10 +178,12 @@
 # with devel build it uses latest version of upstream packages
 # otherwise uses the versions for current SIRF

-set(DEFAULT_SIRF_URL https://github.com/SyneRBI/SIRF )
+#set(DEFAULT_SIRF_URL https://github.com/SyneRBI/SIRF )
+set(DEFAULT_SIRF_URL https://github.com/johannesmayer/SIRF.git )
 if (DEVEL_BUILD)

-  set (DEFAULT_SIRF_TAG origin/master)
+  #set (DEFAULT_SIRF_TAG origin/master)
+  set (DEFAULT_SIRF_TAG origin/rpe-encoding)
   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )
   set(DEFAULT_STIR_TAG origin/master)


add field_io test to CTest script

add field_io test to CTest script

--- test/testing.cmake
+++ test/testing.cmake
@@ -33,6 +33,10 @@
   ${MESHES}/cube/cube.dmg
   ${MESHES}/cube/pumi11/cube.smb
   render_ascii_test)
+mpi_test(field_io 1
+  ./field_io
+  ${MESHES}/cube/cube.dmg
+  ${MESHES}/cube/pumi11/cube.smb)

 set(MDIR ${MESHES}/fun3d)
 mpi_test(inviscid_ugrid 1


Verify also ldflags for -framework

Verify also ldflags for -framework

--- cmake/modules/hunter_pkgconfig_export_target.cmake
+++ cmake/modules/hunter_pkgconfig_export_target.cmake
@@ -59,7 +59,9 @@
       "PKG_CONFIG_MODULE ${PKG_CONFIG_MODULE} LDFLAGS: ${${PKG_CONFIG_PREFIX}_LDFLAGS}"
   )
   if(NOT "${${PKG_CONFIG_PREFIX}_LDFLAGS}" STREQUAL "")
-    list(APPEND link_libs ${${PKG_CONFIG_PREFIX}_LDFLAGS})
+    # turn "-framework;A;-framework;B" into "-framework A;-framework B"
+    string(REPLACE "-framework;" "-framework " ldflags "${${PKG_CONFIG_PREFIX}_LDFLAGS}")
+    list(APPEND link_libs ${ldflags})
   endif()

   hunter_status_debug(


update ActiveMQ URL

update ActiveMQ URL

--- projects/activemqcpp.cmake
+++ projects/activemqcpp.cmake
@@ -15,8 +15,7 @@
   GIT_UPSTREAM git://github.com/apache/${PROJ}.git
   GIT_TAG xp-${VER} # what to 'git checkout'
   GIT_REF ${PROJ}-${VER} # create patch from this tag to 'git checkout'
-  # Download ActiveMQ-CPP following links at http://activemq.apache.org/cms/download.html (mirrors)
-  DLURL http://mirrors.koehn.com/apache/activemq/${PROJ}/${VER}/${PROJ}-library-${VER}-src.tar.gz
+  DLURL https://archive.apache.org/dist/activemq/${PROJ}/${VER}/${PROJ}-library-${VER}-src.tar.gz
   DLMD5 414ac7de16d305058c7f0e2a333a5960
   PATCH ${PATCH_DIR}/activemqcpp.patch
   # TRICKY: PATCH_STRIP because the repo has an extra level of directories that the .tar.gz file doesn't have


On Windows, need at least v1.8.2 of ISPC for --dllexport

--- cmake/ispc.cmake
+++ cmake/ispc.cmake
@@ -14,13 +14,12 @@
 ## limitations under the License.                                           ##
 ## ======================================================================== ##

-SET(ISPC_VERSION_REQUIRED "1.8.1")
-
-# warn about recommended ISPC version on KNC
-IF (OSPRAY_MIC AND NOT OSPRAY_WARNED_MIC_ISPC_VERSION)
-  MESSAGE("Warning: use of ISPC v1.8.1 is recommended on KNC.")
-  SET(OSPRAY_WARNED_MIC_ISPC_VERSION ON CACHE INTERNAL "Warned about recommended ISPC version with KNC.")
-ENDIF()
+IF(WIN32)
+  SET(ISPC_VERSION_REQUIRED "1.8.2")
+ELSE()
+  SET(ISPC_VERSION_REQUIRED "1.8.1")
+ENDIF()
+SET(ISPC_VERSION_RECOMMENDED_KNC "1.8.1")

 IF (NOT ISPC_EXECUTABLE)
   # try sibling folder as hint for path of ISPC
@@ -60,6 +59,13 @@
   SET(ISPC_VERSION ${ISPC_VERSION} CACHE STRING "ISPC Version")
   MARK_AS_ADVANCED(ISPC_VERSION)
   MARK_AS_ADVANCED(ISPC_EXECUTABLE)
+ENDIF()
+
+# warn about recommended ISPC version on KNC
+IF (OSPRAY_MIC AND NOT ISPC_VERSION VERSION_EQUAL ISPC_VERSION_RECOMMENDED_KNC
+    AND NOT OSPRAY_WARNED_KNC_ISPC_VERSION)
+  MESSAGE("Warning: use of ISPC v${ISPC_VERSION_RECOMMENDED_KNC} is recommended on KNC.")
+  SET(OSPRAY_WARNED_KNC_ISPC_VERSION ON CACHE INTERNAL "Warned about recommended ISPC version with KNC.")
 ENDIF()

 GET_FILENAME_COMPONENT(ISPC_DIR ${ISPC_EXECUTABLE} PATH)
@@ -118,11 +124,7 @@
     SET(ISPC_OPT_FLAGS -O2 -g)
   ENDIF()

-  IF (WIN32)
-   IF(ISPC_DLLEXPORT) # workaround for bug #1085 in ISPC 1.8.2: ospray_embree should export, but export in ospray cause link errors
-    SET(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --dllexport)
-   ENDIF()
-  ELSE()
+  IF (NOT WIN32)
     SET(ISPC_ADDITIONAL_ARGS ${ISPC_ADDITIONAL_ARGS} --pic)
   ENDIF()


go back to zlib 1.2.8

go back to zlib 1.2.8

--- cmake/zlib.cmake
+++ cmake/zlib.cmake
@@ -10,8 +10,8 @@
   set(zlib_source  "${CMAKE_CURRENT_BINARY_DIR}/zlib-src")
   set(zlib_build   "${CMAKE_CURRENT_BINARY_DIR}/zlib")
   set(zlib_install "${CMAKE_CURRENT_BINARY_DIR}/prefix")
-  set(zlib_file "http://zlib.net/zlib1210.zip")
-  set(zlib_md5 "5327bdff96926cf9c479008bae983bc0")
+  set(zlib_file "http://zlib.net/fossils/zlib-1.2.8.tar.gz")
+  set(zlib_md5 "44d667c142d7cda120332623eab69f40")

   if(CMAKE_CFG_INTDIR STREQUAL ".")
     set(zlib_build_type ${CMAKE_BUILD_TYPE})


Update CppUTestConfigurationOptions.cmake

setting LONGLONG to OFF

--- cmake/Modules/CppUTestConfigurationOptions.cmake
+++ cmake/Modules/CppUTestConfigurationOptions.cmake
@@ -16,6 +16,7 @@
 elseif (BORLAND)
     set(CPP_PLATFORM Borland)
     set(MEMORY_LEAK_DETECTION False)
+    set(LONGLONG OFF)
     set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -w-8008 -w-8066")
 elseif (STD_C)
     if(NOT CPP_PLATFORM)