include module name which wasn't found in error message (#121)

--- cmake/find_ros1_package.cmake
+++ cmake/find_ros1_package.cmake
@@ -20,14 +20,16 @@
       "${ARG_UNPARSED_ARGUMENTS}")
   endif()

-  if(_ARG_REQUIRED)
-    set(_required "REQUIRED")
+  # the error message of pkg_check_modules for not found required modules
+  # doesn't include the module name which is not helpful
+  pkg_check_modules(ros1_${name} ${name})
+  if(NOT ros1_${name}_FOUND)
+    if(_ARG_REQUIRED)
+      message(FATAL_ERROR
+        "find_ros1_package() failed to find '${name}' using "
+        "pkg_check_modules()")
+    endif()
   else()
-    set(_required "")
-  endif()
-
-  pkg_check_modules(ros1_${name} ${_required} ${name})
-  if(ros1_${name}_FOUND)
     set(_libraries "${ros1_${name}_LIBRARIES}")
     # Prior to catkin 0.7.7, dependent libraries in the pkg-config file were always generated
     # in the form "-l:/absolute/path/to/library".  Because of the leading "-l", this made


Fix: Dev: Fixed name of Catch cmake module

--- cmake/modules/FindCatch.cmake
+++ cmake/modules/FindCatch.cmake
@@ -1,9 +1,4 @@
-# - Try to find LibXml2
-# Once done this will define
-#  LIBCATCH_FOUND - System has LibXml2
-#  LIBCATCH_INCLUDE_DIRS - The LibXml2 include directories
-
-set(MODULE_NAME catch)
+set(MODULE_NAME Catch)
 set(MODULE_INCLUDES catch.hpp)

 find_package(PkgConfig)


Updated zlib to 1.2.7 which fixes bugs encountered when writing out FLD files.

--- cmake/ThirdPartyZlib.cmake
+++ cmake/ThirdPartyZlib.cmake
@@ -5,8 +5,8 @@
     EXTERNALPROJECT_ADD(
         zlib
         PREFIX ${TPSRC}
-        URL ${TPURL}/zlib-1.2.3.tar.bz2
-        URL_MD5 "dee233bf288ee795ac96a98cc2e369b6"
+        URL ${TPURL}/zlib-1.2.7.tar.gz
+        URL_MD5 "60df6a37c56e7c1366cca812414f7b85"
         DOWNLOAD_DIR ${TPSRC}
         CONFIGURE_COMMAND ./configure --shared --prefix=${TPSRC}/dist
         BUILD_IN_SOURCE 1


Boost.Cmake defines Boost_USE_STATIC for static linking to boost libraries

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

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -2,6 +2,7 @@

 if(NOT PCL_SHARED_LIBS OR WIN32)
   set(Boost_USE_STATIC_LIBS ON)
+  set(Boost_USE_STATIC ON)
 endif(NOT PCL_SHARED_LIBS OR WIN32)

 if(${CMAKE_VERSION} VERSION_LESS 2.8.5)


build: smfc: find program in 2 stages

build: smfc: find program in 2 stages

--- cmake/smfc_generator.cmake
+++ cmake/smfc_generator.cmake
@@ -7,11 +7,13 @@
   # Do not put outside of function. We need them discovered later
   # per invocation
   find_program (FLATBUFFERS_COMPILER flatc)
-  set(SMF_COMPILER $<TARGET_FILE:smfc>)
-  # find_program (SMF_COMPILER smfc)
-  # if(SMF_COMPILER-NOTFOUND)
-  #   set(SMF_COMPILER $<TARGET_FILE:smfc>)
-  # endif()
+  # for smfc do it in 2 stages.
+  # first stage is for downstream consumers.
+  # Second stage is for internal targets
+  find_program (SMF_COMPILER smfc)
+  if(NOT SMF_COMPILER)
+    set(SMF_COMPILER $<TARGET_FILE:smfc>)
+  endif()

   # We need one per generator so we can pass it to the flatc compiler
   #


Update NAGFortranCompilerVersion.cmake

Update NAGFortranCompilerVersion.cmake

--- cmake/Modules/NAGFortranCompilerVersion.cmake
+++ cmake/Modules/NAGFortranCompilerVersion.cmake
@@ -1,29 +1,36 @@
 #
-#  Determine the NAG Fortran compiler version
+# Determine the NAG Fortran compiler version.  It returns the variable
 #
 #  CMAKE_Fortran_COMPILER_VERSION -- the version string (x.y.z.b)
 #
+# Here b is the build number.  Cmake automatically sets this variable
+# for other compilers, but the method it uses (extracting it from an
+# object file compiled with the compiler) doesn't work for the NAG
+# compiler.  Here the version is obtained from the output of running
+# the compiler with the "-version" flag.

-if (CMAKE_Fortran_COMPILER_ID MATCHES NAG)
-  execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -V ERROR_VARIABLE _info)
-  if(${_info} MATCHES "([0-9]+)\\.([0-9]+)\\.?([0-9]+)?")
-    set(_major "${CMAKE_MATCH_1}")
-    set(_minor "${CMAKE_MATCH_2}")
-    if(${CMAKE_MATCH_3})
-      set(_patch "${CMAKE_MATCH_3}")
-    else()
-      set(_patch 0)
-    endif()
-    if(${_info} MATCHES "\\(([0-9]+)\\)")
-      set(_build ${CMAKE_MATCH_1})
-    elseif(${_info} MATCHES "Build ([0-9]+)\n")
-      set(_build ${CMAKE_MATCH_1})
-    else()
-      set(_build)
-    endif()
-    set(CMAKE_Fortran_COMPILER_VERSION "${_major}.${_minor}.${_patch}")
-    if(_build)
-      set(CMAKE_Fortran_COMPILER_VERSION "${CMAKE_Fortran_COMPILER_VERSION}.${_build}")
+if(CMAKE_Fortran_COMPILER_ID MATCHES NAG)
+  if(NOT CMAKE_Fortran_COMPILER_VERSION)
+    execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -V ERROR_VARIABLE _info)
+    if(${_info} MATCHES "([0-9]+)\\.([0-9]+)\\.?([0-9]+)?")
+      set(_major "${CMAKE_MATCH_1}")
+      set(_minor "${CMAKE_MATCH_2}")
+      if(${CMAKE_MATCH_3})
+        set(_patch "${CMAKE_MATCH_3}")
+      else()
+        set(_patch 0)
+      endif()
+      if(${_info} MATCHES "\\(([0-9]+)\\)")
+        set(_build ${CMAKE_MATCH_1})
+      elseif(${_info} MATCHES "Build ([0-9]+)\n")
+        set(_build ${CMAKE_MATCH_1})
+      else()
+        set(_build)
+      endif()
+      set(CMAKE_Fortran_COMPILER_VERSION "${_major}.${_minor}.${_patch}")
+      if(_build)
+        set(CMAKE_Fortran_COMPILER_VERSION "${CMAKE_Fortran_COMPILER_VERSION}.${_build}")
+      endif()
     endif()
   endif()
 endif()


proper failure of FindTBB.cmake

proper failure of FindTBB.cmake

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -39,19 +39,14 @@
 ENDIF()

 IF (TBB_INCLUDE_DIR AND TBB_LIBRARY AND TBB_LIBRARY_MALLOC)
-  SET(TBB_FOUND TRUE)
   SET(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
   SET(TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_LIBRARY_MALLOC})
-ELSE ()
-  SET(TBB_FOUND FALSE)
 ENDIF ()

 IF (TBB_INCLUDE_DIR AND TBB_LIBRARY_MIC AND TBB_LIBRARY_MALLOC_MIC)
   SET(TBB_FOUND_MIC TRUE)
   SET(TBB_INCLUDE_DIRS_MIC ${TBB_INCLUDE_DIR_MIC})
   SET(TBB_LIBRARIES_MIC ${TBB_LIBRARY_MIC} ${TBB_LIBRARY_MALLOC_MIC})
-ELSE ()
-  SET(TBB_FOUND_MIC FALSE)
 ENDIF()

 MARK_AS_ADVANCED(TBB_INCLUDE_DIR)
@@ -61,3 +56,6 @@
 MARK_AS_ADVANCED(TBB_INCLUDE_DIR_MIC)
 MARK_AS_ADVANCED(TBB_LIBRARY_MIC)
 MARK_AS_ADVANCED(TBB_LIBRARY_MALLOC_MIC)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB DEFAULT_MSG TBB_INCLUDE_DIRS TBB_LIBRARIES)


no longer installing in /opt/local

no longer installing in /opt/local

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -28,10 +28,10 @@
   SET(TUTORIALS_INSTALL_DIR bin)
   SET(UTILITIES_INSTALL_DIR bin)
 ELSEIF (APPLE)
-  SET(DOC_INSTALL_DIR ../../Applications/embree-${EMBREE_VERSION}/documentation)
-  SET(APPLICATION_INSTALL_DIR ../../Applications/embree-${EMBREE_VERSION})
-  SET(TUTORIALS_INSTALL_DIR ../../Applications/embree-${EMBREE_VERSION}/tutorials)
-  SET(UTILITIES_INSTALL_DIR ../../Applications/embree-${EMBREE_VERSION}/tutorials)
+  SET(DOC_INSTALL_DIR ../Applications/embree-${EMBREE_VERSION}/documentation)
+  SET(APPLICATION_INSTALL_DIR ../Applications/embree-${EMBREE_VERSION})
+  SET(TUTORIALS_INSTALL_DIR ../Applications/embree-${EMBREE_VERSION}/tutorials)
+  SET(UTILITIES_INSTALL_DIR ../Applications/embree-${EMBREE_VERSION}/tutorials)
 ELSE()
   SET(DOC_INSTALL_DIR share/doc/embree-${EMBREE_VERSION})
   SET(TUTORIALS_INSTALL_DIR bin/embree-${EMBREE_VERSION})
@@ -73,8 +73,8 @@
 SET(CPACK_PACKAGE_FILE_NAME "embree-${EMBREE_VERSION}")
 #SET(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/embree-doc/images/icon.png)

-SET(CPACK_PACKAGING_INSTALL_PREFIX "/opt/local")
-SET(CPACK_PACKAGE_RELOCATABLE TRUE)
+#SET(CPACK_PACKAGING_INSTALL_PREFIX "/opt/local")
+#SET(CPACK_PACKAGE_RELOCATABLE TRUE)

 SET(CPACK_PACKAGE_VERSION_MAJOR ${EMBREE_VERSION_MAJOR})
 SET(CPACK_PACKAGE_VERSION_MINOR ${EMBREE_VERSION_MINOR})


move kinematics-utils to my fork for now

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -165,8 +165,8 @@
 set(pypolyhedron_revision 1f110addf89398f62644830bf69a69930db8c4d0)
 set(pypolyhedron_depends)

-set(kinematics-utils_url https://github.com/ipab-slmc/kinematics-utils.git)
-set(kinematics-utils_revision 062e36b056eaa0b5ddc38ed7c738999b9bb5831b)
+set(kinematics-utils_url https://github.com/iamwolf/kinematics-utils.git)
+set(kinematics-utils_revision 0558a4bd0295e3f2285c06c1b7770767bff85390)
 set(kinematics-utils_depends Eigen_pod)

 set(libmultisense_url https://bitbucket.org/crl/libmultisense)


ENH: add ITK compilation flags in OTB use file

--- CMake/UseOTB.cmake
+++ CMake/UseOTB.cmake
@@ -12,9 +12,19 @@

 # Add include directories needed to use OTB.
-include_directories(BEFORE ${OTB_INCLUDE_DIRS})
+include_directories(${OTB_INCLUDE_DIRS})

 # Add link directories needed to use OTB.
 link_directories(${OTB_LIBRARY_DIRS})

-# TODO : find_package() & include(UseFile) for all external dependencies
+# find_package() are already done (in OTBConfig.cmake)
+# perform include(UseFile) for all external dependencies
+
+# ITK : don't call UseFile to avoid the include_directorties(BEFORE ...)
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ITK_REQUIRED_C_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ITK_REQUIRED_CXX_FLAGS}")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
+set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}")
+
+# OpenCV : no USE_FILE defined


start 1.7.6

start 1.7.6

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -43,7 +43,7 @@
 endif()

 set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.7.5")
+set (COTIRE_CMAKE_MODULE_VERSION "1.7.6")

 # activate select policies
 if (POLICY CMP0025)


honor source file property COMPILE_OPTIONS

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -239,7 +239,13 @@
 				# add to excluded sources, if file has custom compile flags
 				list (APPEND _excludedSourceFiles "${_sourceFile}")
 			else()
-				list (APPEND _sourceFiles "${_sourceFile}")
+				get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS)
+				if (_sourceCompileOptions)
+					# add to excluded sources, if file has list of custom compile options
+					list (APPEND _excludedSourceFiles "${_sourceFile}")
+				else()
+					list (APPEND _sourceFiles "${_sourceFile}")
+				endif()
 			endif()
 		endif()
 	endforeach()


Update superbuild version of OpenSSL to 1.1.1 for security reasons

