Add python libs to the bundle before running fixup script

This allows the fixup script to fix up numpy and scipy libraries.

--- projects/apple/tomviz.bundle.cmake
+++ projects/apple/tomviz.bundle.cmake
@@ -21,6 +21,11 @@
          USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
          \"${install_location}/Applications/paraview.app/Contents/Libraries/\")

+    # install all python modules/packages for numpy and pyfftw.
+    file(INSTALL DESTINATION \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Python/\"
+         USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
+         \"${install_location}/lib/python2.7/site-packages/\")
+
     # at this point, the installed bundle should have the libraries that need to
     # be 'fixed' using otool.
     execute_process(
@@ -28,11 +33,6 @@
                \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/tomviz.app\"
                \"${install_location}/lib\"
                \"${install_location}/plugins\")
-
-    # install all python modules/packages for numpy and pyfftw.
-    file(INSTALL DESTINATION \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Python/\"
-         USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
-         \"${install_location}/lib/python2.7/site-packages/\")
    "
    COMPONENT superbuild)


Set SITK_UNDEFINED_SYMBOLS_ALLOWED in language projects

Building Python as a stand alone project on manylinux docker image was
causing a CMake failure due to missing Python libraries. The above
variable was being used before it was set. With the call to the
necessary CMake function it is now getting set.

--- CMake/sitkProjectLanguageCommon.cmake
+++ CMake/sitkProjectLanguageCommon.cmake
@@ -104,6 +104,11 @@
 set ( CMAKE_SWIG_GLOBAL_FLAGS -I${SimpleITK_WRAPPING_COMMON_DIR} ${CMAKE_SWIG_GLOBAL_FLAGS} )

 include(sitkTargetLinkLibrariesWithDynamicLookup)
+sitk_check_dynamic_lookup(MODULE
+  SHARED
+  SITK_UNDEFINED_SYMBOLS_ALLOWED
+  )
+
 include(sitkStripOption)
 include(sitkForbidDownloadsOption)
 include(sitkSITKLegacyNaming)


ERR: type in endif.

ERR: type in endif.

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -134,5 +134,5 @@

 IF (OPENGL_INCLUDE_PATH)
   INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_PATH})
-ENDIF(NOT WIN32)
+ENDIF(OPENGL_INCLUDE_PATH)


Update to latest Matchpoint version

Update to latest Matchpoint version

Test Plan: manual

Reviewers: kislinsk, O1 MITK Core!

Maniphest Tasks: T26270

Differential Revision: https://phabricator.mitk.org/D199

--- CMakeExternals/MatchPoint.cmake
+++ CMakeExternals/MatchPoint.cmake
@@ -26,8 +26,8 @@
       set(download_step SOURCE_DIR ${MatchPoint_SOURCE_DIR})
     else()
       set(download_step
-          URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/MatchPoint_rev_24ef6072.tar.gz
-          URL_MD5 b0a0d7d63da5071db8e73dd6e6b4db7c
+          URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/MatchPoint_rev_f2a64255.tar.gz
+          URL_MD5 4407836f85e6382e65c9d3a4bd79c370
          )
     endif()


ENH: don't report patchelf on platform other than GNU/Linux

--- Packaging/check_cmake_variables.cmake
+++ Packaging/check_cmake_variables.cmake
@@ -26,6 +26,7 @@
   if(LINUX)
     list(APPEND required_vars FILE_COMMAND)
     list(APPEND required_vars READLINK)
+    list(APPEND required_vars  PATCHELF_PROGRAM)
   endif()

   if(WIN32)
@@ -33,7 +34,6 @@
   endif()
   foreach(req
       ${required_vars}
-      PATCHELF_PROGRAM
       PKG_STAGE_DIR
       QT_TRANSLATIONS_DIR
       SUPERBUILD_BINARY_DIR


Fix for code coverage script to be used with CMake 2.8.12.

--- external/cmake_modules/UseCodeCoverage.cmake
+++ external/cmake_modules/UseCodeCoverage.cmake
@@ -41,8 +41,11 @@
         find_program( CODECOV_LCOV lcov )
         find_program( CODECOV_GENHTML genhtml )
         add_definitions( -fprofile-arcs -ftest-coverage )
-        link_libraries( gcov )
-        set( CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} --coverage )
+        #link_libraries( gcov ) #depricated
+        add_definitions( -lgcov )
+        #set( CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} --coverage )
+        set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov -coverage") #-lgcov -coverage
+
         add_custom_target( coverage_init ${CODECOV_LCOV} --base-directory . --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --capture --initial )
         add_custom_target( coverage ${CODECOV_LCOV} --base-directory . --directory ${CMAKE_BINARY_DIR} --output-file ${CODECOV_OUTPUTFILE} --capture COMMAND genhtml -o ${CODECOV_HTMLOUTPUTDIR} ${CODECOV_OUTPUTFILE} )
     endif ( CMAKE_COMPILER_IS_GNUCXX )


Change to use GoogleTest for github repo with update

The 1.8.0 release has issues with MSVC 2017. The usage of tr1 produces
a warning, and flags are enable so that warnings are enabled. The
selected version of GoogleTest is the same one that ITK is using has a
fix for the issue.

google/googletest#1111

--- SuperBuild/External_GTest.cmake
+++ SuperBuild/External_GTest.cmake
@@ -7,17 +7,19 @@

 set(proj GTest)

-set(GTEST_TARGET_VERSION 1.8.0)
-set(GTEST_DOWNLOAD_SOURCE_HASH "16877098823401d1bf2ed7891d7dce36")
+set(GTEST_GIT_REPOSITORY "${git_protocol}://github.com/google/googletest.git" CACHE  STRING "Google Test repository")
+mark_as_advanced(GTEST_GIT_REPOSITORY)
+
+set(GTEST_GIT_TAG "0fe96607d85cf3a25ac40da369db62bbee2939a5" CACHE STRING "Tag or hash for GTtest git repo")
+mark_as_advanced(GTEST_GIT_TAG)
+set(GTEST_TAG_COMMAND GIT_TAG "${GTEST_GIT_TAG}")

 # follow the standard EP_PREFIX locations
 set(GTEST_source_dir ${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj})

-sitkSourceDownload(GTEST_URL "googletest-release-${GTEST_TARGET_VERSION}.tar.gz" ${GTEST_DOWNLOAD_SOURCE_HASH})
-
 ExternalProject_Add(${proj}
-  URL "${GTEST_URL}"
-  URL_MD5 ${GTEST_DOWNLOAD_SOURCE_HASH}
+  GIT_REPOSITORY ${GTEST_GIT_REPOSITORY}
+  ${GTEST_TAG_COMMAND}
   CONFIGURE_COMMAND ""
   BUILD_COMMAND     ""
   INSTALL_COMMAND   ""


Fixed OpenSSL find module.

Fixed OpenSSL find module.

--- cmake/Modules/FindOpenSSL.cmake
+++ cmake/Modules/FindOpenSSL.cmake
@@ -6,7 +6,7 @@
 #  OPENSSL_LIBRARIES - Link these to use OpenSSL
 #  OPENSSL_DEFINITIONS - Compiler switches required for using OpenSSL
 #
-#  Copyright (c) 2009 Andreas Schneider <mail@cynapses.org>
+#  Copyright (c) 2009-2010 Andreas Schneider <mail@cynapses.org>
 #
 #  Redistribution and use is allowed according to the terms of the New
 #  BSD license.
@@ -18,17 +18,10 @@
   # in cache already
   set(OPENSSL_FOUND TRUE)
 else (OPENSSL_LIBRARIES AND OPENSSL_INCLUDE_DIRS)
-  # use pkg-config to get the directories and then use these values
-  # in the FIND_PATH() and FIND_LIBRARY() calls
-  if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    include(UsePkgConfig)
-    pkgconfig(openssl _OPENSSL_INCLUDEDIR _OPENSSL_LIBDIR _OPENSSL_LDFLAGS _OPENSSL_CFLAGS)
-  else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    find_package(PkgConfig)
-    if (PKG_CONFIG_FOUND)
-      pkg_check_modules(_OPENSSL openssl)
-    endif (PKG_CONFIG_FOUND)
-  endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+  find_package(PkgConfig)
+  if (PKG_CONFIG_FOUND)
+    pkg_check_modules(_OPENSSL openssl)
+  endif (PKG_CONFIG_FOUND)

   find_path(OPENSSL_INCLUDE_DIR
     NAMES
@@ -37,12 +30,10 @@
       ${_OPENSSL_INCLUDEDIR}
       /usr/include
       /usr/local/include
-      /usr/local/ssl/include
       /opt/local/include
       /sw/include
       /usr/lib/sfw/include
   )
-  mark_as_advanced(OPENSSL_INCLUDE_DIR)

   find_library(SSL_LIBRARY
     NAMES
@@ -52,13 +43,11 @@
       ${_OPENSSL_LIBDIR}
       /usr/lib
       /usr/local/lib
-      /usr/local/ssl/lib
       /opt/local/lib
       /sw/lib
       /usr/sfw/lib/64
       /usr/sfw/lib
   )
-  mark_as_advanced(SSL_LIBRARY)

   find_library(SSLEAY32_LIBRARY
     NAMES
@@ -67,13 +56,11 @@
       ${_OPENSSL_LIBDIR}
       /usr/lib
       /usr/local/lib
-      /usr/local/ssl/lib
       /opt/local/lib
       /sw/lib
       /usr/sfw/lib/64
       /usr/sfw/lib
   )
-  mark_as_advanced(SSLEAY32_LIBRARY)

   find_library(SSLEAY32MD_LIBRARY
     NAMES
@@ -82,13 +69,11 @@
       ${_OPENSSL_LIBDIR}
       /usr/lib
       /usr/local/lib
-      /usr/local/ssl/lib
       /opt/local/lib
       /sw/lib
       /usr/sfw/lib/64
       /usr/sfw/lib
   )
-  mark_as_advanced(SSLEAY32MD_LIBRARY)

   find_library(CRYPTO_LIBRARY
     NAMES
@@ -100,78 +85,48 @@
       libeay32
     PATHS
       ${_OPENSSL_LIBDIR}
-      /lib
       /usr/lib
       /usr/local/lib
-      /usr/local/ssl/lib
       /opt/local/lib
       /sw/lib
       /usr/sfw/lib/64
       /usr/sfw/lib
   )
-  mark_as_advanced(CRYPTO_LIBRARY)
-
-  if (SSL_LIBRARY)
-    set(SSL_FOUND TRUE CACHE INTERNAL "Wether the ssl library has been found" FORCE)
-  endif (SSL_LIBRARY)
-
-  if (SSLEAY32_LIBRARY)
-    set(SSLEAY32_FOUND TRUE CACHE INTERNAL "Wether the ssleay32 library has been found" FORCE)
-  endif (SSLEAY32_LIBRARY)
-
-  if (SSLEAY32MD_LIBRARY)
-    set(SSLEAY32MD_FOUND TRUE CACHE INTERNAL "Wether the ssleay32MD library has been found" FORCE)
-  endif (SSLEAY32MD_LIBRARY)
-
-  if (CRYPTO_LIBRARY)
-    set(CRYPTO_FOUND TRUE CACHE INTERNAL "Wether the crypto library has been found" FORCE)
-  endif (CRYPTO_LIBRARY)

   set(OPENSSL_INCLUDE_DIRS
     ${OPENSSL_INCLUDE_DIR}
   )

-  if (SSL_FOUND)
+  if (SSL_LIBRARY)
     set(OPENSSL_LIBRARIES
-      ${OPENSSL_LIBRARIES}
-      ${SSL_LIBRARY}
+        ${OPENSSL_LIBRARIES}
+        ${SSL_LIBRARY}
     )
-  endif (SSL_FOUND)
+  endif (SSL_LIBRARY)

-  if (SSLEAY32_FOUND)
+  if (SSLEAY32_LIBRARY)
     set(OPENSSL_LIBRARIES
-      ${OPENSSL_LIBRARIES}
-      ${SSLEAY32_LIBRARY}
+        ${OPENSSL_LIBRARIES}
+        ${SSLEAY32_LIBRARY}
     )
-  endif (SSLEAY32_FOUND)
+  endif (SSLEAY32_LIBRARY)

-  if (SSLEAY32MD_FOUND)
+  if (SSLEAY32MD_LIBRARY)
     set(OPENSSL_LIBRARIES
-      ${OPENSSL_LIBRARIES}
-      ${SSLEAY32MD_LIBRARY}
+        ${OPENSSL_LIBRARIES}
+        ${SSLEAY32MD_LIBRARY}
     )
-  endif (SSLEAY32MD_FOUND)
+  endif (SSLEAY32MD_LIBRARY)

-  if (CRYPTO_FOUND)
+  if (CRYPTO_LIBRARY)
     set(OPENSSL_LIBRARIES
-      ${OPENSSL_LIBRARIES}
-      ${CRYPTO_LIBRARY}
+        ${OPENSSL_LIBRARIES}
+        ${CRYPTO_LIBRARY}
     )
-  endif (CRYPTO_FOUND)
+  endif (CRYPTO_LIBRARY)

-  if (OPENSSL_INCLUDE_DIRS AND OPENSSL_LIBRARIES)
-     set(OPENSSL_FOUND TRUE)
-  endif (OPENSSL_INCLUDE_DIRS AND OPENSSL_LIBRARIES)
-
-  if (OPENSSL_FOUND)
-    if (NOT OpenSSL_FIND_QUIETLY)
-      message(STATUS "Found OpenSSL: ${OPENSSL_LIBRARIES}")
-    endif (NOT OpenSSL_FIND_QUIETLY)
-  else (OPENSSL_FOUND)
-    if (OpenSSL_FIND_REQUIRED)
-      message(FATAL_ERROR "Could not find OpenSSL")
-    endif (OpenSSL_FIND_REQUIRED)
-  endif (OPENSSL_FOUND)
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(OpenSSL DEFAULT_MSG OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIRS)

   # show the OPENSSL_INCLUDE_DIRS and OPENSSL_LIBRARIES variables only in the advanced view
   mark_as_advanced(OPENSSL_INCLUDE_DIRS OPENSSL_LIBRARIES)


cmake: check for DPDK only if enabled

cmake: check for DPDK only if enabled

so the configure.py is less chatty. and it's less confusing if
SPDK is enabled when configuration Seastar. because SPDK comes
with a bundled DPDK, whose version is not necessarily identical to
the one in the top-level dpdk submodule. so the output of cmake
when checking DPDK does not imply the existence of the DPDK used
by SPDK. since the DPDK and SPDK supports cannot be enabled at
the same time, it'd be less confusing if DPDK is checked only if
it is enabled.

Signed-off-by: Kefu Chai <cdc92d111bae0ed1ee3b3c8a1f849fcffc6b44f7@gmail.com>

--- cmake/SeastarDependencies.cmake
+++ cmake/SeastarDependencies.cmake
@@ -52,7 +52,6 @@
     Boost
     c-ares
     cryptopp
-    dpdk # No version information published.
     fmt
     lz4
     # Private and private/public dependencies.
@@ -66,6 +65,11 @@
     numactl # No version information published.
     rt
     yaml-cpp)
