Added optional EBLIF/.net/.place patching script for the common P&R per device flow

Signed-off-by: Maciej Kurc <572803cc6e8d7bb35033942e4b03254951a2e0d6@antmicro.com>

--- common/cmake/devices.cmake
+++ common/cmake/devices.cmake
@@ -1659,7 +1659,10 @@
     VPR_CMD
     ${QUIET_CMD} ${VPR}
     ${DEVICE_MERGED_FILE_LOCATION}
-    ${OUT_EBLIF}
+  )
+
+  set(
+    VPR_ARGS
     --device ${DEVICE_FULL}
     --read_rr_graph ${OUT_RRBIN_REAL_LOCATION}
     ${VPR_BASE_ARGS_LIST}
@@ -1678,7 +1681,7 @@
       )
     append_file_dependency(VPR_DEPS ${LOOKAHEAD_FILE})
     get_file_location(LOOKAHEAD_LOCATION ${LOOKAHEAD_FILE})
-    list(APPEND VPR_CMD --read_router_lookahead ${LOOKAHEAD_LOCATION})
+    list(APPEND VPR_ARGS --read_router_lookahead ${LOOKAHEAD_LOCATION})
   endif()

   get_target_property_required(
@@ -1690,7 +1693,7 @@
       )
     append_file_dependency(VPR_DEPS ${PLACE_DELAY_FILE})
     get_file_location(PLACE_DELAY_LOCATION ${PLACE_DELAY_FILE})
-    list(APPEND VPR_CMD --read_placement_delay_lookup ${PLACE_DELAY_LOCATION})
+    list(APPEND VPR_ARGS --read_placement_delay_lookup ${PLACE_DELAY_LOCATION})
   endif()

   list(APPEND VPR_DEPS ${VPR} ${QUIET_CMD})
@@ -1704,7 +1707,7 @@
   add_custom_command(
     OUTPUT ${OUT_NET} ${OUT_LOCAL}/pack.log
     DEPENDS ${VPR_DEPS}
-    COMMAND ${VPR_CMD} --pack
+    COMMAND ${VPR_CMD} ${OUT_EBLIF} ${VPR_ARGS} --pack
     COMMAND
       ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/vpr_stdout.log ${OUT_LOCAL}/pack.log
     WORKING_DIRECTORY ${OUT_LOCAL}
@@ -1728,7 +1731,7 @@
     OUTPUT ${ECHO_OUT_NET}
     DEPENDS ${VPR_DEPS}
     COMMAND ${CMAKE_COMMAND} -E make_directory ${OUT_LOCAL}/echo
-    COMMAND cd ${OUT_LOCAL}/echo && ${VPR_CMD} --pack_verbosity 3 --echo_file on --pack
+    COMMAND cd ${OUT_LOCAL}/echo && ${VPR_CMD} ${OUT_EBLIF} ${VPR_ARGS} --pack_verbosity 3 --echo_file on --pack
     COMMAND
       ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/echo/vpr_stdout.log ${OUT_LOCAL}/echo/pack.log
     )