--- SuperBuild/CMake/External_openssl.cmake
+++ SuperBuild/CMake/External_openssl.cmake
@@ -44,8 +44,8 @@
 if(MSVC)
   ExternalProject_Add(OPENSSL
     PREFIX OPENSSL
-    URL "https://github.com/openssl/openssl/archive/OpenSSL_1_0_1p.tar.gz"
-    URL_MD5 6bc1f9a9d9d474aceceb377e758e48ec
+    URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1k.tar.gz"
+    URL_MD5 bdd51a68ad74618dd2519da8e0bcc759
     DEPENDS ${OPENSSL_DEPENDENCIES}
     BINARY_DIR ${OPENSSL_SB_SRC}
     INSTALL_DIR ${SB_INSTALL_PREFIX}
@@ -68,8 +68,8 @@
   ExternalProject_Add(OPENSSL
     PREFIX OPENSSL
     DEPENDS ${OPENSSL_DEPENDENCIES}
-    URL "https://github.com/openssl/openssl/archive/OpenSSL_1_0_1p.tar.gz"
-    URL_MD5 6bc1f9a9d9d474aceceb377e758e48ec
+    URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_1k.tar.gz"
+    URL_MD5 bdd51a68ad74618dd2519da8e0bcc759
     BINARY_DIR ${OPENSSL_SB_SRC}
     INSTALL_DIR ${SB_INSTALL_PREFIX}
     DOWNLOAD_DIR ${DOWNLOAD_LOCATION}


Let ENABLE_TESTS enable/disable also the new Boost.Tests.

--- CMakeModules/BoostTestTargets.cmake
+++ CMakeModules/BoostTestTargets.cmake
@@ -51,15 +51,15 @@
 		"NOTE: boost::test-based targets and tests cannot "
 		"be added: boost >= 1.34.0 required but not found. "
 		"(found: '${Boost_VERSION}'; want >=103400) ")
-	if(BUILD_TESTING)
+	if(ENABLE_TESTS)
 		message(FATAL_ERROR
 			${_shared_msg}
-			"You may disable BUILD_TESTING to continue without the "
+			"You may disable ENABLE_TESTS to continue without the "
 			"tests.")
 	else()
 		message(STATUS
 			${_shared_msg}
-			"BUILD_TESTING disabled, so continuing anyway.")
+			"ENABLE_TESTS disabled, so continuing anyway.")
 	endif()
 endif()

@@ -88,7 +88,7 @@
 endif()

 function(add_boost_test _name)
-	if(NOT BUILD_TESTING)
+	if(NOT ENABLE_TESTS)
 		return()
 	endif()


Explicit dependency linking allows users to hardcode dependencies when required, rather than using host dependencies

--- cmake/CelixConfig.cmake
+++ cmake/CelixConfig.cmake
@@ -71,3 +71,11 @@
 set(CELIX_BUNDLES_DIR ${REL_INSTALL_DIR}/share/celix/bundles)
 set(CELIX_SHELL_BUNDLE ${CELIX_BUNDLES_DIR}/shell.zip)
 set(CELIX_SHELL_TUI_BUNDLE ${CELIX_BUNDLES_DIR}/shell_tui.zip)
+
+include(CMakeFindDependencyMacro)
+find_dependency(ZLIB)
+find_dependency(UUID)
+find_dependency(OpenSSL)
+find_dependency(CURL)
+find_dependency(FFI)
+find_dependency(Jansson)


cmake: various clang-format fixes

cmake: various clang-format fixes

--- cmake/ClangFormat.cmake
+++ cmake/ClangFormat.cmake
@@ -1,9 +1,3 @@
-if(__NOVA_CLANG_FORMAT_INCLUDE_GUARD)
-    return()
-else()
-    set(__NOVA_CLANG_FORMAT_INCLUDE_GUARD On)
-endif()
-
 if(NOT CLANG_FORMAT_COMMAND)
     set(CLANG_FORMAT_COMMAND "clang-format-9" "clang-format-8" "clang-format-7" "clang-format")
 endif()
@@ -12,7 +6,7 @@

 execute_process(COMMAND "${CLANG_FORMAT_PROGRAM}" "--version"
                 OUTPUT_VARIABLE CLANG_TIDY_VERSION_FULL_STRING)
-string(REGEX MATCH [=[[0-9]\.[0-9].[0-9]]=] VERSION ${CLANG_TIDY_VERSION_FULL_STRING})
+string(REGEX MATCH [=[[0-9]\.[0-9].[0-9]]=] VERSION "${CLANG_TIDY_VERSION_FULL_STRING}")
 if(VERSION VERSION_LESS "7.0.0")
     message(STATUS "clang-format version ${VERSION} is not greater or equal to 7.0.0")
     set(CLANG_FORMAT_TERMINATE On)
@@ -26,13 +20,20 @@
     function(format)
         # no-op
     endfunction()
+    function(nova_format)
+        # no-op
+    endfunction()
     return()
 endif()

 message(STATUS "Found clang-format at ${CLANG_FORMAT_PROGRAM}")

-add_custom_target(format VERBATIM)
-add_custom_target(reformat VERBATIM)
+if(NOT TARGET format)
+    add_custom_target(format VERBATIM)
+endif()
+if(NOT TARGET reformat)
+    add_custom_target(reformat VERBATIM)
+endif()

 file(GLOB_RECURSE CLANG_FORMAT_PATHS CONFIGURE_DEPENDS "*.clang-format")
 foreach(PATH ${CLANG_FORMAT_PATHS})


look for libclucene first and then for libclucene-core

svn path=/trunk/kdesupport/strigi/; revision=720065

--- cmake/FindCLucene.cmake
+++ cmake/FindCLucene.cmake
@@ -34,7 +34,7 @@
   )
   FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY
       WIN32_DEBUG_POSTFIX d
-      NAMES clucene-core
+      NAMES clucene clucene-core
       PATHS ${TRIAL_LIBRARY_PATHS})
   IF (CLUCENE_LIBRARY)
     MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}")


MAINT: fix CMake bug when requesting Geometry components.

--- cmake/FindDO_Sara.cmake
+++ cmake/FindDO_Sara.cmake
@@ -30,6 +30,8 @@
     message("DO_Sara_SOURCE_DIR = ${DO_Sara_SOURCE_DIR}")

   endif ()
+
+  set(DO_PROJECT_NAME Sara)

   # List the available component libraries in DO++
   # Foundational libraries


AddSourceFolder macro: label c files as c files, not cpp files; all cpp files are marked automatically for PCH usage if PCH used.