+
+  if (Seastar_DPDK)
+    list (APPEND _seastar_all_dependencies
+      dpdk)
+  endif ()

   # Arguments to `find_package` for each 3rd-party dependency.
   # Note that the version specification is a "minimal" version requirement.


Fix whitespace stripping of result variables

--- CMake/mitkFunctionCheckCompilerFlags.cmake
+++ CMake/mitkFunctionCheckCompilerFlags.cmake
@@ -46,8 +46,9 @@
   CHECK_CXX_COMPILER_FLAG(${CXX_FLAG_TO_TEST} HAS_FLAG_${suffix})

   if(HAS_FLAG_${suffix})
-    set(${RESULT_VAR} "${${RESULT_VAR}} ${CXX_FLAG_TO_TEST}" PARENT_SCOPE)
+    set(${RESULT_VAR} "${${RESULT_VAR}} ${CXX_FLAG_TO_TEST}")
     string(STRIP ${${RESULT_VAR}} ${RESULT_VAR})
+    set(${RESULT_VAR} "${${RESULT_VAR}}" PARENT_SCOPE)
   endif()

 endfunction()
@@ -96,15 +97,17 @@
   CHECK_CXX_COMPILER_FLAG(${FLAG_TO_TEST_FIXED} HAS_CXX_FLAG_${suffix})

   if(HAS_CXX_FLAG_${suffix})
-    set(${CXX_RESULT_VAR} "${_saved_cxx_result_var} ${FLAG_TO_TEST}" PARENT_SCOPE)
+    set(${CXX_RESULT_VAR} "${_saved_cxx_result_var} ${FLAG_TO_TEST}")
     string(STRIP ${${CXX_RESULT_VAR}} ${CXX_RESULT_VAR})
+    set(${CXX_RESULT_VAR} "${${CXX_RESULT_VAR}}" PARENT_SCOPE)
   endif()

   CHECK_C_COMPILER_FLAG(${FLAG_TO_TEST_FIXED} HAS_C_FLAG_${suffix})

   if(HAS_C_FLAG_${suffix})
-    set(${C_RESULT_VAR} "${_saved_c_result_var} ${FLAG_TO_TEST}" PARENT_SCOPE)
+    set(${C_RESULT_VAR} "${_saved_c_result_var} ${FLAG_TO_TEST}")
     string(STRIP ${${C_RESULT_VAR}} ${C_RESULT_VAR})
+    set(${C_RESULT_VAR} "${${C_RESULT_VAR}}" PARENT_SCOPE)
   endif()

 endfunction()


fix: always do a git fetch before checkout

--- thirdparty/cmake_modules/koreader_thirdparty_git.cmake
+++ thirdparty/cmake_modules/koreader_thirdparty_git.cmake
@@ -68,6 +68,14 @@
 endif()

 if(NOT \"\${curr_tag}\" STREQUAL \"${git_tag}\")
+  execute_process(
+    COMMAND \"${git_EXECUTABLE}\" fetch
+    WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+    RESULT_VARIABLE error_code
+  )
+  if(error_code)
+    message(FATAL_ERROR \"Failed to fetch update from origin\")
+  endif()
   execute_process(
     COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
     WORKING_DIRECTORY \"${work_dir}/${src_name}\"


Fix git revision extraction

Fix git revision extraction

--- cmake/GetGitRevisionDescription.cmake
+++ cmake/GetGitRevisionDescription.cmake
@@ -41,18 +41,31 @@

 function(get_git_head_revision _refspecvar _hashvar)
     set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}")
-    set(GIT_DIR "${GIT_PARENT_DIR}/.git")
-    while(NOT EXISTS "${GIT_DIR}/HEAD")  # .git dir not found, search parent directories
+
+    while(NOT EXISTS "${GIT_PARENT_DIR}/.git")  # .git dir not found, search parent directories
         set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
         get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} DIRECTORY)
         if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
             # We have reached the root directory, we are not in git
-            set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
-            set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
+            set(${_refspecvar} "000000000000" PARENT_SCOPE)
+            set(${_hashvar} "000000000000" PARENT_SCOPE)
             return()
         endif()
-        set(GIT_DIR "${GIT_PARENT_DIR}/.git")
     endwhile()
+
+    if (IS_DIRECTORY "${GIT_PARENT_DIR}/.git")
+	# common case
+	set(GIT_DIR "${GIT_PARENT_DIR}/.git")
+    else()
+	# submodule case
+	file(STRINGS "${GIT_PARENT_DIR}/.git" contents LIMIT_COUNT 1)
+	message(STATUS "${contents}")
+	string(SUBSTRING "${contents}" 8 -1 SUBMODULE_GIT_DIR)
+	message(STATUS "${SUBMODULE_GIT_DIR}")
+	set(GIT_DIR "${GIT_PARENT_DIR}/${SUBMODULE_GIT_DIR}")
+	message(STATUS "${GIT_DIR}")
+    endif()
+
     set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
     if(NOT EXISTS "${GIT_DATA}")
         file(MAKE_DIRECTORY "${GIT_DATA}")


Fix copy-paste errors in r292001

Fix copy-paste errors in r292001

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@292010 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/HandleLibcxxFlags.cmake
+++ cmake/Modules/HandleLibcxxFlags.cmake
@@ -27,9 +27,9 @@
 macro(remove_flags)
   foreach(var ${ARGN})
     string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