@@ -1884,7 +1887,7 @@
   add_custom_command(
     OUTPUT ${OUT_PLACE}
     DEPENDS ${OUT_NET} ${VPR_DEPS}
-    COMMAND ${VPR_CMD} ${FIX_CLUSTERS_ARG} --place
+    COMMAND ${VPR_CMD} ${OUT_EBLIF} ${VPR_ARGS} ${FIX_CLUSTERS_ARG} --place
     COMMAND
       ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/vpr_stdout.log
       ${OUT_LOCAL}/place.log
@@ -1895,7 +1898,7 @@
   add_custom_command(
     OUTPUT ${ECHO_OUT_PLACE}
     DEPENDS ${ECHO_OUT_NET} ${VPR_DEPS}
-    COMMAND ${VPR_CMD} ${FIX_CLUSTERS_ARG} --echo_file on --place
+    COMMAND ${VPR_CMD} ${OUT_EBLIF} ${VPR_ARGS} ${FIX_CLUSTERS_ARG} --echo_file on --place
     COMMAND
       ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/echo/vpr_stdout.log
         ${OUT_LOCAL}/echo/place.log
@@ -1905,13 +1908,75 @@
   add_custom_target(${NAME}_place DEPENDS ${OUT_PLACE})
   add_dependencies(all_${BOARD}_place ${NAME}_place)

+  # Process packed netlist and circuit netlist
+  # -------------------------------------------------------------------------
+  get_target_property(NET_PATCH_TOOL     ${ARCH} NET_PATCH_TOOL)
+  get_target_property(NET_PATCH_TOOL_CMD ${ARCH} NET_PATCH_TOOL_CMD)
+
+  if (NOT "${NET_PATCH_TOOL}" MATCHES ".*NOTFOUND")
+
+    # Set variables for the configure statement below
+    set(VPR_ARCH ${DEVICE_MERGED_FILE_LOCATION})
+
+    set(IN_NET ${OUT_NET})
+    set(IN_EBLIF ${OUT_EBLIF})
+    set(IN_PLACE ${OUT_PLACE})
+
+    set(OUT_NET ${OUT_LOCAL}/${TOP}.patched.net)
+    set(OUT_NET_REL ${OUT_LOCAL_REL}/${TOP}.patched.net)
+
+    set(OUT_EBLIF ${OUT_LOCAL}/${TOP}.patched.eblif)
+    set(OUT_EBLIF_REL ${OUT_LOCAL_REL}/${TOP}.patched.eblif)
+
+    set(OUT_PLACE ${OUT_LOCAL}/${TOP}.patched.place)
+    set(OUT_PLACE_REL ${OUT_LOCAL_REL}/${TOP}.patched.place)
+
+    # Configure the base command
+    string(CONFIGURE ${NET_PATCH_TOOL_CMD} NET_PATCH_TOOL_CMD_FOR_TARGET)
+    separate_arguments(
+      NET_PATCH_TOOL_CMD_FOR_TARGET_LIST UNIX_COMMAND ${NET_PATCH_TOOL_CMD_FOR_TARGET}
+    )
+
+    # Configure and append extra args
+    get_target_property(NET_PATCH_EXTRA_ARGS ${DEVICE} NET_PATCH_EXTRA_ARGS)
+    if (NOT "${NET_PATCH_EXTRA_ARGS}" MATCHES ".*NOTFOUND")
+      string(CONFIGURE ${NET_PATCH_EXTRA_ARGS} NET_PATCH_EXTRA_ARGS_FOR_TARGET)
+      separate_arguments(
+        NET_PATCH_EXTRA_ARGS_FOR_TARGET_LIST UNIX_COMMAND ${NET_PATCH_EXTRA_ARGS_FOR_TARGET}
+      )
+    else()
+      set(NET_PATCH_EXTRA_ARGS_FOR_TARGET_LIST)
+    endif()
+
+    # Extra dependencies
+    get_target_property(NET_PATCH_DEPS ${DEVICE} NET_PATCH_DEPS)
+    if ("${NET_PATCH_DEPS}" MATCHES ".*NOTFOUND")
+      set(NET_PATCH_DEPS)
+    endif ()
+
+    # Add targets for patched EBLIF and .net
+    add_custom_command(
+      OUTPUT ${OUT_NET} ${OUT_EBLIF} ${OUT_PLACE}
+      DEPENDS ${IN_NET} ${IN_EBLIF} ${IN_PLACE} ${NET_PATCH_TOOL} ${NET_PATCH_DEPS}
+      COMMAND ${NET_PATCH_TOOL_CMD_FOR_TARGET_LIST} ${NET_PATCH_EXTRA_ARGS_FOR_TARGET_LIST}
+      WORKING_DIRECTORY ${OUT_LOCAL}
+    )
+
+    add_output_to_fpga_target(${NAME} PATCHED_NET ${OUT_NET_REL})
+    add_output_to_fpga_target(${NAME} PATCHED_EBLIF ${OUT_EBLIF_REL})
+    add_output_to_fpga_target(${NAME} PATCHED_PLACE ${OUT_PLACE_REL})
+
+    add_custom_target(${NAME}_patch_net DEPENDS ${OUT_NET} ${OUT_EBLIF} ${OUT_PLACE})
+
+  endif ()
+

   # Generate routing.
   # -------------------------------------------------------------------------
   add_custom_command(
     OUTPUT ${OUT_ROUTE}
-    DEPENDS ${OUT_PLACE} ${VPR_DEPS}
-    COMMAND ${VPR_CMD} --route
+    DEPENDS ${OUT_NET} ${OUT_PLACE} ${VPR_DEPS}
+    COMMAND ${VPR_CMD} ${OUT_EBLIF} ${VPR_ARGS} --route
     COMMAND
       ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/vpr_stdout.log
         ${OUT_LOCAL}/route.log
@@ -1925,7 +1990,7 @@
   add_custom_command(
     OUTPUT ${ECHO_ATOM_NETLIST_ORIG} ${ECHO_ATOM_NETLIST_CLEANED}
     DEPENDS ${ECHO_OUT_PLACE} ${VPR_DEPS} ${ECHO_DIRECTORY_TARGET}
-    COMMAND ${VPR_CMD} --echo_file on --route
+    COMMAND ${VPR_CMD} ${OUT_EBLIF} ${VPR_ARGS} --echo_file on --route
     COMMAND
       ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/echo/vpr_stdout.log
         ${OUT_LOCAL}/echo/route.log
@@ -2015,7 +2080,7 @@
   add_custom_command(
     OUTPUT ${OUT_ANALYSIS} ${OUT_POST_SYNTHESIS_V} ${OUT_POST_SYNTHESIS_BLIF}
     DEPENDS ${OUT_ROUTE} ${VPR_DEPS}
-    COMMAND ${VPR_CMD} --analysis --gen_post_synthesis_netlist on
+    COMMAND ${VPR_CMD} ${OUT_EBLIF} ${VPR_ARGS} --analysis --gen_post_synthesis_netlist on
     COMMAND ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/vpr_stdout.log
         ${OUT_LOCAL}/analysis.log
     WORKING_DIRECTORY ${OUT_LOCAL}


update for ROOT6 and rootcling, not rootcint.

--- etc/cmake/FindROOT.cmake
+++ etc/cmake/FindROOT.cmake
@@ -1,16 +1,17 @@
 # - Finds ROOT instalation
 # This module sets up ROOT information
 # It defines:
-# ROOT_FOUND          If the ROOT is found
-# ROOT_INCLUDE_DIR    PATH to the include directory
-# ROOT_INCLUDE_DIRS   PATH to the include directories (not cached)
-# ROOT_LIBRARIES      Most common libraries
-# ROOT_<name>_LIBRARY Full path to the library <name>
-# ROOT_LIBRARY_DIR    PATH to the library directory
-# ROOT_ETC_DIR        PATH to the etc directory
-# ROOT_DEFINITIONS    Compiler definitions
-# ROOT_CXX_FLAGS      Compiler flags to used by client packages
-# ROOT_C_FLAGS        Compiler flags to used by client packages
+# ROOT_FOUND             If the ROOT is found
+# ROOT_INCLUDE_DIR       PATH to the include directory
+# ROOT_INCLUDE_DIRS      PATH to the include directories (not cached)
+# ROOT_LIBRARIES         Most common libraries
+# ROOT_<name>_LIBRARY    Full path to the library <name>
+# ROOT_LIBRARY_DIR       PATH to the library directory
+# ROOT_ETC_DIR           PATH to the etc directory
+# ROOT_DEFINITIONS       Compiler definitions
+# ROOT_CXX_FLAGS         Compiler flags to used by client packages
+# ROOT_C_FLAGS           Compiler flags to used by client packages
+# ROOT_EXE_LINKER_FLAGS  Linker flags to used by client packages
 #
 # Updated by K. Smith (ksmith37@nd.edu) to properly handle
 #  dependencies in ROOT_GENERATE_DICTIONARY
@@ -46,7 +47,7 @@
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 set(ROOT_LIBRARY_DIRS ${ROOT_LIBRARY_DIR})

-set(rootlibs Core Cint RIO Net Hist Graf Graf3d Gpad Tree Rint Postscript Matrix Physics MathCore Thread)
+set(rootlibs Core RIO Net Hist Graf Graf3d Gpad Tree Rint Postscript Matrix Physics MathCore Thread MultiProc)
 set(ROOT_LIBRARIES)
 foreach(_cpt ${rootlibs} ${ROOT_FIND_COMPONENTS})
   find_library(ROOT_${_cpt}_LIBRARY ${_cpt} HINTS ${ROOT_LIBRARY_DIR})
@@ -70,6 +71,12 @@
 string(REGEX REPLACE "(^|[ ]*)-I[^ ]*" "" ROOT_CXX_FLAGS "${__cflags}")
 string(REGEX REPLACE "(^|[ ]*)-I[^ ]*" "" ROOT_C_FLAGS "${__cflags}")

+execute_process(
+    COMMAND ${ROOT_CONFIG_EXECUTABLE} --ldflags
+    OUTPUT_VARIABLE __ldflags
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(ROOT_EXE_LINKER_FLAGS "${__ldflags}")
+
 set(ROOT_USE_FILE ${CMAKE_CURRENT_LIST_DIR}/RootUseFile.cmake)

 execute_process(
@@ -88,7 +95,7 @@
 mark_as_advanced(ROOT_CONFIG_EXECUTABLE)

 include(CMakeParseArguments)
-find_program(ROOTCINT_EXECUTABLE rootcint HINTS $ENV{ROOTSYS}/bin)
+find_program(ROOTCLING_EXECUTABLE rootcling HINTS $ENV{ROOTSYS}/bin)
 find_program(GENREFLEX_EXECUTABLE genreflex HINTS $ENV{ROOTSYS}/bin)
 find_package(GCCXML)

@@ -128,9 +135,9 @@
     set(linkdefs ${linkdefs} ${linkFile})
     unset(linkFile CACHE)
   endforeach()
-  #---call rootcint------------------------------------------
+  #---call rootcling------------------------------------------
   add_custom_command(OUTPUT ${dictionary}.cxx
-                     COMMAND ${ROOTCINT_EXECUTABLE} -cint -f  ${dictionary}.cxx
+                     COMMAND ${ROOTCLING_EXECUTABLE} -f ${dictionary}.cxx
                                           -c ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs}
                      DEPENDS ${headerfiles} ${linkdefs} VERBATIM)
 endfunction()


Travis has gcc 6 headers, so using them with clang 5 is probably crashing everything...

--- CMake/clang.cmake
+++ CMake/clang.cmake
@@ -1,8 +1,8 @@

-CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
-if(COMPILER_SUPPORTS_CXX17)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
-else(COMPILER_SUPPORTS_CXX17)
+#CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
+#if(COMPILER_SUPPORTS_CXX17)
+#  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
+#else(COMPILER_SUPPORTS_CXX17)
   CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
   if(COMPILER_SUPPORTS_CXX14)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
@@ -15,7 +15,7 @@
       message(STATUS "The compiler ${CMAKE_CXX_COMPILER} doesn't support C++11.")
     endif(COMPILER_SUPPORTS_CXX11)
   endif(COMPILER_SUPPORTS_CXX14)
-endif(COMPILER_SUPPORTS_CXX17)
+#endif(COMPILER_SUPPORTS_CXX17)

 CHECK_CXX_COMPILER_FLAG("-pthread" COMPILER_SUPPORTS_PTHREAD)
 if(COMPILER_SUPPORTS_PTHREAD)


fix: Set common unset <Pkg>_<VAR> to <PKG>_<VAR> if the latter is defined [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -54,7 +54,7 @@
   list (APPEND _BASIS_FIND_LIBRARY_SUFFIXES "{${CMAKE_FIND_LIBRARY_SUFFIXES}}")
   list (APPEND _BASIS_FIND_EXECUTABLE_SUFFIX "${CMAKE_FIND_EXECUTABLE_SUFFIX}")
   _find_package(${ARGV})
-  # map obsolete <PKG>_* variables to case-sensitive <Pkg>_*
+  # map common uppercase <PKG>_* variables to case-preserving <Pkg>_*
   string (TOUPPER "${ARGV0}" _FP_ARGV0_U)
   foreach (_FP_VAR IN ITEMS FOUND DIR USE_FILE
                             VERSION VERSION_STRING
@@ -63,7 +63,7 @@
                             INCLUDE_DIR INCLUDE_DIRS INCLUDE_PATH
                             LIBRARY_DIR LIBRARY_DIRS LIBRARY_PATH
                             EXECUTABLE COMPILER CONVERTER)
-    if (NOT DEFINED ${ARGV0}_${_FP_VAR} AND DEFINED ${_FP_ARGV0_U}_${_FP_VAR})
+    if (NOT ${ARGV0}_${_FP_VAR} AND DEFINED ${_FP_ARGV0_U}_${_FP_VAR})
       set (${ARGV0}_${_FP_VAR} "${${_FP_ARGV0_U}_${_FP_VAR}}")
     endif ()
   endforeach ()


cpack: Don't package the obj directory.

cpack: Don't package the obj directory.

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -19,7 +19,7 @@

 ### source generator
 set(CPACK_SOURCE_GENERATOR "TGZ")
-set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;tags;cscope.*")
+set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;/obj/;tags;cscope.*")
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")

 if (WIN32)


add missing libraries for OpenGL on windows build

--- CMake/Packages/FindSDL2.cmake
+++ CMake/Packages/FindSDL2.cmake
@@ -62,9 +62,9 @@
         ${PC_SDL2_LIBRARY_DIRS}
       PATH_SUFFIXES x64 x86
     )
-
+
     set(SDL2_BUILDING_LIBRARY TRUE)
-
+
     if(NOT SDL2_BUILDING_LIBRARY)
       find_library(SDL2MAIN_LIBRARY
         NAMES SDL2main
@@ -93,7 +93,9 @@

     set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
     set(SDL2_LIBRARIES ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY})
-
+    if (WIN32)
+        set(SDL2_LIBRARIES ${SDL2_LIBRARIES} winmm imm32 version)
+    endif()
     include(FindPackageHandleStandardArgs)

     find_package_handle_standard_args(SDL2


COMP: Only use visibility flags with shared libs.

Restoring the original behavior for now. This should be revisited, with
improved logic to handle the case of using visibility with static
libraries on Linux. This likely requires the import/export logic to be
modified in vtkABI.h.

--- CMake/vtkCompilerExtras.cmake
+++ CMake/vtkCompilerExtras.cmake
@@ -38,7 +38,7 @@
   mark_as_advanced(VTK_USE_GCC_VISIBILITY)

   if(${_gcc_version} VERSION_GREATER 4.2.0 AND HAVE_GCC_VISIBILITY
-    AND VTK_USE_GCC_VISIBILITY)
+    AND VTK_USE_GCC_VISIBILITY AND BUILD_SHARED_LIBS)
     # Should only be set if GCC is newer than 4.2.0
     set(VTK_ABI_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden")
   else()


Updated qRestAPI revision

Updated qRestAPI revision

--- CMakeExternals/qRestAPI.cmake
+++ CMakeExternals/qRestAPI.cmake
@@ -24,7 +24,7 @@

 if(NOT DEFINED ${proj}_DIR)

-  set(revision_tag "4293694a89")
+  set(revision_tag "c5e4c2a7d5")
   if(${proj}_REVISION_TAG)
     set(revision_tag ${${proj}_REVISION_TAG})
   endif()


enable our own ctest dashboard

enable our own ctest dashboard

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -5,9 +5,9 @@
 ##   ENABLE_TESTING()
 ##   INCLUDE(CTest)
 set(CTEST_PROJECT_NAME "Eigen")
-set(CTEST_NIGHTLY_START_TIME "05:00:00 UTC")
+set(CTEST_NIGHTLY_START_TIME "06:00:00 UTC")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=Eigen")
+set(CTEST_DROP_SITE "eigen.tuxfamily.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen")
 set(CTEST_DROP_SITE_CDASH TRUE)


[t:4871] don't run drd_test_4015 under memcheck

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@43491 c7de825b-a66e-492c-adef-691d508d4ae1

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -43,6 +43,7 @@
   try-leak-lost
   try-leak-reachable
   try-leak-uninit
+  drd_test_4015.tdb
   )

 ## tests that are supposed to crash will generate memcheck failures


Don't attempt to use ccache for LLVM on Windows.

LLVM assumes that if ccache is enabled, it's on a UNIX style system
and attempts to set env variables as part of the ccache command,
which fails horribly on Windows.

--- gapii/interceptor-lib/cc/CMakeBuild.cmake
+++ gapii/interceptor-lib/cc/CMakeBuild.cmake
@@ -12,10 +12,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.

-set(LLVM_CCACHE_BUILD "OFF")
-find_program(CCACHE_FOUND ccache)
-if(CCACHE_FOUND)
-    set(LLVM_CCACHE_BUILD "ON")
+set(LLVM_CCACHE_BUILD OFF)
+if(NOT CMAKE_HOST_WIN32)
+    find_program(CCACHE_FOUND ccache)
+    if(CCACHE_FOUND)
+        set(LLVM_CCACHE_BUILD ON)
+    endif()
 endif()

 if(ANDROID_ABI)


[CMake] iOS simulator should still build 32-bit by default. (#10510)

Accidentally deleted and never noticed because all of the package
builds configure this explicitly.

--- cmake/modules/DarwinSDKs.cmake
+++ cmake/modules/DarwinSDKs.cmake
@@ -25,7 +25,7 @@
 if(swift_build_ios_simulator)
   configure_sdk_darwin(
       IOS_SIMULATOR "iOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
-      iphonesimulator ios-simulator ios "x86_64")
+      iphonesimulator ios-simulator ios "i386;x86_64")
   configure_target_variant(
       IOS_SIMULATOR-DA "iOS Debug+Asserts"   IOS_SIMULATOR DA "Debug+Asserts")
   configure_target_variant(


Refactoring for job configuration

Refactoring for job configuration

--- cmake/modules/DarwinSDKs.cmake
+++ cmake/modules/DarwinSDKs.cmake
@@ -1,3 +1,11 @@
+set(SUPPORTED_IOS_ARCHS "armv7;armv7s;arm64")
+set(SUPPORTED_IOS_SIMULATOR_ARCHS "i386;x86_64")
+set(SUPPORTED_TVOS_ARCHS "arm64")
+set(SUPPORTED_TVOS_SIMULATOR_ARCHS "x86_64")
+set(SUPPORTED_WATCHOS_ARCHS "armv7k")
+set(SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386")
+set(SUPPORTED_OSX_ARCHS "x86_64")
+
 is_sdk_requested(OSX swift_build_osx)
 if(swift_build_osx)
   configure_sdk_darwin(
@@ -15,7 +23,7 @@
 if(swift_build_ios)
   configure_sdk_darwin(
       IOS "iOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
-      iphoneos ios ios "armv7;armv7s;arm64")
+      iphoneos ios ios "${SUPPORTED_IOS_ARCHS}")
   configure_target_variant(IOS-DA "iOS Debug+Asserts"   IOS DA "Debug+Asserts")
   configure_target_variant(IOS-RA "iOS Release+Asserts" IOS RA "Release+Asserts")
   configure_target_variant(IOS-R  "iOS Release"         IOS R "Release")
@@ -25,7 +33,7 @@
 if(swift_build_ios_simulator)
   configure_sdk_darwin(
       IOS_SIMULATOR "iOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
-      iphonesimulator ios-simulator ios "i386;x86_64")
+      iphonesimulator ios-simulator ios "${SUPPORTED_IOS_SIMULATOR_ARCHS}")
   configure_target_variant(
       IOS_SIMULATOR-DA "iOS Debug+Asserts"   IOS_SIMULATOR DA "Debug+Asserts")
   configure_target_variant(
@@ -38,7 +46,7 @@
 if(swift_build_tvos)
   configure_sdk_darwin(
       TVOS "tvOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}"
-      appletvos tvos tvos "arm64")
+      appletvos tvos tvos "${SUPPORTED_TVOS_ARCHS}")
   configure_target_variant(TVOS-DA "tvOS Debug+Asserts"   TVOS DA "Debug+Asserts")
   configure_target_variant(TVOS-RA "tvOS Release+Asserts" TVOS RA "Release+Asserts")
   configure_target_variant(TVOS-R  "tvOS Release"         TVOS R "Release")
@@ -48,7 +56,7 @@
 if(swift_build_tvos_simulator)
   configure_sdk_darwin(
       TVOS_SIMULATOR "tvOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}"
-      appletvsimulator tvos-simulator tvos "x86_64")
+      appletvsimulator tvos-simulator tvos "${SUPPORTED_TVOS_SIMULATOR_ARCHS}")
   configure_target_variant(
     TVOS_SIMULATOR-DA "tvOS Debug+Asserts"   TVOS_SIMULATOR DA "Debug+Asserts")
   configure_target_variant(
@@ -61,7 +69,7 @@
 if(swift_build_watchos)
   configure_sdk_darwin(
       WATCHOS "watchOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}"
-      watchos watchos watchos "armv7k")
+      watchos watchos watchos "${SUPPORTED_WATCHOS_ARCHS}")
   configure_target_variant(WATCHOS-DA "watchOS Debug+Asserts"   WATCHOS DA "Debug+Asserts")
   configure_target_variant(WATCHOS-RA "watchOS Release+Asserts" WATCHOS RA "Release+Asserts")
   configure_target_variant(WATCHOS-R  "watchOS Release"         WATCHOS R "Release")
@@ -71,7 +79,7 @@
 if(swift_build_watchos_simulator)
   configure_sdk_darwin(
       WATCHOS_SIMULATOR "watchOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}"
-      watchsimulator watchos-simulator watchos "i386")
+      watchsimulator watchos-simulator watchos "${SUPPORTED_WATCHOS_SIMULATOR_ARCHS}")
   configure_target_variant(WATCHOS_SIMULATOR-DA "watchOS Debug+Asserts"   WATCHOS_SIMULATOR DA "Debug+Asserts")
   configure_target_variant(WATCHOS_SIMULATOR-RA "watchOS Release+Asserts" WATCHOS_SIMULATOR RA "Release+Asserts")
   configure_target_variant(WATCHOS_SIMULATOR-R  "watchOS Release"         WATCHOS_SIMULATOR R "Release")


[CMake] Turn LLDB_FRAMEWORK_TOOLS into STRING to allow overrides from cache files

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@351830 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -62,7 +62,7 @@
   set(LLDB_FRAMEWORK_VERSION A CACHE STRING "LLDB.framework version (default is A)")
   set(LLDB_FRAMEWORK_BUILD_DIR bin CACHE STRING "Output directory for LLDB.framework")
   set(LLDB_FRAMEWORK_INSTALL_DIR Library/Frameworks CACHE STRING "Install directory for LLDB.framework")
-  set(LLDB_FRAMEWORK_TOOLS darwin-debug;debugserver;lldb-argdumper;lldb-server CACHE INTERNAL
+  set(LLDB_FRAMEWORK_TOOLS darwin-debug;debugserver;lldb-argdumper;lldb-server CACHE STRING
       "List of tools to include in LLDB.framework/Resources")

   # Set designated directory for all dSYMs. Essentially, this emits the


[CMake][Exp PyROOT] Fix PYTHON_EXECUTABLE for pyunittests

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -917,8 +917,8 @@
        target_include_directories(${library} PRIVATE ${incl})
     endforeach()
   endif()
-
-
+
+

   if(TARGET G__${library})
     add_dependencies(${library} G__${library})
@@ -1520,7 +1520,7 @@
   if(ARG_DIFFCMD)
     string(REPLACE ";" "^" _diff_cmd "${ARG_DIFFCMD}")
     set(_command ${_command} -DDIFFCMD=${_diff_cmd})
-
+
     if(TARGET ROOT::ROOTStaticSanitizerConfig)
       # We have to set up leak sanitizer such that it doesn't report on suppressed
       # leaks. Otherwise, all diffs will fail.
@@ -1735,7 +1735,7 @@
   endif()
   string(REGEX REPLACE "[_]" "-" good_name "${name}")
   ROOT_ADD_TEST(pyunittests-${good_name}
-                COMMAND ${PYTHON_EXECUTABLE} -B -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR} -p "*.py" -v
+                COMMAND ${PYTHON_EXECUTABLE_Development_Main} -B -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR} -p "*.py" -v
                 ENVIRONMENT ${ROOT_ENV})
 endfunction()

@@ -1779,7 +1779,7 @@

   if(dependencies)
     ROOT_ADD_TEST(pyunittests-${good_name}
-                COMMAND ${PYTHON_EXECUTABLE} -B -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR}/${file_dir} -p ${file_name} -v
+                COMMAND ${PYTHON_EXECUTABLE_Development_Main} -B -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR}/${file_dir} -p ${file_name} -v
                 ENVIRONMENT ${ROOT_ENV} ${ARG_ENVIRONMENT}
                 ${copy_to_builddir}
                 ${will_fail})
@@ -1836,7 +1836,7 @@
       endif()
       # A module's location is usually a directory, but for binary modules
       # it's a .so file.
-      execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
+      execute_process(COMMAND "${PYTHON_EXECUTABLE_Development_Main}" "-c"
          "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))"
          RESULT_VARIABLE _${module}_status
          OUTPUT_VARIABLE _${module}_location


[cmake] Simplify and move the var init outside of ARG_MODULE.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -412,20 +412,19 @@

   #---Set the library output directory-----------------------
   ROOT_GET_LIBRARY_OUTPUT_DIR(library_output_dir)
-  set (runtime_cxxmodule_dependencies )
+  set(runtime_cxxmodule_dependencies )
+  set(cpp_module)
   set(library_name ${libprefix}${library_target_name}${libsuffix})
   set(newargs -s ${library_output_dir}/${library_name})
   set(rootmap_name ${library_output_dir}/${libprefix}${library_target_name}.rootmap)
+  set(pcm_name ${library_output_dir}/${libprefix}${library_target_name}_rdict.pcm)
   if(ARG_MODULE)
-    set(cpp_module)
-    set(master_pcm_name ${library_output_dir}/${libprefix}${library_target_name}_rdict.pcm)
     if(ARG_MULTIDICT)
       set(newargs ${newargs} -multiDict)
       set(pcm_name ${library_output_dir}/${libprefix}${library_target_name}_${dictionary}_rdict.pcm)
       set(rootmap_name ${library_output_dir}/${libprefix}${library_target_name}32.rootmap)
     else()
       set(cpp_module ${library_target_name})
-      set(pcm_name ${master_pcm_name})
     endif(ARG_MULTIDICT)

     if(runtime_cxxmodules)
@@ -443,8 +442,6 @@
         endif()
       endif(cpp_module)
     endif()
-  else()
-    set(pcm_name ${library_output_dir}/${libprefix}${library_target_name}_rdict.pcm)
   endif()

   if(CMAKE_ROOTTEST_NOROOTMAP OR cpp_module_file)


fix the mkl dependency for eager mode (#9702)

* explicit link with libtorch instead of use cmake var to avoid introduce mkl dependency

* use find_lib to get libtorch lib name

* temp fix

* add missing libraries

Co-authored-by: Cheng Tang <90ac141276e2238dd87cd4a4a74063853530628a@microsoft.com>

--- cmake/onnxruntime_python.cmake
+++ cmake/onnxruntime_python.cmake
@@ -108,7 +108,11 @@
   # todo: this is because the prebuild pytorch may use a different version of protobuf headers.
   # force the build to find the protobuf headers ort using.
   target_include_directories(onnxruntime_pybind11_state PRIVATE "${REPO_ROOT}/cmake/external/protobuf/src")
-  target_link_libraries(onnxruntime_pybind11_state PRIVATE onnxruntime_eager ${TORCH_LIBRARIES} ${TORCH_PYTHON_LIBRARY})
+  target_include_directories(onnxruntime_pybind11_state PRIVATE "${TORCH_INSTALL_PREFIX}/include" "${TORCH_INSTALL_PREFIX}/include/torch/csrc/api/include")
+  find_library(LIBTORCH_LIBRARY torch PATHS "${TORCH_INSTALL_PREFIX}/lib")
+  find_library(LIBTORCH_CPU_LIBRARY torch_cpu PATHS "${TORCH_INSTALL_PREFIX}/lib")
+  find_library(LIBC10_LIBRARY c10 PATHS "${TORCH_INSTALL_PREFIX}/lib")
+  target_link_libraries(onnxruntime_pybind11_state PRIVATE onnxruntime_eager ${LIBTORCH_LIBRARY} ${LIBTORCH_CPU_LIBRARY} ${LIBC10_LIBRARY} ${TORCH_PYTHON_LIBRARY})
   # the ort_aten.g.cpp is generated from tools. currently it has some limitations.
   # todo: fix this
   if (NOT MSVC)
@@ -116,9 +120,16 @@
     set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_aten.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
     set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_guard.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
     set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_tensor.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
+    set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_backends.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
+    set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_customops.g.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
+    set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_eager.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
+    set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_hooks.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
+    set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_ops.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
+    set_source_files_properties("${ORTTRAINING_ROOT}/orttraining/eager/ort_util.cpp" PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
   endif()
-  if (MSVC)
-    target_compile_options(onnxruntime_pybind11_state PUBLIC "/wd4100" "/wd4324" "/wd4458" "/wd4127" "/wd4193" "/wd4624" "/wd4702")
+  if (MSVC)
+    target_compile_options(onnxruntime_pybind11_state PRIVATE "/wd4100" "/wd4324" "/wd4458" "/wd4127" "/wd4193" "/wd4624" "/wd4702")
+    target_compile_options(onnxruntime_pybind11_state PRIVATE "/bigobj" "/wd4275" "/wd4244" "/wd4267")
   endif()
 endif()


Small fix for OpenEXR.

Small fix for OpenEXR.

--- FindOpenEXR.cmake
+++ FindOpenEXR.cmake
@@ -23,7 +23,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-FIND_PATH(OpenEXR_INCLUDE_DIR ImfRgbaFile.h PATH_SUFFIXES OpenEXR)
+FIND_PATH(OpenEXR_INCLUDE_DIR OpenEXR/ImfRgbaFile.h)

 FIND_LIBRARY(OpenEXR_IlmImf_LIBRARY NAMES IlmImf)
 FIND_LIBRARY(OpenEXR_Imath_LIBRARY NAMES Imath)


Remove commented code

Remove commented code

--- CMake/OTBModuleTest.cmake
+++ CMake/OTBModuleTest.cmake
@@ -142,32 +142,6 @@
 # OTB wrapper for add_test that automatically sets the test's LABELS property
 # to the value of its containing module.
 #
-# function(otb_add_test)
-#   # Add tests with data in the OTBData group.
-#   ExternalData_add_test(OTBData ${ARGN})
-
-#   if("NAME" STREQUAL "${ARGV0}")
-#     set(_iat_testname ${ARGV1})
-#   else()
-#     set(_iat_testname ${ARGV0})
-#   endif()
-
-#   if(otb-module)
-#     set(_label ${otb-module})
-#     if(TARGET ${otb-module}-all AND "${ARGN}" MATCHES "DATA{")
-#       add_dependencies(${otb-module}-all OTBData)
-#     endif()
-#   else()
-#     set(_label ${main_project_name})
-#   endif()
-
-#   set_property(TEST ${_iat_testname} PROPERTY LABELS ${_label})
-# endfunction()
-
-#-----------------------------------------------------------------------------
-# OTB wrapper for add_test that automatically sets the test's LABELS property
-# to the value of its containing module.
-#
 function(otb_add_test)
   set(largeinput_regex "LARGEINPUT{([^;{}\r\n]*)}")


cmake

cmake

--- build/toolchains/rasperypi.cmake
+++ build/toolchains/rasperypi.cmake
@@ -10,6 +10,8 @@

 # include headers for rpi-installed libraries
 include_directories(/opt/vc/include/)
+include_directories(/opt/vc/include/interface/vcos/pthreads)
+include_directories(/opt/vc/include/interface/vmcs_host/linux)

 # load core library
 include_directories(${PROJECT_SOURCE_DIR}/core/include/)


Move directory check to bash command.

Move directory check to bash command.

--- itk/CMake/itkExternal_FFTW.cmake
+++ itk/CMake/itkExternal_FFTW.cmake
@@ -104,11 +104,9 @@
     include_directories(${FFTW_INCLUDE_PATH})
     if(UNIX AND NOT APPLE)
       if(CMAKE_SIZEOF_VOID_P MATCHES 8)
-        if(EXISTS ${ITK_BINARY_DIR}/fftw/lib64)
-          add_custom_command(TARGET fftwd
-            POST_BUILD
-            COMMAND ln -sf ${ITK_BINARY_DIR}/fftw/lib64 ${ITK_BINARY_DIR}/fftw/lib)
-        endif()
+      add_custom_command(TARGET fftwd
+        POST_BUILD
+          COMMAND [ -d ${ITK_BINARY_DIR}/fftw/lib64 ] && ln -sf ${ITK_BINARY_DIR}/fftw/lib64 ${ITK_BINARY_DIR}/fftw/lib)
       endif()
     endif()
     #


improved formatting

improved formatting

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

--- cmake/MacroFindOptionalDep.cmake
+++ cmake/MacroFindOptionalDep.cmake
@@ -1,28 +1,36 @@
-# FIND_OPTIONAL_DEP macro implements two typical optional dependency handling approaches:
+# FIND_OPTIONAL_DEP macro implements two typical optional dependency handling
+# approaches:
 #
 # Best-effort approach(FORCE_DEPS=OFF):
-#	Link to all enabled optional dependencies if found. Turn off not found ones, and keep compiling.
-# This greatly benefits hand-compiling from source if all suggested dependencies are turned on by default.
-# Newly installed software conveniently integrates with whatever environment it's compiled in.
+#	Link to all enabled optional dependencies if found. Turn off not found
+# ones, and keep compiling. This greatly benefits hand-compiling from source
+# if all suggested dependencies are turned on by default. Newly installed
+# software conveniently integrates with whatever environment it's compiled in.
 #
 # Strict dependencies approach(FORCE_DEPS=ON):
 #	All enabled optional dependencies must be found, or compilation aborts.
-# This approach lets request and ensure specific functionality. The compilation is deterministic
-# in the sense that everything that's requested is provided or the process fails.
-# This is the preferred behaviour for automated building by package managers/distro maintainers.
+# This approach lets request and ensure specific functionality. The compilation
+# is deterministic in the sense that everything that's requested is provided
+# or the process fails. This is the preferred behaviour for automated building
+# by package managers/distro maintainers.
 #
 # Parameters:
 # _package:	the package to load
-# _found:	the name of *_FOUND variable which is set by find_package() if ${_package} is found.
-# _enabled:	option/variable name which along with FORCE_DEPS options controls macro behaviour:
+# _found:	the name of *_FOUND variable which is set by find_package()
+#               if ${_package} is found.
+# _enabled:	option/variable name which along with FORCE_DEPS options
+#               controls macro behaviour:
 #	${_enabled}	FORCE_DEPS	Behaviour
 #		OFF	any		${_package} is not loaded
-#		ON	ON		Try loading ${_package}. If package is not found, abort(fatal error).
-#		ON	OFF		Try loading ${_package}. If package is not found, continue.
+#		ON	ON		Try loading ${_package}. If package is
+#                                       not found, abort(fatal error).
+#		ON	OFF		Try loading ${_package}. If package is
+#                                       not found, continue.
 # _description:	a short description of features provided by ${_package}.
 #		Used to display human-readable diagnostic messages

-# macro name changed from FIND_OPTIONAL_PACKAGE to FIND_OPTIONAL_DEP due to clash with a macro from KDE4
+# macro name changed from FIND_OPTIONAL_PACKAGE to FIND_OPTIONAL_DEP due to
+# clash with a macro from KDE4

 # if ON, requested optional deps become required
 # if OFF, requested optional deps are linked to if found
@@ -56,4 +64,4 @@
         MESSAGE("** ${_package} is disabled. No support for ${_description}")
     endif(${_enabled})

-endmacro(REPORT_OPTIONAL_PACKAGE_STATUS)+endmacro(REPORT_OPTIONAL_PACKAGE_STATUS)


gpgme: reformat FindLibGpgme.cmake

gpgme: reformat FindLibGpgme.cmake

--- cmake/Modules/FindLibGpgme.cmake
+++ cmake/Modules/FindLibGpgme.cmake
@@ -17,8 +17,7 @@
 # if gpgme-config has been found
 if (GPGME_EXECUTABLE)

-	# workaround for MinGW/MSYS
-	# CMake can't starts shell scripts on windows so it need to use sh.exe
+	# workaround for MinGW/MSYS CMake can't starts shell scripts on windows so it needs to use sh.exe
 	execute_process (COMMAND sh ${GPGME_EXECUTABLE} --libs
 			 RESULT_VARIABLE _return_VALUE
 			 OUTPUT_VARIABLE LIBGPGME_LIBRARIES
@@ -45,9 +44,13 @@
 	endif (NOT LibGpgme_FIND_QUIETLY)

 	# parse include directory from C-Flags
-	string (LENGTH "${LIBGPGME_CFLAGS}" LIBGPGME_CFLAGS_LEN)
+	string (LENGTH "${LIBGPGME_CFLAGS}"
+		       LIBGPGME_CFLAGS_LEN)
 	if (${LIBGPGME_CFLAGS_LEN} GREATER 1)
-		string (REPLACE "-I" "" LIBGPGME_INCLUDE_DIR "${LIBGPGME_CFLAGS}")
+		string (REPLACE "-I"
+				""
+				LIBGPGME_INCLUDE_DIR
+				"${LIBGPGME_CFLAGS}")
 	endif ()
 	unset (LIBGPGME_CFLAGS_LEN)


Add /Library/Frameworks to list of rpaths for python bindings.

--- cmake/add_rpath_for_python.cmake
+++ cmake/add_rpath_for_python.cmake
@@ -3,6 +3,7 @@
 string(REPLACE "${LIST_SEPARATOR}" ";" SHARED_OBJECT_MODULES "${SHARED_OBJECT_MODULES}")
 foreach(_M ${SHARED_OBJECT_MODULES})
   execute_process(COMMAND ${INSTALL_NAME_TOOL_EXE} -change "/Library/Frameworks/Python.framework/Versions/${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/Python" @rpath/Python.framework/Versions/${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/Python ${_M})
+  execute_process(COMMAND ${INSTALL_NAME_TOOL_EXE} -add_rpath /Library/Frameworks ${_M})
   execute_process(COMMAND ${INSTALL_NAME_TOOL_EXE} -add_rpath /opt/homebrew/Frameworks ${_M})
 endforeach()


Bug fix for `add_svcomp_benchmark()` macro.

If invoking `svcb-emit-cmake-decls.py` fails an output file might
still be left behind which means when configuration is run again
it might succeed. Instead delete the output file.

--- cmake/add_svcomp_benchmark.cmake
+++ cmake/add_svcomp_benchmark.cmake
@@ -47,6 +47,9 @@
                     RESULT_VARIABLE RESULT_CODE
                    )
     if (NOT ${RESULT_CODE} EQUAL 0)
+      # Remove the generated output file because it is broken and if we don't
+      # the next time configure runs it will succeed.
+      file(REMOVE "${OUTPUT_FILE}")
       message(FATAL_ERROR "Failed to process benchmark ${BENCHMARK_DIR}. With error ${RESULT_CODE}")
     endif()
   endif()


WebP: Disable some components

WebP: Disable some components

--- cmake/projects/WebP/hunter.cmake
+++ cmake/projects/WebP/hunter.cmake
@@ -59,16 +59,18 @@
     hunter_cmake_args(
         WebP
         CMAKE_ARGS
-        WEBP_ENABLE_SIMD=ON
+        WEBP_BUILD_ANIM_UTILS=OFF
         WEBP_BUILD_CWEBP=OFF
         WEBP_BUILD_DWEBP=OFF
         WEBP_BUILD_GIF2WEBP=OFF
         WEBP_BUILD_IMG2WEBP=OFF
         WEBP_BUILD_WEBPINFO=OFF
+        WEBP_BUILD_WEBPMUX=OFF
         WEBP_BUILD_WEBP_JS=OFF
         WEBP_ENABLE_NEAR_LOSSLESS=ON
+        WEBP_ENABLE_SIMD=ON
+        WEBP_ENABLE_SWAP_16BIT_CSP=OFF
         WEBP_EXPERIMENTAL_FEATURES=OFF
-        WEBP_ENABLE_SWAP_16BIT_CSP=OFF
     )
 else()
     hunter_cmake_args(


added extra optimization flags

added extra optimization flags

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@12574 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -163,6 +163,7 @@
         # on 32 bit either at minimal performance impact.
         set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer")
         set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g -fno-omit-frame-pointer")
+        set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")

         # Pass CXX flags to flags.
         #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSEQAN_CXX_FLAGS_=\"${CMAKE_CXX_FLAGS}\"")
@@ -402,7 +403,7 @@
     add_definitions(-DSEQAN_HAS_ZLIB=1)
     include_directories(${ZLIB_INCLUDE_DIRS})
   endif (ZLIB_FOUND)
-
+
   find_package (BZip2 QUIET)
   if (BZIP2_FOUND)
     include_directories(${BZIP_INCLUDE_DIRS})


Fixed handling of javac return code

Fixed handling of javac return code

--- Googlify.cmake
+++ Googlify.cmake
@@ -435,7 +435,9 @@
           else\
             javac -d ${CMAKE_CURRENT_BINARY_DIR} ${ABS_SRC}$<SEMICOLON>\
           fi$<SEMICOLON>\
-          IFS=$OIFS"
+          ret_code=$?\
+          IFS=$OIFS\
+          exit $ret_code"
       MAIN_DEPENDENCY ${ABS_SRC}
       VERBATIM)
     list(APPEND CLASS_FILES ${CLASS_FILE})
@@ -503,7 +505,9 @@
         else\
           javac -d ${CMAKE_CURRENT_BINARY_DIR} ${ABS_SRC}$<SEMICOLON>\
         fi$<SEMICOLON>\
-        IFS=$OIFS"
+        ret_code=$?\
+        IFS=$OIFS\
+        exit $ret_code"
     MAIN_DEPENDENCY ${ABS_SRC}
     VERBATIM)
   add_custom_command(


adds compiler id macro to DuneUtils

adds compiler id macro to DuneUtils

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -103,4 +103,15 @@
 pkg_check_modules( CCGNU REQUIRED libccgnu2 )
 ADD_CXX_FLAGS( "${CCGNU_CFLAGS}" )
 INCLUDE_SYS_DIR(${Boost_INCLUDE_DIR})
+
+#try to enable link-time-optimisation
+if (CMAKE_COMPILER_IS_GNUCC)
+	execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+	if (GCC_VERSION VERSION_GREATER 4.5 OR GCC_VERSION VERSION_EQUAL 4.5)
+		set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
+		set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
+		set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
+	endif()
+endif()
+
 ENABLE_TESTING()


build(cmake): remove warning

build(cmake): remove warning

--- cmake/FindApron.cmake
+++ cmake/FindApron.cmake
@@ -16,7 +16,7 @@
   set (APRON_ROOT "" CACHE PATH "Root of Apron install.")

   find_package (Gmp QUIET)
-  find_package (Mpfr QUIET)
+  find_package (MPFR QUIET)

   find_path(APRON_INCLUDE_DIR NAMES ap_abstract0.h PATHS ${APRON_ROOT}/include)


update lib names

update lib names

--- cmake/FindCLASS.cmake
+++ cmake/FindCLASS.cmake
@@ -38,7 +38,7 @@
 SET(CLASS_ROOT_DIR "${CLASS_INCLUDE_DIR}/../..")

 # Look for the library
-FIND_LIBRARY(CLASS_LIBRARY libCLASSpkg.so
+FIND_LIBRARY(CLASS_LIBRARY libCLASSpkg.a
     HINTS "${CLASS_ROOT_DIR}" "${CLASS_ROOT_DIR}/lib" "$ENV{CLASS_PATH}/lib"
     "$ENV{CLASS_lib}"
     /usr/local/CLASS/lib /usr/local/CLASS


use LIBPYLONCAM_OTHER_PREFIX to change prefix found with pkg-config

--- cmake/FindPylon.cmake
+++ cmake/FindPylon.cmake
@@ -10,6 +10,7 @@
 # check for environment variable PYLON_ROOT
 find_package(YAT)
 find_package(PkgConfig)
+find_package(PackageHandleStandardArgs)

 if (NOT "$ENV{PYLON_ROOT}" STREQUAL "")
   message("PYLON_ROOT=$ENV{PYLON_ROOT}")
@@ -21,13 +22,18 @@
   pkg_check_modules(LIBPYLONCAM pyloncam>=0.1 REQUIRED)

   find_library(YAT_LIB yat ${YAT_LIBRARY_DIRS})
-  find_package(PackageHandleStandardArgs)

   find_package_handle_standard_args(PYLON DEFAULT_MSG LIBPYLONCAM_INCLUDEDIR LIBPYLONCAM_LIBRARIES)

   mark_as_advanced(
     LIBPYLONCAM_INCLUDEDIR
     LIBPYLONCAM_LIBRARIES)
+  if (DEFINED LIBPYLONCAM_OTHER_PREFIX)
+    string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX}
+      LIBPYLONCAM_INCLUDEDIR ${LIBPYLONCAM_INCLUDEDIR})
+    string(REPLACE ${LIBPYLONCAM_PREFIX} ${LIBPYLONCAM_OTHER_PREFIX}
+      LIBPYLONCAM_LIBRARIES ${LIBPYLONCAM_LIBRARIES})
+  endif()

 else()
   message("Environment variable PYLON_ROOT not found! => unable to build pylon camera support")


Teach cmake that mk[sd]temp is defined in stdlib.h on some systems.
This fixes parallel build with clang on glibc platforms.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -83,9 +83,9 @@
 check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
 check_symbol_exists(malloc_zone_statistics malloc/malloc.h
                     HAVE_MALLOC_ZONE_STATISTICS)
-check_symbol_exists(mkdtemp unistd.h HAVE_MKDTEMP)
-check_symbol_exists(mkstemp unistd.h HAVE_MKSTEMP)
-check_symbol_exists(mktemp unistd.h HAVE_MKTEMP)
+check_symbol_exists(mkdtemp "stdlib.h;unistd.h" HAVE_MKDTEMP)
+check_symbol_exists(mkstemp "stdlib.h;unistd.h" HAVE_MKSTEMP)
+check_symbol_exists(mktemp "stdlib.h;unistd.h" HAVE_MKTEMP)
 check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
 check_symbol_exists(sbrk unistd.h HAVE_SBRK)
 check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)


Make missing case statements an error. (#245)

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -88,6 +88,7 @@
   google_add_flag(GOOG_CXX_FLAGS "-Werror=missing-braces")
   google_add_flag(GOOG_CXX_FLAGS "-Werror=reorder")
   google_add_flag(GOOG_CXX_FLAGS "-Werror=return-type")
+  google_add_flag(GOOG_CXX_FLAGS "-Werror=switch")
   google_add_flag(GOOG_CXX_FLAGS "-Werror=uninitialized")

   if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")


remove Shlwapi dependency

remove Shlwapi dependency

--- cmake/nd-config.cmake
+++ cmake/nd-config.cmake
@@ -42,11 +42,11 @@

   find_package(CUDA 4.0)

-  if(WIN32)   # Windows shell lightweight utility functions - for plugin search
-    find_library(SHLWAPI Shlwapi.lib)
-  else()
+  #if(WIN32)   # Windows shell lightweight utility functions - for plugin search
+    #find_library(SHLWAPI Shlwapi.lib)
+  #else()
     set(SHLWAPI)
-  endif()
+  #endif()

   get_property(ND_LIBRARY TARGET nd PROPERTY LOCATION)
   set(ND_INCLUDE_DIRS  ${ND_INCLUDE_DIR} ${CUDA_INCLUDE_DIRS})


Output the lengths of the lists that are conflicting sizes.

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

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -374,7 +374,7 @@
   list(LENGTH ${_to_sort_relative} to_sort_list_length)

   if(NOT (list_length EQUAL sorted_list_length))
-    message(FATAL_ERROR "size mismatch between ${_sorted_list} and ${_list}")
+    message(FATAL_ERROR "size mismatch between ${_sorted_list} (length ${sorted_list_length}) and ${_list} (length ${list_length})")
   endif(NOT (list_length EQUAL sorted_list_length))

   if(NOT (list_length EQUAL to_sort_list_length))


cmake: toolchain: Don't warn of both ZEPHYR_*_VARIANT envvars defined

Someone doing bisects on Zephyr will have to have both older
ZEPHYR_GCC_VARIANT and newer ZEPHYR_TOOLCHAIN_VARIANT environment
variables defined. Then warning about ZEPHYR_GCC_VARIANT is
confusing. Issue it if only ZEPHYR_GCC_VARIANT is defined, and
ZEPHYR_TOOLCHAIN_VARIANT isn't.

Signed-off-by: Paul Sokolovsky <35cb557f011771c94f127d6fef99f804b62203f5@linaro.org>

--- cmake/toolchain.cmake
+++ cmake/toolchain.cmake
@@ -9,9 +9,11 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

 # Until we completely deprecate it
-if(DEFINED ENV{ZEPHYR_GCC_VARIANT})
-  message(WARNING "ZEPHYR_GCC_VARIANT is deprecated, please use ZEPHYR_TOOLCHAIN_VARIANT instead")
-  set(ZEPHYR_TOOLCHAIN_VARIANT $ENV{ZEPHYR_GCC_VARIANT})
+if(NOT DEFINED ENV{ZEPHYR_TOOLCHAIN_VARIANT})
+  if(DEFINED ENV{ZEPHYR_GCC_VARIANT})
+    message(WARNING "ZEPHYR_GCC_VARIANT is deprecated, please use ZEPHYR_TOOLCHAIN_VARIANT instead")
+    set(ZEPHYR_TOOLCHAIN_VARIANT $ENV{ZEPHYR_GCC_VARIANT})
+  endif()
 endif()

 if(NOT ZEPHYR_TOOLCHAIN_VARIANT)


cmake: Add quotes to handle missing ZEPHYR_TOOLCHAIN_VARIANT variable

If this environment variable is missing, the user gets a rather
confusing cmake error message about "STREQUAL" "gccarmemb" from the
lines below.

Adding quotes to the check makes cmake handle it better and instead
report the problem in the later ASSERT.

Signed-off-by: Björn Stenberg <8a2957e0063f2abf61bd145b6236a74a3708ac54@haxx.se>

--- cmake/toolchain.cmake
+++ cmake/toolchain.cmake
@@ -34,7 +34,7 @@
 endif()

 # Until we completely deprecate it
-if(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "gccarmemb")
+if("${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "gccarmemb")
   message(WARNING "gccarmemb is deprecated, please use gnuarmemb instead")
   set(ZEPHYR_TOOLCHAIN_VARIANT "gnuarmemb")
 endif()


[cmake] Work around more -Wunused-driver-argument warnings

add_compiler_rt_object_libraries should strip out the -msse3 option on
non-macOS Apple platforms.

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -56,8 +56,15 @@

   foreach(libname ${libnames})
     add_library(${libname} OBJECT ${LIB_SOURCES})
+
+    # Strip out -msse3 if this isn't macOS.
+    set(target_flags ${LIB_CFLAGS})
+    if(APPLE AND NOT "${libname}" MATCHES ".*\.osx.*")
+      list(REMOVE_ITEM target_flags "-msse3")
+    endif()
+
     set_target_compile_flags(${libname}
-      ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${LIB_CFLAGS})
+      ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${target_flags})
     set_property(TARGET ${libname} APPEND PROPERTY
       COMPILE_DEFINITIONS ${LIB_DEFS})
     set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Libraries")


changed: oglplus defaults

changed: oglplus defaults

--- cmake/SetupProjectVariables.cmake
+++ cmake/SetupProjectVariables.cmake
@@ -46,7 +46,8 @@
   SET(GLI_INCLUDE_DIR "~/Projects/others/gli-regnirpsj-git")

   # OGL+
-  SET(OGLplus_ROOT_DIR "~/Projects/others/oglplus-develop-git")
+  # SET(OGLplus_ROOT_DIR "~/Projects/others/oglplus-develop-git/_install")
+  SET(OGLplus_ROOT_DIR "~/Projects/others/oglplus-regnirpsj-git/_install")
 ENDIF()

 IF(WIN32 OR WIN64)


[CMake][Fuchsia] Set -fuse-ld=lld explicitly for Linux runtimes

We set lld as the default linker on non-Darwin platforms, but we still
need to set -fuse-ld=lld explicitly in to support cross-compiling Linux
runtimes on Darwin.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@346056 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -40,12 +40,18 @@
     set(BUILTINS_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
     set(BUILTINS_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING "")
     set(BUILTINS_${target}-linux-gnu_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
+    set(BUILTINS_${target}-linux-gnu_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
+    set(BUILTINS_${target}-linux-gnu_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
+    set(BUILTINS_${target}-linux-gnu_CMAKE_EXE_LINKER_FLAG "-fuse-ld=lld" CACHE STRING "")

     # Set the per-target runtimes options.
     list(APPEND RUNTIME_TARGETS "${target}-linux-gnu")
     set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
     set(RUNTIMES_${target}-linux-gnu_CMAKE_BUILD_TYPE Release CACHE STRING "")
     set(RUNTIMES_${target}-linux-gnu_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
+    set(RUNTIMES_${target}-linux-gnu_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
+    set(RUNTIMES_${target}-linux-gnu_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
+    set(RUNTIMES_${target}-linux-gnu_CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
     set(RUNTIMES_${target}-linux-gnu_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
     set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
     set(RUNTIMES_${target}-linux-gnu_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
@@ -79,25 +85,25 @@
     list(APPEND BUILTIN_TARGETS "${target}-fuchsia")
     set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
     set(BUILTINS_${target}-fuchsia_CMAKE_BUILD_TYPE Release CACHE STRING "")
-    set(BUILTINS_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-    set(BUILTINS_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-    set(BUILTINS_${target}-fuchsia_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-    set(BUILTINS_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
-    set(BUILTINS_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
-    set(BUILTINS_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
+    set(BUILTINS_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+    set(BUILTINS_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+    set(BUILTINS_${target}-fuchsia_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+    set(BUILTINS_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
+    set(BUILTINS_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
+    set(BUILTINS_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
     set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")

     # Set the per-target runtimes options.
     list(APPEND RUNTIME_TARGETS "${target}-fuchsia")
     set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
     set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_TYPE Release CACHE STRING "")
-    set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE STRING "")
-    set(RUNTIMES_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-    set(RUNTIMES_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-    set(RUNTIMES_${target}-fuchsia_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE PATH "")
-    set(RUNTIMES_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
-    set(RUNTIMES_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
-    set(RUNTIMES_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE PATH "")
+    set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "")
+    set(RUNTIMES_${target}-fuchsia_CMAKE_ASM_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+    set(RUNTIMES_${target}-fuchsia_CMAKE_C_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+    set(RUNTIMES_${target}-fuchsia_CMAKE_CXX_FLAGS ${FUCHSIA_${target}_COMPILER_FLAGS} CACHE STRING "")
+    set(RUNTIMES_${target}-fuchsia_CMAKE_SHARED_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
+    set(RUNTIMES_${target}-fuchsia_CMAKE_MODULE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
+    set(RUNTIMES_${target}-fuchsia_CMAKE_EXE_LINKER_FLAGS ${FUCHSIA_${target}_LINKER_FLAGS} CACHE STRING "")
     set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
     set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")


linker: arcmwdt: use preprocess opiton -E.

-P is an option that was inherited from the old MetaWare compiler.
[ccac foo.c -P] is actually a shortcut for: [ccac -E foo.c -o foo.i].
In new version of mwdt, -P option can't redirect the output. we need
to use -E option, which works in all versions.

-P:  Preprocess the file and write it to <src>.i (C) or
      <src>.ii(C++). No compilation is performed.

-E:  Run preprocessor only.

Signed-off-by: Watson Zeng <bb6a45ebfbb8932a11537002b062f5218879c562@synopsys.com>

--- cmake/linker/arcmwdt/target.cmake
+++ cmake/linker/arcmwdt/target.cmake
@@ -49,7 +49,7 @@
     ${current_defines}
     ${linker_pass_define}
     ${LINKER_SCRIPT}
-    -P
+    -E
     -o ${linker_script_gen}
     VERBATIM
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}


[cmake] Look for ROOT headers in [v7/]inc/, too:

Before, many headers were not found, because they were specified as
Math/Foo.h, and ${CMAKE_CURRENT_SOURCE_DIR}/Math/Foo.h does not exist
(missing "inc"). This fixes the broken build system dependency which
did not trigger the dictionary to be re-generated after a header
modification.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -231,13 +231,21 @@
           list(APPEND _list_of_header_dependencies ${f})
         endif()
       endforeach()
-    elseif(CMAKE_PROJECT_NAME STREQUAL ROOT AND
-           EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${fp}) # only for ROOT project
-      list(APPEND headerfiles ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
-      list(APPEND _list_of_header_dependencies ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
     elseif(IS_ABSOLUTE ${fp})
       list(APPEND headerfiles ${fp})
       list(APPEND _list_of_header_dependencies ${fp})
+    elseif(CMAKE_PROJECT_NAME STREQUAL ROOT AND
+           EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inc/${fp})
+      list(APPEND headerfiles ${CMAKE_CURRENT_SOURCE_DIR}/inc/${fp})
+      list(APPEND _list_of_header_dependencies ${CMAKE_CURRENT_SOURCE_DIR}/inc/${fp})
+    elseif(CMAKE_PROJECT_NAME STREQUAL ROOT AND
+           EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc/${fp})
+      list(APPEND headerfiles ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc/${fp})
+      list(APPEND _list_of_header_dependencies ${CMAKE_CURRENT_SOURCE_DIR}/v7/inc/${fp})
+    elseif(CMAKE_PROJECT_NAME STREQUAL ROOT AND
+           EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
+      list(APPEND headerfiles ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
+      list(APPEND _list_of_header_dependencies ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
     elseif(NOT CMAKE_PROJECT_NAME STREQUAL ROOT)
       find_file(headerFile ${fp} HINTS ${localinclude} ${incdirs} NO_DEFAULT_PATH)
       find_file(headerFile ${fp} NO_SYSTEM_ENVIRONMENT_PATH)


Change paraview branch to "point-cloud-rep"

* this enable fast rendering for the VLP128

--- Superbuild/versions.cmake
+++ Superbuild/versions.cmake
@@ -39,7 +39,7 @@
 set(PARAVIEW_VERSION 5.1)
 add_revision(paraview
   GIT_REPOSITORY https://gitlab.kitware.com/bjacquet/paraview.git
-  GIT_TAG origin/veloview)
+  GIT_TAG origin/point-cloud-rep)

 add_revision(veloview
     SOURCE_DIR ${CMAKE_SOURCE_DIR}/..


Fixed version info. (3)

Fixed version info. (3)

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -90,6 +90,7 @@
 else()
     set(CC_NAME "msvc")
     exec_program(cl OUTPUT_VARIABLE CC_VERSION_VERBOSE)
+    message(STATUS "cl output: ${CC_VERSION_VERBOSE}")
     string(FIND "${CC_VERSION_VERBOSE}" "19.10" CC_VERSION_2017)
     if(CC_VERSION_2017 GREATER_EQUAL 0)
         set(CC_VERSION "2017")


Print valgrind supression templates to log.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -334,7 +334,7 @@
 find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
 if(CTEST_MEMORYCHECK_COMMAND)
     set(CTEST_MEMORYCHECK_TYPE "Valgrind")
-    set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --track-origins=yes --leak-check=full --show-reachable=yes")
+    set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --track-origins=yes --leak-check=full --show-reachable=yes --gen-suppressions=all")
     if(EXISTS "${CTEST_SOURCE_DIRECTORY}/valgrind.supp")
         set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "${CTEST_MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CTEST_SOURCE_DIRECTORY}/valgrind.supp")
     endif()


Keep updating on the ITK release tail

Keep updating on the ITK release tail

Change-Id: I9f3bfae228a2d17262fc2e1c965609c5b41d368d

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG 8e99a65d74e86fa2b564b04e64d04c55c4572ae3) # after v4.7.1 release
+set(ITK_TAG_COMMAND GIT_TAG b8f1c2f2ed7db7b214ea52d52273e61d0a25da5e) # after v4.7.1 release

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


#63 Coverage clean

#63 Coverage clean

--- sources/cmake/codeCoverage.cmake
+++ sources/cmake/codeCoverage.cmake
@@ -43,16 +43,23 @@
     # Clean code coverage html
     list(APPEND MAKE_CLEAN_FILES CodeCoverage)
     list(APPEND MAKE_CLEAN_FILES raw.info)
-    list(APPEND MAKE_CLEAN_FILES coverage.info)
+    list(APPEND MAKE_CLEAN_FILES vcdMaker.coverage)

 endif()
+
+add_custom_target(coverage_clean
+    COMMAND rm -rf CodeCoverage
+    COMMAND rm -f raw.info vcdMaker.coverage
+    COMMAND find . -type f -name '*.gcda' -delete
+    COMMENT "Cleaning code coverage data."
+)

 add_custom_target(coverage
     COMMAND mkdir CodeCoverage
     COMMAND lcov --directory . --capture --rc lcov_branch_coverage=1 --output-file=raw.info
-    COMMAND lcov --remove raw.info '/usr/*' '*/3rdParty/*' '*/test/*' --rc lcov_branch_coverage=1 --output-file=coverage.info
-    COMMAND genhtml --output-directory CodeCoverage --rc lcov_branch_coverage=1 coverage.info
-    DEPENDS check
+    COMMAND lcov --remove raw.info '/usr/*' '*/3rdParty/*' '*/test/*' --rc lcov_branch_coverage=1 --output-file=vcdMaker.coverage
+    COMMAND genhtml --output-directory CodeCoverage --rc lcov_branch_coverage=1 vcdMaker.coverage
+    DEPENDS coverage_clean check
     COMMENT "Generating code coverage."
 )


Fix case and re-order statments

Fix case and re-order statments

--- CMake/ctkMacroCompilePythonScript.cmake
+++ CMake/ctkMacroCompilePythonScript.cmake
@@ -32,8 +32,8 @@
     SET(MY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
   ENDIF()

-  set(copied_files)
-  set(copied_python_files)
+  SET(copied_files)
+  SET(copied_python_files)
   FOREACH(file ${MY_SCRIPTS})
     # Append "py" extension if needed
     get_filename_component(file_ext ${file} EXT)
@@ -49,23 +49,24 @@
       SET(tgt "${MY_DESTINATION_DIR}/${tgt_file}")
     ENDIF()

-    SET(copied_python_files ${copied_python_files} ${tgt})
-    SET(copied_files ${copied_files} ${tgt})
     ADD_CUSTOM_COMMAND(DEPENDS ${src}
                         COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
                         OUTPUT ${tgt}
                         COMMENT "Copying python script: ${file}")
+    SET(copied_python_files ${copied_python_files} ${tgt})
+    SET(copied_files ${copied_files} ${tgt})
   ENDFOREACH()

   IF(DEFINED MY_RESOURCES)
     FOREACH(file ${MY_RESOURCES})
       SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
       SET(tgt "${MY_DESTINATION_DIR}/${file}")
-      SET(copied_files ${copied_files} ${tgt})
+
       ADD_CUSTOM_COMMAND(DEPENDS ${src}
                           COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
                           OUTPUT ${tgt}
                           COMMENT "Copying python resource: ${file}")
+      SET(copied_files ${copied_files} ${tgt})
     ENDFOREACH()
   ENDIF()


why was I even trying to not set unrecognized options.... so much pain with 0 gain

--- scripts/cmake/common.cmake
+++ scripts/cmake/common.cmake
@@ -79,9 +79,9 @@
 endif()

 if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+    add_compiler_flags(-Wno-unknown-pragmas)
     add_compiler_flags(-Wall)
     add_compiler_flags(-Wextra)
-    #add_compiler_flags(-Wno-unknown-pragmas)
     add_compiler_flags(-fdiagnostics-show-option)
     add_compiler_flags(-Wconversion)
     add_compiler_flags(-Wold-style-cast)
@@ -113,7 +113,19 @@
     add_compiler_flags(-Wunused-but-set-variable)
     add_compiler_flags(-Wunused-result)
     add_compiler_flags(-Wsuggest-override)
-
+    add_compiler_flags(-Wdouble-promotion)
+    add_compiler_flags(-Wtrampolines)
+    add_compiler_flags(-Wzero-as-null-pointer-constant)
+    add_compiler_flags(-Wuseless-cast)
+    add_compiler_flags(-Wnoexcept)
+    add_compiler_flags(-Wvector-operation-performance)
+    add_compiler_flags(-Wshift-overflow=2)
+    add_compiler_flags(-Wnull-dereference)
+    add_compiler_flags(-Wduplicated-cond)
+    add_compiler_flags(-Walloc-zero)
+    add_compiler_flags(-Walloca)
+    add_compiler_flags(-Wduplicated-branches)
+    add_compiler_flags(-Wcast-align=strict)
 	add_compiler_flags(-Wsuggest-attribute=cold)
     add_compiler_flags(-Wsuggest-attribute=const)
     add_compiler_flags(-Wsuggest-attribute=format)
@@ -123,39 +135,11 @@
     add_compiler_flags(-Wsuggest-final-methods)
     add_compiler_flags(-Wsuggest-final-types)

-    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
-        add_compiler_flags(-Wnoexcept)
-    endif()
-
     # no way to silence it in the expression decomposition macros: _Pragma() in macros doesn't work for the c++ front-end of g++
     # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578
     # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69543
     # Also the warning is completely worthless nowadays - http://stackoverflow.com/questions/14016993
     #add_compiler_flags(-Waggregate-return)
-
-    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
-        add_compiler_flags(-Wdouble-promotion)
-        add_compiler_flags(-Wtrampolines)
-        add_compiler_flags(-Wzero-as-null-pointer-constant)
-        add_compiler_flags(-Wuseless-cast)
-        add_compiler_flags(-Wvector-operation-performance)
-    endif()
-
-    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
-        add_compiler_flags(-Wshift-overflow=2)
-        add_compiler_flags(-Wnull-dereference)
-        add_compiler_flags(-Wduplicated-cond)
-    endif()
-
-    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
-        add_compiler_flags(-Walloc-zero)
-        add_compiler_flags(-Walloca)
-        add_compiler_flags(-Wduplicated-branches)
-    endif()
-
-    if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
-        add_compiler_flags(-Wcast-align=strict)
-    endif()
 endif()

 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")


[cmake] working FindCCTag.cmake

[cmake] working FindCCTag.cmake

fix #30

--- cmake/FindCCTag.cmake
+++ cmake/FindCCTag.cmake
@@ -15,49 +15,36 @@

 MESSAGE(STATUS "Looking for CCTag.")

-FIND_PATH(CCTAG_INCLUDE_DIR cctag/CCTag.hpp
+FIND_PATH(CCTAG_INCLUDE_DIR cctag/ICCTag.hpp
   HINTS
   $ENV{CCTAG_DIR}/include
   ${CCTAG_DIR}/include
   PATH_SUFFIXES
-  CCTag
+  cctag
 )

 find_package(OpenCV REQUIRED)
-find_package(OPTPP REQUIRED)
-find_package(Ceres REQUIRED)
-find_package(Glog REQUIRED)

 IF(CCTAG_INCLUDE_DIR)
-  MESSAGE(STATUS "CCTag headers found in ${CCTAG_INCLUDE_DIRS}")
+  MESSAGE(STATUS "CCTag headers found in ${CCTAG_INCLUDE_DIR}")
 ELSE()
   MESSAGE(STATUS "NOT FOUND")
 ENDIF (CCTAG_INCLUDE_DIR)

 SET(CCTAG_LIBRARIES_NAMES
   CCTag
-  #third_party libraries
-  boost_filesystem
-  boost_system
-  boost_serialization
-  dl
+  # third_party libraries
+  # boost_filesystem
+  # boost_system
+  # boost_serialization
+  # dl
   ${OpenCV_LIBS}
-  ${OPTPP_LIBRARIES}
-  ${Ceres_LIBRARIES}
-  ${GLOG_LIBRARIES}
 )

 FIND_LIBRARY(CCTAG_LIBRARY NAMES ${CCTAG_LIBRARIES_NAMES}
   HINTS
   $ENV{CCTAG_DIR}/lib
   ${CCTAG_DIR}/lib
-  PATH_SUFFIXES
-  CCTag
-  #third_party libraries
-  ${OpenCV_LIB_DIR}
-  ${OPTPP_LIBRARY_DIRS}
-  ${Ceres_LIBRARY}
-  ${GLOG_LIBRARY_DIR_HINTS}
 )
 GET_FILENAME_COMPONENT(CCTAG_LIBRARY_DIR "${CCTAG_LIBRARY}" PATH)


fix typo in FindTaucs.cmake

fix typo in FindTaucs.cmake

--HG--
extra : convert_revision : svn%3A283d02a7-25f6-0310-bc7c-ecb5cbfe19da/trunk/kdesupport/eigen2%40927291

--- cmake/FindTaucs.cmake
+++ cmake/FindTaucs.cmake
@@ -18,7 +18,7 @@
   find_library(TAUCS_LIBRARIES taucs PATHS $ENV{TAUCSDIR} ${LIB_INSTALL_DIR})

   if(TAUCS_LIBRARIES)
-    set(TAUCS_LIBRARIES ${TAUCS_LIBRARIES} ${LAPACK_LIBRARY})
+    set(TAUCS_LIBRARIES ${TAUCS_LIBRARIES} ${LAPACK_LIBRARIES})
   endif(TAUCS_LIBRARIES)

 endif(LAPACK_FOUND)


[profile] Enable on SystemZ.

[profile] Enable on SystemZ.

Differential Revision: http://reviews.llvm.org/D21738

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -153,7 +153,7 @@
 set(ALL_LSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
 set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64})
 set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64}
-    ${MIPS32} ${MIPS64})
+    ${MIPS32} ${MIPS64} ${S390X})
 set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64} ${PPC64})
 set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
     ${MIPS32} ${MIPS64} ${PPC64} ${S390X})


Output the lengths of the lists that are conflicting sizes.

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

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -374,7 +374,7 @@
   list(LENGTH ${_to_sort_relative} to_sort_list_length)

   if(NOT (list_length EQUAL sorted_list_length))
-    message(FATAL_ERROR "size mismatch between ${_sorted_list} and ${_list}")
+    message(FATAL_ERROR "size mismatch between ${_sorted_list} (length ${sorted_list_length}) and ${_list} (length ${list_length})")
   endif(NOT (list_length EQUAL sorted_list_length))

   if(NOT (list_length EQUAL to_sort_list_length))


CMake toolchain: fix options comment

CMake toolchain: fix options comment

Co-authored-by: Hugues Kamba <402748a27f75fbc914c63b0503c6fbcb2aac22b4@users.noreply.github.com>

--- cmake/toolchain.cmake
+++ cmake/toolchain.cmake
@@ -12,7 +12,8 @@
 # Project setup
 enable_language(C CXX ASM)

-# Clear FLAGS for all languages
+# Clear toolchains options for all languages as Mbed OS uses
+# different initialisation options (such as for optimization and debug symbols)
 # Mbed OS uses different init flags (optimization, debug symbols)
 set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "" FORCE)
 set(CMAKE_C_FLAGS_RELEASE "" CACHE STRING "" FORCE)


fix concise-args url

fix concise-args url


Completely backport XOPEN_SOURCE test from autoconf to CMake

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -170,13 +170,130 @@
 endif()

 message(STATUS "Checking for XOPEN_SOURCE")
+
+# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
+# disable features if it is defined, without any means to access these
+# features as extensions. For these systems, we skip the definition of
+# _XOPEN_SOURCE. Before adding a system to the list to gain access to
+# some feature, make sure there is no alternative way to access this
+# feature. Also, when using wildcards, make sure you have verified the
+# need for not defining _XOPEN_SOURCE on all systems matching the
+# wildcard, and that the wildcard does not include future systems
+# (which may remove their limitations).
 set(define_xopen_source 1)

-if(CMAKE_SYSTEM MATCHES OpenBSD)
-  set(_BSD_SOURCE 1)
-endif(CMAKE_SYSTEM MATCHES OpenBSD)
-
-if(APPLE)
+# On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
+# even though select is a POSIX function. Reported by J. Ribbens.
+# Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
+# In addition, Stefan Krah confirms that issue #1244610 exists through
+# OpenBSD 4.6, but is fixed in 4.7.
+if(CMAKE_SYSTEM MATCHES "OpenBSD\\-2\\."
+   OR CMAKE_SYSTEM MATCHES "OpenBSD\\-3\\."
+   OR CMAKE_SYSTEM MATCHES "OpenBSD\\-4\\.[0-6]$")
+
+  #OpenBSD/2.* | OpenBSD/3.* | OpenBSD/4.@<:@0123456@:>@
+
+  set(define_xopen_source 0)
+
+  # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
+  # also defined. This can be overridden by defining _BSD_SOURCE
+  # As this has a different meaning on Linux, only define it on OpenBSD
+  set_required_def(_BSD_SOURCE 1)     # Define on OpenBSD to activate all library features
+
+elseif(CMAKE_SYSTEM MATCHES OpenBSD)
+
+  # OpenBSD/*
+
+  # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
+  # also defined. This can be overridden by defining _BSD_SOURCE
+  # As this has a different meaning on Linux, only define it on OpenBSD
+  set_required_def(_BSD_SOURCE 1)     # Define on OpenBSD to activate all library features
+
+elseif(CMAKE_SYSTEM MATCHES "NetBSD\\-1\\.5$"
+       OR CMAKE_SYSTEM MATCHES "NetBSD\\-1\\.5\\."
+       OR CMAKE_SYSTEM MATCHES "NetBSD\\-1\\.6$"
+       OR CMAKE_SYSTEM MATCHES "NetBSD\\-1\\.6\\."
+       OR CMAKE_SYSTEM MATCHES "NetBSD\\-1\\.6[A-S]$")
+
+  # NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@
+
+  # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
+  # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
+  # Marc Recht
+  set(define_xopen_source 0)
+
+elseif(CMAKE_SYSTEM MATCHES SunOS)
+
+  # SunOS/*)
+
+  # From the perspective of Solaris, _XOPEN_SOURCE is not so much a
+  # request to enable features supported by the standard as a request
+  # to disable features not supported by the standard.  The best way
+  # for Python to use Solaris is simply to leave _XOPEN_SOURCE out
+  # entirely and define __EXTENSIONS__ instead.
+
+  set(define_xopen_source 0)
+
+elseif(CMAKE_SYSTEM MATCHES "OpenUNIX\\-8\\.0\\.0$"
+       OR CMAKE_SYSTEM MATCHES "UnixWare\\-7\\.1\\.[0-4]$")
+
+  # OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@
+
+  # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
+  # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
+  # Reconfirmed for 7.1.4 by Martin v. Loewis.
+
+  set(define_xopen_source 0)
+
+elseif(CMAKE_SYSTEM MATCHES "SCO_SV\\-3\\.2$")
+
+  # SCO_SV/3.2
+
+  # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
+  # but used in struct sockaddr.sa_family. Reported by Tim Rice.
+
+  set(define_xopen_source 0)
+
+elseif(CMAKE_SYSTEM MATCHES "FreeBSD\\-4\\.")
+
+  # FreeBSD/4.*
+
+  # On FreeBSD 4, the math functions C89 does not cover are never defined
+  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
+
+  set(define_xopen_source 0)
+
+elseif(CMAKE_SYSTEM MATCHES "Darwin\\-[6789]\\."
+       OR CMAKE_SYSTEM MATCHES "Darwin\\-1[0-9]\\.")
+
+  # Darwin/@<:@6789@:>@.*)
+  # Darwin/1@<:@0-9@:>@.*
+
+  # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
+  # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
+  # identifies itself as Darwin/7.*
+  # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
+  # disables platform specific features beyond repair.
+  # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
+  # has no effect, don't bother defining them
+
+  set(define_xopen_source 0)
+
+elseif(CMAKE_SYSTEM MATCHES "AIX\\-4$"
+       OR CMAKE_SYSTEM MATCHES "AIX\\-5\\.1$")
+  # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
+  # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
+  # or has another value. By not (re)defining it, the defaults come in place.
+
+  set(define_xopen_source 0)
+
+elseif(CMAKE_SYSTEM MATCHES "QNX\\-6\\.3\\.2$")
+
+  # QNX/6.3.2
+
+  # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
+  # defining NI_NUMERICHOST.
+
   set(define_xopen_source 0)
 endif()


Added explicit deb package dependency from libtbb-dev if TBB is enabled.

(cherry picked from commit 63d6cc5ca66c0627652021650b3f5c5cc608d7f5)

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -104,6 +104,14 @@
   endif()
 endif()

+if(HAVE_TBB AND NOT BUILD_TBB)
+  if(CPACK_DEB_DEV_PACKAGE_DEPENDS)
+    set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, libtbb-dev")
+  else()
+    set(CPACK_DEB_DEV_PACKAGE_DEPENDS "libtbb-dev")
+  endif()
+endif()
+
 if(NOT OPENCV_CUSTOM_PACKAGE_INFO)
   set(CPACK_COMPONENT_LIBS_DESCRIPTION "Open Computer Vision Library")
   set(CPACK_DEBIAN_COMPONENT_LIBS_NAME "libopencv")


Add component display names

Add component display names

(cherry picked from commit 6d52ea898442d2458a40f8b06b75320c9ab4a5cc)

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -61,6 +61,15 @@
 set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
 set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://opencv.org")
+
+#display names
+set(CPACK_COMPONENT_DEV_DISPLAY_NAME     "Development files")
+set(CPACK_COMPONENT_DOCS_DISPLAY_NAME    "Documentation")
+set(CPACK_COMPONENT_JAVA_DISPLAY_NAME    "Java bindings")
+set(CPACK_COMPONENT_LIBS_DISPLAY_NAME    "Libraries and data")
+set(CPACK_COMPONENT_PYTHON_DISPLAY_NAME  "Python bindings")
+set(CPACK_COMPONENT_SAMPLES_DISPLAY_NAME "Samples")
+set(CPACK_COMPONENT_TESTS_DISPLAY_NAME   "Tests")

 #depencencies
 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)


use Boost 1.65.0 as default

use Boost 1.65.0 as default

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -40,7 +40,7 @@
 hunter_config(Avahi VERSION 0.6.31)
 hunter_config(Beast VERSION 1.0.0-b84-hunter-0)
 hunter_config(BZip2 VERSION 1.0.6-p3)
-hunter_config(Boost VERSION 1.64.0)
+hunter_config(Boost VERSION 1.65.0)
 hunter_config(BoostCompute VERSION 0.5-p0)
 hunter_config(BoostProcess VERSION 0.5)
 hunter_config(CapnProto VERSION 0.6.1)


Set destdir properly

Set destdir properly

--- cmake/snippets/python.cmake
+++ cmake/snippets/python.cmake
@@ -4,6 +4,12 @@
 cmake_dependent_option(VISTK_ENABLE_PYTHON3 "Use Python3" OFF
   VISTK_ENABLE_PYTHON OFF)
 if (VISTK_ENABLE_PYTHON)
+  if (WIN32)
+    set(destdir bin)
+  else ()
+    set(destdir lib)
+  endif ()
+
   set(python_output_path "${vistk_binary_dir}/${destdir}/python${PYTHON_VERSION}${PYTHON_ABIFLAGS}")

   set(PYTHON_VERSION "2.7"


Allow more recent Boost.  We don't really use boost::program_options, so remove it.

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -120,14 +120,14 @@

 message (STATUS "BOOST_ROOT ${BOOST_ROOT}")

-set(Boost_ADDITIONAL_VERSIONS "1.38" "1.38.0" "1.37" "1.37.0" "1.34.1" "1_34_1")
+set (Boost_ADDITIONAL_VERSIONS "1.40" "1.39" "1.38" "1.38.0" "1.37" "1.37.0" "1.34.1" "1_34_1")
 #set (Boost_USE_STATIC_LIBS   ON)
 set (Boost_USE_MULTITHREADED ON)
 if (BOOST_CUSTOM)
     set (Boost_FOUND true)
 else ()
     find_package (Boost 1.34 REQUIRED
-                  COMPONENTS filesystem program_options regex system thread
+                  COMPONENTS filesystem regex system thread
                  )
 endif ()


Always place map variables outside function scope.

--- CPM.cmake
+++ CPM.cmake
@@ -812,9 +812,9 @@

     # Ensure we log that we have added this source directory.
     # Otherwise CMake will error out and tell us we can't use the same binary
-    # directory for two source directories.
-    set(CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID} ${CPM_LAST_MODULE_NAME})
-    set(CPM_KV_LIST_SOURCE_ADDED_MAP ${CPM_KV_LIST_SOURCE_ADDED_MAP} "CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID}")
+    # directory for two source directories. We always start in the parent scope.
+    set(CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID} ${CPM_LAST_MODULE_NAME} PARENT_SCOPE)
+    set(CPM_KV_LIST_SOURCE_ADDED_MAP ${CPM_KV_LIST_SOURCE_ADDED_MAP} "CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID}" PARENT_SCOPE)

     # Append target to pre-existing libraries.
     set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)


set activation policy to "eager" which fixes the bug

--- BlueBerry/Bundles/org.blueberry.ui.qt.log/manifest_headers.cmake
+++ BlueBerry/Bundles/org.blueberry.ui.qt.log/manifest_headers.cmake
@@ -3,4 +3,5 @@
 set(Plugin-Vendor "DKFZ, Medical and Biological Informatics")
 set(Plugin-ContactAddress "http://www.mitk.org")
 set(Require-Plugin org.blueberry.ui.qt)
+set(Plugin-ActivationPolicy "eager")


Tweaking the message.

Tweaking the message.

--- simdjson-flags.cmake
+++ simdjson-flags.cmake
@@ -19,12 +19,10 @@

 if (NOT CMAKE_BUILD_TYPE)
+  message(STATUS "No build type selected, default to Release")
+  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
   if(SIMDJSON_SANITIZE)
-    message(STATUS "No build type selected, default to Debug since you have actived the sanitizer")
-    set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
-  else()
-    message(STATUS "No build type selected, default to Release")
-    set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
+    message(WARNING "No build type selected and you have enabled the sanitizer. Consider setting CMAKE_BUILD_TYPE to Debug to help identify the eventual problems.")
   endif()
 endif()


SVN_SILENT made messages (.desktop file)

--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -7,6 +7,7 @@
 Name[da]=Instant messaging
 Name[de]=Instant-Messaging
 Name[el]=Στιγμιαία μηνύματα
+Name[en_GB]=Instant Messaging
 Name[es]=Mensajería instantánea
 Name[et]=Kiirsuhtlus
 Name[fa]=پیام‌رسانی فوری
@@ -48,6 +49,7 @@
 Comment[da]=Start chat med en af dine IM-kontakter eller skift din IM-status
 Comment[de]=Chats mit ihren Kontakten starten oder Ihren IM-Status ändern
 Comment[el]=Έναρξη συνομιλίας με οποιαδήποτε επαφή στιγμιαίων μηνυμάτων ή αλλαγή της κατάστασής σας
+Comment[en_GB]=Start a chat with any of your IM contacts or change your IM status
 Comment[es]=Iniciar una conversación con cualquiera de sus contactos de MI o cambiar su estado de MI
 Comment[et]=Vestluse alustamine mõne oma kiirsuhtluskontaktiga või enda kiirsuhtlusoleku muutmine
 Comment[fi]=Aloita keskustelu muun pikaviestinkäyttäjän kanssa tai vaihda pikaviestintilaasi


Adding locations for boost discovery

Adding locations for boost discovery

--- appveyor.cmake
+++ appveyor.cmake
@@ -1,5 +1,3 @@
 set(BUILD_DIR C:/projects/morebin CACHE PATH "")
-set(Boost_ROOT C:/Libraries/boost_1_60_0/ CACHE_PATH "")
-set(Boost_DIR C:/Libraries/boost_1_60_0/ CACHE_PATH "")
-set(Boost_INCLUDE_DIR C:/Libraries/boost_1_60_0/ CACHE_PATH "")
-set(Boost_LIBRARY_DIR C:/Libraries/boost_1_60_0/lib64-msvc-14.0/ CACHE_PATH "")
+set(BOOST_ROOT C:/Libraries/boost_1_60_0 CACHE_PATH "")
+set(BOOST_LIBRARYDIR C:/Libraries/boost_1_60_0/lib64-msvc-14.0 CACHE_PATH "")


Added automatic loading header files hierarchies from dependencies.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -109,15 +109,26 @@
   endif ()
 endmacro(create_test)

+macro(include_project library_name)
+  if (${library_name}_includes)
+    include_directories(${${library_name}_includes})
+  else ()
+    #    message("${library_name}_DIR ${${library_name}_DIR}")
+#    find_package(${library_name} REQUIRED)
+    include(${${library_name}_DIR}/${library_name}-config.cmake)
+  endif ()
+  set(temp ${${library_name}_dependencies})
+
+  foreach (dependency IN LISTS temp)
+        include_project(${dependency})
+  endforeach ()
+endmacro()
+
 macro(require)
   if (LOCAL_TARGET)
     foreach (library_name ${ARGN})
       #          message(WARNING "${PROJECT_NAME} require ${library_name}")
-      if (${library_name}_includes)
-        include_directories(${${library_name}_includes})
-      else ()
-        find_package(${library_name} REQUIRED)
-      endif ()
+      include_project(${library_name})

       if (TARGET ${library_name})
         if (IOS)
@@ -134,7 +145,7 @@
           ${library_name}
           )
         list(APPEND "${CURRENT_TARGET}_dependencies" "${library_name}")
-#        message("${${CURRENT_TARGET}_dependencies}")
+        #        message("${${CURRENT_TARGET}_dependencies}")
         set(${CURRENT_TARGET}_dependencies ${${CURRENT_TARGET}_dependencies} PARENT_SCOPE)
       endif ()
     endforeach ()
@@ -142,38 +153,15 @@
 endmacro()

 if (IOS)
-
   macro(add_project project_name)
     message(STATUS "ios ${project_name}")
     #include(${CMAKE_SOURCE_DIR}/toolchains/ios.cmake)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-
     project(${project_name})
-
     set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
-
     include(${project_name}-config.cmake)
   endmacro(add_project)
-
-  #  macro(create_library target)
-  #    add_library(${target} ${ARGN})
-  #    set_xcode_property(${target} IPHONEOS_DEPLOYMENT_TARGET "8.0")
-  #  endmacro(create_library)
-
-  macro(require_package project_name library_name)
-    find_package(${library_name} REQUIRED)
-
-    target_link_libraries(${project_name}
-      $<TARGET_FILE:${library_name}>
-      )
-
-    add_dependencies(${project_name}
-      ${library_name}
-      )
-
-  endmacro(require_package)
-
 else ()

   macro(add_project project_name)
@@ -182,15 +170,17 @@
     endif ()

     project(${project_name})
-
+#    message("project ${project_name}")
     if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${project_name}-config.cmake")
-      if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
-        set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR})
-      else ()
-        set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
-      endif ()
-
-      include(${project_name}-config.cmake OPTIONAL)
+#      message(${CMAKE_CURRENT_LIST_DIR}/${project_name}-config.cmake)
+#      if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+        set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL "${project_name} dir")
+#      else ()
+#        set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
+#      endif ()
+#      message("${project_name}_DIR ${${project_name}_DIR}")
+
+      include(${project_name}-config.cmake)

     else ()
       set(${project_name}_includes "${CMAKE_CURRENT_LIST_DIR}/source" PARENT_SCOPE)
@@ -198,19 +188,6 @@
     endif ()

   endmacro(add_project)
-
-  macro(require_package project_name library_name)
-    find_package(${library_name} REQUIRED)
-
-    target_link_libraries(${project_name}
-      $<TARGET_LINKER_FILE:${library_name}>
-      )
-
-    add_dependencies(${project_name}
-      ${library_name}
-      )
-
-  endmacro(require_package)

 endif ()


externals: use recent cxxopts version

externals: use recent cxxopts version

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -83,7 +83,9 @@
     add_external_headeronly_project(libcxxopts
       DEPENDS libzmq
       GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
-      GIT_TAG "v2.1.1"
+      # we are waiting for v3 which brings allowing unrecognized options
+      #GIT_TAG "v2.1.1"
+      GIT_TAG "dd45a0801c99d62109aaa29f8c410ba8def2fbf2"
       INCLUDE_DIR "include")

   # mmpld_io


Try passing path settings to external project. Zlib binary build directory needs to be included in include path for generated header file.

--- src/CMake/ZlibConfig.cmake
+++ src/CMake/ZlibConfig.cmake
@@ -24,12 +24,12 @@
 #  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 #  DEALINGS IN THE SOFTWARE.

-MACRO(EXTERNAL_ZLIB_LIBRARY compress_type cmake_cxx_flags disabled_update)
+MACRO(EXTERNAL_ZLIB_LIBRARY compress_type)

   SET(zlib_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Externals/zlib")
   SET(zlib_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/Externals/zlib")

-  SET(SCI_ZLIB_INCLUDE ${zlib_SOURCE_DIR} CACHE INTERNAL "Zlib include directories." FORCE)
+  SET(SCI_ZLIB_INCLUDE "${zlib_SOURCE_DIR};${zlib_BINARY_DIR}" CACHE INTERNAL "Zlib include directories." FORCE)
   SET(SCI_ZLIB_LIBRARY zlib CACHE INTERNAL "Zlib library name." FORCE)

   # TODO: prefix for windows build?
@@ -63,6 +63,8 @@
         -DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}
         -DCMAKE_CXX_FLAGS:STRING=${cmake_cxx_flags}
         -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
+        -DSCI_ZLIB_LIBRARY:FILEPATH=${SCI_ZLIB_LIBRARY}
+        -DSCI_ZLIB_INCLUDE:PATH=${SCI_ZLIB_INCLUDE}
     )
   ELSEIF(${compress_type} MATCHES "ZIP")
   ENDIF()
@@ -76,7 +78,7 @@
   IF (CMAKE_GENERATOR MATCHES "Makefiles")
     SET_TARGET_PROPERTIES(${SCI_ZLIB_LIBRARY}
       PROPERTIES
-        IMPORTED_LOCATION ${boost_LIBRARY_PATH}
+        IMPORTED_LOCATION ${zlib_LIBRARY_PATH}
     )
   ELSE() # IDEs: Xcode, VS, others...
     SET_TARGET_PROPERTIES(${SCI_ZLIB_LIBRARY}


Allow override of HC12_PATH and find in multiple locations

--- toolchain/Toolchain-Generic-chc12.cmake
+++ toolchain/Toolchain-Generic-chc12.cmake
@@ -12,11 +12,15 @@
 # Look for modules in this path
 SET (CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

-# Path to compiler, must not contain spaces
-IF (WIN32)
-SET (HC12_PATH "P:")
-ELSE()
-SET (HC12_PATH "/Users/joakim/.wine/drive_c/P")
+# Path to compiler
+IF (NOT DEFINED HC12_PATH)
+    find_path(HC12_PATH NAMES Prog/chc12.exe
+                        PATHS "/Users/joakim/.wine/drive_c/P"
+                              "/c/Program Files/Freescale/CWS12v5.1/"
+                              "/cygdrive/c/Program Files/Freescale/CWS12v5.1/"
+                              "P:"
+                              "C:/Program Files/Freescale/CWS12v5.1/"
+                        NO_DEFAULT_PATH)
 ENDIF()

 LIST(APPEND CMAKE_PROGRAM_PATH "${HC12_PATH}/Prog")


xpFindPkg as a function instead of a macro

* expose the list of reqVars from the package's use script to the parent scope
* provide new xpGetPkgVar cmake function to parent scope cmake variable(s) from the use script
  * for example: see mod in this commit to get PATCH_CMD with `xpGetPkgVar(patch CMD)`

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -145,7 +145,7 @@
         set(depsOpt DEPENDS)
         list(APPEND depsList patch)
       else()
-        xpFindPkg(PKGS patch)
+        xpGetPkgVar(patch CMD)
       endif()
       if(DEFINED P_PATCH_STRIP)
         set(patchCmd ${PATCH_CMD} -p${P_PATCH_STRIP} < ${P_PATCH})
@@ -701,7 +701,7 @@
   endforeach()
 endfunction()

-macro(xpFindPkg)
+function(xpFindPkg)
   cmake_parse_arguments(FP "" "" PKGS ${ARGN})
   foreach(pkg ${FP_PKGS})
     string(TOUPPER ${pkg} PKG)
@@ -710,9 +710,31 @@
       unset(usexp-${pkg}_DIR CACHE)
       find_package(usexp-${pkg} PATHS ${XP_MODULE_PATH} NO_DEFAULT_PATH)
       mark_as_advanced(usexp-${pkg}_DIR)
+      foreach(var ${reqVars})
+        set(${var} ${${var}} PARENT_SCOPE)
+      endforeach()
     endif()
   endforeach()
-endmacro()
+endfunction()
+
+function(xpGetPkgVar pkg)
+  xpFindPkg(PKGS ${pkg})
+  string(TOUPPER ${pkg} PKG)
+  if(${PKG}_FOUND)
+    foreach(var ${ARGN})
+      string(TOUPPER ${var} VAR)
+      if(DEFINED ${PKG}_${VAR})
+        set(${PKG}_${VAR} ${${PKG}_${VAR}} PARENT_SCOPE)
+      elseif(DEFINED ${pkg}_${VAR})
+        set(${pkg}_${VAR} ${${pkg}_${VAR}} PARENT_SCOPE)
+      elseif(DEFINED ${PKG}_${var})
+        set(${PKG}_${var} ${${PKG}_${var}} PARENT_SCOPE)
+      elseif(DEFINED ${pkg}_${var})
+        set(${pkg}_${var} ${${pkg}_${var}} PARENT_SCOPE)
+      endif()
+    endforeach()
+  endif()
+endfunction()

 # meant for internal consumption (called by xpGetExtern)
 function(xpAppendPkgVars pkg _libList _incDirs)


xpSourceListAppend relative paths for files with clang-format

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -602,6 +602,15 @@
   set(${var} "${listVar}" PARENT_SCOPE)
 endfunction()

+function(xpListRemoveFromAll var match replace)
+  set(listVar)
+  foreach(f ${ARGN})
+    string(REPLACE "${match}" "${replace}" f ${f})
+    list(APPEND listVar ${f})
+  endforeach()
+  set(${var} "${listVar}" PARENT_SCOPE)
+endfunction()
+
 function(xpListAppendIfDne appendTo items)
   foreach(item ${items})
     list(FIND ${appendTo} ${item} index)
@@ -822,11 +831,14 @@
     endif()
     ####
     if(fmtFiles AND NOT ${CMAKE_PROJECT_NAME} STREQUAL externpro)
+      # make paths relative to CMAKE_SOURCE_DIR
+      xpListRemoveFromAll(fmtFiles ${CMAKE_SOURCE_DIR} . ${fmtFiles})
+      list(LENGTH fmtFiles lenFmtFiles)
       xpGetPkgVar(clangformat EXE)
       add_custom_command(OUTPUT format_cmake
         COMMAND $<TARGET_FILE:clang-format> -style=file -i ${fmtFiles}
         WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        COMMENT "Running clang-format..."
+        COMMENT "Running clang-format on ${lenFmtFiles} files..."
         )
       string(REPLACE ";" "\n" fmtFiles "${fmtFiles}")
       file(WRITE ${CMAKE_BINARY_DIR}/formatfiles.txt ${fmtFiles}\n)


Reverted FreeCadMacros.cmake to what is in master.

--- cMake/FreeCadMacros.cmake
+++ cMake/FreeCadMacros.cmake
@@ -237,8 +237,10 @@
         # FreeCADBase, SMDS, Driver, MEFISTO2 and area-native libs don't depend on parts from CMAKE_INSTALL_LIBDIR
         if(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2|area-native)$")
             if(${ARGC} STREQUAL 4)
-                set_property(TARGET ${ProjectName} APPEND PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}${ARGV3})
-            else(${ARGC} STREQUAL 4)
+                set_property(TARGET ${ProjectName} APPEND PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${ARGV3})
+            elseif(NOT IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
+                set_property(TARGET ${ProjectName} APPEND PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
+            else()
                 set_property(TARGET ${ProjectName} APPEND PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_LIBDIR})
             endif()
         endif()


ENH: Improved logic

ENH: Improved logic

--- CMake/RequiresGitLfs.cmake
+++ CMake/RequiresGitLfs.cmake
@@ -1,7 +1,7 @@
 macro(Requires_GitLfs example)
   set(GIT_LFS)
   file(READ "${WikiExamples_SOURCE_DIR}/src/Testing/Data/GitLfsInstalled" data)
-  if (data STREQUAL "GitLfsNotInstalled")
+  if (NOT data STREQUAL "GitLfsInstalled")
     message(STATUS "VTKWikiExamples: ${example} requires git lfs to be installed and will not be built")
     string(REGEX REPLACE "[^;]*${example}.cxx"
            "" ALL_FILES "${ALL_FILES}")


Prevent Boost from building anything when we need only header files

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -133,7 +133,9 @@
   if(MITK_USE_Boost_LIBRARIES)
     set(_boost_build_cmd BUILD_COMMAND ${_build_cmd} install ${_macos_change_install_name_cmd} ${_windows_move_libs_cmd})
   else()
-    set(_boost_build_cmd BUILD_COMMAND ${_build_cmd} install)
+    set(_boost_build_cmd BUILD_COMMAND
+      ${CMAKE_COMMAND} -E echo "copying Boost headers..."
+      COMMAND ${CMAKE_COMMAND} -E copy_directory "<SOURCE_DIR>/boost" "<INSTALL_DIR>/${_boost_install_include_dir}")
   endif()

   ExternalProject_Add(${proj}-download


From Raymond de Vries, added support for latest FBX SDK

--- CMakeModules/FindFBX.cmake
+++ CMakeModules/FindFBX.cmake
@@ -44,7 +44,7 @@
 #try to use 2015.1 or 2014.2 version

 IF(APPLE)
-    SET(FBX_LIBNAME "libfbxsdk")
+    SET(FBX_LIBNAME "fbxsdk")
 ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
     SET(FBX_LIBNAME "fbxsdk")
 ELSE()
@@ -62,6 +62,7 @@
     $ENV{FBX_DIR}
     "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
     "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1"
+    "/Applications/Autodesk/FBX\ SDK/2018.0"
     "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
     "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
     "/Applications/Autodesk/FBX SDK/2017.1"


FindMKL.cmake: fixes for VOTCA build

FindMKL.cmake: fixes for VOTCA build

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -203,6 +203,10 @@
   set(multi_args "")

   cmake_parse_arguments(mkl_args "${options}" "${single_args}" "${multi_args}" ${ARGN})
+
+  if(TARGET MKL::${mkl_args_NAME})
+    return()
+  endif()

   add_library(MKL::${mkl_args_NAME}        SHARED IMPORTED)
   add_library(MKL::${mkl_args_NAME}_STATIC STATIC IMPORTED)
@@ -315,11 +319,13 @@
   if(MKL_ThreadingLibrary_LINK_LIBRARY)
     mark_as_advanced(MKL_${mkl_args_NAME}_LINK_LIBRARY)
   endif()
-  add_library(MKL::ThreadingLibrary SHARED IMPORTED)
-  set_target_properties(MKL::ThreadingLibrary
-    PROPERTIES
-      IMPORTED_LOCATION "${MKL_ThreadingLibrary_LINK_LIBRARY}"
-      INTERFACE_LINK_LIBRARIES OpenMP::OpenMP_CXX)
+  if(NOT TARGET MKL::ThreadingLibrary)
+    add_library(MKL::ThreadingLibrary SHARED IMPORTED)
+    set_target_properties(MKL::ThreadingLibrary
+      PROPERTIES
+        IMPORTED_LOCATION "${MKL_ThreadingLibrary_LINK_LIBRARY}"
+        INTERFACE_LINK_LIBRARIES OpenMP::OpenMP_CXX)
+  endif()
 elseif(MKL_THREAD_LAYER STREQUAL "TBB")
   find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_tbb_thread SEARCH_STATIC)
   find_mkl_library(NAME ThreadingLibrary LIBRARY_NAME tbb)
@@ -350,6 +356,11 @@
 set(MKL_RUNTIME_KERNEL_LIBRARIES "${MKL_RUNTIME_KERNEL_LIBRARIES_TMP}" CACHE STRING
     "MKL kernel libraries targeting different CPU architectures")
 mark_as_advanced(MKL_RUNTIME_KERNEL_LIBRARIES)
+
+# Bypass developer warning that the first argument to find_package_handle_standard_args (MKL_...) does not match
+# the name of the calling package (MKL)
+# https://cmake.org/cmake/help/v3.17/module/FindPackageHandleStandardArgs.html
+set(FPHSA_NAME_MISMATCHED TRUE)

 find_package_handle_standard_args(MKL_Shared
   FAIL_MESSAGE "Could NOT find MKL: Source the compilervars.sh or mklvars.sh scripts included with your installation of MKL. This script searches for the libraries in MKLROOT, LIBRARY_PATHS(Linux), and LIB(Windows) environment variables"
@@ -372,7 +383,7 @@
   mark_as_advanced(M_LIB)
 endif()

-if(MKL_Shared_FOUND)
+if(MKL_Shared_FOUND AND NOT TARGET MKL::Shared)
   add_library(MKL::Shared SHARED IMPORTED)
   if(MKL_THREAD_LAYER STREQUAL "Sequential")
     set_target_properties(MKL::Shared
@@ -397,7 +408,7 @@
   endif()
 endif()

-if(MKL_Static_FOUND)
+if(MKL_Static_FOUND AND NOT TARGET MKL::Static)
   add_library(MKL::Static STATIC IMPORTED)

   if(UNIX AND NOT APPLE)


Disable warnings that whine about boost::optional

--- cmake/EnableExtraCompilerWarnings.cmake
+++ cmake/EnableExtraCompilerWarnings.cmake
@@ -50,6 +50,15 @@
 			set(_flags "${_flags} -Wextra")
 		endif()

+		if(SUPPORTS_WALL_FLAG)
+			# At least GCC includes -Wmaybe-uninitialized in -Wall, which
+			# unneccesarily whines about boost::optional (by it's nature
+			# it's a "maybe" warning - prone to noisy false-positives)
+			check_cxx_compiler_flag(-Wno-maybe-uninitialized SUPPORTS_WNO_MAYBE_UNINITIALIZED_FLAG)
+			if(SUPPORTS_WNO_MAYBE_UNINITIALIZED_FLAG)
+				set(_flags "${_flags} -Wno-maybe-uninitialized")
+			endif()
+		endif()
 	endif()
 endmacro()


Fix cmake -D_FORTIFY_SOURCE=2 detection.

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -26,12 +26,14 @@
             set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
         endif (WITH_STACK_PROTECTOR)

-        string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
-        if (NOT CMAKE_BUILD_TYPE_LOWER MATCHES debug)
-            check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
-            if (WITH_FORTIFY_SOURCE)
-                set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
-            endif (WITH_FORTIFY_SOURCE)
+        if (CMAKE_BUILD_TYPE)
+            string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
+            if (NOT CMAKE_BUILD_TYPE_LOWER MATCHES debug)
+                check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
+                if (WITH_FORTIFY_SOURCE)
+                    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
+                endif (WITH_FORTIFY_SOURCE)
+            endif()
         endif()
     endif (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")