--- cmake/TundraUtils.cmake
+++ cmake/TundraUtils.cmake
@@ -42,11 +42,13 @@
 # Adds the given folder_name into the source files of the current project. Use this macro when your module contains .cpp and .h files in several subdirectories.
 macro(AddSourceFolder folder_name)
     file(GLOB H_FILES_IN_FOLDER_${folder_name} ${folder_name}/*.h ${folder_name}/*.inl)
-    file(GLOB CPP_FILES_IN_FOLDER_${folder_name} ${folder_name}/*.cpp ${folder_name}/*.c)
+    file(GLOB CPP_FILES_IN_FOLDER_${folder_name} ${folder_name}/*.cpp)
+    file(GLOB C_FILES_IN_FOLDER_${folder_name} ${folder_name}/*.c ${folder_name}/*.c)
     source_group("Header Files\\${folder_name}" FILES ${H_FILES_IN_FOLDER_${folder_name}})
-    source_group("Source Files\\${folder_name}" FILES ${CPP_FILES_IN_FOLDER_${folder_name}})
+    source_group("Source Files\\${folder_name}" FILES ${CPP_FILES_IN_FOLDER_${folder_name}} ${C_FILES_IN_FOLDER_${folder_name}})
     set(H_FILES ${H_FILES} ${H_FILES_IN_FOLDER_${folder_name}})
     set(CPP_FILES ${CPP_FILES} ${CPP_FILES_IN_FOLDER_${folder_name}})
+    set(C_FILES ${C_FILES} ${C_FILES_IN_FOLDER_${folder_name}})
 endmacro()

 # Lists sub directories


Added conformance test impl file to CMake.

--- cmake/conformance.cmake
+++ cmake/conformance.cmake
@@ -21,6 +21,7 @@
 add_executable(conformance_test_runner
   ${protobuf_source_dir}/conformance/conformance.pb.cc
   ${protobuf_source_dir}/conformance/conformance_test.cc
+  ${protobuf_source_dir}/conformance/conformance_test_impl.cc
   ${protobuf_source_dir}/conformance/conformance_test_runner.cc
   ${protobuf_source_dir}/conformance/third_party/jsoncpp/json.h
   ${protobuf_source_dir}/conformance/third_party/jsoncpp/jsoncpp.cpp


Append "${PYTHON_LIBRARIES}" to PYGCW_LIBS to remove ldd -r undefined symbol
errors from loadable python modules associated with pygcw.

svn path=/trunk/; revision=9225

--- cmake/modules/gcw.cmake
+++ cmake/modules/gcw.cmake
@@ -175,6 +175,8 @@
 if(ENABLE_pygcw)
   pkg_check_modules(_GCW4 pygtk-2.0)
   cmake_link_flags(linkflags  "${_GCW4_LDFLAGS}")
+  # Include PYTHON_LIBRARIES because pkg-config does not appear to do so.
+  list(APPEND linkflags "${PYTHON_LIBRARIES}")
   set (cflags "${_GCW4_CFLAGS}")
   # pygtk 2.13.0 uses numpy by default if it is available while 2.12.x does
   # not.  So 2.13.0 and above are likely to be using numpy although no


CMake pcl_targets fix

CMake pcl_targets fix

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

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -144,7 +144,7 @@
     #
     # Only link if needed
     if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
+      set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl)
       target_link_libraries(${_exename} pthread)
     elseif(UNIX)
       set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl,--as-needed)


little cmake fix

little cmake fix

--- bench/btl/cmake/FindEigen2.cmake
+++ bench/btl/cmake/FindEigen2.cmake
@@ -17,15 +17,15 @@

 else (EIGEN2_INCLUDE_DIR)

-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR)
-
 find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
      PATHS
      ${Eigen_SOURCE_DIR}/
      ${INCLUDE_INSTALL_DIR}
    )

+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR)
+
 mark_as_advanced(EIGEN2_INCLUDE_DIR)

 endif(EIGEN2_INCLUDE_DIR)


ilastik.cmake: Override the ilastik_NAME and ilastik_SRC_DIR variables using the optional arg to external_git_repo()

--- ilastik.cmake
+++ ilastik.cmake
@@ -41,9 +41,8 @@

 external_git_repo (ilastik
     ${ILASTIK_VERSION}
-    http://github.com/janelia-flyem/flyem-ilastik)
-set(ilastik_NAME ilastik)
-set(ilastik_SRC_DIR "${BUILDEM_DIR}/src/${ilastik_NAME}")
+    http://github.com/janelia-flyem/flyem-ilastik
+    ilastik)
 set(lazyflow_SRC_DIR "${ilastik_SRC_DIR}/lazyflow")

 if("${ILASTIK_VERSION}" STREQUAL "master")


BUG: superbuild: avoid conflict with system muParser headers (WIP)

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -137,6 +137,9 @@
     env
     ${LDLIBVAR}=${CMAKE_INSTALL_PREFIX}/lib:$ENV{${LDLIBVAR}}
     ${CMAKE_COMMAND})
+  list(APPEND OTB_SB_CONFIG
+    -DCMAKE_C_FLAGS:STRING="-I${CMAKE_INSTALL_PREFIX}/include"
+    -DCMAKE_CXX_FLAGS:STRING="-I${CMAKE_INSTALL_PREFIX}/include")
 else()
   set(OTB_SB_CMAKE_COMMAND ${SB_CMAKE_COMMAND})
 endif()


BUG: workaround strange issue in png cmake variable

--- SuperBuild/CMake/External_png.cmake
+++ SuperBuild/CMake/External_png.cmake
@@ -39,4 +39,7 @@
     )
 endif()

+
+set(_SB_PNG_PNG_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
+
 SUPERBUILD_UPDATE_CMAKE_VARIABLES(PNG TRUE)


Add python bin dir as hint for finding PySide tools

(On OS X and Windows)

This should handle most situations

--- cMake/FindPySideTools.cmake
+++ cMake/FindPySideTools.cmake
@@ -14,27 +14,15 @@
   set(PYSIDE_TOOLS_FOUND_QUIETLY TRUE)
 ENDIF(PYSIDEUIC4BINARY AND PYSIDERCC4BINARY)

-if(WIN32)
-	FIND_PROGRAM(PYSIDEUIC4BINARY pyside-uic
-		HINTS ${PYSIDE_BIN_DIR}
-	)
-	FIND_PROGRAM(PYSIDERCC4BINARY pyside-rcc
-		HINTS ${PYSIDE_BIN_DIR}
-	)
-else(WIN32)
-    if(APPLE)
-    	#set (PYTHON_BIN_DIR /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin )
-    	FIND_PROGRAM( PYSIDEUIC4BINARY PYSIDEUIC4
-    		HINTS ${PYSIDE_BIN_DIR}
-    		)
-    	FIND_PROGRAM(PYSIDERCC4BINARY PYSIDERCC4
-    		HINTS ${PYSIDE_BIN_DIR}
-    		)
-    else(APPLE)
-        FIND_PROGRAM(PYSIDEUIC4BINARY pyside-uic)
-        FIND_PROGRAM(PYSIDERCC4BINARY pyside-rcc)
-    endif(APPLE)
-endif(WIN32)
+if(WIN32 OR APPLE)
+    #pyside tools are often in same location as python interpreter
+    get_filename_component(PYTHON_BIN_DIR ${PYTHON_EXECUTABLE} PATH)
+    set(PYSIDE_BIN_DIR ${PYTHON_BIN_DIR})
+endif(WIN32 OR APPLE)
+
+FIND_PROGRAM(PYSIDEUIC4BINARY pyside-uic HINTS ${PYSIDE_BIN_DIR})
+FIND_PROGRAM(PYSIDERCC4BINARY pyside-rcc HINTS ${PYSIDE_BIN_DIR})
+
 #message(STATUS "PYSIDEUIC4BINARY ${PYSIDEUIC4BINARY}" )
 #message(STATUS "PYSIDERCC4BINARY ${PYSIDERCC4BINARY}" )


testind alt. libs

testind alt. libs

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@9017 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/AddCXXCompileOptions.cmake
+++ cmake/AddCXXCompileOptions.cmake
@@ -57,11 +57,11 @@
     endif()

     if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
-      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11 -stdlib=libc++")
       set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
       set(CMAKE_CXX_STANDARD_DEFAULT 11)
     elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
-      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
+      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x -stdlib=libc++")
       set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
       set(CMAKE_CXX_STANDARD_DEFAULT 11)
     endif()


[Fix] Fix blas cmake for mac os (#3898)

[Fix] Fix blas cmake for mac os (#3898)

* fix cmake for mac os

* rename

--- cmake/modules/contrib/BLAS.cmake
+++ cmake/modules/contrib/BLAS.cmake
@@ -28,17 +28,17 @@
     set(USE_MKL_PATH /opt/intel/mkl)
   endif()
   if(APPLE)
-    find_library(BLAS_LIBRARY NAMES mklml mkl_rt HINTS ${USE_MKL_PATH}/lib/ ${USE_MKL_PATH}/lib/intel64)
+    find_library(BLAS_LIBRARY_MKL NAMES mklml mkl_rt HINTS ${USE_MKL_PATH}/lib/ ${USE_MKL_PATH}/lib/intel64)
   elseif(UNIX)
-    find_library(BLAS_LIBRARY NAMES mkl_rt mklml_gnu HINTS ${USE_MKL_PATH}/lib/ ${USE_MKL_PATH}/lib/intel64)
+    find_library(BLAS_LIBRARY_MKL NAMES mkl_rt mklml_gnu HINTS ${USE_MKL_PATH}/lib/ ${USE_MKL_PATH}/lib/intel64)
   elseif(MSVC)
-    find_library(BLAS_LIBRARY NAMES mkl_rt HINTS ${USE_MKL_PATH}/lib/ ${USE_MKL_PATH}/lib/intel64_win)
+    find_library(BLAS_LIBRARY_MKL NAMES mkl_rt HINTS ${USE_MKL_PATH}/lib/ ${USE_MKL_PATH}/lib/intel64_win)
   endif()
   include_directories(${USE_MKL_PATH}/include)
-  list(APPEND TVM_RUNTIME_LINKER_LIBS ${BLAS_LIBRARY})
+  list(APPEND TVM_RUNTIME_LINKER_LIBS ${BLAS_LIBRARY_MKL})
   list(APPEND RUNTIME_SRCS ${CBLAS_CONTRIB_SRC})
   add_definitions(-DUSE_MKL_BLAS=1)
-  message(STATUS "Use BLAS library " ${BLAS_LIBRARY})
+  message(STATUS "Use BLAS library " ${BLAS_LIBRARY_MKL})
 elseif(USE_BLAS STREQUAL "atlas" OR USE_BLAS STREQUAL "blas")
   find_library(BLAS_LIBRARY cblas)
   list(APPEND TVM_RUNTIME_LINKER_LIBS ${BLAS_LIBRARY})


Fix SDL2 hash

Fix SDL2 hash

See https://github.com/ruslo/hunter/issues/1032 for details

--- cmake/projects/SDL2/hunter.cmake
+++ cmake/projects/SDL2/hunter.cmake
@@ -14,7 +14,7 @@
         URL
         "https://github.com/hunter-packages/SDL2/archive/2.0.4-p4.tar.gz"
         SHA1
-        523d8fd427f707541c7e600ad4c37e0e7bdc3662
+        589fcb46963b28e9d968646af54add6f4b19890c
 )

 hunter_add_version(


Changed default CUDA build type to Device

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

--- src/CMake/cuda/FindCuda.cmake
+++ src/CMake/cuda/FindCuda.cmake
@@ -98,7 +98,7 @@

 # Parse CUDA build type.
 IF (NOT CUDA_BUILD_TYPE)
-  SET(CUDA_BUILD_TYPE "Emulation" CACHE STRING "Cuda build type: Emulation or Device")
+  SET(CUDA_BUILD_TYPE "Device" CACHE STRING "Cuda build type: Emulation or Device")
 ENDIF(NOT CUDA_BUILD_TYPE)

 # Emulation if the card isn't present.


use correct macro name to enable strdup()

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -12,7 +12,7 @@

     add_definitions(-D_REENTRANT)           # for gmtime_r()
     add_definitions(-D_XOPEN_SOURCE) 	    # for popen() and pclose()
-    add_definitions(-DXOPEN_SOURCE_EXTENDED)   # for strdup(), which isn't part of C99
+    add_definitions(-D_XOPEN_SOURCE_EXTENDED) # for strdup(), which isn't part of C99
     add_definitions(-D__STDC_FORMAT_MACROS) # for PRI*PTR format macros, required by C99

     # with -fPIC


I think there is bad logic in the IF(NOT CMAKE_MODULE_EXISTS) logic block since
the relevant LIBRARY variables that are being copied to the equivalent
MODULES variables are actually defined later.  PLplot doesn't use Ada
modules so this bad logic is never exercised for that case.

There is no such logic block in the Fortran case or the D case so I have
removed the whole IF(NOT CMAKE_MODULE_EXISTS) logic block for the Ada case.
This should give better CMake support for Ada in general. As expected (since
no modules are used), the Ada bindings and examples builds continue to work
fine on Linux after this change.

svn path=/trunk/; revision=9909

--- cmake/modules/CMakeAdaInformation.cmake
+++ cmake/modules/CMakeAdaInformation.cmake
@@ -21,18 +21,10 @@
    INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Ada})
 ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_Ada)

-
-# for most systems a module is the same as a shared library
-# so unless the variable CMAKE_MODULE_EXISTS is set just
-# copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
-  SET(CMAKE_SHARED_MODULE_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_Ada_FLAGS})
-  SET(CMAKE_SHARED_MODULE_CREATE_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
-
 # Create a set of shared library variable specific to Ada
 # For 90% of the systems, these are the same flags as the C versions
 # so if these are not set just copy the flags from the c version
+
 IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS)
   SET(CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
 ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Ada_FLAGS)


rename debian6 and debian7

rename debian6 and debian7

--- cmake/EnumerateSystem.cmake
+++ cmake/EnumerateSystem.cmake
@@ -41,10 +41,16 @@
       endif(LINUX_ISSUE MATCHES "Ubuntu")
       # Debian case
       if(LINUX_ISSUE MATCHES "Debian")
-        string(REGEX MATCH "Debian .*ux ([0-9]+\\.[0-9]+)" DEBIAN "${LINUX_ISSUE}")
+        string(REGEX MATCH "Debian .*ux ([0-9]+)" DEBIAN "${LINUX_ISSUE}")
         set(LINUX_NAME "Debian")
         set(LINUX_VER "${CMAKE_MATCH_1}")
         set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "DEB")
+        if(${LINUX_VER} MATCHES "6")
+          set(LINUX_VER "squeeze")
+        endif()
+        if(${LINUX_VER} MATCHES "7")
+          set(LINUX_VER "wheezy")
+        endif()
       endif(LINUX_ISSUE MATCHES "Debian")

       #Find CPU Arch


Added more paths to libssh location

Added more paths to libssh location

--- cmake/Modules/FindSSH.cmake
+++ cmake/Modules/FindSSH.cmake
@@ -6,7 +6,7 @@

 find_library( LIBSSH_LIBRARY
 		NAMES ssh
-		PATHS /usr/local/lib /usr/pkg/lib /opt/lib /usr/lib64 /usr/lib /lib
+		PATHS /usr/local/lib /usr/local/lib64 /usr/pkg/lib /opt/lib /usr/lib64 /usr/lib /lib /lib64
 		NO_DEFAULT_PATH
 )


Deb package build fix for CUDA 6.5 and newer.

(cherry picked from commit e650d87e470b2e6a8f87ad4dd81977748a136aee)
(cherry picked from commit ca9c52ac9778d01eba933a786b4303c79d0162be)

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -68,9 +68,23 @@

 if(HAVE_CUDA)
   string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
-  set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
+  if(${CUDA_VERSION} VERSION_LESS "6.5")
+    set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
+    set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
+  else()
+    set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-cudart-${cuda_version_suffix}, cuda-npp-${cuda_version_suffix}")
+    set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-cudart-dev-${cuda_version_suffix}, cuda-npp-dev-${cuda_version_suffix}")
+    if(HAVE_CUFFT)
+      set(CPACK_DEB_libs_PACKAGE_DEPENDS "${CPACK_DEB_libs_PACKAGE_DEPENDS}, cuda-cufft-${cuda_version_suffix}")
+      set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cufft-dev-${cuda_version_suffix}")
+    endif()
+    if(HAVE_HAVE_CUBLAS)
+      set(CPACK_DEB_libs_PACKAGE_DEPENDS "${CPACK_DEB_libs_PACKAGE_DEPENDS}, cuda-cublas-${cuda_version_suffix}")
+      set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cublas-dev-${cuda_version_suffix}")
+    endif()
+  endif()
   set(CPACK_COMPONENT_dev_DEPENDS libs)
-  set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
+
 endif()

 if(NOT OPENCV_CUSTOM_PACKAGE_INFO)


CMAKE: Added rpath flags to build system so that examples run.

Without these flag, one needs to specify LD_LIBRARY_PATH manually.
However, users should not be required to manually specify an LD_LIBRARY_PATH by default.

--- cmake/ViennaSHECommon.cmake
+++ cmake/ViennaSHECommon.cmake
@@ -67,6 +67,9 @@
 endif(ENABLE_OPENMP)

 find_package(PETSc)
+SET(PETSC_ROOT "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-rpath -Wl,${PETSC_ROOT}/lib")
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${PETSC_ROOT}/lib")

 # ************************** Section 3: Miscellaneous compiler settings **************************


cmake fix px4_base linker flags

cmake fix px4_base linker flags

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -566,6 +566,7 @@
 		# QuRT 6.4.X compiler identifies as Clang but does not support this option
 		if (NOT ${OS} STREQUAL "qurt")
 			list(APPEND warnings
+				-Qunused-arguments
 				-Wno-unused-const-variable
 				-Wno-varargs
 			)
@@ -701,14 +702,11 @@
 		-DCONFIG_ARCH_BOARD_${board_config}
 		)

-	if (NOT ${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")
-		set(added_exe_link_flags
+	if (NOT (APPLE AND (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")))
+		set(added_exe_linker_flags
 			-Wl,--warn-common
 			-Wl,--gc-sections
-			)
-	else()
-		set(added_exe_link_flags
-			-Wl,--warn-common
+			#,--print-gc-sections
 			)
 	endif()


Make parameter source file generation properly depend on board config

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -846,7 +846,7 @@
 		PROPERTIES GENERATED TRUE)
 	add_custom_command(OUTPUT ${generated_files}
 		COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Tools/px_generate_params.py ${XML} ${SCOPE}
-		DEPENDS ${XML} ${DEPS}
+		DEPENDS ${XML} ${DEPS} ${CMAKE_SOURCE_DIR}/cmake/configs/${OS}_${BOARD}_${LABEL}.cmake
 		)
 	set(${OUT} ${generated_files} PARENT_SCOPE)
 endfunction()


Cleanup trailing ws in default.cmake

Cleanup trailing ws in default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -176,7 +176,7 @@
 hunter_default_version(autoutils VERSION 0.3.0)
 hunter_default_version(aws-c-common VERSION 0.2.1-p0)
 hunter_default_version(benchmark VERSION 1.4.0)
-hunter_default_version(binaryen VERSION 1.38.28-p1)
+hunter_default_version(binaryen VERSION 1.38.28-p1)
 hunter_default_version(bison VERSION 3.0.4-p0)
 hunter_default_version(boost-pba VERSION 1.0.0-p0)
 hunter_default_version(breakpad VERSION 0.0.0-12ecff3-p1)


Try to fix windows build after r198136.

Try to fix windows build after r198136.

`type` can't read from stdin.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -37,7 +37,7 @@

     add_custom_command(OUTPUT symbol.def
       COMMAND cmake -E echo "EXPORTS" > symbol.def
-      COMMAND ${CAT} < ${export_file} >> symbol.def
+      COMMAND ${CAT} ${export_file} >> symbol.def
       DEPENDS ${export_file}
       VERBATIM
       COMMENT "Creating export file for ${target_name}")


Added correct interface to FindGSL.

Added correct interface to FindGSL.

--- cmake/modules/FindGSL.cmake
+++ cmake/modules/FindGSL.cmake
@@ -19,6 +19,7 @@
 # This module exports
 #
 #   GSL_LIBRARIES
+#   GSL_INCLUDE_LIBRARIES
 #   GSL_LINKER_FLAGS
 #

@@ -31,9 +32,17 @@
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )

+DEAL_II_FIND_PATH(GSL_INCLUDE_DIR gsl/gsl_version.h
+  HINTS ${GSL_DIR}
+  PATH_SUFFIXES include
+  )

 DEAL_II_PACKAGE_HANDLE(GSL
   LIBRARIES
     REQUIRED GSL_LIBRARY
-  CLEAR GSL_LIBRARY
+  INCLUDE_DIRS
+    REQUIRED GSL_INCLUDE_DIR
+  USER_INCLUDE_DIRS
+    REQUIRED GSL_INCLUDE_DIR
+  CLEAR GSL_LIBRARY GSL_INCLUDE_DIR
   )


Phonon-VLC needs 1.1

Phonon-VLC needs 1.1

--- cmake/modules/FindVLC.cmake
+++ cmake/modules/FindVLC.cmake
@@ -25,12 +25,12 @@
 # in the FIND_PATH() and FIND_LIBRARY() calls
 if(NOT WIN32)
   find_package(PkgConfig)
-  pkg_check_modules(VLC libvlc>=1.0.0)
+  pkg_check_modules(VLC libvlc>=1.1.0)
   set(VLC_DEFINITIONS ${VLC_CFLAGS})
   set(VLC_LIBRARIES ${VLC_LDFLAGS})
   # TODO add argument support to pass version on find_package
   include(MacroEnsureVersion)
-  macro_ensure_version(1.0.0 ${VLC_VERSION} VLC_VERSION_OK)
+  macro_ensure_version(1.1.0 ${VLC_VERSION} VLC_VERSION_OK)
 endif(NOT WIN32)


Added CMAKE_PLATFORM_INFO_DIR definition for CMake <2.8.10 backward compatibility

--- .cmake/Modules/CMakeDetermineObjectiveCCompiler.cmake
+++ .cmake/Modules/CMakeDetermineObjectiveCCompiler.cmake
@@ -1,6 +1,11 @@
 # Copyright (C) 2015 Franklin "Snaipe" Mathieu.
 # Redistribution and use of this file is allowed according to the terms of the MIT license.
 # For details see the LICENSE file distributed with Criterion.
+
+# CMake <2.8.10 backward compat
+if(NOT CMAKE_PLATFORM_INFO_DIR)
+  set(CMAKE_PLATFORM_INFO_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
+endif(NOT CMAKE_PLATFORM_INFO_DIR)

 set(CMAKE_ObjectiveC_COMPILER_ID ${CMAKE_C_COMPILER_ID})
 set(CMAKE_ObjectiveC_COMPILER ${CMAKE_C_COMPILER})


Add plugins/debugger to tf_python.cmake

Add plugins/debugger to tf_python.cmake

This fixes @7352 by making the debugger Tensorboard plugin available to cmake builds.

--- tensorflow/contrib/cmake/tf_python.cmake
+++ tensorflow/contrib/cmake/tf_python.cmake
@@ -205,6 +205,7 @@
 add_python_module("tensorflow/tensorboard/backend")
 add_python_module("tensorflow/tensorboard/lib/python")
 add_python_module("tensorflow/tensorboard/plugins")
+add_python_module("tensorflow/tensorboard/plugins/debugger")
 add_python_module("tensorflow/tensorboard/plugins/projector")
 add_python_module("tensorflow/tensorboard/scripts")
 add_python_module("tensorflow/contrib")


that was a mistake, fix build

that was a mistake, fix build

--- build/build.cmake
+++ build/build.cmake
@@ -57,7 +57,7 @@
   spdlog
 )

-target_precompile_headers(core PUBLIC
+target_precompile_headers(core PRIVATE
 	<3rdParty/doctest.h>
     <3rdParty/fmt.h>
     <3rdParty/function2.h>


Optimize dependency checking by removing duplicates.

--- CMake/mitkFunctionAddExternalProject.cmake
+++ CMake/mitkFunctionAddExternalProject.cmake
@@ -15,7 +15,7 @@
 #! boolean cache option is created with the given DOC argument as help string.
 #! The option is marked as advanced if the ADVANCED option is set. The
 #! option's initial value matches the ON or OFF option and defaults to OFF
-#! is none is given. The DEPENDS arguments are used to force the
+#! if none is given. The DEPENDS arguments are used to force the
 #! corresponding MITK_USE_<depN> cache variables to ON if MITK_USE_<name>
 #! is ON.
 #!
@@ -53,11 +53,12 @@
     set(_on 1)
   endif()

-  if(_on)
+  if(_on AND EP_DEPENDS)
     # Get all transitive dependencies
     set(_depends_all)
     set(_depends_cur ${EP_DEPENDS})
-    set(_depends_new ${EP_DEPENDS})
+    list(REMOVE_DUPLICATES _depends_cur)
+    set(_depends_new ${_depends_cur})
     while(NOT "${_depends_all}" STREQUAL "${_depends_cur}")
       list(APPEND _depends_all ${_depends_new})
       set(_depends_new_tmp )
@@ -66,7 +67,10 @@
         list(APPEND _depends_new_tmp ${_dep_dep})
       endforeach()
       set(_depends_new ${_depends_new_tmp})
-      list(APPEND _depends_cur ${_depends_new})
+      if(_depends_new)
+        list(REMOVE_DUPLICATES _depends_new)
+        list(APPEND _depends_cur ${_depends_new})
+      endif()
     endwhile()
     # Force dependencies to ON
     foreach(dep ${_depends_all})


CMake: Bites is not BETA any more

CMake: Bites is not BETA any more

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -16,7 +16,7 @@

 #summarise components
 if (OGRE_BUILD_COMPONENT_BITES)
-	set(_components "${_components}  + Bites [BETA]\n")
+	set(_components "${_components}  + Bites\n")
 endif ()
 if (OGRE_BUILD_COMPONENT_HLMS)
 	set(_components "${_components}  + HLMS [BETA]\n")


bug-19181 for bug-fix release

bug-19181 for bug-fix release

--- CMakeExternals/Vigra.cmake
+++ CMakeExternals/Vigra.cmake
@@ -17,6 +17,13 @@
   set(proj_DEPENDENCIES HDF5)
   set(Vigra_DEPENDS ${proj})

+  # If a mac ports installation is present some imaging-io-libraries may interfere with the vigra build.
+  # Hence, we exclude them here.
+  set(mac_additional_cmake_args)
+  if(APPLE)
+    set(mac_additional_cmake_args -DJPEG_INCLUDE_DIR= -DJPEG_LIBRARY= -DTIFF_INCLUDE_DIR= -DTIFF_LIBRARY= -DPNG_LIBRARY_RELEASE= -DPNG_PNG_INCLUDE_DIR= )
+  endif()
+
   if(NOT DEFINED Vigra_DIR)

     set(additional_cmake_args )
@@ -34,6 +41,7 @@
        CMAKE_ARGS
          ${ep_common_args}
          ${additional_cmake_args}
+         ${mac_additional_cmake_args}
          -DAUTOEXEC_TESTS:BOOL=OFF
          -DWITH_VIGRANUMPY:BOOL=OFF
          -DHDF5_DIR:PATH=${HDF5_DIR}


Check new find_library suffix for oneMKL in FindMKL module

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -212,6 +212,7 @@
   add_library(MKL::${mkl_args_NAME}_STATIC STATIC IMPORTED)

   if(NOT (WIN32 AND mkl_args_DLL_ONLY))
+    list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".so.1")
     find_library(MKL_${mkl_args_NAME}_LINK_LIBRARY
       NAMES
         ${mkl_args_LIBRARY_NAME}${shared_suffix}
@@ -232,6 +233,7 @@
         ""
         intel64
         intel64/gcc4.7)
+    list(REMOVE_ITEM CMAKE_FIND_LIBRARY_SUFFIXES ".so.1")
     if(MKL_${mkl_args_NAME}_LINK_LIBRARY)
       if (CMAKE_VERSION VERSION_GREATER 3.14)
         message(VERBOSE "MKL_${mkl_args_NAME}_LINK_LIBRARY: ${MKL_${mkl_args_NAME}_LINK_LIBRARY}")


Added cmake code to include MS runtime dll's in release.


Calm down (gcc) compiler warning for RPC generated files

--- make/FindONCRPC.cmake
+++ make/FindONCRPC.cmake
@@ -111,11 +111,23 @@
    ${RPC_GENERATED_FILE_PREFIX}_clnt.c
    ${RPC_GENERATED_FILE_PREFIX}_xdr.c
    ${RPC_GENERATED_FILE_PREFIX}.h)
-
+
+ #inhibit compiler warning for generated files
+ IF (CMAKE_COMPILER_IS_GNUCC)
+     SET_SOURCE_FILES_PROPERTIES(${${RPC_PREFIX}_RPCGEN_OUTPUT_CLNT}
+	                            PROPERTIES COMPILE_FLAGS "-w")
+ ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
  SET(${RPC_PREFIX}_RPCGEN_OUTPUT_SVC
    ${RPC_GENERATED_FILE_PREFIX}_svc.c
    ${RPC_GENERATED_FILE_PREFIX}_xdr.c
    ${RPC_GENERATED_FILE_PREFIX}.h)
+
+ #inhibit compiler warning for generated files
+ IF (CMAKE_COMPILER_IS_GNUCC)
+     SET_SOURCE_FILES_PROPERTIES(${${RPC_PREFIX}_RPCGEN_OUTPUT_SVC}
+	                            PROPERTIES COMPILE_FLAGS "-w")
+ ENDIF(CMAKE_COMPILER_IS_GNUCC)

  ADD_CUSTOM_TARGET(${RPC_PREFIX}_rpcgen_exec_svc
    DEPENDS ${${RPC_PREFIX}_RPCGEN_OUTPUT_SVC}


STYLE: Add parameters for slicer package creation

--- DTIPrepTools.cmake
+++ DTIPrepTools.cmake
@@ -187,6 +187,17 @@
 set(TestData_DIR ${CMAKE_CURRENT_SOURCE_DIR}/TestData)

 if( DTIPrep_BUILD_SLICER_EXTENSION )
+
+  set(EXTENSION_NAME ${LOCAL_PROJECT_NAME} )
+  set(MODULE_NAME ${LOCAL_PROJECT_NAME} )
+  set(EXTENSION_HOMEPAGE "https://www.nitrc.org/projects/dtiprep/")
+  set(EXTENSION_CATEGORY "DWI/DTI Quality Control")
+  set(EXTENSION_CONTRIBUTORS "Joy Matsui, Zhexing Liu, Clement Vachet, David Welch, Guido Gerig, kent williams, Mahshid Farzinfar, Sylvain Gouttard, Vincent Magnotta, Hans Johnson, Martin Styner, Francois Budin, Juan Prieto")
+  set(EXTENSION_DESCRIPTION "DTIPrep performs a "Study-specific Protocol" based automatic pipeline for DWI/DTI quality control and preparation")
+  set(EXTENSION_ICONURL "https://www.nitrc.org/project/list_screenshots.php?group_id=283&screenshot_id=216")
+  set(EXTENSION_DEPENDS "NA") # Specified as a space separated list or 'NA' if any
+  set(EXTENSION_BUILD_SUBDIRECTORY DTIPrep-build/DTIPrepTools-build)
+
   unsetForSlicer( NAMES SlicerExecutionModel_DIR ITK_DIR VTK_DIR CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS ITK_LIBRARIES )
   find_package(Slicer REQUIRED)
   include(${Slicer_USE_FILE})


mac port fortran g95

mac port fortran g95

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@1148 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/FortranLibraries.cmake
+++ Numerics/cmake/FortranLibraries.cmake
@@ -22,6 +22,7 @@
    "fio\;f90math\;f77math"
    "afio\;af90math\;af77math\;amisc"
    "g2c"
+   "f95"
 )

@@ -56,7 +57,7 @@
   MESSAGE(STATUS "Seeking fortran library directory")

   FILE(GLOB _LIBDIRS_MAYBE
-    /opt /opt/* /opt/lib/*
+    /opt /opt/* /opt/local/lib/gcc-lib/*/* /opt/lib/*
     /usr/local/* /usr/local/lib/*
     /usr/local/*/lib/gcc/*/*
     /usr/lib/gcc/*/*


Remove the dependence from my paths

Remove the dependence from my paths

--- legacy/ndsim/build/FindROOT.cmake
+++ legacy/ndsim/build/FindROOT.cmake
@@ -220,7 +220,7 @@

   if (CMAKE_SYSTEM_NAME MATCHES Linux)
     ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES}