-    string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_DEBUG}")
-    string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG}")
-    string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG}")
+    string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
+    string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+    string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
     string(REPLACE "${var}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
     string(REPLACE "${var}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
     string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")


enable building with LTO on Windows using clang-cl and lld

Summary: With clang-cl gaining support for link-time optimization, we can now enable builds using LTO when using clang-cl and lld on Windows. To do this, we must not pass the -flto flag to the linker; lld-link does not understand it, but will perform LTO automatically when it encounters bitcode files. We also don't pass /Brepro when using LTO - the compiler doesn't generate object files for LTO, so passing the flag would only result in a warning about it being unused.

Reviewers: rnk, ruiu, hans

Reviewed By: hans

Subscribers: mgorny, mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D30240

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -11,6 +11,12 @@
 include(AddLLVMDefinitions)
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
+
+if(CMAKE_LINKER MATCHES "lld-link.exe" OR (WIN32 AND LLVM_USE_LINKER STREQUAL "lld"))
+  set(LINKER_IS_LLD_LINK TRUE)
+else()
+  set(LINKER_IS_LLD_LINK FALSE)
+endif()

 # Ninja Job Pool support
 # The following only works with the Ninja generator in CMake >= 3.0.
@@ -37,7 +43,7 @@
 endif()

-if (CMAKE_LINKER MATCHES "lld-link.exe")
+if (LINKER_IS_LLD_LINK)
   # Pass /MANIFEST:NO so that CMake doesn't run mt.exe on our binaries.  Adding
   # manifests with mt.exe breaks LLD's symbol tables and takes as much time as
   # the link. See PR24476.
@@ -407,11 +413,13 @@
   # "Enforce type conversion rules".
   append("/Zc:rvalueCast" CMAKE_CXX_FLAGS)

-  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT LLVM_ENABLE_LTO)
     # clang-cl and cl by default produce non-deterministic binaries because
     # link.exe /incremental requires a timestamp in the .obj file.  clang-cl
     # has the flag /Brepro to force deterministic binaries. We want to pass that
-    # whenever you're building with clang unless you're passing /incremental.
+    # whenever you're building with clang unless you're passing /incremental
+    # or using LTO (/Brepro with LTO would result in a warning about the flag
+    # being unused, because we're not generating object files).
     # This checks CMAKE_CXX_COMPILER_ID in addition to check_cxx_compiler_flag()
     # because cl.exe does not emit an error on flags it doesn't understand,
     # letting check_cxx_compiler_flag() claim it understands all flags.
@@ -561,7 +569,7 @@
   elseif (CLANG_CL)
     # Keep frame pointers around.
     append("/Oy-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-    if (CMAKE_LINKER MATCHES "lld-link.exe")
+    if (LINKER_IS_LLD_LINK)
       # Use DWARF debug info with LLD.
       append("-gdwarf" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     else()
@@ -699,20 +707,29 @@

 set(LLVM_ENABLE_LTO OFF CACHE STRING "Build LLVM with LTO. May be specified as Thin or Full to use a particular kind of LTO")
 string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO)
+if(LLVM_ENABLE_LTO AND LLVM_ON_WIN32 AND NOT LINKER_IS_LLD_LINK)
+  message(FATAL_ERROR "When compiling for Windows, LLVM_ENABLE_LTO requires using lld as the linker (point CMAKE_LINKER at lld-link.exe)")
+endif()
 if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
-  append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS
-                      CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
+  if(NOT LINKER_IS_LLD_LINK)
+    append("-flto=thin" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
   # On darwin, enable the lto cache. This improves initial build time a little
   # since we re-link a lot of the same objects, and significantly improves
   # incremental build time.
   append_if(APPLE "-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
             CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
 elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
-  append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS
-                 CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
+  if(NOT LINKER_IS_LLD_LINK)
+    append("-flto=full" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
 elseif(LLVM_ENABLE_LTO)
-  append("-flto" CMAKE_CXX_FLAGS CMAKE_C_FLAGS
-                 CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  append("-flto" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
+  if(NOT LINKER_IS_LLD_LINK)
+    append("-flto" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
 endif()

 # This option makes utils/extract_symbols.py be used to determine the list of


Unbreak shared library linkage on DragonFlyBSD.

Patch submitted by rimvydas.

Reviewers: llvm-commits, krytarowski, mgorny

Reviewed By: krytarowski, mgorny

Subscribers: mgorny

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D35125

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -138,6 +138,7 @@
 # Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO
 # build might work on ELF but fail on MachO/COFF.
 if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR CYGWIN OR
+        ${CMAKE_SYSTEM_NAME} MATCHES "DragonFly" OR
         ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
 	${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" OR
 	${CMAKE_SYSTEM_NAME} MATCHES "DragonFly") AND


Ninja/NMake friendly detection of HUNTER_MSVC_* variables

Relates: https://github.com/ruslo/hunter/issues/311

--- cmake/modules/hunter_setup_msvc.cmake
+++ cmake/modules/hunter_setup_msvc.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2014,2015, Ruslan Baratov, Sumedh Ghaisas
+# Copyright (c) 2014-2016, Ruslan Baratov, Sumedh Ghaisas
 # All rights reserved.

 cmake_minimum_required(VERSION 3.0)
@@ -6,91 +6,121 @@
 include(hunter_internal_error)
 include(hunter_status_debug)

-# Detect architecture, year and version by MSVC name generator.
-# Sets HUNTER_MSVC_ARCH, HUNTER_MSVC_VERSION, HUNTER_MSVC_YEAR
-# Variable used to start VS Command Prompt.
-# See section "Vcvarsall.bat argument":
-#     * http://msdn.microsoft.com/en-us/library/x4d2c09s.aspx
-# Checks for file "vcvarsall.bat" and imports the file as HUNTER_MSVC_VCVARSALL
+# Set next variables to the current scope:
+# * HUNTER_MSVC_VERSION - version of Visual Studio. Used to create VS*COMNTOOLS
+#     environment variable name, e.g.:
+#     Visual Studio 8 2005 -> VS80COMNTOOLS
+#     Visual Studio 14 2015 -> VS140COMNTOOLS
+# * HUNTER_MSVC_YEAR - year of Visual Studio. Used by 'url_sha1_qt' scheme
+# * HUNTER_MSVC_ARCH - architecture specifier. Variable used to start VS
+#     Command Prompt. See section "Vcvarsall.bat argument":
+#     - http://msdn.microsoft.com/en-us/library/x4d2c09s.aspx
+#     - http://msdn.microsoft.com/library/x4d2c09s%28v=vs.110%29.aspx
+#     CMake generator -> HUNTER_MSVC_ARCH example:
+#       Visual Studio 12 2013 -> x86
+#       Visual Studio 12 2013 Win64 -> amd64
+#       Visual Studio 12 2013 ARM -> x86_arm
+#     CMake's MSVC_CXX_ARCHITECTURE_ID:
+#       x86 -> x86
+#       x64 -> amd64
+#       ARMV7 -> x86_arm
+# * HUNTER_MSVC_VCVARSALL - full path to the 'vcvarsall.bat' script
+
+# This function should work with all generators that provide MSVC compiler:
+# * Visual Studio ...
+# * NMake Makefiles
+# * Ninja
+
+# User can set all HUNTER_MSVC_* variables manually in toolchain to force
+# custom values (checked by HUNTER_MSVC_ARCH)
 macro(hunter_setup_msvc)
   if(MSVC AND NOT HUNTER_MSVC_ARCH)
-    hunter_status_debug("MSVC generator: ${CMAKE_GENERATOR}")
-    STRING(REGEX REPLACE "^Visual Studio (8 2005|9 2008|10 2010|11 2012|12 2013|14 2015)( Win64| ARM|)" "\\1;\\2" _hunter_msvc_check "${CMAKE_GENERATOR}")
-    list(GET _hunter_msvc_check 0 _hunter_msvc_check_string)
+    string(COMPARE EQUAL "${MSVC_VERSION}" "1400" _vs_8_2005)
+    string(COMPARE EQUAL "${MSVC_VERSION}" "1500" _vs_9_2008)
+    string(COMPARE EQUAL "${MSVC_VERSION}" "1600" _vs_10_2010)
+    string(COMPARE EQUAL "${MSVC_VERSION}" "1700" _vs_11_2012)
+    string(COMPARE EQUAL "${MSVC_VERSION}" "1800" _vs_12_2013)
+    string(COMPARE EQUAL "${MSVC_VERSION}" "1900" _vs_14_2015)

-    string(COMPARE EQUAL "${_hunter_msvc_check_string}" "${CMAKE_GENERATOR}" _hunter_msvc_check_string_bool)
+    if(_vs_8_2005)
+      set(HUNTER_MSVC_VERSION "8")
+      set(HUNTER_MSVC_YEAR "2005")
+    elseif(_vs_9_2008)
+      set(HUNTER_MSVC_VERSION "9")
+      set(HUNTER_MSVC_YEAR "2008")
+    elseif(_vs_10_2010)
+      set(HUNTER_MSVC_VERSION "10")
+      set(HUNTER_MSVC_YEAR "2010")
+    elseif(_vs_11_2012)
+      set(HUNTER_MSVC_VERSION "11")
+      set(HUNTER_MSVC_YEAR "2012")
+    elseif(_vs_12_2013)
+      set(HUNTER_MSVC_VERSION "12")
+      set(HUNTER_MSVC_YEAR "2013")
+    elseif(_vs_14_2015)
+      set(HUNTER_MSVC_VERSION "14")
+      set(HUNTER_MSVC_YEAR "2015")
+    else()
+      hunter_internal_error("Unexpected MSVC_VERSION: '${MSVC_VERSION}'")
+    endif()

-    if(_hunter_msvc_check_string_bool)
-      hunter_internal_error("Invalid MSVC generator: ${CMAKE_GENERATOR}")
+    hunter_status_debug("HUNTER_MSVC_VERSION: ${HUNTER_MSVC_VERSION}")
+    hunter_status_debug("HUNTER_MSVC_YEAR: ${HUNTER_MSVC_YEAR}")
+
+    string(COMPARE EQUAL "${MSVC_CXX_ARCHITECTURE_ID}" "x86" _is_x86)
+    string(COMPARE EQUAL "${MSVC_CXX_ARCHITECTURE_ID}" "x64" _is_x64)
+    string(COMPARE EQUAL "${MSVC_CXX_ARCHITECTURE_ID}" "ARMV7" _is_arm)
+
+    if(_is_x86)
+      set(HUNTER_MSVC_ARCH "x86")
+    elseif(_is_x64)
+      set(HUNTER_MSVC_ARCH "amd64")
+    elseif(_is_arm)
+      set(HUNTER_MSVC_ARCH "x86_arm")
     else()
-      STRING(REPLACE " " ";" _hunter_msvc_version_list "${_hunter_msvc_check_string}")
-      list(GET _hunter_msvc_version_list 0 HUNTER_MSVC_VERSION)
-      list(GET _hunter_msvc_version_list 1 HUNTER_MSVC_YEAR)
+      hunter_internal_error(
+          "Unexpected MSVC_CXX_ARCHITECTURE_ID: '${MSVC_CXX_ARCHITECTURE_ID}'"
+      )
+    endif()

-      hunter_status_debug("HUNTER_MSVC_VERSION: ${HUNTER_MSVC_VERSION}")
-      hunter_status_debug("HUNTER_MSVC_YEAR: ${HUNTER_MSVC_YEAR}")
+    hunter_status_debug("HUNTER_MSVC_ARCH: ${HUNTER_MSVC_ARCH}")

-      list(GET _hunter_msvc_check 1 HUNTER_MSVC_ARCH)
-      string(STRIP "${HUNTER_MSVC_ARCH}" HUNTER_MSVC_ARCH)
+    set(_hunter_vcvarsall_env "${HUNTER_MSVC_VERSION}0")
+    set(_hunter_vcvarsall_env "VS${_hunter_vcvarsall_env}COMNTOOLS")
+    set(_hunter_vcvarsall_path "$ENV{${_hunter_vcvarsall_env}}")

-      string(COMPARE EQUAL "${HUNTER_MSVC_ARCH}" "Win64" _hunter_result_win64)
-      string(COMPARE EQUAL "${HUNTER_MSVC_ARCH}" "ARM" _hunter_result_arm)
-      string(COMPARE EQUAL "${HUNTER_MSVC_ARCH}" "" _hunter_result_x86)
+    string(COMPARE EQUAL "${_hunter_vcvarsall_path}" "" _is_empty)
+    if(_is_empty)
+      if(HUNTER_TESTING)
+        # ignore error, see 'tests/hunter_setup_msvc/CMakeLists.txt'
+      else()
+        hunter_internal_error(
+             "Environment variable ${_hunter_vcvarsall_env} is empty"
+        )
+      endif()
+    endif()

-      if(_hunter_result_win64)
-        set(HUNTER_MSVC_ARCH "amd64")
-      elseif(_hunter_result_arm)
-        set(HUNTER_MSVC_ARCH "x86_arm")
-      elseif(_hunter_result_x86)
-        set(HUNTER_MSVC_ARCH "x86")
-      else()
-        hunter_internal_error("Can't detect generator arch: ${CMAKE_GENERATOR}")
-      endif()
-
-      hunter_status_debug("HUNTER_MSVC_ARCH: ${HUNTER_MSVC_ARCH}")
-
-      set(_hunter_vcvarsall_env "${HUNTER_MSVC_VERSION}0")
-      set(_hunter_vcvarsall_env "VS${_hunter_vcvarsall_env}COMNTOOLS")
-      set(_hunter_vcvarsall_path "$ENV{${_hunter_vcvarsall_env}}")
-
-      string(COMPARE EQUAL "${_hunter_vcvarsall_path}" "" _is_empty)
-      if(_is_empty)
-        if(HUNTER_TESTING)
-          # ignore error, see 'tests/hunter_setup_msvc/CMakeLists.txt'
-        else()
-          hunter_internal_error(
-               "Environment variable ${_hunter_vcvarsall_env} is empty"
-          )
-        endif()
-      endif()
-
-      set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/../../VC")
-      get_filename_component(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}" ABSOLUTE)
-      find_file(
+    set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/../../VC")
+    get_filename_component(
+        _hunter_vcvarsall_path "${_hunter_vcvarsall_path}" ABSOLUTE
+    )
+    find_file(
         HUNTER_MSVC_VCVARSALL
         "vcvarsall.bat"
         PATHS
         "${_hunter_vcvarsall_path}"
         NO_DEFAULT_PATH
-      )
-      if(NOT HUNTER_MSVC_VCVARSALL)
-        if(HUNTER_TESTING)
-          # ignore error, see 'tests/hunter_setup_msvc/CMakeLists.txt'
-        else()
-          hunter_internal_error("vcvarsall.bat not found in `${_hunter_vcvarsall_path}`")
-        endif()
+    )
+    if(NOT HUNTER_MSVC_VCVARSALL)
+      if(HUNTER_TESTING)
+        # ignore error, see 'tests/hunter_setup_msvc/CMakeLists.txt'
+      else()
+        hunter_internal_error(
+            "vcvarsall.bat not found in `${_hunter_vcvarsall_path}`"
+        )
       endif()
+    endif()

-      hunter_status_debug("vcvarsall.bat file location: ${HUNTER_MSVC_VCVARSALL}")
-
-      unset(_hunter_result_win64)
-      unset(_hunter_result_arm)
-      unset(_hunter_result_x86)
-      unset(_hunter_msvc_check)
-      unset(_hunter_msvc_check_string)
-      unset(_hunter_msvc_check_string_bool)
-      unset(_hunter_msvc_version_list)
-      unset(_hunter_vcvarsall_path)
-    endif()
+    hunter_status_debug("vcvarsall.bat file location: ${HUNTER_MSVC_VCVARSALL}")
   endif()
 endmacro()


Use MITK_INSTALL() macro instead of install()

--- CMake/mitkFunctionCreateMatchPointDeployedAlgorithm.cmake
+++ CMake/mitkFunctionCreateMatchPointDeployedAlgorithm.cmake
@@ -102,6 +102,6 @@
     endif()
   endif()

-  install(TARGETS ${ALG_TARGET} RUNTIME DESTINATION bin LIBRARY DESTINATION bin)
+  MITK_INSTALL(TARGETS ${ALG_TARGET})

 endfunction()


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 05)

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


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 08)

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


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 11)

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


fix missing keyword

fix missing keyword

--- Shared/CMake/JamomaUtilFunctions.cmake
+++ Shared/CMake/JamomaUtilFunctions.cmake
@@ -192,7 +192,7 @@
 	foreach(THE_FRAMEWORK ${target_link_frameworks_FRAMEWORKS})
 		unset(THE_LIBRARY CACHE)
 		find_library(THE_LIBRARY ${THE_FRAMEWORK})
-		target_link_libraries(${target_link_frameworks_TARGET} ${THE_LIBRARY})
+		target_link_libraries(${target_link_frameworks_TARGET} PUBLIC ${THE_LIBRARY})
 		message("Linking ${target_link_frameworks_TARGET} with ${THE_LIBRARY}")
 	endforeach()
 	endif()


cmake: we don't need the dylib copy on travis, so just disable it there.

--- Shared/CMake/JamomaUtilFunctions.cmake
+++ Shared/CMake/JamomaUtilFunctions.cmake
@@ -48,34 +48,35 @@

 	if(APPLE)
 		if(BUILD_JAMOMAMAX)
+			if(!$ENV{TRAVIS})
+				# TODO there appears to be some ambiguity when building because some things are build into debug/release even though CMAKE_BUILD_TYPE is the other here... [tap]

-			# TODO there appears to be some ambiguity when building because some things are build into debug/release even though CMAKE_BUILD_TYPE is the other here... [tap]
-
-			# ADD_CUSTOM_COMMAND(
-			#   TARGET ${LIBNAME}
-			#   POST_BUILD
-			#   COMMAND ${CMAKE_COMMAND} -E make_directory
-			#    ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support
-			# )
-			ADD_CUSTOM_COMMAND(
-			  TARGET ${LIBNAME}
-			  POST_BUILD
-			  COMMAND ${CMAKE_COMMAND} -E make_directory
-			   ${CMAKE_BINARY_DIR}/Debug/support
-			)
-			ADD_CUSTOM_COMMAND(
-			  TARGET ${LIBNAME}
-			  POST_BUILD
-			  COMMAND ${CMAKE_COMMAND} -E make_directory
-			   ${CMAKE_BINARY_DIR}/Release/support
-			)
-			ADD_CUSTOM_COMMAND(
-			  TARGET ${LIBNAME} #Jamoma::Foundation # for instance
-			  POST_BUILD
-			  COMMAND ${CMAKE_COMMAND} -E copy
-			      ${CMAKE_BINARY_DIR}/JamomaCore/${LIBNAME}/library/${CMAKE_BUILD_TYPE}/libJamoma${LIBNAME}.dylib #* # we have to be careful with .so / .dll
-			      ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support #/libJamomaFoundation.dylib
-			)
+				# ADD_CUSTOM_COMMAND(
+				#   TARGET ${LIBNAME}
+				#   POST_BUILD
+				#   COMMAND ${CMAKE_COMMAND} -E make_directory
+				#    ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support
+				# )
+				ADD_CUSTOM_COMMAND(
+				  TARGET ${LIBNAME}
+				  POST_BUILD
+				  COMMAND ${CMAKE_COMMAND} -E make_directory
+				   ${CMAKE_BINARY_DIR}/Debug/support
+				)
+				ADD_CUSTOM_COMMAND(
+				  TARGET ${LIBNAME}
+				  POST_BUILD
+				  COMMAND ${CMAKE_COMMAND} -E make_directory
+				   ${CMAKE_BINARY_DIR}/Release/support
+				)
+				ADD_CUSTOM_COMMAND(
+				  TARGET ${LIBNAME} #Jamoma::Foundation # for instance
+				  POST_BUILD
+				  COMMAND ${CMAKE_COMMAND} -E copy
+				      ${CMAKE_BINARY_DIR}/JamomaCore/${LIBNAME}/library/${CMAKE_BUILD_TYPE}/libJamoma${LIBNAME}.dylib #* # we have to be careful with .so / .dll
+				      ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support #/libJamomaFoundation.dylib
+				)
+			endif() # !$ENV{TRAVIS}
 		endif() # BUILD_JAMOMAMAX
 	endif() # APPLE


COMP: Bump Sphinx Examples remote.

COMP: Bump Sphinx Examples remote.

This fixes the Doxygen configuration error.

Change-Id: I964061fbb4e8b369b1e09a894438c0566465903b

--- Modules/Remote/SphinxExamples.remote.cmake
+++ Modules/Remote/SphinxExamples.remote.cmake
@@ -2,6 +2,6 @@
 itk_fetch_module(SphinxExamples
   "This module builds the examples found at http://itk.org/ITKExamples/"
   GIT_REPOSITORY http://itk.org/ITKExamples.git
-  # 2014-11-23
-  GIT_TAG 8a18624e7d20386410d1a1fb14e354210284103a
+  # 2014-12-03
+  GIT_TAG f23b2857bdba605a4b87df77926d3558e18bb540
   )


Adding support for easybuild modules

Adding support for easybuild modules

Former-commit-id: d414d56fffd351cfe1b19d46234170de025b0de6

--- cmake-modules/Fetch_Arpackpp.cmake
+++ cmake-modules/Fetch_Arpackpp.cmake
@@ -35,7 +35,7 @@
             )
     if(ARPACKPP_INCLUDE_DIR)
         get_filename_component(DIRNAME ${ARPACKPP_INCLUDE_DIR} NAME)
-        message(STATUS: ${DIRNAME})
+        message(STATUS "DIRNAME: ${DIRNAME}")
         if("${DIRNAME}" STREQUAL "arpack++")
             get_filename_component(ARPACKPP_INCLUDE_DIR ${ARPACKPP_INCLUDE_DIR} DIRECTORY)
             message(STATUS "Searching for Arpack++ in module - Success: ${ARPACKPP_INCLUDE_DIR}")


Include the OpenCV config headers into every module.

This has no bearing on compilation, but it makes them show up in IDEs.

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -470,7 +470,8 @@
 #   ocv_create_module(<extra link dependencies>)
 #   ocv_create_module(SKIP_LINK)
 macro(ocv_create_module)
-  add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES})
+  add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
+    "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp")

   if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
     target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})