-       COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:/batchsoft/gcc/gcc-4.6.3-x86_64-sl6/lib64 ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE}
+       COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} ROOTSYS=${ROOTSYS} ${ROOT_CINT_EXECUTABLE}
        ARGS -f ${OUTFILE} -c -p -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES} ${LINKDEF_FILE}
        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
   else (CMAKE_SYSTEM_NAME MATCHES Linux)


Add default path

Add default path

--- CMake/FindeORL.cmake
+++ CMake/FindeORL.cmake
@@ -1,7 +1,7 @@
-FIND_PATH(eORL_INCLUDE_DIRS NAMES "eORL.h" PATHS ${eORL_INCLUDE_DIR} DOC "The eORL include directory")
+FIND_PATH(eORL_INCLUDE_DIRS NAMES "eORL.h" PATHS /opt/inc /include /usr/include /include/eorl /usr/include/eorl ${eORL_INCLUDE_DIR} DOC "The eORL include directory")
 message("eORL_INCLUDE_DIRS: ${eORL_INCLUDE_DIRS}; eORL_LIBRARIES: ${eORL_LIBRARIES}")
 message("PREFIX: ${CMAKE_PREFIX_PATH}")
-FIND_LIBRARY(eORL_LIBRARIES NAMES "eORL" PATHS /opt/eorl/lib /opt/eORL/lib /usr/lib/eORL /lib/eORL /opt/eORL/ ${CMAKE_PREFIX_PATH}/eORL ${eORL_LIB_DIR} DOC "The eORL library (libeORL.so)")
+FIND_LIBRARY(eORL_LIBRARIES NAMES "eORL" PATHS /opt/lib /opt/eorl/lib /opt/eORL/lib /usr/lib/eORL /lib/eORL /opt/eORL/ ${CMAKE_PREFIX_PATH}/eORL ${eORL_LIB_DIR} DOC "The eORL library (libeORL.so)")

 SET(eORL_FOUND FALSE)


Fixing issue where headers were being placed in the wrong directory during installation

--- Resources/CMake/MXA_CMakeMacros.cmake
+++ Resources/CMake/MXA_CMakeMacros.cmake
@@ -2,7 +2,7 @@
 MACRO (MXA_SOURCE_PROPERTIES NAME HEADERS SOURCES)

   INSTALL (FILES ${HEADERS}
-              DESTINATION include/R3D/${NAME}
+              DESTINATION include/MXA/${NAME}
               COMPONENT Headers
   )


Set quantum depth and HDRI for magick core.

--- add_dependencies.cmake
+++ add_dependencies.cmake
@@ -53,7 +53,7 @@
 include_directories(${Boost_INCLUDE_DIR})
 list(APPEND LIBRARIES ${Boost_LIBRARIES})

-FIND_PACKAGE (ITK 4.5 REQUIRED)
+find_package(ITK 4.5 REQUIRED)
 include(${ITK_USE_FILE})
 add_definitions("-DVCL_CAN_STATIC_CONST_INIT_FLOAT=0")
 add_definitions("-DVCL_NEEDS_INLINE_INSTANTIATION=0")
@@ -61,6 +61,8 @@

 find_package(ImageMagick REQUIRED COMPONENTS Magick++)
 include_directories(${ImageMagick_INCLUDE_DIRS})
+add_definitions("-DMAGICKCORE_QUANTUM_DEPTH=32")
+add_definitions("-DMAGICKCORE_HDRI_ENABLE=1")
 list(APPEND LIBRARIES ${ImageMagick_LIBRARIES})

 #  -Wno-unused-local-typedefs is just because of ITK 4.5 with 4.7 it is not necessary any more


SourceKit: repair the build when cross-compiling

Not all targets (CMAKE_SYSTEM_NAME) use `lib` and `.a` for the static library
name.  Adjust the name properly for the host that we are building for.  This
repairs the build when performing a cross-compile from Linux to Windows.

--- tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -158,7 +158,7 @@
   set(prefixed_link_libraries)
   foreach(dep ${SOURCEKITLIB_LINK_LIBS})
     if("${dep}" MATCHES "^clang")
-      set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/lib${dep}.a")
+      set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${dep}${CMAKE_STATIC_LIBRARY_SUFFIX}")
     endif()
     list(APPEND prefixed_link_libraries "${dep}")
   endforeach()


[Build] Ensure that we link in SwiftSyntax and Swift for SourceKit

This applies the changes from c50b142a14eea3f4cab612f224fd8ee46cc0ee27 to AddSwiftSourceKit.cmake.

--- tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -154,6 +154,24 @@
     endif()
   endif()
   set(RPATH_LIST ${RPATH_LIST} PARENT_SCOPE)
+
+  if(SWIFT_SWIFT_PARSER)
+    # Make sure we can find the early SwiftSyntax libraries.
+    target_link_directories(${target} PRIVATE "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/lib")
+
+    # For the "end step" of bootstrapping configurations on Darwin, need to be
+    # able to fall back to the SDK directory for libswiftCore et al.
+    if (BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")
+      if (NOT "${bootstrapping}" STREQUAL "1")
+        if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_DARWIN_PLATFORMS)
+          target_link_directories(${target} PRIVATE "${sdk_dir}")
+
+          # Include the abi stable system stdlib in our rpath.
+         set(swift_runtime_rpath "/usr/lib/swift")
+        endif()
+      endif()
+    endif()
+  endif()
 endfunction()

 # Add a new SourceKit library.


[CMake] Use an absolute path when adding Swift runtime paths.

The SourceKit version of these operations takes an absolute path, whereas
the primary one takes a relative path.

Fixes rdar://100976577

--- tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -341,7 +341,7 @@
   endif()

   set(RPATH_LIST)
-  add_sourcekit_swift_runtime_link_flags(${name} "../../../.." ${SKEXEC_HAS_SWIFT_MODULES})
+  add_sourcekit_swift_runtime_link_flags(${name} ${SOURCEKIT_LIBRARY_OUTPUT_INTDIR} ${SKEXEC_HAS_SWIFT_MODULES})

 endmacro()


Handle trailing spaces and empty condition variables

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -43,7 +43,8 @@
     if (NOT "${line_match}" STREQUAL "")
 #message(STATUS "match on ${line_match}")
       set(var_name ${CMAKE_MATCH_1})
-      set(var_value ${CMAKE_MATCH_2})
+#      set(var_value ${CMAKE_MATCH_2})
+      string(STRIP ${CMAKE_MATCH_2} var_value)
       # check for Makefile variables in the string, e.g. $(TSUFFIX)
       string(REGEX MATCHALL "\\$\\(([0-9_a-zA-Z]+)\\)" make_var_matches ${var_value})
       foreach (make_var ${make_var_matches})
@@ -63,7 +64,7 @@
         string(REGEX MATCH "ifeq \\(\\$\\(([_A-Z]+)\\),[ \t]*([0-9_A-Z]+)\\)" line_match "${makefile_line}")
         if (NOT "${line_match}" STREQUAL "")
 #          message(STATUS "IFEQ: ${line_match} first: ${CMAKE_MATCH_1} second: ${CMAKE_MATCH_2}")
-          if (${${CMAKE_MATCH_1}} STREQUAL ${CMAKE_MATCH_2})
+          if (DEFINED ${${CMAKE_MATCH_1}} AND ${${CMAKE_MATCH_1}} STREQUAL ${CMAKE_MATCH_2})
 #            message (STATUS "condition is true")
             set (IfElse 1)
           else ()


Fix bundled-installer filename (omitted version)

--- Superbuild/Projects/veloview.bundle.common.cmake
+++ Superbuild/Projects/veloview.bundle.common.cmake
@@ -39,4 +39,4 @@
 set(CPACK_RESOURCE_FILE_LICENSE "${VeloViewSuperBuild_SOURCE_DIR}/LICENSE")

 set(CPACK_PACKAGE_FILE_NAME
-    "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_FULL}-${PACKAGE_TIMESTAMP}-${package_suffix}")
+    "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${PACKAGE_TIMESTAMP}-${package_suffix}")


kata:rust: Point the rust version to KATA_RUST_VERSION

So we don't need to maintain the version at two places.

Change-Id: Ibbbb9b7744bdd4e209404bf744e2f57e0022db7a
GitOrigin-RevId: 7583eaba9d5364e6c47ede3e5fed4505c73ae790

--- apps/system/rust.cmake
+++ apps/system/rust.cmake
@@ -51,7 +51,7 @@
         WORKING_DIRECTORY ${RUST_SOURCE_DIR}
         COMMAND
             ${CMAKE_COMMAND} -E env RUSTFLAGS=${RUSTFLAGS}
-            cargo +nightly-2021-08-05 build
+            cargo "+$ENV{KATA_RUST_VERSION}" build
             --target ${RUST_TARGET}
             ${CARGO_OPTIONS} ${CARGO_RELEASE}
             --target-dir ${RUST_BUILD_DIR}


Review default visibility of compiler and linker options

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -67,75 +67,79 @@
 # MSVC compiler options
 if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
     set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
-        /MP           # -> build with multiple processes
-        /W4           # -> warning level 4
-        # /WX         # -> treat warnings as errors
+        PRIVATE
+            /MP           # -> build with multiple processes
+            /W4           # -> warning level 4
+            # /WX         # -> treat warnings as errors

-        /wd4251       # -> disable warning: 'identifier': class 'type' needs to have dll-interface to be used by clients of class 'type2'
-        /wd4592       # -> disable warning: 'identifier': symbol will be dynamically initialized (implementation limitation)
-        # /wd4201     # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
-        # /wd4127     # -> disable warning: conditional expression is constant (caused by Qt)
-
-        #$<$<CONFIG:Debug>:
-        #/RTCc         # -> value is assigned to a smaller data type and results in a data loss
-        #>
+            #$<$<CONFIG:Debug>:
+            #/RTCc         # -> value is assigned to a smaller data type and results in a data loss
+            #>

-        $<$<CONFIG:Release>:
-        /Gw           # -> whole program global optimization
-        /GS-          # -> buffer security check: no
-        /GL           # -> whole program optimization: enable link-time code generation (disables Zi)
-        /GF           # -> enable string pooling
-        >
-
-        # No manual c++11 enable for MSVC as all supported MSVC versions for cmake-init have C++11 implicitly enabled (MSVC >=2013)
+            $<$<CONFIG:Release>:
+            /Gw           # -> whole program global optimization
+            /GS-          # -> buffer security check: no
+            /GL           # -> whole program optimization: enable link-time code generation (disables Zi)
+            /GF           # -> enable string pooling
+            >
+
+            # No manual c++11 enable for MSVC as all supported MSVC versions for cmake-init have C++11 implicitly enabled (MSVC >=2013)
+
+        PUBLIC
+            /wd4251       # -> disable warning: 'identifier': class 'type' needs to have dll-interface to be used by clients of class 'type2'
+            /wd4592       # -> disable warning: 'identifier': symbol will be dynamically initialized (implementation limitation)
+            # /wd4201     # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
+            # /wd4127     # -> disable warning: conditional expression is constant (caused by Qt)
     )
 endif ()

 # GCC and Clang compiler options
 if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
     set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
-        -Wall
-        -Wextra
-        -Wunused
+        PRIVATE
+            -Wall
+            -Wextra
+            -Wunused

-        -Wreorder
-        -Wignored-qualifiers
-        -Wmissing-braces
-        -Wreturn-type
-        -Wswitch
-        -Wswitch-default
-        -Wuninitialized
-        -Wmissing-field-initializers
-
-        $<$<CXX_COMPILER_ID:GNU>:
-            -Wmaybe-uninitialized
+            -Wreorder
+            -Wignored-qualifiers
+            -Wmissing-braces
+            -Wreturn-type
+            -Wswitch
+            -Wswitch-default
+            -Wuninitialized
+            -Wmissing-field-initializers

-            $<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.8>:
+            $<$<CXX_COMPILER_ID:GNU>:
+                -Wmaybe-uninitialized
+
+                $<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.8>:
+                    -Wpedantic
+
+                    -Wreturn-local-addr
+                >
+            >
+
+            $<$<CXX_COMPILER_ID:Clang>:
                 -Wpedantic

-                -Wreturn-local-addr
+                # -Wreturn-stack-address # gives false positives
             >
-        >
-
-        $<$<CXX_COMPILER_ID:Clang>:
-            -Wpedantic

-            # -Wreturn-stack-address # gives false positives
-        >
-
-        $<$<PLATFORM_ID:Darwin>:
-            -pthread
-        >
-
-        # Required for CMake < 3.1; should be removed if minimum required CMake version is raised.
-        $<$<VERSION_LESS:${CMAKE_VERSION},3.1>:
-            -std=c++11
-        >
-
-        $<$<BOOL:${OPTION_COVERAGE_ENABLED}>:
-            -fprofile-arcs
-            -ftest-coverage
-        >
+            $<$<BOOL:${OPTION_COVERAGE_ENABLED}>:
+                -fprofile-arcs
+                -ftest-coverage
+            >
+
+        PUBLIC
+            $<$<PLATFORM_ID:Darwin>:
+                -pthread
+            >
+
+            # Required for CMake < 3.1; should be removed if minimum required CMake version is raised.
+            $<$<VERSION_LESS:${CMAKE_VERSION},3.1>:
+                -std=c++11
+            >
     )
 endif ()

@@ -149,15 +153,17 @@
 # Use pthreads on mingw and linux
 if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
     set(DEFAULT_LINKER_OPTIONS
-        ${DEFAULT_LINKER_OPTIONS}
-        -pthread
+        PUBLIC
+            ${DEFAULT_LINKER_OPTIONS}
+            -pthread
     )

     if (${OPTION_COVERAGE_ENABLED})
         set(DEFAULT_LINKER_OPTIONS
-        ${DEFAULT_LINKER_OPTIONS}
-        -fprofile-arcs
-        -ftest-coverage
-    )
+            PUBLIC
+                ${DEFAULT_LINKER_OPTIONS}
+                -fprofile-arcs
+                -ftest-coverage
+        )
     endif ()
 endif()


Update CompileOptions.cmake

Update CompileOptions.cmake

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -33,7 +33,7 @@
 set(DEFAULT_INCLUDE_DIRECTORIES)

 if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
-    include_directories("/usr/local/include")
+    LIST(APPEND DEFAULT_INCLUDE_DIRECTORIES "/usr/local/include")
 endif ()


Suppress missing braces warning on GCC

Suppress missing braces warning on GCC

--- cmake/SketchUpAPICpp.cmake
+++ cmake/SketchUpAPICpp.cmake
@@ -16,6 +16,7 @@
   target_compile_options(SketchUpAPICpp PRIVATE "/MP")
 else()
   # target_compile_options(SketchUpAPICpp PRIVATE "-Wall")