Change GSL download to use HTTPS URL. (#13563)

--- cmake/external/gsl.cmake
+++ cmake/external/gsl.cmake
@@ -5,9 +5,8 @@

 FetchContent_Declare(
     GSL
-    GIT_REPOSITORY https://github.com/microsoft/gsl
-    GIT_TAG a3534567187d2edc428efd3f13466ff75fe5805c  # v4.0.0
-    GIT_SHALLOW ON
+    URL https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip
+    URL_HASH SHA1=cf368104cd22a87b4dd0c80228919bb2df3e2a14
     )

 FetchContent_MakeAvailable(GSL)


CMake: Fix rebuilding dkp ports

CMake: Fix rebuilding dkp ports

--- src/platform/cmake/devkitPro.cmake
+++ src/platform/cmake/devkitPro.cmake
@@ -8,12 +8,13 @@

 function(create_devkit DEVKIT)
 	if(DEFINED ENV{DEVKIT${DEVKIT}})
-	        set(DEVKIT${DEVKIT} $ENV{DEVKIT${DEVKIT}} PARENT_SCOPE)
+	        set(DEVKIT${DEVKIT} $ENV{DEVKIT${DEVKIT}})
 	else()
-	        set(DEVKIT${DEVKIT} ${DEVKITPRO}/devkit${DEVKIT} PARENT_SCOPE)
+	        set(DEVKIT${DEVKIT} ${DEVKITPRO}/devkit${DEVKIT})
 	endif()
+	set(DEVKIT${DEVKIT} "${DEVKIT${DEVKIT}}" PARENT_SCOPE)

-	set(CMAKE_PROGRAM_PATH ${DEVKIT${DEVKIT}}/bin CACHE INTERNAL "program path")
+	set(CMAKE_PROGRAM_PATH "${DEVKIT${DEVKIT}}/bin" CACHE INTERNAL "program path")
 	set(cross_prefix_path "${CMAKE_PROGRAM_PATH}/${cross_prefix}")
 	set(cross_prefix_path "${cross_prefix_path}" PARENT_SCOPE)

@@ -40,4 +41,4 @@
 	set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE INTERNAL "")
 	set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE INTERNAL "")
 	set(PKG_CONFIG_EXECUTABLE "/dev/null" CACHE INTERNAL "" FORCE)
-endfunction()+endfunction()


cmake: Add missing link libraries on Linux platform

--- platforms/linux-gcc/platform.cmake
+++ platforms/linux-gcc/platform.cmake
@@ -2,6 +2,8 @@
 set (PLIB_IPC_MODEL posix)
 set (PLIB_TIME_PROFILER_MODEL posix)
 set (PLIB_PLATFORM_CONFIG_PATH "../common/posix/pplatform.h")
+
+set (PLIB_PLATFORM_LINK_LIBRARIES -pthread rt)

 set (PLIB_PLATFORM_DEFINES
 	-D_REENTRANT


Update internal_utils.cmake

Update internal_utils.cmake

--- googletest/cmake/internal_utils.cmake
+++ googletest/cmake/internal_utils.cmake
@@ -62,8 +62,7 @@
   if (MSVC)
     # Newlines inside flags variables break CMake's NMake generator.
     # TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
-    # -J does not set path correctly for pdb with spaces
-    set(cxx_base_flags "-GS -W4 -WX -wd4251 -wd4275 -nologo -Zi")
+    set(cxx_base_flags "-GS -W4 -WX -wd4251 -wd4275 -nologo -J -Zi")
     if (MSVC_VERSION LESS 1400)  # 1400 is Visual Studio 2005
       # Suppress spurious warnings MSVC 7.1 sometimes issues.
       # Forcing value to bool.


Fixed an introduced bug in android project creation.

--HG--
branch : android-cmake-project-creation-refactor

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

-	SET(DEPENDENCIES ${DEPENDENCIES} OgreTerrain OgreRTShaderSystem OgreMeshLodGeneratorStatic OgreOverlay OgrePaging OgreVolume Plugin_ParticleFX Plugin_OctreeSceneManager)
+	SET(DEPENDENCIES ${DEPENDENCIES} OgreTerrain OgreRTShaderSystem OgreMeshLodGenerator OgreOverlay OgrePaging OgreVolume Plugin_ParticleFX Plugin_OctreeSceneManager)
 	add_dependencies(${ANDROID_PROJECT_TARGET} ${DEPENDENCIES})
 	set(DEPEND_STATIC_LIBS "")
 	foreach(DEPENDENCY ${DEPENDENCIES})


Use patchable tarball for cpprestsdk

Use patchable tarball for cpprestsdk

--- CMakeExternals/cpprestsdk.cmake
+++ CMakeExternals/cpprestsdk.cmake
@@ -23,9 +23,9 @@
     endif()

     ExternalProject_Add(${proj}
-      GIT_REPOSITORY https://github.com/Microsoft/cpprestsdk.git
-      GIT_TAG v2.10.10
-      PATCH_COMMAND ${PATCH_COMMAND} -d "${ep_prefix}/src/cpprestsdk/Release/libs/websocketpp" -N -p1 -i "${CMAKE_CURRENT_LIST_DIR}/${proj}.patch"
+      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/cpprestsdk-2.10.10.tar.gz
+      URL_MD5 705c4bd79158433309b21251a4936b18
+      PATCH_COMMAND ${PATCH_COMMAND} -d "Release/libs/websocketpp" -N -p1 -i "${CMAKE_CURRENT_LIST_DIR}/${proj}.patch"
       SOURCE_SUBDIR Release
       CMAKE_ARGS ${ep_common_args}
       CMAKE_CACHE_ARGS ${cmake_cache_args}
@@ -33,13 +33,6 @@
       DEPENDS ${proj_DEPENDENCIES}
     )

-    ExternalProject_Add_Step(${proj} git-submodule
-      COMMAND ${GIT_EXECUTABLE} submodule update --init -- Release/libs/websocketpp
-      WORKING_DIRECTORY <SOURCE_DIR>
-      DEPENDEES patch
-      DEPENDERS configure
-    )
-
     set(${proj}_DIR ${ep_prefix})
   else()
     mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")


FIX: windows build

FIX: windows build

--- CMakeModules/FindFreetype.cmake
+++ CMakeModules/FindFreetype.cmake
@@ -11,13 +11,32 @@
   NO_DEFAULT_PATH
 )

-FIND_LIBRARY(FREETYPE_LIBRARY
-  NAMES freetype libfreetype freetype219
-  PATHS
-  ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-  NO_DEFAULT_PATH
-  #PATH_SUFFIXES lib64 lib
-)
+if(WIN32)
+    FIND_LIBRARY(FREETYPE_LIBRARY_DEBUG
+      NAMES freetype libfreetype freetype219
+      PATHS
+      ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG}
+      NO_DEFAULT_PATH
+      #PATH_SUFFIXES lib64 lib
+    )
+    FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE
+      NAMES freetype libfreetype freetype219
+      PATHS
+      ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE}
+      NO_DEFAULT_PATH
+      #PATH_SUFFIXES lib64 lib
+    )
+    set(FREETYPE_LIBRARY debug ${FREETYPE_LIBRARY_DEBUG} optimized ${FREETYPE_LIBRARY_RELEASE})
+    message(${FREETYPE_LIBRARY})
+else()
+    FIND_LIBRARY(FREETYPE_LIBRARY
+      NAMES freetype libfreetype freetype219
+      PATHS
+      ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
+      NO_DEFAULT_PATH
+      #PATH_SUFFIXES lib64 lib
+    )
+endif()

 IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
   SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")


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   08)
+SET(KWSYS_DATE_STAMP_DAY   09)


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 11)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- 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   20)
+SET(KWSYS_DATE_STAMP_DAY   21)


Template environment script uses absolute path

--- scripts/EnvironmentScript.cmake
+++ scripts/EnvironmentScript.cmake
@@ -42,9 +42,9 @@
     return()
 endif()

-set(_PATH_TO_LOCALBASH_IN
+get_filename_component(_PATH_TO_LOCALBASH_IN
     "${CMAKE_CURRENT_LIST_DIR}/localbash.in.sh"
-    CACHE INTERNAL "Path to a template bash script"
+    ABSOLUTE
 )
 find_program(BASH_EXECUTABLE bash)
 find_program(ENV_EXECUTABLE env)


Respect CMAKE_INSTALL_MANDIR for sphinx generated manpages

This is a re-work of r297516, which was reverted in r297545.

https://reviews.llvm.org/D30906

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

--- cmake/modules/AddSphinxTarget.cmake
+++ cmake/modules/AddSphinxTarget.cmake
@@ -48,10 +48,15 @@
     # Handle installation
     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
       if (builder STREQUAL man)
+        if (CMAKE_INSTALL_MANDIR)
+          set(INSTALL_MANDIR ${CMAKE_INSTALL_MANDIR}/)
+        else()
+          set(INSTALL_MANDIR share/man/)
+        endif()
         # FIXME: We might not ship all the tools that these man pages describe
         install(DIRECTORY "${SPHINX_BUILD_DIR}/" # Slash indicates contents of
                 COMPONENT "${project}-sphinx-man"
-                DESTINATION share/man/man1)
+                DESTINATION ${INSTALL_MANDIR}man1)

       elseif (builder STREQUAL html)
         string(TOUPPER "${project}" project_upper)


编译第三方库是可以指定多个 INSTALL_TARGET

编译第三方库是可以指定多个 INSTALL_TARGET

--- project/cmake/modules/FindConfigurePackage.cmake
+++ project/cmake/modules/FindConfigurePackage.cmake
@@ -28,7 +28,7 @@
 #     PREFIX_DIRECTORY <prefix directory>
 #     SRC_DIRECTORY_NAME <source directory name>
 #     MSVC_CONFIGURE <Debug/Release/RelWithDebInfo/MinSizeRel>
-#     INSTALL_TARGET <target name: install>
+#     INSTALL_TARGET [install targets...]
 #     ZIP_URL <zip url>
 #     TAR_URL <tar url>
 #     SVN_URL <svn url>
@@ -50,7 +50,7 @@
 #   <build directory>       - where to execute configure and make
 #   <prefix directory>      - prefix directory(default: <work directory>)
 #   <source directory name> - source directory name(default detected by download url)
-#   <target name: install>  - which target used to install package(default: install)
+#   <install targets>       - which target(s) used to install package(default: install)
 #   <zip url>               - from where to download zip when find package failed
 #   <tar url>               - from where to download tar.* or tgz when find package failed
 #   <svn url>               - from where to svn co when find package failed
@@ -157,8 +157,8 @@
     endif ()
     set(optionArgs BUILD_WITH_CONFIGURE BUILD_WITH_CMAKE BUILD_WITH_SCONS BUILD_WITH_CUSTOM_COMMAND GIT_ENABLE_SUBMODULE
         CMAKE_INHIRT_BUILD_ENV CMAKE_INHIRT_BUILD_ENV_DISABLE_C_FLAGS CMAKE_INHIRT_BUILD_ENV_DISABLE_CXX_FLAGS CMAKE_INHIRT_BUILD_ENV_DISABLE_ASM_FLAGS)
-    set(oneValueArgs PACKAGE WORKING_DIRECTORY BUILD_DIRECTORY PREFIX_DIRECTORY SRC_DIRECTORY_NAME PROJECT_DIRECTORY MSVC_CONFIGURE ZIP_URL TAR_URL SVN_URL GIT_URL GIT_BRANCH GIT_COMMIT GIT_FETCH_DEPTH INSTALL_TARGET)
-    set(multiValueArgs CONFIGURE_CMD CONFIGURE_FLAGS CMAKE_FLAGS FIND_PACKAGE_FLAGS RESET_FIND_VARS SCONS_FLAGS MAKE_FLAGS CUSTOM_BUILD_COMMAND PREBUILD_COMMAND AFTERBUILD_COMMAND)
+    set(oneValueArgs PACKAGE WORKING_DIRECTORY BUILD_DIRECTORY PREFIX_DIRECTORY SRC_DIRECTORY_NAME PROJECT_DIRECTORY MSVC_CONFIGURE ZIP_URL TAR_URL SVN_URL GIT_URL GIT_BRANCH GIT_COMMIT GIT_FETCH_DEPTH)
+    set(multiValueArgs CONFIGURE_CMD CONFIGURE_FLAGS CMAKE_FLAGS FIND_PACKAGE_FLAGS RESET_FIND_VARS SCONS_FLAGS MAKE_FLAGS CUSTOM_BUILD_COMMAND PREBUILD_COMMAND AFTERBUILD_COMMAND INSTALL_TARGET)
     foreach(RESTORE_VAR IN LISTS optionArgs oneValueArgs multiValueArgs)
         unset(FindConfigurePackage_${RESTORE_VAR})
     endforeach()


cleanup: Mark uncommon CMake options as "advanced". (#97)

This removes the options from the CMake UIs, and makes it easier for our
users to discover the interesting tweaks.

--- cmake/EnableClangTidy.cmake
+++ cmake/EnableClangTidy.cmake
@@ -16,6 +16,7 @@

 option(GOOGLE_CLOUD_CPP_CLANG_TIDY
        "If set compiles the Cloud Cloud C++ Libraries with clang-tidy." "")
+mark_as_advanced(GOOGLE_CLOUD_CPP_CLANG_TIDY)

 if (${CMAKE_VERSION} VERSION_LESS "3.6")
     message(STATUS "clang-tidy is not enabled because cmake version is too old")
@@ -23,20 +24,22 @@
     if (${CMAKE_VERSION} VERSION_LESS "3.8")
         message(WARNING "clang-tidy exit code ignored in this version of cmake")
     endif ()
-    find_program(CLANG_TIDY_EXE
+    find_program(GOOGLE_CLOUD_CPP_CLANG_TIDY_PROGRAM
                  NAMES "clang-tidy"
                  DOC "Path to clang-tidy executable")
-
-    if (NOT CLANG_TIDY_EXE)
+    mark_as_advanced(GOOGLE_CLOUD_CPP_CLANG_TIDY_PROGRAM)
+    if (NOT GOOGLE_CLOUD_CPP_CLANG_TIDY_PROGRAM)
         message(STATUS "clang-tidy not found.")
     else ()
-        message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
+        message(
+            STATUS "clang-tidy found: ${GOOGLE_CLOUD_CPP_CLANG_TIDY_PROGRAM}")
     endif ()
 endif ()

 function (google_cloud_cpp_add_clang_tidy target)
-    if (CLANG_TIDY_EXE AND GOOGLE_CLOUD_CPP_CLANG_TIDY)
-        set_target_properties(${target}
-                              PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
+    if (GOOGLE_CLOUD_CPP_CLANG_TIDY_PROGRAM AND GOOGLE_CLOUD_CPP_CLANG_TIDY)
+        set_target_properties(
+            ${target}
+            PROPERTIES CXX_CLANG_TIDY "${GOOGLE_CLOUD_CPP_CLANG_TIDY_PROGRAM}")
     endif ()
 endfunction ()


[numerics] link to SuiteSparse's libcolamd

Not sure why but it appears to be necessary at least on debian unstable.

--- cmake/FindSuiteSparse.cmake
+++ cmake/FindSuiteSparse.cmake
@@ -31,6 +31,10 @@
   if (CXSparse_INCLUDE_DIR AND CXSparse_LIBRARY)
       set(SuiteSparse_CXSparse_FOUND TRUE)
   endif()
+
+  # At least on some systems we need to link to libcolamd which is
+  # another output from suitesparse.
+  find_library(colamd_LIBRARY NAMES colamd)
 endif ()

 include(FindPackageHandleStandardArgs)
@@ -43,7 +47,7 @@
   mark_as_advanced(CXSparse_INCLUDE_DIR CXSparse_LIBRARY)
 endif ()

-set(SuiteSparse_LIBRARIES ${CXSparse_LIBRARY})
+set(SuiteSparse_LIBRARIES ${CXSparse_LIBRARY} ${colamd_LIBRARY})
 set(SuiteSparse_INCLUDE_DIRS ${CXSparse_INCLUDE_DIR})

 # If at least one component was found, SuiteSparse was found.


Codegen: handle DEPENDS in qi_generate_src

Change-Id: I821bf1ebf859c5aee939ffcbfb34712c4c5f935e
Reviewed-on: http://gerrit.aldebaran.lan/36771
Tested-by: gerrit
Reviewed-by: vbarbaresi <371b46c96c99af52f4f920034e4fcb63ece5bdb5@aldebaran-robotics.com>
Reviewed-by: pdaouadi <fc1eb3334d3fdad315bae23aa166bc70bd434067@aldebaran-robotics.com>
Tested-by: pdaouadi <fc1eb3334d3fdad315bae23aa166bc70bd434067@aldebaran-robotics.com>

--- cmake/qibuild/codegen.cmake
+++ cmake/qibuild/codegen.cmake
@@ -23,7 +23,7 @@
 # \group:COMMAND the command to run to generate the files
 # \arg:COMMENT a comment to be displayed while generating the source file
 function(qi_generate_src)
-  cmake_parse_arguments(ARG "" "COMMENT" "SRC;COMMAND" ${ARGN})
+  cmake_parse_arguments(ARG "" "COMMENT" "SRC;COMMAND;DEPENDS" ${ARGN})
   set(out ${ARG_UNPARSED_ARGUMENTS})
   foreach(_out_file ${out})
     set_source_files_properties(${_out_file}
@@ -41,7 +41,7 @@
                      COMMENT "${_comment}"
                      COMMAND ${_cmd}
                      ARGS ${ARG_COMMAND}
-                     DEPENDS ${ARG_SRC}
+                     DEPENDS ${ARG_SRC} ${ARG_DEPENDS}
   )
 endfunction()


ISSUE #262 add search for .tx files on apple (untested)

--- cmake_modules/FindODA.cmake
+++ cmake_modules/FindODA.cmake
@@ -53,6 +53,21 @@
 		)

 		if(NOT libPathRelease${libName} AND UNIX)
+			#check for .tx (unix)
+			SET(CMAKE_FIND_LIBRARY_PREFIXES "")
+			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".tx")
+			find_library(libPathRelease${libName} NAMES ${libName}
+				PATHS
+				${ODA_ROOT}/lib
+				${ODA_BIN_DIR}
+				${ODA_LIB_DIR}
+			)
+
+			SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+		endif()
+
+		if(NOT libPathRelease${libName} AND APPLE)
 			#check for .tx
 			SET(CMAKE_FIND_LIBRARY_PREFIXES "")
 			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".tx")
@@ -61,10 +76,10 @@
 				${ODA_ROOT}/lib
 				${ODA_BIN_DIR}
 				${ODA_LIB_DIR}
-			)
-
+			)
+
 			SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".a")
 		endif()

 		set(ODA_LIBRARIES_RELEASE ${ODA_LIBRARIES_RELEASE} ${libPathRelease${libName}})
@@ -76,7 +91,7 @@
 			${ODA_BIN_DIR}
 			${ODA_LIB_DIR}
 		)
-
+
 		if(NOT libPathDebug${libName} AND UNIX)
 			#check for .tx
 			SET(CMAKE_FIND_LIBRARY_PREFIXES "")
@@ -86,10 +101,25 @@
 				${ODA_ROOT}/lib
 				${ODA_BIN_DIR}
 				${ODA_LIB_DIR}
-			)
-
+			)
+
 			SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
 			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+		endif()
+
+		if(NOT libPathDebug${libName} AND APPLE)
+			#check for .tx
+			SET(CMAKE_FIND_LIBRARY_PREFIXES "")
+			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".tx")
+			find_library(libPathDebug${libName} NAMES ${libName}
+				PATHS
+				${ODA_ROOT}/lib
+				${ODA_BIN_DIR}
+				${ODA_LIB_DIR}
+			)
+
+			SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
+			SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".a")
 		endif()
 		set(ODA_LIBRARIES_DEBUG ${ODA_LIBRARIES_DEBUG} ${libPathDebug${libName}})
 	endforeach()


Fixed match string in ITK Patch

Fixed match string in ITK Patch

--- CMakeExternals/PatchITK-4.7.0.cmake
+++ CMakeExternals/PatchITK-4.7.0.cmake
@@ -2,7 +2,8 @@

 set(path "Modules/ThirdParty/GDCM/src/CMakeLists.txt")
 file(STRINGS ${path} contents NEWLINE_CONSUME)
-string(REPLACE "SFF)" "SFF gdcmDSED gdcmCommon)" contents ${contents})
+# more robust search for replacement
+string(REPLACE "gdcmMSFF" "gdcmMSFF gdcmDSED gdcmCommon" contents ${contents})
 set(CONTENTS ${contents})
 configure_file(${TEMPLATE_FILE} ${path} @ONLY)


further investigation

further investigation

--- sundials/config/FindKLU.cmake
+++ sundials/config/FindKLU.cmake
@@ -19,6 +19,7 @@
 # Set library prefixes for Windows
 IF(WIN32)
   set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES})
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
 endif()

 ### Find include dir
@@ -39,6 +40,7 @@
     # find library with user provided directory path
     set(KLU_LIBRARY_NAME klu)
     message(STATUS ${KLU_LIBRARY_DIR})
+    message(STATUS ${CMAKE_FIND_LIBRARY_PREFIXES})
     find_library(KLU_LIBRARY ${KLU_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH)
 endif ()
 mark_as_advanced(KLU_LIBRARY)


fix: remove old protobuf workaround (#3923)

Fixes: https://github.com/googleapis/google-cloud-cpp-common/issues/110

--- super/external/protobuf.cmake
+++ super/external/protobuf.cmake
@@ -47,11 +47,6 @@
             -DCMAKE_PREFIX_PATH=${GOOGLE_CLOUD_CPP_PREFIX_PATH}
             -DCMAKE_INSTALL_RPATH=${GOOGLE_CLOUD_CPP_INSTALL_RPATH}
             -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-            # Protobuf installs using `CMAKE_INSTALL_LIBDIR`, as it should,
-            # which expands to `lib` or `lib64`. But hard-codes RPATH to
-            # `$ORIGIN/../lib`, so change the default `LIBDIR` to something that
-            # works. https://github.com/protocolbuffers/protobuf/pull/6204
-            -DCMAKE_INSTALL_LIBDIR=lib
             -Dprotobuf_BUILD_TESTS=OFF
             -Dprotobuf_DEBUG_POSTFIX=
             -H<SOURCE_DIR>/cmake


WRG: update tag for diapotb

WRG: update tag for diapotb

--- Modules/Remote/diapotb.remote.cmake
+++ Modules/Remote/diapotb.remote.cmake
@@ -22,5 +22,5 @@
 otb_fetch_module(DiapOTBModule
   "OTB module for SAR processing in Diapason."
   GIT_REPOSITORY https://gitlab.orfeo-toolbox.org/remote_modules/diapotb.git
-  GIT_TAG 79f48869d2a50d588c35560df5ee9dac646418a8
+  GIT_TAG ac9fb0371a262d5cc405bc72d39033963e6380f0
 )


ENH: update QT4-uninstall target and no-gtk config

--- SuperBuild/CMake/External_qt4.cmake
+++ SuperBuild/CMake/External_qt4.cmake
@@ -55,10 +55,9 @@
   else() #Linux
     if(QT4_SB_ENABLE_GTK)
       message(WARNING "QT4_SB_ENABLE_GTK support is experimental")
-
       set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -sm -xrender -xrandr -gtkstyle")
     else()
-      set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-gtkstyle")
+      set(QT4_SB_CONFIG "${QT4_SB_CONFIG} -no-gtkstyle -no-glib")
     endif()
   endif()
   #common for all unix
@@ -105,10 +104,12 @@
   COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtSvg"
   COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtTest"
   COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/QtXml"
+  COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/include/Qt"
   COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/mkspecs"
   COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/plugins"
   COMMAND ${CMAKE_COMMAND} -E remove_directory "${SB_INSTALL_PREFIX}/translations"
   COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/lib/libQt*"
+  COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/lib/pkgconfig/Qt*"
   COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/qmake${QT4_BIN_EXT}"
   COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/lrelease${QT4_BIN_EXT}"
   COMMAND ${CMAKE_COMMAND} -E remove -f "${SB_INSTALL_PREFIX}/bin/moc${QT4_BIN_EXT}"


SuperBuild: jpeg: remove unused patch

SuperBuild: jpeg: remove unused patch

--- SuperBuild/patches/JPEG/patch.cmake
+++ SuperBuild/patches/JPEG/patch.cmake
@@ -1,7 +0,0 @@
-file(READ ${CMAKE_SOURCE_DIR}/CMakeLists.txt   cmake_lists_orig1)
-string( REPLACE "-DUSE_SETMODE" "" cmake_lists_patch1 ${cmake_lists_orig1})
-file(WRITE ${CMAKE_SOURCE_DIR}/CMakeLists.txt "${cmake_lists_patch1}")
-
-file(READ ${CMAKE_SOURCE_DIR}/sharedlib/CMakeLists.txt   cmake_lists_orig)
-string( REPLACE "-DUSE_SETMODE" "" cmake_lists_patch ${cmake_lists_orig})
-file(WRITE ${CMAKE_SOURCE_DIR}/sharedlib/CMakeLists.txt "${cmake_lists_patch}")


SVN_SILENT made messages (.desktop file)

--- plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
+++ plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
@@ -29,6 +29,7 @@
 Comment[uk]=Інтерфейс користувача для нетипового налаштовування облікового запису за допомогою керування з’єднаннями Morse.
 Comment[x-test]=xxCustom account configuration user interface for accounts using the Morse connection manager.xx
 Comment[zh_CN]=通过 Morse 连接管理器自定义账户的配置界面
+Comment[zh_TW]=對使用 Morse 連線管理員的帳號自訂帳號設定使用者介面。
 Type=Service
 ServiceTypes=KTpAccountsKCM/AccountUiPlugin


cmake: Remove commented lines which set the generated property to files: they are definitely not needed

--- cmake/modules/TpQt4Macros.cmake
+++ cmake/modules/TpQt4Macros.cmake
@@ -231,7 +231,6 @@
         COMMAND ${PYTHON_EXECUTABLE}
         ARGS ${ARGS}
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-    # Tell CMake the source won't be available until build time.
     add_custom_target(generate_future-${spec}-body DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}-body.hpp)

     if (future_client_generator_depends)
@@ -241,8 +240,6 @@
     tpqt4_generate_moc_i_target_deps(${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}.h
                        ${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}.moc.hpp
                        "generate_future-${spec}-body")
-    # Tell CMake the source won't be available until build time.
-    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_gen/future-${spec}.moc.hpp PROPERTIES GENERATED 1)
 endfunction(tpqt4_future_client_generator spec namespace)

 # This function is used for generating CM in various examples
@@ -258,9 +255,6 @@
                                ${MANAGER_FILE}
                                _gen)

-    set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_gen/param-spec-struct.h
-                                ${CMAKE_CURRENT_BINARY_DIR}/_gen/${OUTPUT_FILENAME}
-                                PROPERTIES GENERATED true)
     set_source_files_properties(${DEPEND_FILENAME}
                                 PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_gen/param-spec-struct.h)
 endfunction(tpqt4_generate_manager_file MANAGER_FILE)
@@ -280,8 +274,6 @@
     if (xincludator_gen_depends)
         add_dependencies(${_TARGET_NAME} ${xincludator_gen_depends})
     endif (xincludator_gen_depends)
-
-    #set_source_files_properties(${_OUTPUT_FILE} PROPERTIES GENERATED true)
 endfunction(tpqt4_xincludator _TARGET_NAME _INPUT_FILE _OUTPUT_FILE)

 function(tpqt4_constants_gen _TARGET_NAME _SPEC_XML _OUTFILE)
@@ -299,8 +291,6 @@
     if (constants_gen_depends)
         add_dependencies(${_TARGET_NAME} ${constants_gen_depends})
     endif (constants_gen_depends)
-
-    #set_source_files_properties(${_OUTFILE} PROPERTIES GENERATED true)
 endfunction (tpqt4_constants_gen _TARGET_NAME _SPEC_XML _OUTFILE)

 function(tpqt4_types_gen _TARGET_NAME _SPEC_XML _OUTFILE_DECL _OUTFILE_IMPL _NAMESPACE _REALINCLUDE _PRETTYINCLUDE)
@@ -320,8 +310,6 @@
     if (types_gen_depends)
         add_dependencies(${_TARGET_NAME} ${types_gen_depends})
     endif (types_gen_depends)
-    #set_source_files_properties(${_OUTFILE_DECL} PROPERTIES GENERATED true)
-    #set_source_files_properties(${_OUTFILE_IMPL} PROPERTIES GENERATED true)
 endfunction(tpqt4_types_gen _TARGET_NAME _SPEC_XML _OUTFILE_DECL _OUTFILE_IMPL _NAMESPACE _REALINCLUDE _PRETTYINCLUDE)

 macro(tpqt4_add_generic_unit_test _fancyName _name)


make: Use symlink instead of copy.

make: Use symlink instead of copy.

This enables you to edit non-generated files in the `./build` directory
and have the changes appear in your git repository. You want to do this
so that tools which parse includes will find the generated files.