+  target_compile_options(SketchUpAPICpp PRIVATE "-Wno-missing-braces")
   target_compile_options(SketchUpAPICpp PRIVATE "-Werror")
 endif()


Followup to 12607800, testing it in PB2 didn't work, trying again Be more explicit about path to (potential) plugin tests dirs

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -103,7 +103,7 @@
 # just use if(INSTALL_PLUGINTESTDIR).
 # The plugin must set its own install path for tests
 #
-FILE(GLOB plugin_tests plugin/*/tests)
+FILE(GLOB plugin_tests ${CMAKE_SOURCE_DIR}/plugin/*/tests)

 #
 # STANDALONE layout


Prevent host Vulkan SDK blocking cross-compilation (#7609)

--- cmake/modules/Vulkan.cmake
+++ cmake/modules/Vulkan.cmake
@@ -26,16 +26,11 @@
 tvm_option(USE_VULKAN_VALIDATION "Enable Vulkan API validation layers" OFF
   IF USE_VULKAN)

-if(Vulkan_FOUND)
-  # always set the includedir
-  # avoid global retrigger of cmake
-  include_directories(SYSTEM ${Vulkan_INCLUDE_DIRS})
-endif(Vulkan_FOUND)
-
 if(USE_VULKAN)
   if(NOT Vulkan_FOUND)
     message(FATAL_ERROR "Cannot find Vulkan, USE_VULKAN=" ${USE_VULKAN})
   endif()
+  include_directories(SYSTEM ${Vulkan_INCLUDE_DIRS})
   message(STATUS "Build with Vulkan support")
   file(GLOB RUNTIME_VULKAN_SRCS src/runtime/vulkan/vulkan.cc)
   file(GLOB COMPILER_VULKAN_SRCS src/target/spirv/*.cc)


Adding -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store at GNU GCC under x86/x64 systems. (#1462)

--- cmake/simdjson-flags.cmake
+++ cmake/simdjson-flags.cmake
@@ -99,6 +99,12 @@
   target_compile_options(simdjson-internal-flags INTERFACE -Werror -Wall -Wextra -Weffc++)
   target_compile_options(simdjson-internal-flags INTERFACE -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion)
 endif(MSVC)
+
+
+# workaround for GNU GCC poor AVX load/store code generation
+if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86(_64)?)$"))
+  target_compile_options(simdjson-flags INTERFACE -mno-avx256-split-unaligned-load -mno-avx256-split-unaligned-store)
+endif()

 #
 # Optional flags


fixed oneTBB 2021 version detection bug

fixed oneTBB 2021 version detection bug

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -6,8 +6,8 @@
 #
 # The user may specify a version and lists of required and optional components:
 #
-# find_package(TBB 2017.0 EXACT REQUIRED
-#              tbb tbbmalloc
+# find_package(TBB 2017.0 EXACT REQUIRED
+#              tbb tbbmalloc
 #              OPTIONAL_COMPONENTS tbbmalloc_proxy
 #              QUIET)
 #
@@ -27,7 +27,7 @@
 # component targets TBB::<COMPONENT>, e.g. TBB::tbbmalloc.
 #
 # The targets will attempt to link to release versions of TBB in release mode,
-# and debug versions in debug mode.
+# and debug versions in debug mode.
 #
 # In addition to the targets, the script defines:
 #
@@ -38,14 +38,6 @@

 # We use INTERFACE libraries, which are only supported in 3.x
 cmake_minimum_required(VERSION 3.1)
-
-
-# CMake before 3.12 used to ignore <PKGNAME>_ROOT, but we always use this
-# variable. Avoid warning by setting the policy to new behaviour, which means
-# the variables are used.
-if(POLICY CMP0074)
-  cmake_policy(SET CMP0074 NEW)
-endif()

 # These two are used to automatically find the root and include directories.
 set(_TBB_INCLUDE_SUBDIR "include")
@@ -144,7 +136,9 @@

 macro(rk_tbb_check_version)
   # Extract the version we found in our root.
-  if (EXISTS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h")
+  if(EXISTS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h")
+    set(_TBB_VERSION_HEADER "oneapi/tbb/version.h")
+  elseif(EXISTS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h")
     set(_TBB_VERSION_HEADER "tbb/tbb_stddef.h")
   elseif(EXISTS "${TBB_INCLUDE_DIR}/tbb/version.h")
     set(_TBB_VERSION_HEADER "tbb/version.h")
@@ -219,7 +213,7 @@
     set(TBB_FOUND TRUE)
     set(TBB_INCLUDE_DIRS "${TBB_INCLUDE_DIR}")
     return()
-  elseif ((TARGET TBB) OR (NOT _TBB_AVAILABLE_COMPONENTS STREQUAL ""))
+  elseif ((TARGET TBB) OR (NOT _TBB_AVAILABLE_COMPONENTS STREQUAL ""))
     rk_tbb_error("Ignoring existing TBB targets because required components are missing: ${_TBB_MISSING_COMPONENTS}")
   endif()
 endmacro()
@@ -323,7 +317,7 @@
     set(DLL_NAME "${LIB_NAME}.dll")
     find_path(${BIN_DIR_VAR}
       NAMES "${DLL_NAME}"
-      PATHS
+      PATHS
         ${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER}
         ${TBB_ROOT}/bin
         ${TBB_ROOT}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER}


Fix DLL unloading on Linux

Fix DLL unloading on Linux

--- cmake/DaemonFlags.cmake
+++ cmake/DaemonFlags.cmake
@@ -197,6 +197,10 @@
     # Use hidden symbol visibility if possible
     try_c_cxx_flag(FVISIBILITY_HIDDEN "-fvisibility=hidden")

+    # Prevent the generation of STB_GNU_UNIQUE symbols on templated functions on Linux.
+    # STB_GNU_UNIQUE renders dlclose() inoperative.
+    try_cxx_flag(FNO_GNU_UNIQUE "-fno-gnu-unique")
+
     # Extra debug flags
     set_c_cxx_flag("-g3" DEBUG)
     set_c_cxx_flag("-g3" RELWITHDEBINFO)


Change pkgconfig hiredis library search method

--- cmake/FindHIREDIS.cmake
+++ cmake/FindHIREDIS.cmake
@@ -1,6 +1,6 @@
 find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
-  pkg_search_module(SHARED_HIREDIS REQUIRED hiredis)
+  pkg_check_modules(SHARED_HIREDIS REQUIRED hiredis)
 endif()

 find_path(HIREDIS_INCLUDE_DIR hiredis/hiredis.h


BUG: Remove package-config content from FindJsonCpp.

Not relevant.

--- cmake/FindJsonCpp.cmake
+++ cmake/FindJsonCpp.cmake
@@ -26,15 +26,12 @@
   set( JsonCpp_LIBDIR ${JsonCpp_DIR}/lib )
 endif( JsonCpp_DIR )

-find_package( PkgConfig QUIET )
-pkg_check_modules( PC_JsonCpp QUIET jsoncpp )
-
 find_path( JsonCpp_INCLUDE_DIR NAMES json/json.h
-  HINTS ${JsonCpp_INCLUDEDIR} ${PC_JsonCpp_INCLUDEDIR} ${PC_JsonCpp_INCLUDE_DIRS}
+  HINTS ${JsonCpp_INCLUDEDIR}
   PATH_SUFFIXES jsoncpp )

 find_library( JsonCpp_LIBRARY NAMES jsoncpp libjsoncpp
-  HINTS ${JsonCpp_LIBDIR} ${PC_JsonCpp_LIBDIR} ${PC_JsonCpp_LIBRARY_DIRS} )
+  HINTS ${JsonCpp_LIBDIR} )

 set( JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR} )
 set( JsonCpp_LIBRARIES ${JsonCpp_LIBRARY} )


FindJsonCpp manual pre-merge-conflict resolution

--- cmake/FindJsonCpp.cmake
+++ cmake/FindJsonCpp.cmake
@@ -46,18 +46,18 @@
 	set(__jsoncpp_have_jsoncpplib FALSE)
 	if(TARGET jsoncpp_lib)
 		get_property(__jsoncpp_lib_type TARGET jsoncpp_lib PROPERTY TYPE)
-		#message(STATUS "__jsoncpp_lib_type ${__jsoncpp_lib_type}")
 		# We make interface libraries. If an actual config module made it, it would be an imported library.
 		if(NOT __jsoncpp_lib_type STREQUAL "INTERFACE_LIBRARY")
-			#message("have jsoncpp_lib and we didn't invent it ourselves")
 			set(__jsoncpp_have_jsoncpplib TRUE)
 		endif()
 	endif()
+	#message(STATUS "__jsoncpp_have_jsoncpplib ${__jsoncpp_have_jsoncpplib}")
 endmacro()

 include(FindPackageHandleStandardArgs)
 # Ensure that if this is TRUE later, it's because we set it.
 set(JSONCPP_FOUND FALSE)
+set(__jsoncpp_have_jsoncpplib FALSE)

 # See if we find a CMake config file - there is no harm in calling this more than once,
 # and we need to call it at least once every CMake invocation to create the original
@@ -71,7 +71,6 @@

 	# part of the string to indicate if we found a real jsoncpp_lib (and what kind)
 	_jsoncpp_check_for_real_jsoncpplib()
-

 	macro(_jsoncpp_apply_map_config target)
 		if(MSVC)


Fix cmake/FindOpenVDB.cmake to handle the QUIET argument of find_package() correctly.

When find_package() is given the QUIET argument it sets the variable
<PackageName>_FIND_QUIETLY, not <PackageName>_FIND_QUIET.

Signed-off-by: Baruch Sterin <f795aa93bfc84d114eac76693f2c1d6657ec8049@gmail.com>

--- cmake/FindOpenVDB.cmake
+++ cmake/FindOpenVDB.cmake
@@ -433,7 +433,7 @@
   endif()
 endif()

-if(NOT OpenVDB_FIND_QUIET)
+if(NOT OpenVDB_FIND_QUIETLY)
   if(NOT OpenVDB_ABI)
     message(WARNING "Unable to determine OpenVDB ABI version from OpenVDB "
       "installation. The library major version \"${OpenVDB_MAJOR_VERSION}\" "


Prevent GTest and GMock from being installed with Google Benchmark.

When users satisfy the GTest dependancy by placing a googletest
directory in the project, the targets from GTest and GMock incorrectly
get installed along side this library. We shouldn't be installing
our test dependancies.

This patch forces the options that control installation for googletest
to OFF.

--- cmake/HandleGTest.cmake
+++ cmake/HandleGTest.cmake
@@ -67,6 +67,8 @@

 if (BENCHMARK_ENABLE_GTEST_TESTS)
   if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/googletest)
+    set(INSTALL_GTEST OFF CACHE INTERNAL "")
+    set(INSTALL_GMOCK OFF CACHE INTERNAL "")
     add_subdirectory(${CMAKE_SOURCE_DIR}/googletest)
     set(GTEST_BOTH_LIBRARIES gtest gtest_main)
   elseif(BENCHMARK_DOWNLOAD_DEPENDENCIES)


cleanup: Prefer the CMake CONFIG module for CURL. (#2720)

This gives us the standard targets, with the correct dependencies and
flags. Fallback on the native CMake module if nothing else is available.
This is a port of the `vcpkg` patch for google-cloud-cpp, once merged we
can cleanup the patch from the `vcpkg` port.

--- cmake/IncludeCurl.cmake
+++ cmake/IncludeCurl.cmake
@@ -34,49 +34,65 @@
 if ("${GOOGLE_CLOUD_CPP_CURL_PROVIDER}" STREQUAL "external")
     include(external/curl)
 elseif("${GOOGLE_CLOUD_CPP_CURL_PROVIDER}" STREQUAL "package")
-    # Search for libcurl, in CMake 3.5 this does not define a target, but it
-    # will in 3.12 (see https://cmake.org/cmake/help/git-
-    # stage/module/FindCURL.html for details).  Until then, define the target
-    # ourselves if it is missing.
-    find_package(CURL REQUIRED)
-    if (NOT TARGET CURL::libcurl)
-        add_library(CURL::libcurl UNKNOWN IMPORTED)
-        set_property(TARGET CURL::libcurl
-                     APPEND
-                     PROPERTY INTERFACE_INCLUDE_DIRECTORIES
-                              "${CURL_INCLUDE_DIR}")
-        set_property(TARGET CURL::libcurl
-                     APPEND
-                     PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}")
-    endif ()
-    # If the library is static, we need to explicitly link its dependencies.
-    # However, we should not do so for shared libraries, because the version of
-    # OpenSSL (for example) found by find_package() may be newer than the
-    # version linked against libcurl.
-    if ("${CURL_LIBRARY}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
-        find_package(OpenSSL REQUIRED)
-        find_package(ZLIB REQUIRED)
-        set_property(TARGET CURL::libcurl
-                     APPEND
-                     PROPERTY INTERFACE_LINK_LIBRARIES
-                              OpenSSL::SSL
-                              OpenSSL::Crypto
-                              ZLIB::ZLIB)
-        message(STATUS "CURL linkage will be static")
-        if (WIN32)
+    # Try to find libcurl using the CMake config file installed by libcurl
+    # itself, that can fail if libcurl was installed in your system using Make,
+    # which many distros continue to do.
+    find_package(CURL CONFIG QUIET)
+    if (CURL_FOUND)
+        message(STATUS "CURL found using via CONFIG module")
+    else()
+        # As searching for libcurl using CONFIG mode failed, try again using the
+        # CMake config module. We will need to fix up a few things if the module
+        # is found this way.
+        find_package(CURL REQUIRED)
+        # Before CMake 3.12 the module does not define a target, compare:
+        # https://cmake.org/cmake/help/v3.12/module/FindCURL.html vs
+        # https://cmake.org/cmake/help/v3.11/module/FindCURL.html
+        #
+        # Manually define the target if it does not exist so the rest of the
+        # code does not have to deal with these details:
+        if (NOT TARGET CURL::libcurl)
+            add_library(CURL::libcurl UNKNOWN IMPORTED)
+            set_property(TARGET CURL::libcurl
+                         APPEND
+                         PROPERTY INTERFACE_INCLUDE_DIRECTORIES
+                                  "${CURL_INCLUDE_DIR}")
+            set_property(TARGET CURL::libcurl
+                         APPEND
+                         PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}")
+        endif ()
+        # If the library is static, we need to explicitly link its dependencies.
+        # The CMake module does not do so. However, we should not do so for
+        # shared libraries, because the version of OpenSSL (for example) found
+        # by find_package() may be newer than the version linked against
+        # libcurl.
+        if ("${CURL_LIBRARY}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
+            find_package(OpenSSL REQUIRED)
+            find_package(ZLIB REQUIRED)
             set_property(TARGET CURL::libcurl
                          APPEND
                          PROPERTY INTERFACE_LINK_LIBRARIES
-                                  crypt32
-                                  wsock32
-                                  ws2_32)
+                                  OpenSSL::SSL
+                                  OpenSSL::Crypto
+                                  ZLIB::ZLIB)
+            message(STATUS "CURL linkage will be static")
+            # On WIN32 and APPLE there are even more libraries needed for static
+            # linking.
+            if (WIN32)
+                set_property(TARGET CURL::libcurl
+                             APPEND
+                             PROPERTY INTERFACE_LINK_LIBRARIES
+                                      crypt32
+                                      wsock32
+                                      ws2_32)
+            endif ()
+            if (APPLE)
+                set_property(TARGET CURL::libcurl
+                             APPEND
+                             PROPERTY INTERFACE_LINK_LIBRARIES ldap)
+            endif ()
+        else()
+            message(STATUS "CURL linkage will be non-static")
         endif ()
-        if (APPLE)
-            set_property(TARGET CURL::libcurl
-                         APPEND
-                         PROPERTY INTERFACE_LINK_LIBRARIES ldap)
-        endif ()
-    else()
-        message(STATUS "CURL linkage will be non-static")
-    endif ()
+    endif (CURL_FOUND)
 endif ()


Even in shared build Windows requires to find static libraries, issue #636

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

--- cmake/pcl_options.cmake
+++ cmake/pcl_options.cmake
@@ -6,7 +6,10 @@
   set(PCL_LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
   set(PCL_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
   set(PCL_LIB_TYPE "SHARED")
-  set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
+#  set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
+  if(WIN32)
+    set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_IMPORT_LIBRARY_SUFFIX})
+  endif(WIN32)
 else(PCL_SHARED_LIBS)
   set(PCL_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
   set(PCL_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})


Fixes issue #1414

Fixes issue #1414

Applies the proposed resolution discussed in #1414, deleting the addition of the -Wl flag.

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -203,10 +203,6 @@
     # Only link if needed
     if(WIN32 AND MSVC)
       set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
-    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-        set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
-      endif()
     elseif(__COMPILER_PATHSCALE)
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -mp)
     elseif(CMAKE_COMPILER_IS_GNUCXX AND MINGW)
@@ -251,10 +247,6 @@
     # Only link if needed
     if(WIN32 AND MSVC)
       set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
-    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-        set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
-      endif()
     else()
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     endif()
@@ -293,10 +285,6 @@
       set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF
                                                 DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX}
                                                 RELEASE_OUTPUT_NAME ${_name}${CMAKE_RELEASE_POSTFIX})
-    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-        set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
-      endif()
     elseif(__COMPILER_PATHSCALE)
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -mp)
     elseif(CMAKE_COMPILER_IS_GNUCXX AND MINGW)
@@ -339,10 +327,6 @@
       set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF
                                                 DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX}
                                                 RELEASE_OUTPUT_NAME ${_name}${CMAKE_RELEASE_POSTFIX})
-    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-        set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
-      endif()
     elseif(__COMPILER_PATHSCALE)
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -mp)
     elseif(CMAKE_COMPILER_IS_GNUCXX AND MINGW)
@@ -386,10 +370,6 @@
       set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF
                                                 DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX}
                                                 RELEASE_OUTPUT_NAME ${_name}${CMAKE_RELEASE_POSTFIX})
-    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-        set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
-      endif()
     else()
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     endif()
@@ -425,9 +405,6 @@
     #
     # Only link if needed
     if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-        set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl)
-      endif()
       target_link_libraries(${_exename} pthread)
     elseif(UNIX AND NOT ANDROID)
       set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl,--as-needed)


Changed name from LIBRARY -> LINKLIB

Changed name from LIBRARY -> LINKLIB

Former-commit-id: dc290df557f6cd6588a4401019a00f499f3c266b

--- cmake-modules/PrintTargetInfo.cmake
+++ cmake-modules/PrintTargetInfo.cmake
@@ -54,7 +54,7 @@
             message(STATUS "${padded_target} INCLUDE : ${INFO_INC}" )
         endif()
         if(INFO_LIB)
-            message(STATUS "${padded_target} LIBRARY : ${INFO_LIB}" )
+            message(STATUS "${padded_target} LINKLIB : ${INFO_LIB}" )
         endif()
         if(INFO_OPT)
             message(STATUS "${padded_target} OPTIONS : ${INFO_OPT}" )


Android required CMake 3.7+

Android required CMake 3.7+

--- cmake/modules/hunter_finalize.cmake
+++ cmake/modules/hunter_finalize.cmake
@@ -133,4 +133,11 @@
   )

   hunter_apply_copy_rules()
+
+  if(ANDROID AND CMAKE_VERSION VERSION_LESS "3.7")
+    hunter_user_error(
+        "CMake version 3.7+ required for Android platforms, see"
+        " https://docs.hunter.sh/en/latest/quick-start/cmake.html"
+    )
+  endif()
 endmacro()


bugfix in ispc.cmake

bugfix in ispc.cmake

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -47,7 +47,7 @@
   SET(ISPC_OBJECTS "")

   FOREACH(src ${ARGN})
-		message("src "${src})
+
     GET_FILENAME_COMPONENT(fname ${src} NAME_WE)
     GET_FILENAME_COMPONENT(dir ${src} PATH)

@@ -72,7 +72,7 @@
     ENDIF ()

     SET(results "${outdir}/${fname}.dev.${ISPC_TARGET_EXT}")
-		message("results ${outdir}/${fname}.dev.${ISPC_TARGET_EXT}")
+
     # if we have multiple targets add additional object files
     IF (__XEON__)
       IF (${targets} MATCHES ".*,.*")


Update AllFiles.cmake

Update AllFiles.cmake


add CONFIG_EXTRAS_POST to ament_package() (#123)

--- ament_cmake_core/cmake/core/ament_package.cmake
+++ ament_cmake_core/cmake/core/ament_package.cmake
@@ -28,8 +28,17 @@
 #   a template which is expanded using configure_file() (ending in
 #   '.cmake.in') with @ONLY.
 #   If the global variable ${PROJECT_NAME}_CONFIG_EXTRAS is set it
+#   will be appended to the explicitly passed argument.
+# :type CONFIG_EXTRAS: list of files
+# :param CONFIG_EXTRAS_POST: a list of CMake files containing extra
+#   stuff that should be accessible to users of this package after
+#   ``find_package``\ -ing it.
+#   The file can either be a plain CMake file (ending in '.cmake') or
+#   a template which is expanded using configure_file() (ending in
+#   '.cmake.in') with @ONLY.
+#   If the global variable ${PROJECT_NAME}_CONFIG_EXTRAS_POST is set it
 #   will be prepended to the explicitly passed argument.
-# :type CONFIG_EXTRAS: list of files
+# :type CONFIG_EXTRAS_POST: list of files
 #
 # @public
 #
@@ -60,7 +69,7 @@
 endmacro()

 function(_ament_package)
-  cmake_parse_arguments(PACKAGE "" "" "CONFIG_EXTRAS" ${ARGN})
+  cmake_parse_arguments(PACKAGE "" "" "CONFIG_EXTRAS;CONFIG_EXTRAS_POST" ${ARGN})
   if(PACKAGE_UNPARSED_ARGUMENTS)
     message(FATAL_ERROR "ament_package() called with unused arguments: "
       "${PACKAGE_UNPARSED_ARGUMENTS}")
@@ -72,7 +81,12 @@

   # expand and install config extras
   set(PACKAGE_CONFIG_EXTRA_FILES "")
-  foreach(extra ${PACKAGE_CONFIG_EXTRAS} ${${PROJECT_NAME}_CONFIG_EXTRAS})
+  foreach(
+    extra
+    ${PACKAGE_CONFIG_EXTRAS}
+    ${${PROJECT_NAME}_CONFIG_EXTRAS}
+    ${PACKAGE_CONFIG_EXTRAS_POST}
+  )
     assert_file_exists("${extra}"
       "ament_package() called with extra file '${extra}' which does not exist")
     stamp("${extra}")


BUG: Needed to pass SlicerExecutionModel_DIR to cache for style check

--- CMake/DashboardScripts/cmakecache.cmake
+++ CMake/DashboardScripts/cmakecache.cmake
@@ -99,6 +99,13 @@
     " )
 endif()

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


BUG: #1761: fix openMP linker flag

BUG: #1761: fix openMP linker flag

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -288,6 +288,8 @@
     set(OTB_REQUIRED_CXX_FLAGS "${OTB_REQUIRED_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
     if(OpenMP_EXE_LINKER_FLAGS)
       set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
+    else()
+      set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${OpenMP_CXX_FLAGS}")
     endif()
   endif()


Commented SOFA patches.

Commented SOFA patches.

--- CMakeExternals/PatchSOFA-rev10669.cmake
+++ CMakeExternals/PatchSOFA-rev10669.cmake
@@ -1,59 +1,100 @@
-file(STRINGS "cmake/dependencies.cmake" dependencies_cmake NEWLINE_CONSUME)
-string(REPLACE "\"tinyxml\"" "\"SofaTinyXml\"" dependencies_cmake "${dependencies_cmake}")
-string(REPLACE "add_subdirectory(\"\${SOFA_A" "#add_subdirectory(\"\${SOFA_A" dependencies_cmake "${dependencies_cmake}")
-file(WRITE "cmake/dependencies.cmake" "${dependencies_cmake}")
+# Changes of cmake/dependencies.cmake are commented separately below

-file(STRINGS "modules/sofa/component/SofaBaseVisual/CMakeLists.txt" CMakeLists_txt NEWLINE_CONSUME)
-string(REPLACE "tinyxml" "SofaTinyXml" CMakeLists_txt "${CMakeLists_txt}")
-file(WRITE "modules/sofa/component/SofaBaseVisual/CMakeLists.txt" "${CMakeLists_txt}")
+set(path "cmake/dependencies.cmake")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)

-file(STRINGS "modules/sofa/component/SofaLoader/CMakeLists.txt" CMakeLists_txt NEWLINE_CONSUME)
-string(REPLACE "tinyxml" "SofaTinyXml" CMakeLists_txt "${CMakeLists_txt}")
-file(WRITE "modules/sofa/component/SofaLoader/CMakeLists.txt" "${CMakeLists_txt}")
+# Comment out add_subdirectory() commands that reference the SOFA applications
+# directory

-file(STRINGS "modules/sofa/simulation/common/CMakeLists.txt" CMakeLists_txt NEWLINE_CONSUME)
-string(REPLACE "tinyxml" "SofaTinyXml" CMakeLists_txt "${CMakeLists_txt}")
-file(WRITE "modules/sofa/simulation/common/CMakeLists.txt" "${CMakeLists_txt}")
+string(REPLACE "add_subdirectory(\"\${SOFA_A" "#add_subdirectory(\"\${SOFA_A" CONTENTS ${CONTENTS})

-file(STRINGS "extlibs/csparse/CMakeLists.txt" CMakeLists_txt NEWLINE_CONSUME)
-string(REPLACE "\${CMAKE_COMPILER_IS_GNUCC}" "\"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR \"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"" CMakeLists_txt "${CMakeLists_txt}")
-file(WRITE "extlibs/csparse/CMakeLists.txt" "${CMakeLists_txt}")
+# Rename tinyxml to SofaTinyXml since MITK has its own version of tinyxml and
+# the same name lead to linker or runtime errors in the past

-file(STRINGS "extlibs/metis-5.1.0/CMakeLists.txt" CMakeLists_txt NEWLINE_CONSUME)
-string(REPLACE "\${CMAKE_COMPILER_IS_GNUCC}" "\"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR \"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"" CMakeLists_txt "${CMakeLists_txt}")
-file(WRITE "extlibs/metis-5.1.0/CMakeLists.txt" "${CMakeLists_txt}")
+string(REPLACE "\"tinyxml\"" "\"SofaTinyXml\"" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)

-file(STRINGS "extlibs/miniFlowVR/CMakeLists.txt" CMakeLists_txt NEWLINE_CONSUME)
-string(REPLACE "\${CMAKE_COMPILER_IS_GNUCC}" "\"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR \"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"" CMakeLists_txt "${CMakeLists_txt}")
-file(WRITE "extlibs/miniFlowVR/CMakeLists.txt" "${CMakeLists_txt}")
+# Adjust tinyxml references (see above)

-file(STRINGS "extlibs/newmat/CMakeLists.txt" CMakeLists_txt NEWLINE_CONSUME)
-string(REPLACE "\${CMAKE_COMPILER_IS_GNUCC}" "\"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR \"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"" CMakeLists_txt "${CMakeLists_txt}")
-file(WRITE "extlibs/newmat/CMakeLists.txt" "${CMakeLists_txt}")
+set(path "modules/sofa/component/SofaBaseVisual/CMakeLists.txt")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)
+string(REPLACE "tinyxml" "SofaTinyXml" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+set(path "modules/sofa/component/SofaLoader/CMakeLists.txt")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)
+string(REPLACE "tinyxml" "SofaTinyXml" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+set(path "modules/sofa/simulation/common/CMakeLists.txt")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)
+string(REPLACE "tinyxml" "SofaTinyXml" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+# Add -fPIC compiler flag for static libraries also if Clang is used
+
+set(path "extlibs/csparse/CMakeLists.txt")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)
+string(REPLACE "\${CMAKE_COMPILER_IS_GNUCC}" "\"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR \"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+set(path "extlibs/metis-5.1.0/CMakeLists.txt")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)
+string(REPLACE "\${CMAKE_COMPILER_IS_GNUCC}" "\"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR \"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+set(path "extlibs/miniFlowVR/CMakeLists.txt")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)
+string(REPLACE "\${CMAKE_COMPILER_IS_GNUCC}" "\"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR \"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+set(path "extlibs/newmat/CMakeLists.txt")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)
+string(REPLACE "\${CMAKE_COMPILER_IS_GNUCC}" "\"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"GNU\" OR \"\${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+# Remove SOFA's FindGLEW.cmake since we need the official FindGLEW.cmake to
+# inject the MITK superbuild version of GLEW into SOFA

 file(REMOVE "cmake/Modules/FindGLEW.cmake")

-file(STRINGS "cmake/externals.cmake" externals_cmake NEWLINE_CONSUME)
-string(REPLACE "graph " "" externals_cmake "${externals_cmake}")
-string(REPLACE "set(GLUT_LIBRARIES \"freeglut\")" "find_package(GLUT REQUIRED)" externals_cmake "${externals_cmake}")
-string(REPLACE "set(GLEW_LIBRARIES \"glew32\")" "find_package(GLEW REQUIRED)" externals_cmake "${externals_cmake}")
-string(REPLACE "else()\n    set(O" "    list(APPEND GLOBAL_INCLUDE_DIRECTORIES \"\${GLUT_INCLUDE_DIRS}\" \"\${GLEW_INCLUDE_DIRS}\")\nelse()\n    set(O" externals_cmake "${externals_cmake}")
-string(REPLACE "GLUT REQUIRED" "GLUT REQUIRED CONFIG" externals_cmake "${externals_cmake}")
-string(REPLACE "GLEW REQUIRED" "GLEW REQUIRED CONFIG" externals_cmake "${externals_cmake}")
-file(WRITE "cmake/externals.cmake" "${externals_cmake}")
+# Changes of cmake/externals.cmake are commented separately below

-file(APPEND "cmake/externals.cmake" "\nif(SOFA-EXTERNAL_TINYXML)\n    list(APPEND GLOBAL_INCLUDE_DIRECTORIES \"\${TINYXML_INCLUDE_DIRS}\")\nendif()\n")
+set(path "cmake/externals.cmake")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)

-file(STRINGS "cmake/preProject.cmake" preProject_cmake NEWLINE_CONSUME)
-string(REPLACE "DEBUG \"\${SOFA_BIN_DIR}" "DEBUG \"\${SOFA_BIN_DIR}/Debug" preProject_cmake "${preProject_cmake}")
-string(REPLACE "RELEASE \"\${SOFA_BIN_DIR}" "RELEASE \"\${SOFA_BIN_DIR}/Release" preProject_cmake "${preProject_cmake}")
-string(REPLACE "RELWITHDEBINFO \"\${SOFA_BIN_DIR}" "RELWITHDEBINFO \"\${SOFA_BIN_DIR}/RelWithDebInfo" preProject_cmake "${preProject_cmake}")
-string(REPLACE "MINSIZEREL \"\${SOFA_BIN_DIR}" "MINSIZEREL \"\${SOFA_BIN_DIR}/MinSizeRel" preProject_cmake "${preProject_cmake}")
-string(REPLACE "DEBUG \"\${SOFA_LIB_DIR}" "DEBUG \"\${SOFA_LIB_DIR}/Debug" preProject_cmake "${preProject_cmake}")
-string(REPLACE "RELEASE \"\${SOFA_LIB_DIR}" "RELEASE \"\${SOFA_LIB_DIR}/Release" preProject_cmake "${preProject_cmake}")
-string(REPLACE "RELWITHDEBINFO \"\${SOFA_LIB_DIR}" "RELWITHDEBINFO \"\${SOFA_LIB_DIR}/RelWithDebInfo" preProject_cmake "${preProject_cmake}")
-string(REPLACE "MINSIZEREL \"\${SOFA_LIB_DIR}" "MINSIZEREL \"\${SOFA_LIB_DIR}/MinSizeRel" preProject_cmake "${preProject_cmake}")
-file(WRITE "cmake/preProject.cmake" "${preProject_cmake}")
+# Enhance GLUT and GLEW finding routine to regard externally injected GLUT and
+# GLEW libraries
+
+string(REPLACE "set(GLUT_LIBRARIES \"freeglut\")" "find_package(GLUT REQUIRED)" CONTENTS ${CONTENTS})
+string(REPLACE "set(GLEW_LIBRARIES \"glew32\")" "find_package(GLEW REQUIRED)" CONTENTS ${CONTENTS})
+string(REPLACE "else()\n    set(O" "    list(APPEND GLOBAL_INCLUDE_DIRECTORIES \"\${GLUT_INCLUDE_DIRS}\" \"\${GLEW_INCLUDE_DIRS}\")\nelse()\n    set(O" CONTENTS ${CONTENTS})
+string(REPLACE "GLUT REQUIRED" "GLUT REQUIRED CONFIG" CONTENTS ${CONTENTS})
+string(REPLACE "GLEW REQUIRED" "GLEW REQUIRED CONFIG" CONTENTS ${CONTENTS})
+
+# Remove Boost binary graph dependency because it is not straight forward to
+# compile on all plattforms and its header-only part is enough
+
+string(REPLACE "graph " "" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+# Place binaries and libraries in different subfolders according to the build
+# configuration
+
+set(path "cmake/preProject.cmake")
+file(STRINGS ${path} CONTENTS NEWLINE_CONSUME)
+string(REPLACE "DEBUG \"\${SOFA_BIN_DIR}" "DEBUG \"\${SOFA_BIN_DIR}/Debug" CONTENTS ${CONTENTS})
+string(REPLACE "RELEASE \"\${SOFA_BIN_DIR}" "RELEASE \"\${SOFA_BIN_DIR}/Release" CONTENTS ${CONTENTS})
+string(REPLACE "RELWITHDEBINFO \"\${SOFA_BIN_DIR}" "RELWITHDEBINFO \"\${SOFA_BIN_DIR}/RelWithDebInfo" CONTENTS ${CONTENTS})
+string(REPLACE "MINSIZEREL \"\${SOFA_BIN_DIR}" "MINSIZEREL \"\${SOFA_BIN_DIR}/MinSizeRel" CONTENTS ${CONTENTS})
+string(REPLACE "DEBUG \"\${SOFA_LIB_DIR}" "DEBUG \"\${SOFA_LIB_DIR}/Debug" CONTENTS ${CONTENTS})
+string(REPLACE "RELEASE \"\${SOFA_LIB_DIR}" "RELEASE \"\${SOFA_LIB_DIR}/Release" CONTENTS ${CONTENTS})
+string(REPLACE "RELWITHDEBINFO \"\${SOFA_LIB_DIR}" "RELWITHDEBINFO \"\${SOFA_LIB_DIR}/RelWithDebInfo" CONTENTS ${CONTENTS})
+string(REPLACE "MINSIZEREL \"\${SOFA_LIB_DIR}" "MINSIZEREL \"\${SOFA_LIB_DIR}/MinSizeRel" CONTENTS ${CONTENTS})
+configure_file(${TEMPLATE_FILE} ${path} @ONLY)
+
+# Create SOFAConfig.cmake.in file to make SOFA findable through the config mode
+# of find_package()

 file(APPEND "CMakeLists.txt" "\nconfigure_file(SOFAConfig.cmake.in SOFAConfig.cmake @ONLY)\n")


remove deprecated NVIDIA architectures

remove deprecated NVIDIA architectures

With CUDA 10.2+, SM 3.5-5.0 are marked as deprecated. SM 3.0 will be dropped in the next release (10.3 or 11.0).

--- alpakaConfig.cmake
+++ alpakaConfig.cmake
@@ -431,8 +431,10 @@
             SET(ALPAKA_CUDA_VERSION "${CUDA_VERSION}")
             IF(CUDA_VERSION VERSION_LESS 9.0)
                 SET(ALPAKA_CUDA_ARCH "20" CACHE STRING "GPU architecture")
+            ELSEIF(CUDA_VERSION VERSION_LESS 10.3)
+                SET(ALPAKA_CUDA_ARCH "30" CACHE STRING "GPU architecture")
             ELSE()
-                SET(ALPAKA_CUDA_ARCH "30" CACHE STRING "GPU architecture")
+                SET(ALPAKA_CUDA_ARCH "35" CACHE STRING "GPU architecture")
             ENDIF()
             SET(ALPAKA_CUDA_COMPILER "nvcc" CACHE STRING "CUDA compiler")
             SET_PROPERTY(CACHE ALPAKA_CUDA_COMPILER PROPERTY STRINGS "nvcc;clang")


#6 append -fimplicit-templates because we want them

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -91,6 +91,12 @@
   -fno-exceptions
   )
 ## set_cflags_if_supported_named("-Weffc++" -Weffcpp)
+
+# must append this because mysql sets -fno-implicit-templates and we need to override it
+check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_-fimplicit-templates)
+if (HAVE_CXX_-fimplicit-templates)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fimplicit-templates")
+endif ()

 ## Clang has stricter POD checks.  So, only enable this warning on our other builds (Linux + GCC)
 if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)


Fix for user-config.jam

Fix for user-config.jam

--- cmake/BjamScheme.cmake
+++ cmake/BjamScheme.cmake
@@ -36,8 +36,11 @@
     unset(_user_config)
     if(PYTHON27_PREFIX)
         set(ADDRESS_MODEL ${_address_model_value})
-        message("Configuring file: ${SOURCE_DIR}/user-config.jam")
-        configure_file(${CMAKE_SOURCE_DIR}/cmake/user-config.jam.in ${SOURCE_DIR}/user-config.jam @ONLY)
+        set(_user_config_file ${CMAKE_CURRENT_BINARY_DIR}/user-config.jam)
+        message(STATUS "Configuring file: ${_user_config_file}")
+        configure_file(${CMAKE_SOURCE_DIR}/cmake/user-config.jam.in ${_user_config_file} @ONLY)
+        file(TO_NATIVE_PATH ${_user_config_file} _user_config_file_native)
+        set(_user_config --user-config=${_user_config_file_native})
     endif()

     if(BUILD_SHARED_LIBS)
@@ -67,7 +70,7 @@
         file(TO_NATIVE_PATH ${_build_dir} _build_dir)
         set(_stagedir ${CMAKE_INSTALL_PREFIX}/boost)
         file(TO_NATIVE_PATH ${_stagedir} _stagedir)
-        set(_build_command b2 -j${_n_cpus} runtime-link=shared threading=multi ${_address_model} ${_link} ${_toolset} ${_variant} ${_components} --build-dir=${_build_dir} --stagedir=${_stagedir} stage)
+        set(_build_command b2 -j${_n_cpus} runtime-link=shared threading=multi ${_address_model} ${_link} ${_toolset} ${_variant} ${_components} ${_user_config} --build-dir=${_build_dir} --stagedir=${_stagedir} stage)
         # set(_build_command b2 runtime-link=shared threading=multi ${_address_model} ${_link} ${_toolset} ${_variant} --build-dir=${_build_dir} --prefix=${_stagedir} install)

         ExternalProject_Add(${_target_name}


cmake/BuildPCRE2.cmake: INSTALL_DIR ${PROJECT_SOURCE_DIR} instead of INSTALL_DIR "."

--- cmake/BuildPCRE2.cmake
+++ cmake/BuildPCRE2.cmake
@@ -40,7 +40,7 @@
   URL "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23-patched.tar.gz"
   UPDATE_COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/3rdparty/tar/pcre2-10.23/CMakeLists_fixed.txt" "${CMAKE_CURRENT_BINARY_DIR}/pcre2/src/pcre2/CMakeLists.txt"
   PREFIX "${CMAKE_CURRENT_BINARY_DIR}/pcre2"
-  INSTALL_DIR "."
+  INSTALL_DIR ${PROJECT_SOURCE_DIR}
   CMAKE_ARGS ${_PCRE2_CMAKE_ARGS}
   CMAKE_CACHE_ARGS ${_CMAKE_CACHE_ARGS}
   )