Signed-off-by: Tim 'mithro' Ansell <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@mith.ro>

--- common/cmake/file_targets.cmake
+++ common/cmake/file_targets.cmake
@@ -260,7 +260,7 @@
     add_custom_command(
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ADD_FILE_TARGET_FILE}
       COMMAND
-        ${CMAKE_COMMAND} -E copy
+        ${CMAKE_COMMAND} -E create_symlink
         ${CMAKE_CURRENT_SOURCE_DIR}/${ADD_FILE_TARGET_FILE}
         ${CMAKE_CURRENT_BINARY_DIR}/${ADD_FILE_TARGET_FILE}
       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${ADD_FILE_TARGET_FILE} ${INCLUDE_FILES_TARGETS}


Added DCMTK to the library search path, since it is build shared now.

--- CMake/mitkFunctionGetLibrarySearchPaths.cmake
+++ CMake/mitkFunctionGetLibrarySearchPaths.cmake
@@ -9,8 +9,14 @@
   endif()

   if(WIN32)
-    list(APPEND _dir_candidates "${ITK_DIR}/bin")
+    if(DCMTK_DIR)
+      list(APPEND _dir_candidates "${DCMTK_DIR}/bin")
+    endif()
+   list(APPEND _dir_candidates "${ITK_DIR}/bin")
   else()
+    if(DCMTK_DIR)
+      list(APPEND _dir_candidates "${DCMTK_DIR}/lib")
+    endif()
     list(APPEND _dir_candidates "${ITK_DIR}/lib")
   endif()


Reduce the set of ITK modules required to build SimpleITK

--- CMake/sitkCheckForITKModuleDependencies.cmake
+++ CMake/sitkCheckForITKModuleDependencies.cmake
@@ -15,47 +15,18 @@
 # ensure that we have the 'IO on' too.
 #
 list(APPEND _SITK_REQUIRED_ITK_MODULES
-  ITKAnisotropicSmoothing
-  ITKAntiAlias
-  ITKBiasCorrection
-  ITKBinaryMathematicalMorphology
-  ITKClassifiers
-  ITKColormap
   ITKCommon
-  ITKConnectedComponents
-  ITKConvolution
-  ITKCurvatureFlow
-  ITKDeconvolution
-  ITKDenoising
   ITKDisplacementField
-  ITKDistanceMap
-  ITKFFT
-  ITKFastMarching
-  ITKImageAdaptors
-  ITKImageCompare
+  ITKIOGDCM
+  ITKIOImageBase
+  ITKIOTransformBase
   ITKImageCompose
-  ITKImageFeature
-  ITKImageFilterBase
-  ITKImageFusion
-  ITKImageGradient
-  ITKImageGrid
   ITKImageIntensity
-  ITKImageLabel
-  ITKImageNoise
-  ITKImageSources
-  ITKImageStatistics
   ITKLabelMap
-  ITKLabelVoting
-  ITKLevelSets
-  ITKMathematicalMorphology
-  ITKPDEDeformableRegistration
-  ITKRegionGrowing
-  ITKReview
-  ITKSmoothing
-  ITKStatistics
-  ITKThresholding
+  ITKMetricsv4
+  ITKOptimizersv4
+  ITKRegistrationMethodsv4
   ITKTransform
-  ITKWatersheds
 )

 foreach(itkDependency ${_SITK_REQUIRED_ITK_MODULES})


Use static linking for oss-fuzz

Use static linking for oss-fuzz

--- tools/cmake/FindMbedTLS.cmake
+++ tools/cmake/FindMbedTLS.cmake
@@ -1,8 +1,15 @@
 find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h HINTS ${MBEDTLS_FOLDER_INCLUDE})

-find_library(MBEDTLS_LIBRARY mbedtls HINTS ${MBEDTLS_FOLDER_LIBRARY})
-find_library(MBEDX509_LIBRARY mbedx509 HINTS ${MBEDTLS_FOLDER_LIBRARY})
-find_library(MBEDCRYPTO_LIBRARY mbedcrypto HINTS ${MBEDTLS_FOLDER_LIBRARY})
+if(UA_BUILD_OSS_FUZZ)
+    # oss-fuzz requires static linking of libraries
+    set(MBEDTLS_LIBRARY /usr/lib/x86_64-linux-gnu/libmbedtls.a)
+    set(MBEDX509_LIBRARY /usr/lib/x86_64-linux-gnu/libmbedx509.a)
+    set(MBEDCRYPTO_LIBRARY /usr/lib/x86_64-linux-gnu/libmbedcrypto.a)
+else()
+    find_library(MBEDTLS_LIBRARY mbedtls HINTS ${MBEDTLS_FOLDER_LIBRARY})
+    find_library(MBEDX509_LIBRARY mbedx509 HINTS ${MBEDTLS_FOLDER_LIBRARY})
+    find_library(MBEDCRYPTO_LIBRARY mbedcrypto HINTS ${MBEDTLS_FOLDER_LIBRARY})
+endif()

 set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}")


Find Systemd Journal: Reformat CMake code

--- cmake/Modules/FindSystemdJournal.cmake
+++ cmake/Modules/FindSystemdJournal.cmake
@@ -1,70 +1,67 @@
+# ~~~
 # Finds systemd-journal and its libraries
 # Uses the same semantics as pkg_check_modules, i.e. LIBSYSTEMD_JOURNAL{_FOUND,_INCLUDE_DIR,_LIBRARIES}
 #
-# This is an adapted version of FindSystemd.cmake:
+# This is an adapted version of FindSystemd.cmake:
 # Copyright: Red Hat, Inc. 2013
 # Author: Martin Briza <mbriza@redhat.com>
 #
 # Distributed under the BSD license. See COPYING-CMAKE-SCRIPTS for details.
+# ~~~

 if (LIBSYSTEMD_JOURNAL_INCLUDE_DIR AND LIBSYSTEMD_ID128_INCLUDE_DIR)
-  # in cache already
-  set (LIBSYSTEMD_JOURNAL_FOUND TRUE)
+	set (LIBSYSTEMD_JOURNAL_FOUND TRUE) # in cache already
 else (LIBSYSTEMD_JOURNAL_INCLUDE_DIR AND LIBSYSTEMD_ID128_INCLUDE_DIR)

-  # try to find systemd-journal via pkg-config
-  find_package(PkgConfig)
+	# try to find systemd-journal via pkg-config
+	find_package (PkgConfig)

-  if (PKG_CONFIG_FOUND)
-    pkg_check_modules(_LIBSYSTEMD_JOURNAL_PC QUIET "libsystemd-journal")
-    pkg_check_modules(_LIBSYSTEMD_ID128_PC QUIET "libsystemd-id128")
-    pkg_check_modules(_LIBSYSTEMD_PC QUIET "libsystemd")
-  endif (PKG_CONFIG_FOUND)
+	if (PKG_CONFIG_FOUND)
+		pkg_check_modules (_LIBSYSTEMD_JOURNAL_PC QUIET "libsystemd-journal")
+		pkg_check_modules (_LIBSYSTEMD_ID128_PC QUIET "libsystemd-id128")
+		pkg_check_modules (_LIBSYSTEMD_PC QUIET "libsystemd")
+	endif (PKG_CONFIG_FOUND)

-  find_path (LIBSYSTEMD_JOURNAL_INCLUDE_DIR systemd/sd-journal.h
-    ${_LIBSYSTEMD_JOURNAL_PC_INCLUDE_DIRS}
-    ${_LIBSYSTEMD_PC_INCLUDE_DIRS}
-    /usr/include
-    /usr/local/include
-  )
+	find_path (LIBSYSTEMD_JOURNAL_INCLUDE_DIR
+		   systemd/sd-journal.h
+		   ${_LIBSYSTEMD_JOURNAL_PC_INCLUDE_DIRS}
+		   ${_LIBSYSTEMD_PC_INCLUDE_DIRS}
+		   /usr/include
+		   /usr/local/include)

-  find_path (LIBSYSTEMD_ID128_INCLUDE_DIR systemd/sd-id128.h
-    ${_LIBSYSTEMD_ID128_PC_INCLUDE_DIRS}
-    ${_LIBSYSTEMD_PC_INCLUDE_DIRS}
-    /usr/include
-    /usr/local/include
-  )
+	find_path (LIBSYSTEMD_ID128_INCLUDE_DIR
+		   systemd/sd-id128.h
+		   ${_LIBSYSTEMD_ID128_PC_INCLUDE_DIRS}
+		   ${_LIBSYSTEMD_PC_INCLUDE_DIRS}
+		   /usr/include
+		   /usr/local/include)

-  # try to use the merged library libsystemd
-  find_library (LIBSYSTEMD_JOURNAL_LIBRARIES NAMES systemd
-    PATHS
-    ${_LIBSYSTEMD_PC_LIBDIR}
-  )
+	# try to use the merged library libsystemd
+	find_library (LIBSYSTEMD_JOURNAL_LIBRARIES NAMES systemd PATHS ${_LIBSYSTEMD_PC_LIBDIR})

-  # if the merged library was not found try to use the old split library
-  if (NOT LIBSYSTEMD_JOURNAL_LIBRARIES)
-    find_library (LIBSYSTEMD_JOURNAL_LIBRARIES NAMES systemd-journal systemd-id128
-      PATHS
-      ${_LIBSYSTEMD_JOURNAL_PC_LIBDIR}
-      ${_LIBSYSTEMD_ID128_PC_LIBDIR}
-    )
-  endif (NOT LIBSYSTEMD_JOURNAL_LIBRARIES)
+	# if the merged library was not found try to use the old split library
+	if (NOT LIBSYSTEMD_JOURNAL_LIBRARIES)
+		find_library (LIBSYSTEMD_JOURNAL_LIBRARIES
+			      NAMES systemd-journal
+				    systemd-id128
+			      PATHS ${_LIBSYSTEMD_JOURNAL_PC_LIBDIR}
+				    ${_LIBSYSTEMD_ID128_PC_LIBDIR})
+	endif (NOT LIBSYSTEMD_JOURNAL_LIBRARIES)

+	if (LIBSYSTEMD_JOURNAL_INCLUDE_DIR AND LIBSYSTEMD_ID128_INCLUDE_DIR AND LIBSYSTEMD_JOURNAL_LIBRARIES)
+		set (LIBSYSTEMD_JOURNAL_FOUND TRUE)
+	endif (LIBSYSTEMD_JOURNAL_INCLUDE_DIR AND LIBSYSTEMD_ID128_INCLUDE_DIR AND LIBSYSTEMD_JOURNAL_LIBRARIES)

-  if (LIBSYSTEMD_JOURNAL_INCLUDE_DIR AND LIBSYSTEMD_ID128_INCLUDE_DIR AND LIBSYSTEMD_JOURNAL_LIBRARIES)
-    set (LIBSYSTEMD_JOURNAL_FOUND TRUE)
-  endif (LIBSYSTEMD_JOURNAL_INCLUDE_DIR AND LIBSYSTEMD_ID128_INCLUDE_DIR AND LIBSYSTEMD_JOURNAL_LIBRARIES)
+	if (LIBSYSTEMD_JOURNAL_FOUND)
+		if (NOT LIBSYSTEMD_JOURNAL_FIND_QUIETLY)
+			message (STATUS "Found systemd-journal: ${LIBSYSTEMD_JOURNAL_LIBRARIES}")
+		endif (NOT LIBSYSTEMD_JOURNAL_FIND_QUIETLY)
+	else (LIBSYSTEMD_JOURNAL_FOUND)
+		if (LIBSYSTEMD_JOURNAL_FIND_REQUIRED)
+			message (FATAL_ERROR "Could NOT find systemd-journal")
+		endif (LIBSYSTEMD_JOURNAL_FIND_REQUIRED)
+	endif (LIBSYSTEMD_JOURNAL_FOUND)

-  if (LIBSYSTEMD_JOURNAL_FOUND)
-    if (NOT LIBSYSTEMD_JOURNAL_FIND_QUIETLY)
-      message(STATUS "Found systemd-journal: ${LIBSYSTEMD_JOURNAL_LIBRARIES}")
-    endif (NOT LIBSYSTEMD_JOURNAL_FIND_QUIETLY)
-  else (LIBSYSTEMD_JOURNAL_FOUND)
-    if (LIBSYSTEMD_JOURNAL_FIND_REQUIRED)
-      message(FATAL_ERROR "Could NOT find systemd-journal")
-    endif (LIBSYSTEMD_JOURNAL_FIND_REQUIRED)
-  endif (LIBSYSTEMD_JOURNAL_FOUND)
-
-  mark_as_advanced(LIBSYSTEMD_JOURNAL_INCLUDE_DIR LIBSYSTEMD_ID128_INCLUDE_DIR LIBSYSTEMD_JOURNAL_LIBRARIES)
+	mark_as_advanced (LIBSYSTEMD_JOURNAL_INCLUDE_DIR LIBSYSTEMD_ID128_INCLUDE_DIR LIBSYSTEMD_JOURNAL_LIBRARIES)

 endif (LIBSYSTEMD_JOURNAL_INCLUDE_DIR AND LIBSYSTEMD_ID128_INCLUDE_DIR)


[CMake][Exp PyROOT] Fatal Error if Python < 2.7

--- cmake/modules/SearchRootCoreDeps.cmake
+++ cmake/modules/SearchRootCoreDeps.cmake
@@ -36,7 +36,7 @@
       set(NUMPY_INCLUDE_DIRS "${Python_NumPy_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE)
     endif()
     if(DEFINED Python_VERSION AND "${Python_VERSION}" VERSION_LESS "2.7")
-      message(WARNING "Ignoring Python installation: unsupported version ${Python_VERSION} (version>=2.7 required)")
+        message(FATAL_ERROR "Ignoring Python installation: unsupported version ${Python_VERSION} (version>=2.7 required)")
     endif()
     if(NOT Python_Development_FOUND)
       message(WARNING "No supported Python development package was found for the specified Python executable; PyROOT will not be built")


remove intel warning about always_inline

disable the following incorrect warning:
```
include/deal.II/base/tensor.h(824): warning #3415: the "always_inline"
attribute is ignored on non-inline functions
inline DEAL_II_ALWAYS_INLINE
```

--- cmake/setup_compiler_flags_intel.cmake
+++ cmake/setup_compiler_flags_intel.cmake
@@ -58,6 +58,7 @@
 #
 # Disable some warnings that lead to a lot of false positives:
 #
+#   -w21    type qualifiers are meaningless in this declaration
 #   -w68    integer conversion resulted in a change of sign
 #           (triggers a lot in functionparser)
 #   -w175   subscript out of range
@@ -97,10 +98,12 @@
 #   -w1572  floating-point equality and inequality comparisons are unreliable
 #   -w2259  non-pointer conversion from "double" to "float" may
 #           lose significant bits
-#   -w21    type qualifiers are meaningless in this declaration
 #   -w2536  type qualifiers are meaningless here
+#   -w3415  the "always_inline" attribute is ignored on non-inline functions
+#           incorrectly triggered by inline functions in tensor.h
 #   -w15531 A portion of SIMD loop is serialized
 #
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd21")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd68")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd135")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd175")
@@ -115,8 +118,8 @@
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1478")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd1572")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd2259")
-ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd21")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd2536")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd3415")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd15531")


[Build] Added a dependency on Boost::RegEx

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -383,7 +383,7 @@
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS
-    program_options date_time iostreams serialization filesystem
+    regex program_options date_time iostreams serialization filesystem
     unit_test_framework python)

   # The first check is for the required components.
@@ -400,18 +400,19 @@

     # Update the list of dependencies for the project
     list (APPEND PROJ_DEP_LIBS_FOR_LIB
-      ${Boost_IOSTREAMS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
-      ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
-      ${Boost_PYTHON_LIBRARY})
-    list (APPEND PROJ_DEP_LIBS_FOR_BIN ${Boost_PROGRAM_OPTIONS_LIBRARY})
+      ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
+	  ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
+	  ${Boost_DATE_TIME_LIBRARY} ${Boost_PYTHON_LIBRARY})
+    list (APPEND PROJ_DEP_LIBS_FOR_BIN
+	  ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
     list (APPEND PROJ_DEP_LIBS_FOR_TST ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

     # For display purposes
     set (BOOST_REQUIRED_LIBS
-      ${Boost_IOSTREAMS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
-      ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
-      ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
-      ${Boost_PYTHON_LIBRARY})
+      ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
+	  ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
+	  ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
+	  ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_PYTHON_LIBRARY})
   endif (Boost_FOUND)

 endmacro (get_boost)


[Build] Added support to read the version from the CMake cache.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -139,6 +139,8 @@
 macro (store_in_cache)
   # Force some variables that could be defined in the command line to be
   # written to cache
+  set (PACKAGE_VERSION "${PACKAGE_VERSION}" CACHE STRING
+  "Version of the project/package")
   set (BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}" CACHE BOOL
 	"Set to OFF to build static libraries" FORCE)
   set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH


ENH: Fixing error and improving examples' test

CMake Error at CMake/ITKModuleMacros.cmake:352 (add_subdirectory):
  add_subdirectory given source "examples" which is not an existing
  directory.
Call Stack (most recent call first):
  Modules/Remote/MorphologicalContourInterpolation/CMakeLists.txt:12 (itk_module_examples)

Change-Id: I1d1b70da30b4ed701d40d41bbd2864266df57dc5

--- Modules/Remote/MorphologicalContourInterpolation.remote.cmake
+++ Modules/Remote/MorphologicalContourInterpolation.remote.cmake
@@ -14,5 +14,5 @@
 This work is supported by NIH grant R01 EB014346
 'Continued development and maintenance of the ITK-SNAP 3D image segmentation software'."
   GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/ITKMorphologicalContourInterpolation.git
-  GIT_TAG 04baa12efb3c01f74719682ece22b58165dc548c
+  GIT_TAG 55081578b270af82addfbdf9720e0b8a3929eaea
   )


Support Win8.1 SDK in the x64 LIB path changes for the test suite

SVN-Revision: 2658

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -500,9 +500,9 @@
           string(REGEX REPLACE "(v[^/\\\\]*[/\\\\][Ll][Ii][Bb][/\\\\])[Aa][Mm][Dd]64"
             "\\1x64"
             newlib "${newlib}")
-          # Win8 SDK uses um/x86 and um/x64
+          # Win8 SDK uses um/x86 and um/x64 after "Lib/win{8,v6.3}/"
           string(REGEX REPLACE
-            "([Ll][Ii][Bb])[/\\\\]amd64([/\\\\][Ww][Ii][Nn]8[/\\\\]um[/\\\\])x86"
+            "([Ll][Ii][Bb])[/\\\\]amd64([/\\\\][Ww][Ii][Nn][v0-9.]+[/\\\\]um[/\\\\])x86"
             "\\1\\2x64" newlib "${newlib}")
           if (arg_verbose)
             message("Env setup: setting LIB to ${newlib}")


deactivated test because it fails on some dart clients

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -32,9 +32,9 @@

    # ------------------ Navigation Tool Management Tests -------------------
    mitkNavigationToolStorageTest.cpp
-   mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
+   #mitkNavigationToolStorageSerializerAndDeserializerTest.cpp #deactivated, see bug #10701
    mitkNavigationToolTest.cpp
-   mitkNavigationToolReaderAndWriterTest.cpp #deactivated, see bug #3461
+   mitkNavigationToolReaderAndWriterTest.cpp
    # -----------------------------------------------------------------------

    # ------------------ Deavtivated Tests ----------------------------------
@@ -46,4 +46,4 @@
   mitkNDIAuroraHardwareTest.cpp
   mitkNDIPolarisHardwareTest.cpp
   mitkClaronTrackingDeviceHardwareTest.cpp
-)
+)


add VAD_MetaMat

add VAD_MetaMat

--- external/vigra_cmake/VAD_MetaMat.cmake
+++ external/vigra_cmake/VAD_MetaMat.cmake
@@ -21,13 +21,20 @@
 function(vad_live)
   message("run VAD_LIVE for METAMAT")

+  vigra_add_dep(HDF5 REQUIRED LIVE)
+  vigra_add_dep(OpenCV REQUIRED LIVE)
+  vigra_add_dep(Boost REQUIRED LIVE)
+
   git_clone(MetaMat)

   add_subdirectory("${VAD_EXTERNAL_ROOT}/MetaMat" "${CMAKE_BINARY_DIR}/external/MetaMat")

   add_library(METAMAT::METAMAT INTERFACE IMPORTED)

-  set_target_properties(METAMAT::METAMAT PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/external/MetaMat/include")
-  set_target_properties(METAMAT::METAMAT PROPERTIES INTERFACE_LINK_LIBRARIES cliini)

+  # FIXME shouldnt this be forwarded?
+  get_target_property(_MM_INC_DIRS metamat INTERFACE_INCLUDE_DIRECTORIES)
+
+  set_target_properties(METAMAT::METAMAT PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/external/MetaMat/include;${_MM_INC_DIRS}")
+  set_target_properties(METAMAT::METAMAT PROPERTIES INTERFACE_LINK_LIBRARIES metamat)
 endfunction()


commented FRI CMake code

commented FRI CMake code

--- config/FRI-Client-SDK_Cpp.cmake
+++ config/FRI-Client-SDK_Cpp.cmake
@@ -1,3 +1,15 @@
+# Sets up KUKA Sunrise FRI Cpp SDK with KUKA connectivity suite
+
+# Variables
+# FRI_Client_SDK_Cpp_zip_PATH - Path to folder containing FRI-Client-SDK_Cpp.zip
+#
+# Targets
+# KukaFRIClient     - KukaFRIClient Libraries you should link to to use Kuka FRI APIs
+# nanopb            - nanopb library used to communicate with FRI on Kuka controller
+# friUdpConnection  - UDP components for demo code (not needed by github.com/ahundt/grl)
+#
+# Author: Andrew Hundt <ATHundt@gmail.com>
+
 # Sets up KUKA Sunrise FRI Cpp SDK with KUKA connectivity suite
 message(STATUS "Looking for File Path to FRI-Client-SDK_Cpp.zip KUKA FRI C++ API zip file from sunrise connectivity suite v1.9")
 set(FRI_Client_SDK_Cpp_zip_PATH "${CMAKE_SOURCE_DIR}/data/" CACHE FILEPATH "File Path to FRI-Client-SDK_Cpp.zip KUKA FRI C++ API zip file from sunrise connectivity suite v1.9")


Add version check logic for macOS deployment target build option. [skip appveyor] [ci only: OSX]

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -96,14 +96,18 @@
     unset (CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
 elseif (XCODE)
     set (CMAKE_OSX_SYSROOT macosx)    # Set Base SDK to "Latest OS X"
-    if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+    if (CMAKE_OSX_DEPLOYMENT_TARGET)
+        if (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.9)
+            message (FATAL_ERROR "The minimum supported CMAKE_OSX_DEPLOYMENT_TARGET is 10.9.")
+        endif ()
+    else ()
         # If not set, set to current running build system OS version by default
         execute_process (COMMAND sw_vers -productVersion OUTPUT_VARIABLE CURRENT_OSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
         string (REGEX REPLACE ^\([^.]+\\.[^.]+\).* \\1 CMAKE_OSX_DEPLOYMENT_TARGET ${CURRENT_OSX_VERSION})
-        set (CMAKE_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET} CACHE STRING "Specify macOS deployment target (macOS platform only); default to current running macOS if not specified, the minimum supported target is 10.5 due to constraint from SDL library")
+        set (CMAKE_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET} CACHE STRING "Specify macOS deployment target (macOS platform only); default to current running macOS if not specified, the minimum supported target is 10.9")
     endif ()
     if (DEPLOYMENT_TARGET_SAVED AND NOT CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL DEPLOYMENT_TARGET_SAVED)
-        set (CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET_SAVED} CACHE STRING "Specify macOS deployment target (macOS platform only); default to current running macOS if not specified, the minimum supported target is 10.5 due to constraint from SDL library" FORCE)
+        set (CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET_SAVED} CACHE STRING "Specify macOS deployment target (macOS platform only); default to current running macOS if not specified, the minimum supported target is 10.9" FORCE)
         message (FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET cannot be changed after the initial configuration/generation. "
             "Auto reverting to its initial value. If you wish to change it then the build tree would have to be regenerated from scratch.")
     endif ()


cmake UPDATE find sysrepo with version

cmake UPDATE find sysrepo with version

--- CMakeModules/FindSysrepo.cmake
+++ CMakeModules/FindSysrepo.cmake
@@ -1,12 +1,13 @@
 # Find Sysrepo
 #  Once done, it will define
 #
-#  SYSREPO_FOUND - System has SYSREPO
-#  SYSREPO_INCLUDE_DIRS - The SYSREPO include directories
-#  SYSREPO_LIBRARIES - The libraries needed to use SYSREPO
+#  SYSREPO_FOUND - System has sysrepo
+#  SYSREPO_INCLUDE_DIRS - The sysrepo include directories
+#  SYSREPO_LIBRARIES - The libraries needed to use sysrepo
+#  SYSREPO_VERSION - SO version of the found sysrepo library
 #
 #  Author Michal Vasko <mvasko@cesnet.cz>
-#  Copyright (c) 2020 CESNET, z.s.p.o.
+#  Copyright (c) 2021 CESNET, z.s.p.o.
 #
 #  Redistribution and use in source and binary forms, with or without
 #  modification, are permitted provided that the following conditions
@@ -49,11 +50,20 @@
         ${CMAKE_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib
     )

+    if(SYSREPO_INCLUDE_DIR)
+        find_path(SR_VERSION_PATH "sysrepo/version.h" HINTS ${SYSREPO_INCLUDE_DIR})
+        file(READ "${SR_VERSION_PATH}/sysrepo/version.h" SR_VERSION_FILE)
+        string(REGEX MATCH "#define SR_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\"" SR_VERSION_MACRO "${SR_VERSION_FILE}")
+        string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" SYSREPO_VERSION "${SR_VERSION_MACRO}")
+    endif()
+
     set(SYSREPO_INCLUDE_DIRS ${SYSREPO_INCLUDE_DIR})
     set(SYSREPO_LIBRARIES ${SYSREPO_LIBRARY})
     mark_as_advanced(SYSREPO_INCLUDE_DIRS SYSREPO_LIBRARIES)

     # handle the QUIETLY and REQUIRED arguments and set SYSREPO_FOUND to TRUE
     # if all listed variables are TRUE
-    find_package_handle_standard_args(Sysrepo DEFAULT_MSG SYSREPO_LIBRARY SYSREPO_INCLUDE_DIR)
+    find_package_handle_standard_args(Sysrepo FOUND_VAR SYSREPO_FOUND
+        REQUIRED_VARS SYSREPO_LIBRARY SYSREPO_INCLUDE_DIR
+        VERSION_VAR SYSREPO_VERSION)
 endif()


fbcode_builder: cmake: propagate thrift include dependencies correctly

Summary:
Update `add_thrift_cpp2_library()` to pass in the correct `-I` flags when
invoking the thrift compiler so that it can find all of the other thrift files
that this library depends on.

D16062657 was a previous attempt to do this, but suffered from a few problems:
- It required all dependencies to be defined before
  `add_thrift_cpp2_library()` was called.  This requires users to carefully
  order their CMake files and subdirectory include ordering.
- It only handled one level of dependencies, and did not propagate include
  paths for deeper dependencies.
- It set the include path for dependencies to the source directory path where
  the dependency was originally built, rather than the directory where the
  thrift file for that dependency would be installed.

This change does require CMake 3.8+.  Previous versions of CMake do not
support using generator expressions to generate multiple arguments for a
custom command.

Reviewed By: strager

Differential Revision: D17005381

fbshipit-source-id: 31190beba94b4d1010445375a5e2791450230f7d

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -17,13 +17,24 @@
 #   The sub-directory where generated headers will be installed.
 #   Defaults to "include" if not specified.  The caller must still call
 #   install() to install the thrift library if desired.
+# - THRIFT_INCLUDE_DIR <path>
+#   The sub-directory where generated headers will be installed.
+#   Defaults to "${INCLUDE_DIR}/thrift-files" if not specified.
+#   The caller must still call install() to install the thrift library if
+#   desired.
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
   set(one_value_args INCLUDE_DIR)
-  set(multi_value_args SERVICES DEPENDS OPTIONS)
+  set(multi_value_args SERVICES DEPENDS OPTIONS THRIFT_INCLUDE_DIR)
   fb_cmake_parse_args(
     ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
   )
+  if(NOT DEFINED ARG_INCLUDE_DIR)
+    set(ARG_INCLUDE_DIR "include")
+  endif()
+  if(NOT DEFINED ARG_THRIFT_INCLUDE_DIR)
+    set(ARG_THRIFT_INCLUDE_DIR "${ARG_INCLUDE_DIR}/thrift-files")
+  endif()

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -39,9 +50,6 @@
     "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
   )
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)
-  if(NOT DEFINED ARG_INCLUDE_DIR)
-    set(ARG_INCLUDE_DIR "include")
-  endif()

   if (NOT "${include_prefix}" STREQUAL "")
     list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
@@ -78,22 +86,21 @@
     )
   endforeach()

-  list(APPEND thrift_include_options -I "${CMAKE_SOURCE_DIR}")
-  foreach(depends IN LISTS ARG_DEPENDS)
-    get_property(thrift_include_directory
-      TARGET ${depends}
-      PROPERTY THRIFT_INCLUDE_DIRECTORY)
-
-    if (thrift_include_directory STREQUAL "")
-      message(STATUS "No thrift dependency found for ${depends}")
-    else()
-      list(
-        APPEND thrift_include_options
-        -I "${thrift_include_directory}"
-      )
-    endif()
-  endforeach()
-
+  # This generator expression gets the list of include directories required
+  # for all of our dependencies.
+  # It requires using COMMAND_EXPAND_LISTS in the add_custom_command() call
+  # below.  COMMAND_EXPAND_LISTS is only available in CMake 3.8+
+  # If we really had to support older versions of CMake we would probably need
+  # to use a wrapper script around the thrift compiler that could take the
+  # include list as a single argument and split it up before invoking the
+  # thrift compiler.
+  if (NOT POLICY CMP0067)
+    message(FATAL_ERROR "add_thrift_cpp2_library() requires CMake 3.8+")
+  endif()
+  set(
+    thrift_include_options
+    "-I;$<JOIN:$<TARGET_PROPERTY:${LIB_NAME}.thrift_includes,INTERFACE_INCLUDE_DIRECTORIES>,;-I;>"
+  )
   file(
     GLOB_RECURSE THRIFT_TEMPLATE_FILES
     FOLLOW_SYMLINKS "${FBTHRIFT_TEMPLATES_DIR}/cpp2/*.mustache"
@@ -104,6 +111,7 @@
     OUTPUT
       ${generated_headers}
       ${generated_sources}
+    COMMAND_EXPAND_LISTS
     COMMAND
       "${CMAKE_COMMAND}" -E make_directory "${output_dir}"
     COMMAND
@@ -111,7 +119,7 @@
       --strict
       --templates "${FBTHRIFT_TEMPLATES_DIR}"
       --gen "mstch_cpp2:${GEN_ARG_STR}"
-      ${thrift_include_options}
+      "${thrift_include_options}"
       -o "${output_dir}"
       "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
     WORKING_DIRECTORY
@@ -159,11 +167,27 @@
     PROPERTY PUBLIC_HEADER ${generated_headers}
   )

+  # Define a dummy interface library to help propagate the thrift include
+  # directories between dependencies.
+  add_library("${LIB_NAME}.thrift_includes" INTERFACE)
+  target_include_directories(
+    "${LIB_NAME}.thrift_includes"
+    INTERFACE
+      "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>"
+      "$<INSTALL_INTERFACE:${ARG_THRIFT_INCLUDE_DIR}>"
+  )
+  foreach(dep IN LISTS ARG_DEPENDS)
+    target_link_libraries(
+      "${LIB_NAME}.thrift_includes"
+      INTERFACE "${dep}.thrift_includes"
+    )
+  endforeach()
+
   set_target_properties(
     "${LIB_NAME}"
     PROPERTIES
-      EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
-      THRIFT_INCLUDE_DIRECTORY "${CMAKE_SOURCE_DIR}"
+      EXPORT_PROPERTIES "THRIFT_INSTALL_DIR"
+      THRIFT_INSTALL_DIR "${ARG_THRIFT_INCLUDE_DIR}/${include_prefix}"
       HEADER_INSTALL_DIR "${ARG_INCLUDE_DIR}/${include_prefix}/gen-cpp2"
   )
 endfunction()


Short workaround

Short workaround

git-svn-id: 59f82343654cec32357d3b049d399063e4e4cfc7@30367 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_deal_ii_add_test.cmake
+++ deal.II/cmake/macros/macro_deal_ii_add_test.cmake
@@ -94,11 +94,7 @@
         COMMAND ${DEAL_II_TEST_DIFF}
           ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
           ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.output
-          > ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff
-        # and a second time to get the output:
-        COMMAND ${DEAL_II_TEST_DIFF}
-          ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
-          ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.output
+          | tee ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff
         DEPENDS
           ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output
           ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.output


Fix error condition

Fix error condition

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -168,7 +168,7 @@
   )

   foreach(deps ${HUNTER_PACKAGE_DEPENDS_ON})
-    if(HUNTER_DOWNLOAD_SCHEME_INSTALL)
+    if(NOT HUNTER_DOWNLOAD_SCHEME_INSTALL)
       hunter_internal_error("Unpack-only scheme can't depends on anything")
     endif()
     # Register explicit dependency


Fix link to download libdill.

Fix link to download libdill.

--- cmake/projects/libdill/hunter.cmake
+++ cmake/projects/libdill/hunter.cmake
@@ -9,8 +9,8 @@
 hunter_add_version(
     PACKAGE_NAME libdill
     VERSION "1.6"
-    URL "https://github.com/isaachier/libdill/archive/hunter-1.6-p1.tar.gz"
-    SHA1 "06a6aa00364007b2f19d942b503566bb15136a93")
+    URL "https://github.com/hunter-packages/libdill/archive/hunter-1.6.tar.gz"
+    SHA1 "603ca85ac4b0d9f0ab4f5db57281127370c5cacc")
 hunter_cmake_args(libdill CMAKE_ARGS
                   BUILD_TESTING=OFF
                   BUILD_PERF=OFF)


fewer warnings related to coverage

fewer warnings related to coverage

--- cmake_modules/CoverageReports.cmake
+++ cmake_modules/CoverageReports.cmake
@@ -70,7 +70,6 @@
       set(COVERAGE_ENABLED OFF)
     endif ()
   endif ()
-
 endif ()

 function(enable_coverage_flags coverage_target)
@@ -79,8 +78,6 @@
             COMPILE_FLAGS ${COVERAGE_COMPILE_FLAGS})
     set_target_properties(${coverage_target} PROPERTIES
             LINK_FLAGS ${COVERAGE_LINK_FLAGS})
-  else ()
-    message(STATUS "Cannot enable coverage flags for target: ${coverage_target}. Code coverage feature not available.")
   endif ()
 endfunction()

@@ -91,8 +88,6 @@
     set_target_properties(${coverage_target} PROPERTIES
       LINK_FLAGS ${COVERAGE_LINK_FLAGS})
     target_link_libraries(${coverage_target} ${COVERAGE_LIBRARIES})
-  else ()
-    message(STATUS "Cannot enable coverage for target: ${coverage_target}. Code coverage feature not available.")
   endif ()
 endfunction()


Detect Raspberry Pi host

Detect Raspberry Pi host

--- compiler/gcc-cross-compile-raspberry-pi.cmake
+++ compiler/gcc-cross-compile-raspberry-pi.cmake
@@ -8,6 +8,25 @@
 endif()

 include(polly_fatal_error)
+include(polly_status_print)
+
+# Detect Raspberry Pi host
+set(_proc_cpuinfo "/proc/cpuinfo")
+if(EXISTS "${_proc_cpuinfo}")
+  # https://en.wikipedia.org/wiki/Raspberry_Pi#Specifications
+  file(
+      STRINGS
+      "${_proc_cpuinfo}"
+      _proc_cpuinfo_strings
+      REGEX
+      "^Hardware[\t ]*:[\t ]*BCM283(5|6|7)$"
+  )
+  string(COMPARE EQUAL "${_proc_cpuinfo_strings}" "" _is_empty)
+  if(NOT _is_empty)
+    polly_status_print("Raspberry Pi host")
+    return() # We are not cross-compiling, exit now.
+  endif()
+endif()

 set(_rpi_error_msg) #if empty, then no errors!
 string(COMPARE EQUAL


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Fixed so that catch.hpp isn't compiled more than once per target (previously it recompiled each for each consecutive build)

--- cmake/testing.cmake
+++ cmake/testing.cmake
@@ -99,13 +99,17 @@

 # We generate an include a header that defines CATCH_CONFIG_MAIN, includes catch then undefines CATCH_CONFIG_MAIN
 function(define_catch_main_for_target TARGET)
-    set(CPP_SOURCE "\
-    #define CATCH_CONFIG_MAIN \n
-    #include <catch.hpp> \n
-    #undef CATCH_CONFIG_MAIN")
+
     get_target_property(TARGET_BINARY_DIR ${TARGET} BINARY_DIR)
     set(CPP_FILE "${TARGET_BINARY_DIR}/define_catch_main.cpp")
-    file(WRITE "${CPP_FILE}" "${CPP_SOURCE}")
+
+    if(NOT EXISTS "${CPP_FILE}")
+        set(CPP_SOURCE "\
+        #define CATCH_CONFIG_MAIN \n
+        #include <catch.hpp> \n
+        #undef CATCH_CONFIG_MAIN")
+        file(WRITE "${CPP_FILE}" "${CPP_SOURCE}")
+    endif()

     target_sources(${TARGET} PRIVATE ${CPP_FILE})
 endfunction()


Add newline at the end of *.cmake

Add newline at the end of *.cmake

(except cmake-modules which we'll fix in its source repo)

--- cmake_package.cmake
+++ cmake_package.cmake
@@ -1,2 +1,2 @@
 set(CMAKE_INSTALL_PREFIX $ENV{CMAKE_INSTALL_PREFIX})
-include(cmake_install.cmake)+include(cmake_install.cmake)


SuperBuild: add libEGL as system dependency

--- Packaging/PackageGlobals.cmake
+++ Packaging/PackageGlobals.cmake
@@ -114,6 +114,7 @@
   libmysqlclient.so*
   libodbc.so*
   libpq.so*
+  libEGL.so*
   )
   # libexpat.so.*
   # libfontconfig.so*


* merged with dev_linux, rev.5827
 - updated cmake for add_boost_test

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@5894 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/rdo_studio/trunk/cmake/add_boost_test.cmake
+++ rdo/rdo_studio/trunk/cmake/add_boost_test.cmake
@@ -10,6 +10,10 @@
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 INCLUDE_DIRECTORIES(${RDO_BASE_DIRECTORY})

+IF(MSVC)
+    SET(Boost_USE_STATIC_LIBS   ON)
+    SET(Boost_USE_MULTITHREADED ON)
+ENDIF(MSVC)
 FIND_PACKAGE(Boost COMPONENTS unit_test_framework REQUIRED)
 INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})

@@ -17,12 +21,12 @@
 ADD_TEST(NAME ${ARGV0} COMMAND ${EXECUTABLE_OUTPUT_PATH}/${ARGV0})

 IF(MSVC)
-	SET_TARGET_PROPERTIES(${ARGV0} PROPERTIES COMPILE_FLAGS "/EHa")
+    SET_TARGET_PROPERTIES(${ARGV0} PROPERTIES COMPILE_FLAGS "/EHa")
 ENDIF(MSVC)

 TARGET_LINK_LIBRARIES(${ARGV0} ${Boost_LIBRARIES})

 SOURCE_GROUP(".test" FILES
-	${ARGN})
+    ${ARGN})

 ENDMACRO(ADD_BOOST_TEST)


Use VMTK that works with VTK change from v9.0 to v8.2. Temp location of changed VMTK, awaiting PR.

--- SuperBuild/External_VMTK.cmake
+++ SuperBuild/External_VMTK.cmake
@@ -17,17 +17,17 @@

 if(NOT DEFINED ${proj}_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})

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

-ExternalProject_SetIfNotDefined(
-  ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG
-  "a0dacdc2499a3828d7a649c9c1d32363ce407b1a"
-  QUIET
-  )
+  ExternalProject_SetIfNotDefined(
+    ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG
+    "f5469652deaeeb823123bfa93f9f11e391aa05ac"
+    QUIET
+    )

   set(EP_SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj})
   set(EP_BINARY_DIR ${CMAKE_BINARY_DIR}/${proj}-build)


cmake: Include contrib.

cmake: Include contrib.

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -10,6 +10,16 @@
 include( ${CMAKE_SOURCE_DIR}/cmake/vlc_add_compile_flag.cmake )
 include( ${CMAKE_SOURCE_DIR}/cmake/vlc_check_type.cmake )
 include( ${CMAKE_SOURCE_DIR}/cmake/pkg_check_modules.cmake )
+
+###########################################################
+# Contribs
+###########################################################
+
+OPTION( ENABLE_CONTRIB "Attempt to use VLC contrib system to get the third-party libraries" ON )
+if(ENABLE_CONTRIB)
+  add_definitions(-I${CMAKE_SOURCE_DIR}/extras/contrib/include)
+  add_definitions(-L${CMAKE_SOURCE_DIR}/extras/contrib/lib)
+endif(ENABLE_CONTRIB)

 ###########################################################
 # Headers checks


cmake: FindX11.

cmake: FindX11.

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -483,6 +483,16 @@
   vlc_module_add_link_libraries(ncurses ${CURSES_LIBRARIES})
 endif(CURSES_LIBRARIES)

+find_package(X11)
+if(X11_FOUND)
+  vlc_enable_modules(x11 panoramix)
+  vlc_check_include_files (X11/Xlib.h)
+  vlc_check_include_files (gl/glu.h)
+  vlc_check_include_files (gl/glx.h)
+  vlc_module_add_link_libraries(x11       ${X11_LIBRARIES})
+  vlc_module_add_link_libraries(panoramix ${X11_LIBRARIES})
+endif(X11_FOUND)
+
 set(CMAKE_REQUIRED_INCLUDES)

 ###########################################################


attempt to autofetch

attempt to autofetch

--- modules/git_info/git_info.cmake
+++ modules/git_info/git_info.cmake
@@ -4,6 +4,11 @@
 # This file can be included in sources to print
 # Git repository version and status information
 # to the program output.
+#
+# autocmake.cfg configuration::
+#
+#   fetch: https://github.com/scisoft/autocmake/raw/master/modules/git_info/git_info_sub.cmake
+#          https://github.com/scisoft/autocmake/raw/master/modules/git_info/git_info.h.in

 add_custom_command(
     OUTPUT ${PROJECT_BINARY_DIR}/git_info.h