modules: updated FindMagnum.cmake.

modules: updated FindMagnum.cmake.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -38,6 +38,14 @@
 #   importer plugins
 #  MAGNUM_PLUGINS_AUDIOIMPORTER[|_DEBUG|_RELEASE]_DIR - Directory with dynamic
 #   audio importer plugins
+#
+# If Magnum is built for Emscripten, the following variables contain paths to
+# various support files:
+#
+#  MAGNUM_EMSCRIPTENAPPLICATION_JS - Path to the EmscriptenApplication.js file
+#  MAGNUM_WINDOWLESSEMSCRIPTENAPPLICATION_JS - Path to the
+#   WindowlessEmscriptenApplication.js file
+#  MAGNUM_WEBAPPLICATION_CSS    - Path to the WebApplication.css file
 #
 # This command will try to find only the base library, not the optional
 # components. The base library depends on Corrade and OpenGL libraries (or
@@ -639,6 +647,17 @@
                 find_package(SDL2)
                 set_property(TARGET Magnum::${_component} APPEND PROPERTY
                     INTERFACE_LINK_LIBRARIES SDL2::SDL2)
+                # Use the Foundation framework on Apple to query the DPI awareness
+                if(CORRADE_TARGET_APPLE)
+                    find_library(_MAGNUM_APPLE_FOUNDATION_FRAMEWORK_LIBRARY Foundation)
+                    mark_as_advanced(_MAGNUM_APPLE_FOUNDATION_FRAMEWORK_LIBRARY)
+                    set_property(TARGET Magnum::${_component} APPEND PROPERTY
+                        INTERFACE_LINK_LIBRARIES ${_MAGNUM_APPLE_FOUNDATION_FRAMEWORK_LIBRARY})
+                # Needed for opt-in DPI queries
+                elseif(CORRADE_TARGET_UNIX)
+                    set_property(TARGET Magnum::${_component} APPEND PROPERTY
+                        INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
+                endif()

                 # With GLVND (since CMake 3.11) we need to explicitly link to
                 # GLX/EGL because libOpenGL doesn't provide it. For EGL we have
@@ -911,10 +930,28 @@
     endif()
 endforeach()

+# Emscripten-specific files
+if(CORRADE_TARGET_EMSCRIPTEN)
+    find_file(MAGNUM_EMSCRIPTENAPPLICATION_JS EmscriptenApplication.js
+        PATH_SUFFIXES share/magnum)
+    find_file(MAGNUM_WINDOWLESSEMSCRIPTENAPPLICATION_JS WindowlessEmscriptenApplication.js
+        PATH_SUFFIXES share/magnum)
+    find_file(MAGNUM_WEBAPPLICATION_CSS WebApplication.css
+        PATH_SUFFIXES share/magnum)
+    mark_as_advanced(
+        MAGNUM_EMSCRIPTENAPPLICATION_JS
+        MAGNUM_WINDOWLESSEMSCRIPTENAPPLICATION_JS
+        MAGNUM_WEBAPPLICATION_CSS)
+    set(MAGNUM_EXTRAS_NEEDED
+        MAGNUM_EMSCRIPTENAPPLICATION_JS
+        MAGNUM_WINDOWLESSEMSCRIPTENAPPLICATION_JS
+        MAGNUM_WEBAPPLICATION_CSS)
+endif()
+
 # Complete the check with also all components
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Magnum
-    REQUIRED_VARS MAGNUM_INCLUDE_DIR MAGNUM_LIBRARY
+    REQUIRED_VARS MAGNUM_INCLUDE_DIR MAGNUM_LIBRARY ${MAGNUM_EXTRAS_NEEDED}
     HANDLE_COMPONENTS)

 # Create Windowless*Application, *Application and *Context aliases
@@ -1040,6 +1077,7 @@
 set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/audioimporters)
 set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/audioimporters)
 set(MAGNUM_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/Magnum)
+set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/MagnumExternal)
 set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${MAGNUM_INCLUDE_INSTALL_PREFIX}/include/MagnumPlugins)

 # Get base plugin directory from main library location. This is *not* PATH,


Pass -fcolor-diagnostics when it is supported. This makes a difference when
using cmake+ninja, since ninja buffers the compiler output.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -190,6 +190,10 @@
     if( SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG )
       add_llvm_definitions( -Wcovered-switch-default )
     endif()
+    check_cxx_compiler_flag("-Werror -fcolor-diagnostics" SUPPORTS_FCOLOR_DIAGNOSTICS_FLAG)
+    if( SUPPORTS_FCOLOR_DIAGNOSTICS_FLAG )
+      add_llvm_definitions( -fcolor-diagnostics )
+    endif()
   endif (LLVM_ENABLE_WARNINGS)
   if (LLVM_ENABLE_WERROR)
     add_llvm_definitions( -Werror )


[cmake] Prevent LLVMgold.so from being unloaded on Linux

Extend the fix from D40459 to also apply to modules such as the LLVM
gold plugin. This is needed because current binutils master (and future
binutils 2.32) calls dlclose() on bfd plugins as part of a recent fix
for https://sourceware.org/bugzilla/show_bug.cgi?id=23460.

Patch by Evangelos Foutras!

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -149,6 +149,7 @@
 # is unloaded.
 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,nodelete")
+  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,nodelete")
 endif()


Check variables for flush

Check variables for flush

Check change of HUNTER_CONFIGURATION_TYPES and HUNTER_BUILD_SHARED_LIBS
variables before Toolchain-ID calculation because it can be skipped
by HUNTER_NO_TOOLCHAIN_ID_RECALCULATION.

--- cmake/modules/hunter_initialize.cmake
+++ cmake/modules/hunter_initialize.cmake
@@ -73,6 +73,34 @@
       set(_flush TRUE)
     endif()

+    string(
+        COMPARE
+        EQUAL
+        "${HUNTER_CACHED_CONFIGURATION_TYPES}"
+        "${HUNTER_CONFIGURATION_TYPES}"
+        _is_ok
+    )
+    if(NOT _is_ok)
+      hunter_status_debug("HUNTER_CONFIGURATION_TYPES changed:")
+      hunter_status_debug("  ${HUNTER_CACHED_CONFIGURATION_TYPES}")
+      hunter_status_debug("  ${HUNTER_CONFIGURATION_TYPES}")
+      set(_flush TRUE)
+    endif()
+
+    string(
+        COMPARE
+        EQUAL
+        "${HUNTER_CACHED_BUILD_SHARED_LIBS}"
+        "${HUNTER_BUILD_SHARED_LIBS}"
+        _is_ok
+    )
+    if(NOT _is_ok)
+      hunter_status_debug("HUNTER_BUILD_SHARED_LIBS changed:")
+      hunter_status_debug("  ${HUNTER_CACHED_BUILD_SHARED_LIBS}")
+      hunter_status_debug("  ${HUNTER_BUILD_SHARED_LIBS}")
+      set(_flush TRUE)
+    endif()
+
     if(_flush)
       set(HUNTER_CACHED_ROOT "${HUNTER_GATE_ROOT}" CACHE INTERNAL "")
       set(HUNTER_VERSION "${HUNTER_GATE_VERSION}" CACHE INTERNAL "")


fixed compilation with clang due to uninteresting -Wignored-attributes Tokutek/mongo#869

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -88,6 +88,7 @@
   -Wno-error=missing-format-attribute
   -Wno-error=address-of-array-temporary
   -Wno-error=tautological-constant-out-of-range-compare
+  -Wno-ignored-attributes
   -fno-rtti
   -fno-exceptions
   )


support multiple joysticks

support multiple joysticks

--- cmake/FileList.cmake
+++ cmake/FileList.cmake
@@ -112,6 +112,7 @@
 src/util/language-string.cpp
 src/util/thread.cpp
 src/util/input/joystick.cpp
+src/util/input/allegro5/joystick.cpp
 src/util/input/allegro/allegro-joystick.cpp
 src/util/input/sdl/joystick.cpp
 src/util/input/psp/joystick.cpp


set cmake CMP0553 policy to satisfy warning introduced in version 3

--- cmake/FindGDAL.cmake
+++ cmake/FindGDAL.cmake
@@ -13,8 +13,8 @@
 #
 # GDAL_INCLUDE_DIR      = where to find headers

-
-INCLUDE (@CMAKE_SOURCE_DIR@/cmake/MacPlistMacros.cmake)
+cmake_policy(SET CMP0053 NEW)
+INCLUDE (@CMAKE_SOURCE_DIR@/../cmake/MacPlistMacros.cmake)

 IF(WIN32)


get GLEW version from glew.h and display version info, if found [skip ci]

--- cmake/FindGLEW.cmake
+++ cmake/FindGLEW.cmake
@@ -9,27 +9,22 @@

 # glew32d glew32sd
 find_library(GLEW_LIBRARY
-    NAMES GLEW glew32 glew32s
-    PATHS ${GLEW_INCLUDE_DIR}/../lib lib
+  NAMES GLEW glew32 glew32s
+  PATHS ${GLEW_INCLUDE_DIR}/../lib lib
 )

-if(GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
-    set(GLEW_FOUND TRUE)
-endif()
-
-if(GLEW_FOUND)
-    if(NOT GLEW_FIND_QUIETLY)
-        message(STATUS "  GLEW:  ${GLEW_LIBRARY}")
-        message(STATUS "  GLEW INCLUDE:  ${GLEW_INCLUDE_DIR}")
-    endif()
-else(GLEW_FOUND)
-    if(GLEW_FIND_REQUIRED)
-        message(FATAL_ERROR "Could not find GLEW.")
-    endif()
+# get GLEW version from glew.h
+if(GLEW_INCLUDE_DIR AND EXISTS "${GLEW_INCLUDE_DIR}/GL/glew.h")
+  file(STRINGS "${GLEW_INCLUDE_DIR}/GL/glew.h" GLEW_VERSION_LINE REGEX "^VERSION [0-9].[0-9].[0-9]+$")
+  string(REPLACE "VERSION " "" GLEW_VERSION "${GLEW_VERSION_LINE}")
+  unset(GLEW_VERSION_LINE)
 endif()

 include(FindPackageHandleStandardArgs)

-find_package_handle_standard_args(GLEW REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY)
+find_package_handle_standard_args(GLEW
+  REQUIRED_VARS GLEW_LIBRARY GLEW_INCLUDE_DIR
+  VERSION_VAR GLEW_VERSION
+)

 mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY)


Fixes handling of libm in FindOTF2.cmake

--- cmake/FindOTF2.cmake
+++ cmake/FindOTF2.cmake
@@ -77,6 +77,8 @@
         IMPORTED_LINK_INTERFACE_LANGUAGES "C"
         IMPORTED_LOCATION "${OTF2_LIBRARIES}"
         INTERFACE_INCLUDE_DIRECTORIES "${OTF2_INCLUDE_DIRS}"
+        # Note for MacOS: libm is a symlink to libSystem, so there is no harm to link it anyways, but it isn't required
+        INTERFACE_LINK_LIBRARIES "m"
     )

 else()


Also set ROOT_ETC_DIR for convenience.

Also set ROOT_ETC_DIR for convenience.

--- cmake/FindROOT.cmake
+++ cmake/FindROOT.cmake
@@ -7,6 +7,7 @@
 # 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
@@ -32,6 +33,12 @@
     OUTPUT_VARIABLE ROOT_INCLUDE_DIR
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 set(ROOT_INCLUDE_DIRS ${ROOT_INCLUDE_DIR})
+
+execute_process(
+    COMMAND ${ROOT_CONFIG_EXECUTABLE} --etcdir
+    OUTPUT_VARIABLE ROOT_ETC_DIR
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(ROOT_ETC_DIRS ${ROOT_ETC_DIR})

 execute_process(
     COMMAND ${ROOT_CONFIG_EXECUTABLE} --libdir


XFAILs are meant to fail (and therefore pass!)

--- cmake/P4CUtils.cmake
+++ cmake/P4CUtils.cmake
@@ -92,7 +92,7 @@
     set (${tag}_timeout 300)
   endif()
   if (${isXfail})
-    set_tests_properties(${__testname} PROPERTIES LABELS "${tag};XFAIL" TIMEOUT ${${tag}_timeout})
+    set_tests_properties(${__testname} PROPERTIES LABELS "${tag};XFAIL" TIMEOUT ${${tag}_timeout} WILL_FAIL 1)
   else()
     set_tests_properties(${__testname} PROPERTIES LABELS ${tag} TIMEOUT ${${tag}_timeout})
   endif()


in RESTRICT_SYMBOL_EXPORTS,handle cases where COMPILE_FLAGS are not set (COMPILE_FLAGS-NOTFOUND)

--- cmake/libutils.cmake
+++ cmake/libutils.cmake
@@ -260,6 +260,10 @@
 MACRO(RESTRICT_SYMBOL_EXPORTS target)
   IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
     GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS)
+	IF(NOT COMPILE_FLAGS)
+	  # Avoid COMPILE_FLAGS-NOTFOUND
+	  SET(COMPILE_FLAGS)
+	ENDIF()
     SET_TARGET_PROPERTIES(${target} PROPERTIES
        COMPILE_FLAGS "${COMPILE_FLAGS} -fvisibility=hidden")
   ENDIF()


Android does not need -lrt

Android does not need -lrt

--- cmake/tools/rt.cmake
+++ cmake/tools/rt.cmake
@@ -31,7 +31,7 @@
 # message("CMAKE_SYSTEM_LIBRARY_PATH: ${CMAKE_SYSTEM_LIBRARY_PATH}")
 # message("CMAKE_VERSION=${CMAKE_VERSION}")

-if(NOT (APPLE OR WIN32 OR MINGW))
+if(NOT (APPLE OR WIN32 OR MINGW OR ANDROID))
   if (${CMAKE_VERSION} VERSION_LESS 2.8.4)
     # cmake later than 2.8.0 appears to have a better find_library
     # that knows about the ABI of the compiler.  For lucid we just


improved error message when catkin is not found in toplevel.cmake (fix #252)

--- cmake/toplevel.cmake
+++ cmake/toplevel.cmake
@@ -37,11 +37,15 @@

   # search for catkin in all workspaces
   set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
-  find_package(catkin REQUIRED
+  find_package(catkin QUIET
     NO_POLICY_SCOPE
     PATHS ${catkin_search_path}
     NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   unset(CATKIN_TOPLEVEL_FIND_PACKAGE)
+
+  if(NOT catkin_FOUND)
+    message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.")
+  endif()
 endif()

 catkin_workspace()


Split off 6.2.0

Split off 6.2.0

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

--- version.cmake
+++ version.cmake
@@ -3,7 +3,7 @@
 ###
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 6 )
-set ( HPCC_MINOR 1 )
+set ( HPCC_MINOR 3 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "trunk" )
 set ( HPCC_SEQUENCE 0 )


Nagios Monitoring 7.0.0-1 Gold

Nagios Monitoring 7.0.0-1 Gold

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

--- version.cmake
+++ version.cmake
@@ -5,6 +5,6 @@
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 0 )
 set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 5 )
+set ( HPCC_MATURITY "release" )
+set ( HPCC_SEQUENCE 1 )
 ###


[ioninja] release 3.4.4

[ioninja] release 3.4.4

jancy release 1.5.6

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

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


Split off 7.12.92

Split off 7.12.92

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

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


Split off candidate-7.8.x

Split off candidate-7.8.x

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

--- version.cmake
+++ version.cmake
@@ -4,7 +4,7 @@
 set ( HPCC_NAME "Nagios Monitoring" )
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
-set ( HPCC_MINOR 7 )
+set ( HPCC_MINOR 9 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "trunk" )
 set ( HPCC_SEQUENCE 0 )


Add a harmless macro PETSC_WITH_COMPLEX.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@31653 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/modules/FindPETSC.cmake
+++ deal.II/cmake/modules/FindPETSC.cmake
@@ -29,6 +29,7 @@
 #     PETSC_VERSION_PATCH
 #     PETSC_WITH_MPIUNI
 #     PETSC_WITH_64BIT_INDICES
+#     PETSC_WITH_COMPLEX
 #

 INCLUDE(FindPackageHandleStandardArgs)
@@ -207,6 +208,17 @@
     SET(PETSC_WITH_64BIT_INDICES TRUE)
   ENDIF()

+  #
+  # Is petsc compiled with support for COMPLEX numbers?
+  #
+  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_COMPLEX_STRING
+    REGEX "#define.*PETSC_USE_COMPLEX 1")
+  IF("${PETSC_COMPLEX_STRING}" STREQUAL "")
+    SET(PETSC_WITH_COMPLEX FALSE)
+  ELSE()
+    SET(PETSC_WITH_COMPLEX TRUE)
+  ENDIF()
+
   FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING
     REGEX "#define.*PETSC_VERSION_MAJOR")
   STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1"


some minor cleanups.

some minor cleanups.

--- Artifactory.cmake
+++ Artifactory.cmake
@@ -29,9 +29,9 @@
     if(NOT ARTIFACTORY_CLI)
         message(FATAL_ERROR
             "Artifactory integration requires the `art` Artifactory "
-            "commandline client. It is available at: "
+            "command-line client. It is available at: "
             "https://github.com/JFrogDev/artifactory-cli-go. If it is "
-            "available but not present in PATH, please use define the "
+            "available but not present in PATH, please define the "
             "ARTIFACTORY_CLI variable to the location of the program.")
     endif()


lock down vtk until linux bug is fixed

lock down vtk until linux bug is fixed

--- superbuild/versions.cmake
+++ superbuild/versions.cmake
@@ -87,7 +87,7 @@

 add_revision(vtk
   GIT_REPOSITORY git://vtk.org/VTK.git
-  GIT_TAG origin/master)
+  GIT_TAG 423001ec771bc5fd8232a16b5d696010729b3a22)

 if (UNIX)
   add_revision(mpi


refs #4871 don't run 6.0.0 upgrade tests during normal dev time

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -97,7 +97,7 @@
 if(NOT @RUN_LONG_TESTS@)
   foreach(test ${stress_tests})
     if (NOT ${test} MATCHES test_stress_openclose)
-      foreach(oldver 4.2.0 5.0.8 5.2.7)
+      foreach(oldver 4.2.0 5.0.8 5.2.7 6.0.0)
         foreach(p_or_s pristine stressed)
           if (NOT (${test} MATCHES test_stress4 AND ${p_or_s} MATCHES stressed))
             foreach(size 2000)


Fix package name generation

Fix package name generation

--- CommonCPack.cmake
+++ CommonCPack.cmake
@@ -12,12 +12,12 @@
   set(CPACK_PACKAGE_NAME ${CPACK_PROJECT_NAME})
 endif()

-if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND
-    EXISTS ${CMAKE_SOURCE_DIR}/CMake/${CMAKE_PROJECT_NAME}.in.spec)
-
+if(EXISTS ${CMAKE_SOURCE_DIR}/CMake/${CMAKE_PROJECT_NAME}.in.spec)
   configure_file(${CMAKE_SOURCE_DIR}/CMake/${CMAKE_PROJECT_NAME}.in.spec
     ${CMAKE_SOURCE_DIR}/CMake/${CMAKE_PROJECT_NAME}.spec @ONLY)
+endif()

+if(CMAKE_SYSTEM_NAME MATCHES "Linux")
   string(TOLOWER ${CPACK_PACKAGE_NAME} LOWER_PACKAGE_NAME_PREFIX)
   set(CPACK_PACKAGE_NAME "${LOWER_PACKAGE_NAME_PREFIX}${VERSION_ABI}")
   set(OLD_PACKAGES)


Fix doxygen API copy

Fix doxygen API copy

--- DoxygenRule.cmake
+++ DoxygenRule.cmake
@@ -20,8 +20,8 @@
 add_dependencies(doxygen doxygen_install)

 add_custom_target(github
-  ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/../eyescale/${PROJECT_NAME}-${VERSION}
-  ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/doc/html ${CMAKE_SOURCE_DIR}/../eyescale/${PROJECT_NAME}-${VERSION}
+  COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/../eyescale/${PROJECT_NAME}-${VERSION}
+  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/doc/html ${CMAKE_SOURCE_DIR}/../eyescale/${PROJECT_NAME}-${VERSION}
   COMMENT "Copying API documentation to eyescale.github.com/${PROJECT_NAME}-${VERSION}"
   VERBATIM)
 add_dependencies(github doxygen)


start 3.6.0

start 3.6.0

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -34,7 +34,7 @@
 cmake_policy(POP)

 set (Mathematica_CMAKE_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-set (Mathematica_CMAKE_MODULE_VERSION "3.5.1")
+set (Mathematica_CMAKE_MODULE_VERSION "3.6.0")

 # activate select policies
 if (POLICY CMP0025)


Added support for ndk-r9b and ndk-r9c.
Bugfix: Detecting AndroidDependencies using direct paths.

--HG--
branch : android-ndk-r9-support


bump version 0.1.2

bump version 0.1.2

--- src/CPackConfig.cmake
+++ src/CPackConfig.cmake
@@ -4,7 +4,7 @@

 set(CPACK_PACKAGE_VERSION_MAJOR "0")
 set(CPACK_PACKAGE_VERSION_MINOR "1")
-set(CPACK_PACKAGE_VERSION_PATCH "0")
+set(CPACK_PACKAGE_VERSION_PATCH "2")
 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libtmx")


Add cmake option for shallow clones

Add cmake option for shallow clones

--- GitExternal.cmake
+++ GitExternal.cmake
@@ -34,6 +34,7 @@
 #    This is a global option which has the same effect as the VERBOSE option,
 #    with the difference that output information will be produced for all
 #    external repos when set.
+#  GIT_EXTERNAL_SHALLOW: See SHALLOW option above.
 #
 # CMake or environment variables:
 #  GITHUB_USER If set, a remote called 'user' is set up for github
@@ -48,6 +49,7 @@

 include(CMakeParseArguments)
 option(GIT_EXTERNAL_VERBOSE "Print git commands as they are executed" OFF)
+option(GIT_EXTERNAL_SHALLOW "Use shallow git clones" OFF)

 if(NOT GITHUB_USER AND DEFINED ENV{GITHUB_USER})
   set(GITHUB_USER $ENV{GITHUB_USER} CACHE STRING
@@ -93,7 +95,8 @@
   if(NOT EXISTS "${DIR}")
     # clone
     set(_clone_options --recursive)
-    if(GIT_EXTERNAL_LOCAL_SHALLOW)
+    if(GIT_EXTERNAL_LOCAL_SHALLOW OR GIT_EXTERNAL_SHALLOW)
+      set(GIT_EXTERNAL_LOCAL_SHALLOW ON)
       list(APPEND _clone_options --depth 1 --branch ${TAG})
     endif()
     JOIN("${_clone_options}" " " _msg_text)


* check: fix tests option comment;

* check: fix tests option comment;

--- check.cmake
+++ check.cmake
@@ -80,7 +80,7 @@
 pkg_check_modules(BASH_COMPL bash-completion)

 # check tests option
-option(TESTS_ENABLE "Disable build tests" OFF)
+option(TESTS_ENABLE "Enable build tests" OFF)
 if (${TESTS_ENABLE})
 	enable_testing()
 endif()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


updated SIRF tag to v0.9.2

updated SIRF tag to v0.9.2

--- version_config.cmake
+++ version_config.cmake
@@ -86,7 +86,7 @@
   set(DEFAULT_ISMRMRD_TAG master)

 else()
-  set(DEFAULT_SIRF_TAG v0.9.1)
+  set(DEFAULT_SIRF_TAG v0.9.2)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )


COMP:  DTIPrep builds against ITKv4 now.

COMP:  DTIPrep builds against ITKv4 now.

Remove unnecessary (and fragile logic) regarding ITKv3
build options.

--- DTIPrepTools.cmake
+++ DTIPrepTools.cmake
@@ -28,16 +28,7 @@
   )

 #-----------------------------------------------------------------------------
-set(expected_ITK_VERSION_MAJOR ${ITK_VERSION_MAJOR})
-find_package(ITK NO_MODULE REQUIRED)
-if(${ITK_VERSION_MAJOR} VERSION_LESS ${expected_ITK_VERSION_MAJOR})
-  # Note: Since ITKv3 doesn't include a ITKConfigVersion.cmake file, let's check the version
-  #       explicitly instead of passing the version as an argument to find_package() command.
-  message(FATAL_ERROR "Could not find a configuration file for package \"ITK\" that is compatible "
-                      "with requested version \"${expected_ITK_VERSION_MAJOR}\".\n"
-                      "The following configuration files were considered but not accepted:\n"
-                      "  ${ITK_CONFIG}, version: ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}\n")
-endif()
+find_package(ITK 4 NO_MODULE REQUIRED)

 include(${ITK_USE_FILE})


CSharp: Fix broken unix builds.

CSharp: Fix broken unix builds.


Style fixes in CPackConfig file

Style fixes in CPackConfig file

--- CMakeModules/CPackConfig.cmake
+++ CMakeModules/CPackConfig.cmake
@@ -226,7 +226,7 @@
   INSTALL_TYPES All Development)
 cpack_add_component(documentation
   DISPLAY_NAME "Documentation"
-  DESCRIPTION "Doxygen documentation"
+  DESCRIPTION "ArrayFire html documentation"
   INSTALL_TYPES All Extra)
 cpack_add_component(examples
   DISPLAY_NAME "ArrayFire Examples"
@@ -297,7 +297,7 @@
   "BSD3" ${bsd3_lic_path} "Intel MKL" ${issl_lic_path}
 )
 if (AF_INSTALL_FORGE_DEV)
-    cpack_ifw_configure_component(forge)
+  cpack_ifw_configure_component(forge)
 endif ()

 ##


build: quotes around parameter

build: quotes around parameter

--- CMakeModules/FindLibXml2.cmake
+++ CMakeModules/FindLibXml2.cmake
@@ -81,7 +81,7 @@
    /opt
    )

-IF(${LIBXML2_LIBRARIES} MATCHES "framework")
+IF("${LIBXML2_LIBRARIES}" MATCHES "framework")
   SET( LIBXML2_LIBRARIES "${LIBXML2_LIBRARIES}" CACHE STRING "LibXml2 framework")
 ENDIF()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


CMake: make the MPI compatibility check less strict

When configuring with CMake 3.10 and providing compiler wrappers,
  CC=mpicc CXX=mpicxx cmake ...
the new FindMPI.cmake library does not export MPI_CXX_LIBRARIES and
MPI_C_LIBRARIES any more. So, make the check less strict.

--- cmake/macros/macro_check_mpi_interface.cmake
+++ cmake/macros/macro_check_mpi_interface.cmake
@@ -27,7 +27,7 @@
     SET(_nope FALSE)

     FOREACH(_library ${${_feature}_LIBRARIES})
-      IF( _library MATCHES "/libmpi(|_cxx)\\.(a|so)[^/]*$")
+      IF( _library MATCHES "/libmpi\\.(a|so)[^/]*$")

         GET_FILENAME_COMPONENT(_file1 ${_library} REALPATH)


cmake: Disable gcrypt ECC.

cmake: Disable gcrypt ECC.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -148,8 +148,8 @@
 if (GCRYPT_FOUND)
     set(HAVE_LIBGCRYPT 1)
     if (GCRYPT_VERSION VERSION_GREATER "1.4.6")
-        set(HAVE_GCRYPT_ECC 1)
-        set(HAVE_ECC 1)
+        #set(HAVE_GCRYPT_ECC 1)
+        #set(HAVE_ECC 1)
     endif (GCRYPT_VERSION VERSION_GREATER "1.4.6")
 endif (GCRYPT_FOUND)


CMake: Use -Og for debug builds with gcc if available

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@29842 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_compiler_flags_gnu.cmake
+++ deal.II/cmake/setup_compiler_flags_gnu.cmake
@@ -126,7 +126,13 @@
   LIST(APPEND DEAL_II_DEFINITIONS_DEBUG "DEBUG")
   LIST(APPEND DEAL_II_USER_DEFINITIONS_DEBUG "DEBUG")

-  ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0")
+  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-Og")
+  #
+  # If -Og is not available, fall back to -O0:
+  #
+  IF(NOT DEAL_II_HAVE_FLAG_O0)
+    ADD_FLAGS(DEAL_II_CXX_FLAGS_DEBUG "-O0")
+  ENDIF()

   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS_DEBUG "-ggdb")
   ENABLE_IF_SUPPORTED(DEAL_II_SHARED_LINKER_FLAGS_DEBUG "-ggdb")


include cryptopp if abi is enabled

include cryptopp if abi is enabled

--- cmake/lib.cmake
+++ cmake/lib.cmake
@@ -47,6 +47,7 @@

 if(ABI_ENALED)
     add_dependencies(ethrpc abi)
+    include_directories(${CRYPTOPP_INCLUDE_DIR})

     if (WIN32 AND NOT MINGW)
 #        set_property (TARGET ethrpc APPEND PROPERTY STATIC_LIBRARY_FLAGS $<TARGET_OBJECTS:abi>)


Simplify dput target names

Simplify dput target names

--- UploadPPA.cmake
+++ UploadPPA.cmake
@@ -206,10 +206,10 @@

   ##############################################################################
   # dput ppa:your-lp-id/ppa <source.changes>
-  add_custom_target(dput_${PROJECT_NAME}_${UBUNTU_NAME}
+  add_custom_target(dput_${UBUNTU_NAME}
     ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES}
     DEPENDS ${DEBIAN_BASE_DIR}/${DEB_SOURCE_CHANGES}
     WORKING_DIRECTORY ${DEBIAN_BASE_DIR}
     )
-  set(DPUT_${PROJECT_NAME}_TARGETS ${DPUT_${PROJECT_NAME}_TARGETS} dput_${PROJECT_NAME}_${UBUNTU_NAME} PARENT_SCOPE)
+  set(DPUT_TARGETS ${DPUT_TARGETS} dput_${UBUNTU_NAME} PARENT_SCOPE)
 endfunction()


sugar_install_library support multiple targets

--- cmake/core/sugar_install_library.cmake
+++ cmake/core/sugar_install_library.cmake
@@ -12,9 +12,18 @@
 include(sugar_test_target_exists)

 function(sugar_install_library)
-  set(one_value_args TARGETS DESTINATION)
+  string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" is_ios)
+  if(NOT is_ios)
+    # If target is not iOS use regular cmake install
+    sugar_status_debug("Use cmake install: ${ARGV}")
+    install(${ARGV})
+    return()
+  endif()
+
+  sugar_status_debug("Use ios-workaround install: ${ARGV}")
+
   CMAKE_PARSE_ARGUMENTS(
-      lib_install "" "${one_value_args}" "" ${ARGV}
+      lib_install "" "DESTINATION" "TARGETS" ${ARGV}
   )

   if(lib_install_UNPARSED_ARGUMENTS)
@@ -23,25 +32,14 @@

   if(NOT lib_install_TARGETS)
     sugar_fatal_error("TARGETS is mandatory parameter")
-  else()
-    sugar_test_target_exists(${lib_install_TARGETS})
   endif()

   if(NOT lib_install_DESTINATION)
     sugar_fatal_error("DESTINATION is mandatory parameter")
   endif()

-  string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" is_ios)
-
-  # If target is not iOS use regular cmake install
-  if(NOT is_ios)
-    sugar_status_debug("Use cmake install: ${lib_install_TARGETS}")
-    install(
-        TARGETS ${lib_install_TARGETS} DESTINATION ${lib_install_DESTINATION}
-    )
-    return()
-  endif()
-
-  sugar_status_debug("Use ios-workaround install: ${lib_install_TARGETS}")
-  sugar_install_ios_library(${lib_install_TARGETS} ${lib_install_DESTINATION})
+  foreach(lib ${lib_install_TARGETS})
+    sugar_test_target_exists(${lib})
+    sugar_install_ios_library(${lib} ${lib_install_DESTINATION})
+  endforeach()
 endfunction()


[axl] release 6.0.1

[axl] release 6.0.1

--- version.cmake
+++ version.cmake
@@ -11,7 +11,7 @@

 set (AXL_VERSION_MAJOR     6)
 set (AXL_VERSION_MINOR     0)
-set (AXL_VERSION_REVISION  0)
+set (AXL_VERSION_REVISION  1)
 set (AXL_VERSION_TAG)

 set (AXL_VERSION_FULL      "${AXL_VERSION_MAJOR}.${AXL_VERSION_MINOR}.${AXL_VERSION_REVISION}")


Split off 7.8.88

Split off 7.8.88

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

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


compressible: pick solver.inp to match the enabled solver

ctest currently only supports running the compressible tests under one solver, not both

--- phSolver/compressible/test/testing.cmake
+++ phSolver/compressible/test/testing.cmake
@@ -14,7 +14,14 @@
 endmacro(c_serial_test)

 set(CDIR ${CASES}/compressible)
+
 c_serial_test(inpCfg cp ${PHASTA_SOURCE_DIR}/phSolver/common/input.config ${CDIR})
+
+if(PHASTA_USE_PETSC)
+  c_serial_test(solverInp ln -snf ${CDIR}/solver.inp.petsc ${CDIR}/solver.inp)
+else()
+  c_serial_test(solverInp ln -snf ${CDIR}/solver.inp.native ${CDIR}/solver.inp)
+endif()

 c_serial_test(linkProcsDir-sync
   ln -snf ${CDIR}/2-procs_case-SyncIO-1 ${CDIR}/2-procs_case)


[Conf] More robust way to derive Boost.Python component

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -70,6 +70,8 @@
 #  * INSTALL_INCLUDE_DIR  - Installation directory for the header files
 #  * INSTALL_DATA_DIR     - Installation directory for the data files
 #  * INSTALL_SAMPLE_DIR   - Installation directory for the (CSV) sample files
+#  * NEED_PYTHON          - Whether Python libraries are needed
+#                           That paremeter is derived from the required libraries
 #  * RUN_GCOV             - Whether or not to perform code coverage
 #
 macro (set_project_options _build_doc _enable_tests _run_gcov)
@@ -106,6 +108,7 @@
   set (CSS_ALL_TARGETS)
   set (IMG_ALL_TARGETS)
   set (MAN_ALL_TARGETS)
+  set (NEED_PYTHON OFF)

   # Set the library installation directory (either 32 or 64 bits)
   set (LIBDIR "lib${LIB_SUFFIX}" CACHE PATH
@@ -335,6 +338,7 @@
     endif (${_arg_lower} STREQUAL "lcov")

     if (${_arg_lower} STREQUAL "python")
+      set (NEED_PYTHON ON)
       get_python (${_arg_version})
     endif (${_arg_lower} STREQUAL "python")

@@ -616,19 +620,37 @@
   #         On some platform/Boost version combinations, the Python version
   #         may be just the major version (2 or 3 as of 2020) or the major
   #         and minor versions (e.g., 27, 28, 34, 36, 37, 38, 39 as of 2020)
-  set (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
-  set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
+  # Note 3: Boot.Python has is reuired only for Python extensions. It should
+  #         not be linked with other regular (non-Python) libraries/binaries,
+  #         as it pulls with it symbols from the Python interpreter, which are
+  #         available only when launched from a Python interpreter.
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
+  # Boost.Python - Depending on the platforms, the component name
+  # differs. We try all of them, and the find_package() will retrieve
+  # just one
+  if (NEED_PYTHON)
+    set (python_cpt_name0 "python")
+    #
+    if (Python3_VERSION_MAJOR)
+      set (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
+    endif (Python3_VERSION_MAJOR)
+    #
+    if (Python3_VERSION_MINOR)
+      set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
+    endif (Python3_VERSION_MINOR)
+  endif (NEED_PYTHON)

   # Boost components for (non-Python) libraries
   set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
     date_time random iostreams serialization filesystem system locale regex)

   # Boost components for Python extensions
-  set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT
-	${python_cpt_name1} ${python_cpt_name2})
+  if (NEED_PYTHON)
+    set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT
+      ${python_cpt_name0} ${python_cpt_name1} ${python_cpt_name2})
+  endif (NEED_PYTHON)

   # Boost components for main (non-test) binaries
   set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
@@ -655,54 +677,61 @@
   find_package (BoostWrapper ${_required_version} REQUIRED)

   if (Boost_FOUND)
-    # Boost.Python library
-	if (${Boost_PYTHON3_FOUND})
-      message (STATUS "  + Boost_PYTHON3_FOUND: ${Boost_PYTHON3_FOUND}")
-	endif (${Boost_PYTHON3_FOUND})
-	#
-	if (${Boost_PYTHON38_FOUND})
-      message (STATUS "  + Boost_PYTHON38_FOUND: ${Boost_PYTHON38_FOUND}")
-	endif (${Boost_PYTHON38_FOUND})
-	#
-	if (${Boost_PYTHON_VERSION})
+
+    if (NEED_PYTHON)
+      # Boost has a single Python library, but its name depends on the
+      # distribution, it can be libboost_python3 or libboost_python3x
+      if (Boost_PYTHON_LIBRARY)
+	set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name0})
+	if (Python3_VERSION_MAJOR)
+	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name1})
+	endif (Python3_VERSION_MAJOR)
+	if (Python3_VERSION_MINOR)
+	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name2})
+	endif (Python3_VERSION_MINOR)
+      endif (Boost_PYTHON_LIBRARY)
+
+      #
+      if (Boost_PYTHON${Python3_VERSION_MAJOR}_LIBRARY)
+	set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name1})
+	list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name0})
+	if (Python3_VERSION_MINOR)
+	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name2})
+	endif (Python3_VERSION_MINOR)
+      endif (Boost_PYTHON${Python3_VERSION_MAJOR}_LIBRARY)
+
+      #
+      if (Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_LIBRARY)
+	set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name2})
+	list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name0})
+	if (Python3_VERSION_MAJOR)
+	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name1})
+	endif (Python3_VERSION_MAJOR)
+      endif (Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_LIBRARY)
+
+      # Reporting
+      message (STATUS "  + Retained Boost Python component: ${BOOST_REQUIRED_COMPONENTS_FOR_PYEXT}")
+
+      # Derive the Boost.Python component name (amoung Boost_PYTHON,
+      # Boost_PYTHON3, Boost_PYTHON3X)
+      string (TOUPPER ${BOOST_REQUIRED_COMPONENTS_FOR_PYEXT} _python_cpt)
+
+      # Reporting
+      message (STATUS "  + Boost Python component: Boost_${_python_cpt}")
+
+      # Derive the Python version used by Boost.Python
+      if (${Boost_${_python_cpt}_LIBRARY} MATCHES "python([1-9])\\.?([0-9])?")
+	set (Boost_PYTHON_VERSION "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
+      endif (${Boost_${_python_cpt}_LIBRARY} MATCHES "python([1-9])\\.?([0-9])?")
+
+      # Reporting
       message (STATUS "  + Boost_PYTHON_VERSION: ${Boost_PYTHON_VERSION}")
-	endif (${Boost_PYTHON_VERSION})
-	#
-	if (${Boost_PYTHON_LIBRARY})
-      message (STATUS "  + Boost_PYTHON_LIBRARY: ${Boost_PYTHON_LIBRARY}")
-	endif (${Boost_PYTHON_LIBRARY})
-	#
-	if (${Boost_PYTHON3_LIBRARY})
-      message (STATUS "  + Boost_PYTHON3_LIBRARY: ${Boost_PYTHON3_LIBRARY}")
-	endif (${Boost_PYTHON3_LIBRARY})
-	#
-	if (${Boost_PYTHON36_LIBRARY})
-      message (STATUS "  + Boost_PYTHON36_LIBRARY: ${Boost_PYTHON36_LIBRARY}")
-	endif (${Boost_PYTHON36_LIBRARY})
-	#
-	if (${Boost_PYTHON37_LIBRARY})
-      message (STATUS "  + Boost_PYTHON37_LIBRARY: ${Boost_PYTHON37_LIBRARY}")
-	endif (${Boost_PYTHON37_LIBRARY})
-	#
-	if (${Boost_PYTHON38_LIBRARY})
-      message (STATUS "  + Boost_PYTHON38_LIBRARY: ${Boost_PYTHON38_LIBRARY}")
-	endif (${Boost_PYTHON38_LIBRARY})
-	#
-	if (${Boost_PYTHON39_LIBRARY})
-      message (STATUS "  + Boost_PYTHON39_LIBRARY: ${Boost_PYTHON39_LIBRARY}")
-	endif (${Boost_PYTHON39_LIBRARY})
-
-	# Boost has a single Python library, but its name depends on the
-	# distribution, it can be libboost_python3 or libboost_python3x
-	if (${Boost_PYTHON3_FOUND})
-	  set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name1})
-	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name2})
-	endif (${Boost_PYTHON3_FOUND})
-
-	if (${Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_FOUND})
-	  set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name2})
-	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name1})
-	endif (${Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_FOUND})
+
+      # Boost.Python library
+      if (Boost_${_python_cpt}_LIBRARY)
+	message (STATUS "  + Boost_${_python_cpt}_LIBRARY: ${Boost_${_python_cpt}_LIBRARY}")
+      endif (Boost_${_python_cpt}_LIBRARY)
+    endif (NEED_PYTHON)

     # Update the list of include directories for the project
     include_directories (${Boost_INCLUDE_DIRS})
@@ -715,8 +744,10 @@
       "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")

     # Update the list of Python library dependencies for the project
-    register_boost_lib ("PROJ_DEP_LIBS_FOR_PYEXT"
-      "${BOOST_REQUIRED_COMPONENTS_FOR_PYEXT}")
+    if (NEED_PYTHON)
+      register_boost_lib ("PROJ_DEP_LIBS_FOR_PYEXT"
+	"${BOOST_REQUIRED_COMPONENTS_FOR_PYEXT}")
+    endif (NEED_PYTHON)

     # Update the list of binary dependencies for the project
     register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
@@ -772,22 +803,22 @@

   set (${_proto_srcs})
   foreach (FIL ${ARGN})
-	# Extract the file-path and the extension of the Protobuf specification file
+    # Extract the file-path and the extension of the Protobuf specification file
     get_filename_component (ABS_FIL ${FIL} ABSOLUTE)
     get_filename_component (FIL_WE ${FIL} NAME_WE)

-	# With Python, Protobuf adds "_pb2"
-	set (_proto_gen_src ${FIL_WE}_pb2.py)
-
-	message (STATUS
-	  "Adding ${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src} to Python sources")
+    # With Python, Protobuf adds "_pb2"
+    set (_proto_gen_src ${FIL_WE}_pb2.py)
+
+    message (STATUS
+      "Adding ${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src} to Python sources")

     list (APPEND ${_proto_srcs} "${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src}")

-	# Add a specific command for the Protobuf stub/skeleton generation
+    # Add a specific command for the Protobuf stub/skeleton generation
     add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src}"
       COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE}
-	  --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
+      --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
       DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
       COMMENT "Running Python protocol buffer compiler on ${FIL}, generating ${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src}"
       VERBATIM)
@@ -1852,10 +1883,10 @@
   endif (${_lib_short_name} STREQUAL ${MODULE_NAME})

   ##
-  # Python extension libraries hase some peculiarities
+  # Python extension libraries has some peculiarities
   if ("${_lib_prefix}" STREQUAL "py")
-	message (STATUS "${_lib_short_name} is assumed to be a Python library:")
-	message (STATUS "  -> Following libraries will be weakly linked: ${Python3_LIBRARIES} ${PROJ_DEP_LIBS_FOR_PYEXT}")
+    message (STATUS "${_lib_short_name} is assumed to be a Python library:")
+    message (STATUS "  -> Following libraries will be weakly linked: ${Python3_LIBRARIES} ${PROJ_DEP_LIBS_FOR_PYEXT}")

     # no 'lib' prefix
     set_target_properties (${_lib_target} PROPERTIES PREFIX "")
@@ -1863,34 +1894,34 @@
     # The suffix must be .so (even on MacOS, not .dylib)
     set_target_properties (${_lib_target} PROPERTIES SUFFIX ".so")

-	# Add the dependencies for Python extensions.
-	#
-	# Python extensions (which are also libraries per se) must not be linked
-	# against libpython3.x.so (which includes the interpreter). On Linux, it is
-	# fine not to link against libpython3.x.so, but on OS X, the compiler
-	# fails, unless the -undefined dynamic_lookup option is passed, which is
-	# what target_link_libraries_with_dynamic_lookup() is doing. That function
-	# is specified in the targetLinkLibrariesWithDynamicLookup.cmake file.
-	#
-	# See also:
-	#  https://blog.tim-smith.us/2015/09/python-extension-modules-os-x/
-	#  https://github.com/scikit-build/scikit-build/blob/master/skbuild/resources/cmake/targetLinkLibrariesWithDynamicLookup.cmake
-	target_link_libraries_with_dynamic_lookup (${_lib_target}
-	  ${Python3_LIBRARIES} ${PROJ_DEP_LIBS_FOR_PYEXT})
-	#python_extension_module (${_lib_target})
+    # Add the dependencies for Python extensions.
+    #
+    # Python extensions (which are also libraries per se) must not be linked
+    # against libpython3.x.so (which includes the interpreter). On Linux, it is
+    # fine not to link against libpython3.x.so, but on OS X, the compiler
+    # fails, unless the -undefined dynamic_lookup option is passed, which is
+    # what target_link_libraries_with_dynamic_lookup() is doing. That function
+    # is specified in the targetLinkLibrariesWithDynamicLookup.cmake file.
+    #
+    # See also:
+    #  https://blog.tim-smith.us/2015/09/python-extension-modules-os-x/
+    #  https://github.com/scikit-build/scikit-build/blob/master/skbuild/resources/cmake/targetLinkLibrariesWithDynamicLookup.cmake
+    target_link_libraries_with_dynamic_lookup (${_lib_target}
+      ${Python3_LIBRARIES} ${PROJ_DEP_LIBS_FOR_PYEXT})
+    #python_extension_module (${_lib_target})

   endif ("${_lib_prefix}" STREQUAL "py")

   ##
   # Library name (and soname)
   if (WIN32)
-	# MS Windows
+    # MS Windows
     set_target_properties (${_lib_target} PROPERTIES
       OUTPUT_NAME ${_lib_short_name}
       VERSION ${GENERIC_LIB_VERSION})

   else (WIN32)
-	# Linux and MacOS
+    # Linux and MacOS
     set_target_properties (${_lib_target} PROPERTIES
       OUTPUT_NAME ${_lib_short_name}
       VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
@@ -1907,15 +1938,15 @@
   ##
   # Installation of the library
   if ("${_lib_prefix}" STREQUAL "py")
-	# If the library is Python, install it into a dedicated directory
-	message (STATUS "${_lib_short_name} is assumed to be a Python library")
-	install (TARGETS ${_lib_target}
+    # If the library is Python, install it into a dedicated directory
+    message (STATUS "${_lib_short_name} is assumed to be a Python library")
+    install (TARGETS ${_lib_target}
       EXPORT ${LIB_DEPENDENCY_EXPORT}
       LIBRARY DESTINATION "${INSTALL_PY_LIB_DIR}" COMPONENT runtime)
-
+
   else ("${_lib_prefix}" STREQUAL "py")
-	# Install the library in the standard location
-	install (TARGETS ${_lib_target}
+    # Install the library in the standard location
+    install (TARGETS ${_lib_target}
       EXPORT ${LIB_DEPENDENCY_EXPORT}
       LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT runtime)
   endif ("${_lib_prefix}" STREQUAL "py")
@@ -2673,7 +2704,7 @@

 # Python
 macro (display_python)
-  if (Python3_FOUND)
+  if (NEED_PYTHON)
     message (STATUS)
     message (STATUS "* Python:")
     message (STATUS "  - Python3_VERSION ............... : ${Python3_VERSION}")
@@ -2682,7 +2713,10 @@
     message (STATUS "  - Python3_LIBRARIES ............. : ${Python3_LIBRARIES}")
     message (STATUS "  - Python3_LIBRARY_DIRS .......... : ${Python3_LIBRARY_DIRS}")
     message (STATUS "  - Python3_RUNTIME_LIBRARY_DIRS .. : ${Python3_RUNTIME_LIBRARY_DIRS}")
-  endif (Python3_FOUND)
+  else (NEED_PYTHON)
+    message (STATUS)
+    message (STATUS "* Python not required")
+  endif (NEED_PYTHON)
 endmacro (display_python)

 # ICU
@@ -2717,7 +2751,9 @@
     message (STATUS "  - Boost_LIB_VERSION ............. : ${Boost_LIB_VERSION}")
     message (STATUS "  - Boost_HUMAN_VERSION ........... : ${Boost_HUMAN_VERSION}")
     message (STATUS "  - Boost_INCLUDE_DIRS ............ : ${Boost_INCLUDE_DIRS}")
-    message (STATUS "  - Boost_PYTHON_VERSION .......... : ${Boost_PYTHON_VERSION}")
+    if (NEED_PYTHON)
+      message (STATUS "  - Boost_PYTHON_VERSION .......... : ${Boost_PYTHON_VERSION}")
+    endif (NEED_PYTHON)
     message (STATUS "  - Boost required components ..... : ${BOOST_REQUIRED_COMPONENTS}")
     message (STATUS "  - Boost required libraries ...... : ${BOOST_REQUIRED_LIBS}")
     message (STATUS "  - Boost required libs for Py ext. : ${PROJ_DEP_LIBS_FOR_PYEXT}")


[Config] (hopefully) better detection of Boost.Python across platforms

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -504,7 +504,7 @@
 	  set (PY_MINOR_VERSION "${CMAKE_MATCH_2}")
 	  set (PY_PATCH_VERSION "${CMAKE_MATCH_3}")
 	endif (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-
+
 	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION} (${PYTHONLIBS_VERSION_STRING} / ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION})")

 	# Set the Python installation directory
@@ -585,15 +585,15 @@
 macro (register_boost_lib _boost_lib_list_name _boost_lib_list)
   # Update the list of library dependencies for the project
   foreach (_lib_cpt ${_boost_lib_list})
-	string (TOUPPER ${_lib_cpt} _lib_cpt_up)
-
-	if (Boost_${_lib_cpt_up}_LIBRARY)
-	  # Update the list of dependencies for the project
-	  list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
-
-	  # Update the list of libraries to be displayed
-	  list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
-	endif (Boost_${_lib_cpt_up}_LIBRARY)
+    string (TOUPPER ${_lib_cpt} _lib_cpt_up)
+
+    if (Boost_${_lib_cpt_up}_LIBRARY)
+      # Update the list of dependencies for the project
+      list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
+
+      # Update the list of libraries to be displayed
+      list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
+    endif (Boost_${_lib_cpt_up}_LIBRARY)
   endforeach (_lib_cpt ${_boost_lib_list})
 endmacro (register_boost_lib _boost_lib_list_name _boost_lib_list)

@@ -606,18 +606,26 @@
   else (${ARGC} GREATER 0)
     message (STATUS "Requires Boost without specifying any version")
   endif (${ARGC} GREATER 0)
-
+
   #
-  # Note: ${Boost_DATE_TIME_LIBRARY} and ${Boost_PROGRAM_OPTIONS_LIBRARY}
-  # are already set by ${SOCIMYSQL_LIBRARIES} and/or ${SOCI_LIBRARIES}.
-  #
-  set (python_component_name "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
+  # Note 1: ${Boost_DATE_TIME_LIBRARY} and ${Boost_PROGRAM_OPTIONS_LIBRARY}
+  #         are already set by ${SOCIMYSQL_LIBRARIES} and/or ${SOCI_LIBRARIES}.
+  # Note 2: Boost libraries are not installed in a consistent way across the
+  #         the different platforms and versions of Boost.
+  #         For a while, the Boost.Python library component was just called
+  #         'python'. It is now suffixed with the version of Python, and
+  #         on some Linux distributions, there is even a '-py' suffix.
+  #         On some platform/Boost version combinations, the Python version
+  #         may be just the major version (2 or 3 as of 2019) or the major
+  #         and minor versions (e.g., 27, 28, 34, 36, 37 as of 2019)
+  set (python_cpt_name1 "python${PY_MAJOR_VERSION}")
+  set (python_cpt_name2 "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
     date_time random iostreams serialization filesystem system
-	locale ${python_component_name} regex)
+    locale ${python_cpt_name1} ${python_cpt_name2} regex)
   set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
   set (BOOST_REQUIRED_COMPONENTS_FOR_TST unit_test_framework)
   set (BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS_FOR_LIB}
@@ -637,23 +645,28 @@
   find_package (BoostWrapper ${_required_version} REQUIRED)

   if (Boost_FOUND)
+    # Boost.Python library
+    message (STATUS "  + Boost_PYTHON_LIBRARY: ${Boost_PYTHON_LIBRARY}")
+    message (STATUS "  + Boost_PYTHON3_LIBRARY: ${Boost_PYTHON3_LIBRARY}")
+    message (STATUS "  + Boost_PYTHON37_LIBRARY: ${Boost_PYTHON37_LIBRARY}")
+
     # Update the list of include directories for the project
     include_directories (${Boost_INCLUDE_DIRS})

-	# For display purposes
+    # For display purposes
     set (BOOST_REQUIRED_LIBS "")

     # Update the list of library dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")

     # Update the list of binary dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")

     # Update the list of test dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")

   endif (Boost_FOUND)


libtheora links against libogg: fix linking order

Change-Id: I2168c62762ea5a979a4a7ee356c51018a141fa83

--- CMake/FindOGGTHEORA.cmake
+++ CMake/FindOGGTHEORA.cmake
@@ -24,9 +24,9 @@
 SET(OGGTHEORA_INCLUDE_DIR ${OGGTHEORA_INCLUDE_DIRS})

 SET(OGGTHEORA_LIBRARIES
-  ${OGGTHEORA_ogg_LIBRARY}
   ${OGGTHEORA_theoraenc_LIBRARY}
   ${OGGTHEORA_theoradec_LIBRARY}
+  ${OGGTHEORA_ogg_LIBRARY}
   )
 #HACK multiple libraries
 SET(OGGTHEORA_LIBRARY ${OGGTHEORA_LIBRARIES})


use target_compile_definitions instead of set_target_properties

--- rmw/cmake/configure_rmw_library.cmake
+++ rmw/cmake/configure_rmw_library.cmake
@@ -44,7 +44,7 @@
   if(WIN32)
     # Causes the visibility macros to use dllexport rather than dllimport
     # which is appropriate when building the dll but not consuming it.
-    set_target_properties(${library_target}
-      PROPERTIES COMPILE_FLAGS "-DRMW_BUILDING_DLL")
+    target_compile_definitions(${library_target}
+      PRIVATE "-DRMW_BUILDING_DLL")
   endif()
 endmacro()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Fixed declaration order.

Fixed declaration order.

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -366,7 +366,6 @@
 set_libraries(clang_rewrite_frontend ${CLANG_LIB_DIR} clangRewriteFrontend)
 set_libraries(clang_sema ${CLANG_LIB_DIR} clangSema)
 set_libraries(clang_serialization ${CLANG_LIB_DIR} clangSerialization)
-set_libraries(cluster ${CLUSTER_PREFIX}/lib cluster)
 set_libraries(
     clang_static_analyzer_checkers ${CLANG_LIB_DIR} clangStaticAnalyzerCheckers)
 set_libraries(
@@ -374,6 +373,7 @@
 set_libraries(
     clang_static_analyzer_frontend ${CLANG_LIB_DIR} clangStaticAnalyzerFrontend)
 set_libraries(clang_tooling ${CLANG_LIB_DIR} clangTooling)
+set_libraries(cluster ${CLUSTER_PREFIX}/lib cluster)
 set_libraries(cpp-netlib-uri ${CPP_NETLIB_URI_PREFIX}/lib network-uri)
 set_libraries(curl-asio ${CURL_ASIO_PREFIX}/lib curlasio)
 set_libraries(diff_match_patch ${DIFF_MATCH_PATCH_PREFIX}/lib diff_match_patch)


Fix typo that caused profiles not to be imported.

--- PolysquareCommon.cmake
+++ PolysquareCommon.cmake
@@ -85,7 +85,7 @@
                                                   polysquare_verapp_copy_profiles
                                                   "Vera++ profile")

-    add_dependencies (${_import_target} polysquare_verapp_copy_profile)
+    add_dependencies (${_import_target} polysquare_verapp_copy_profiles)


Revert "add external cmake module to determin number for CPU cores"

This reverts commit f46362b6e31fd460d5149a812c4c36d2b11fac92.

--- external/common/cmake_modules/cpucount.cmake
+++ external/common/cmake_modules/cpucount.cmake
@@ -1,183 +0,0 @@
-# - ProcessorCount(var)
-# Determine the number of processors/cores and save value in ${var}
-#
-# Sets the variable named ${var} to the number of physical cores available on
-# the machine if the information can be determined. Otherwise it is set to 0.
-# Currently this functionality is implemented for AIX, cygwin, FreeBSD, HPUX,
-# IRIX, Linux, Mac OS X, QNX, Sun and Windows.
-#
-# This function is guaranteed to return a positive integer (>=1) if it
-# succeeds. It returns 0 if there's a problem determining the processor count.
-#
-# Example use, in a ctest -S dashboard script:
-#
-#   include(ProcessorCount)
-#   ProcessorCount(N)
-#   if(NOT N EQUAL 0)
-#     set(CTEST_BUILD_FLAGS -j${N})
-#     set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
-#   endif()
-#
-# This function is intended to offer an approximation of the value of the
-# number of compute cores available on the current machine, such that you
-# may use that value for parallel building and parallel testing. It is meant
-# to help utilize as much of the machine as seems reasonable. Of course,
-# knowledge of what else might be running on the machine simultaneously
-# should be used when deciding whether to request a machine's full capacity
-# all for yourself.
-
-# A more reliable way might be to compile a small C program that uses the CPUID
-# instruction, but that again requires compiler support or compiling assembler
-# code.
-
-#=============================================================================
-# Copyright 2010-2011 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-function(ProcessorCount var)
-  # Unknown:
-  set(count 0)
-
-  if(WIN32)
-    # Windows:
-    set(count "$ENV{NUMBER_OF_PROCESSORS}")
-    #message("ProcessorCount: WIN32, trying environment variable")
-  endif()
-
-  if(NOT count)
-    # Mac, FreeBSD, OpenBSD (systems with sysctl):
-    find_program(ProcessorCount_cmd_sysctl sysctl
-      PATHS /usr/sbin /sbin)
-    if(ProcessorCount_cmd_sysctl)
-      execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE count)
-      #message("ProcessorCount: trying sysctl '${ProcessorCount_cmd_sysctl}'")
-    endif()
-  endif()
-
-  if(NOT count)
-    # Linux (systems with getconf):
-    find_program(ProcessorCount_cmd_getconf getconf)
-    if(ProcessorCount_cmd_getconf)
-      execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE count)
-      #message("ProcessorCount: trying getconf '${ProcessorCount_cmd_getconf}'")
-    endif()
-  endif()
-
-  if(NOT count)
-    # HPUX (systems with machinfo):
-    find_program(ProcessorCount_cmd_machinfo machinfo
-      PATHS /usr/contrib/bin)
-    if(ProcessorCount_cmd_machinfo)
-      execute_process(COMMAND ${ProcessorCount_cmd_machinfo}
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE machinfo_output)
-      string(REGEX MATCHALL "Number of CPUs = ([0-9]+)" procs "${machinfo_output}")
-      set(count "${CMAKE_MATCH_1}")
-      #message("ProcessorCount: trying machinfo '${ProcessorCount_cmd_machinfo}'")
-    endif()
-  endif()
-
-  if(NOT count)
-    # IRIX (systems with hinv):
-    find_program(ProcessorCount_cmd_hinv hinv
-      PATHS /sbin)
-    if(ProcessorCount_cmd_hinv)
-      execute_process(COMMAND ${ProcessorCount_cmd_hinv}
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE hinv_output)
-      string(REGEX MATCHALL "([0-9]+) .* Processors" procs "${hinv_output}")
-      set(count "${CMAKE_MATCH_1}")
-      #message("ProcessorCount: trying hinv '${ProcessorCount_cmd_hinv}'")
-    endif()
-  endif()
-
-  if(NOT count)
-    # AIX (systems with lsconf):
-    find_program(ProcessorCount_cmd_lsconf lsconf
-      PATHS /usr/sbin)
-    if(ProcessorCount_cmd_lsconf)
-      execute_process(COMMAND ${ProcessorCount_cmd_lsconf}
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE lsconf_output)
-      string(REGEX MATCHALL "Number Of Processors: ([0-9]+)" procs "${lsconf_output}")
-      set(count "${CMAKE_MATCH_1}")
-      #message("ProcessorCount: trying lsconf '${ProcessorCount_cmd_lsconf}'")
-    endif()
-  endif()
-
-  if(NOT count)
-    # QNX (systems with pidin):
-    find_program(ProcessorCount_cmd_pidin pidin)
-    if(ProcessorCount_cmd_pidin)
-      execute_process(COMMAND ${ProcessorCount_cmd_pidin} info
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE pidin_output)
-      string(REGEX MATCHALL "Processor[0-9]+: " procs "${pidin_output}")
-      list(LENGTH procs count)
-      #message("ProcessorCount: trying pidin '${ProcessorCount_cmd_pidin}'")
-    endif()
-  endif()
-
-  if(NOT count)
-    # Sun (systems where uname -X emits "NumCPU" in its output):
-    find_program(ProcessorCount_cmd_uname uname)
-    if(ProcessorCount_cmd_uname)
-      execute_process(COMMAND ${ProcessorCount_cmd_uname} -X
-        ERROR_QUIET
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE uname_X_output)
-      string(REGEX MATCHALL "NumCPU = ([0-9]+)" procs "${uname_X_output}")
-      set(count "${CMAKE_MATCH_1}")
-      #message("ProcessorCount: trying uname -X '${ProcessorCount_cmd_uname}'")
-    endif()
-  endif()
-
-  # Execute this code when all previously attempted methods return empty
-  # output:
-  #
-  if(NOT count)
-    # Systems with /proc/cpuinfo:
-    set(cpuinfo_file /proc/cpuinfo)
-    if(EXISTS "${cpuinfo_file}")
-      file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
-      list(LENGTH procs count)
-      #message("ProcessorCount: trying cpuinfo '${cpuinfo_file}'")
-    endif()
-  endif()
-
-  # Since cygwin builds of CMake do not define WIN32 anymore, but they still
-  # run on Windows, and will still have this env var defined:
-  #
-  if(NOT count)
-    set(count "$ENV{NUMBER_OF_PROCESSORS}")
-    #message("ProcessorCount: last fallback, trying environment variable")
-  endif()
-
-  # Ensure an integer return (avoid inadvertently returning an empty string
-  # or an error string)... If it's not a decimal integer, return 0:
-  #
-  if(NOT count MATCHES "^[0-9]+$")
-    set(count 0)
-  endif()
-
-  set(${var} ${count} PARENT_SCOPE)
-endfunction()


use cmake 3.2's BYPRODUCTS to fix the build with Ninja generator

--- gtest.cmake
+++ gtest.cmake
@@ -1,18 +1,47 @@
 option(USE_SYSTEM_GTEST "Use system installed gtest when set to ON, or build gtest locally when set to OFF" OFF)

 if(USE_SYSTEM_GTEST)
-  if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_LESS 2.8)
-    message(STATUS "CMake version 2.8 or greater needed to use GTest")
-  else()
-    find_package(GTest)
-  endif()
+  find_package(GTest)
 else()
   include(ExternalProject)
+
+  # the binary dir must be know before creating the external project in order
+  # to pass the byproducts
+  set(prefix "${CMAKE_CURRENT_BINARY_DIR}/gtest-external")
+  set(binary_dir "${prefix}/src/gtest-external-build")
+
+  set(byproducts)
+  foreach(lib gtest gtest_main)
+    if(CMAKE_CONFIGURATION_TYPES)
+      set(${lib}_properties)
+      foreach(type ${CMAKE_CONFIGURATION_TYPES})
+        string(TOUPPER ${type} TYPE)
+        set(file ${binary_dir}/${type}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
+        list(APPEND ${lib}_properties IMPORTED_LOCATION_${TYPE} ${file})
+        list(APPEND byproducts ${file})
+      endforeach()
+    else()
+      set(file ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
+      set(${lib}_properties IMPORTED_LOCATION ${file})
+      list(APPEND byproducts ${file})
+    endif()
+  endforeach()
+
+  set(build_byproducts)
+  if(${CMAKE_VERSION} VERSION_LESS 3.2)
+    if(CMAKE_GENERATOR MATCHES "Ninja")
+      message(WARNING "Building GTest with Ninja has known issues with CMake older than 3.2")
+    endif()
+  else()
+    set(build_byproducts BUILD_BYPRODUCTS ${byproducts})
+  endif()

   ExternalProject_Add(
     gtest-external
     URL http://googletest.googlecode.com/files/gtest-1.7.0.zip
     URL_MD5 2d6ec8ccdf5c46b05ba54a9fd1d130d7
+    PREFIX ${prefix}
+    BINARY_DIR ${binary_dir}
     CMAKE_CACHE_ARGS
       -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
       -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
@@ -28,22 +57,13 @@
       -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
       -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
       -Dgtest_force_shared_crt:BOOL=ON
+    ${build_byproducts}
     INSTALL_COMMAND "")

-  ExternalProject_Get_Property(gtest-external binary_dir)
   foreach(lib gtest gtest_main)
     add_library(${lib} IMPORTED STATIC)
     add_dependencies(${lib} gtest-external)
-    if(CMAKE_CONFIGURATION_TYPES)
-      foreach(type ${CMAKE_CONFIGURATION_TYPES})
-        string(TOUPPER ${type} TYPE)
-        set_target_properties(${lib} PROPERTIES
-          IMPORTED_LOCATION_${TYPE} ${binary_dir}/${type}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
-      endforeach()
-    else()
-      set_target_properties(${lib} PROPERTIES
-        IMPORTED_LOCATION ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
-    endif()
+    set_target_properties(${lib} PROPERTIES ${${lib}_properties})
   endforeach()

   ExternalProject_Get_Property(gtest-external source_dir)


fix for subdirs in FindProtobuf.cmake

fix for subdirs in FindProtobuf.cmake

--- src/fnord/protobuf/FindProtobuf.cmake
+++ src/fnord/protobuf/FindProtobuf.cmake
@@ -62,13 +62,23 @@
   foreach(FIL ${ARGN})
     get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
     get_filename_component(FIL_WE ${FIL} NAME_WE)
-
-    list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
-    list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
+
+    get_filename_component(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} ABSOLUTE)
+    string(LENGTH ${ROOT_DIR} ROOT_DIR_LEN)
+
+    get_filename_component(FIL_DIR ${ABS_FIL} PATH)
+    string(LENGTH ${FIL_DIR} FIL_DIR_LEN)
+    math(EXPR FIL_DIR_REM "${FIL_DIR_LEN} - ${ROOT_DIR_LEN}")
+
+    string(SUBSTRING ${FIL_DIR} ${ROOT_DIR_LEN} ${FIL_DIR_REM} FIL_DIR_PREFIX)
+    set(FIL_WEPREFIX "${FIL_DIR_PREFIX}/${FIL_WE}")
+
+    list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.cc")
+    list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.h")

     add_custom_command(
-      OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
-             "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
+      OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.cc"
+             "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.h"
       COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE}
       ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} --proto_path ${PROTOBUF_INCLUDE_DIR} --proto_path ${FNORD_SOURCE_DIR}/fnord ${PROTOC_ARGS} ${ABS_FIL}
       DEPENDS ${ABS_FIL}


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Fix error preventing normal configuration with direct specifying of product directory via cmake option.

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -507,7 +507,7 @@

   # Override the variable - don't append to it, as it would give precedence
   # to what was stored there before!
-  IF(DEFINED ENV{${_envvar}})
+  IF(DEFINED ${_envvar})
     SET(CMAKE_PREFIX_PATH "${${_envvar}}")
   ENDIF()


added warning in cmake if libdl not found (2)

--- cmake/libdl.cmake
+++ cmake/libdl.cmake
@@ -1,6 +1,8 @@
+if (NOT LIBDL_LIBRARY)
 find_library( LIBDL_LIBRARY dl)
 if( LIBDL_LIBRARY  AND NOT LIBDL_LIBRARY STREQUAL "LIBDL_LIBRARY-NOTFOUND" )
 message( STATUS "Library dl found at '${LIBDL_LIBRARY}' " )
 else( LIBDL_LIBRARY  AND NOT LIBDL_LIBRARY STREQUAL "LIBDL_LIBRARY-NOTFOUND" )
 message( WARNING "Library dl not found" )
 endif( LIBDL_LIBRARY  AND NOT LIBDL_LIBRARY STREQUAL "LIBDL_LIBRARY-NOTFOUND" )
+endif (NOT LIBDL_LIBRARY)


Bump develop version to v0.5

Bump develop version to v0.5

--- cmake/build-version.cmake
+++ cmake/build-version.cmake
@@ -19,7 +19,7 @@
   endif( )
   if( POLICY CMP0048 )
     cmake_policy( SET CMP0048 NEW )
-    project( ${PV_NAME} VERSION 0.4.0.0 LANGUAGES ${PV_LANGUAGES} )
+    project( ${PV_NAME} VERSION 0.5.0.0 LANGUAGES ${PV_LANGUAGES} )

   else( )
     project( ${PV_NAME} ${PV_LANGUAGES} )
@@ -29,7 +29,7 @@
     endif( )

     if( NOT DEFINED ${PV_NAME}_VERSION_MINOR )
-      set( ${PV_NAME}_VERSION_MINOR 4 )
+      set( ${PV_NAME}_VERSION_MINOR 5 )
     endif( )

     if( NOT DEFINED ${PV_NAME}_VERSION_PATCH )


Use cached grpc

Use cached grpc

--- cmake/external/grpc.cmake
+++ cmake/external/grpc.cmake
@@ -32,8 +32,7 @@
 ExternalProject_Add(
     extern_grpc
     DEPENDS protobuf zlib
-    GIT_REPOSITORY "https://github.com/grpc/grpc.git"
-    GIT_TAG "v1.10.x"
+    URL "http://paddlepaddledeps.bj.bcebos.com/grpc.tar.xz"
     PREFIX          ${GRPC_SOURCES_DIR}
     UPDATE_COMMAND  ""
     CONFIGURE_COMMAND ""


Add missing updated linux cmake script

Add missing updated linux cmake script

--- cmake/linux.service.cmake
+++ cmake/linux.service.cmake
@@ -2,14 +2,19 @@
 #   Linux Userspace CMake script   #
 ####################################

-#set(CMAKE_CXX_COMPILER "clang++-4.0")
 set(CMAKE_CXX_STANDARD 14)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -march=native -Wall -Wextra")
+set(COMMON "-g -O2 -march=native -Wall -Wextra")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON}")
+set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON}")

 option(GPROF "Enable profiling with gprof" OFF)
 option(SANITIZE "Enable undefined- and address sanitizers" OFF)
+option(ENABLE_LTO "Enable thinLTO for use with LLD" OFF)

+if (ENABLE_LTO)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto=thin -fuse-ld=lld-5.0")
+  set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -flto=thin -fuse-ld=lld-5.0")
+endif()

 if(GPROF)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
@@ -26,6 +31,7 @@
 add_definitions(-DINCLUDEOS_SINGLE_THREADED)
 add_definitions(-DSERVICE=\"\\\"${BINARY}\\\"\")
 add_definitions(-DSERVICE_NAME=\"\\\"${SERVICE_NAME}\\\"\")
+add_definitions(-DUSERSPACE_LINUX)

 set(IOSPATH $ENV{INCLUDEOS_PREFIX}/includeos)


implement choosing of the database directory depending on the installation options

--- cmake/packages/nsis.cmake
+++ cmake/packages/nsis.cmake
@@ -8,7 +8,8 @@
 set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL 1)
 set(CPACK_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Windows/Templates")
 set(CPACK_PLUGIN_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Windows/Plugins")
-
+# want @ in @only nsis template:
+set(CPACK_ROOTDIR "@ROOTDIR@")
 if (CMAKE_CL_64)
   # this needs to remain a $string for the template:
   SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")


[CMAKE] Cleanup the OSX platform file

[CMAKE] Cleanup the OSX platform file

Summary:
Replace some hardcoded linker flags with CMake built-in variables.
This has no impact to the build.

Test Plan:
  mkdir buildcmake && cd buildcmake
  cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/OSX.cmake ..
  ninja -v
Check the linker flags are identical before and after this patch.
Note: the build can fail if the fixes (other diffs) are not landed.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3031

--- cmake/platforms/OSX.cmake
+++ cmake/platforms/OSX.cmake
@@ -6,10 +6,11 @@
 # On OSX, we use clang by default.
 set(CMAKE_C_COMPILER clang)
 set(CMAKE_CXX_COMPILER clang++)
-# set(CMAKE_CXX_EXTENSIONS OFF)

 # On OSX we use various stuff from Apple's SDK.
 set(OSX_SDK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/depends/SDKs/MacOSX10.11.sdk")
+set(CMAKE_OSX_SYSROOT ${OSX_SDK_PATH})
+set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)

 # target environment on the build host system
 #   set 1st to dir with the cross compiler's C/C++ headers/libs
@@ -28,8 +29,6 @@
 # Sysroot clang
 set(OSX_EXTRA_FLAGS
 	" -target ${TOOLCHAIN_PREFIX}"
-	" -mmacosx-version-min=10.8"
-	" --sysroot ${OSX_SDK_PATH}"
 	" -mlinker-version=253.9"
 )


rm accidenally pushed noisy stuff

rm accidenally pushed noisy stuff

--- cmake/rosbuild_lite.cmake
+++ cmake/rosbuild_lite.cmake
@@ -54,7 +54,7 @@
           NO_DEFAULT_PATH
           )
         find_library(${libname}_LIBRARY ${libname})
-        message("${libname}_LIBRARY ${${libname}_LIBRARY}")
+        # message("${libname}_LIBRARY ${${libname}_LIBRARY}")
         if (NOT ${libname}_LIBRARY)
           message(FATAL_ERROR "uh oh ${PACKAGE} ${libname} found us ${thelib}")
         endif()
@@ -66,12 +66,11 @@
     include_directories(${${PACKAGE}_INCLUDE_DIRS})
     add_definitions(${${PACKAGE}_DEFINITIONS})

-    message(STATUS "BING BING ${PACKAGE} ${${PACKAGE}_LIBRARIES}")
   endif() # not PACKAGE_DIR

   if (${PACKAGE}_DIR)

-    message("${PACKAGE}_LIBRARIES ${${PACKAGE}_LIBRARIES}")
+    # message("${PACKAGE}_LIBRARIES ${${PACKAGE}_LIBRARIES}")
     list(LENGTH ${PACKAGE}_LIBRARIES nlibs)
     list(LENGTH ${PACKAGE}_INCLUDE_DIRS nincludes)
     list(LENGTH ${PACKAGE}_DEFINITIONS ndefs)


remove -Wabi-tag

remove -Wabi-tag

--- cmake/dev.cmake
+++ cmake/dev.cmake
@@ -75,7 +75,6 @@
         LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wformat-nonliteral")
         LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wformat-security")
         LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wformat-y2k")
-        LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wabi-tag")
         LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wctor-dtor-privacy")
         LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wdelete-non-virtual-dtor")
         LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wliteral-suffix")


cmake: Error-out when dts.fixup files are detected

The filename dts.fixup is deprecated, dts_fixup.h should be used
instead. This commit detects when fixup files have not been renamed
and errors out with a warning.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -119,6 +119,22 @@
     message(FATAL_ERROR "command failed with return code: ${ret}")
   endif()

+  # Error-out when the deprecated naming convention is found (until
+  # after 1.14.0 has been released)
+  foreach(path
+	  ${BOARD_DIR}/dts.fixup
+	  ${PROJECT_SOURCE_DIR}/soc/${ARCH}/${SOC_PATH}/dts.fixup
+      ${APPLICATION_SOURCE_DIR}/dts.fixup
+	  )
+	if(EXISTS ${path})
+	  message(FATAL_ERROR
+		"A deprecated filename has been detected. Porting is required."
+		"The file '${path}' exists, but it should be named dts_fixup.h instead."
+		"See https://github.com/zephyrproject-rtos/zephyr/pull/10352 for more details"
+		)
+	endif()
+  endforeach()
+
   # Run extract_dts_includes.py for the header file
   # generated_dts_board.h
   set_ifndef(DTS_BOARD_FIXUP_FILE ${BOARD_DIR}/dts_fixup.h)


Fix for GCC version detection

Fix for GCC version detection

--- cmake/gcc.cmake
+++ cmake/gcc.cmake
@@ -47,24 +47,26 @@
   ENDIF()
 ENDIF()

-IF(NOT GCC_VERSION)
-  EXECUTE_PROCESS(COMMAND ${GCC_EXECUTABLE} --version OUTPUT_VARIABLE GCC_OUTPUT)
-  STRING(REGEX MATCH " [0-9]+[.][0-9]+[.][0-9]+ " GCC_VERSION "${GCC_OUTPUT}")
-
-  SET(GCC_VERSION ${GCC_VERSION} CACHE STRING "GCC Version")
-  MARK_AS_ADVANCED(GCC_VERSION)
-ENDIF()
+#IF(NOT GCC_VERSION)
+#  EXECUTE_PROCESS(COMMAND ${GCC_EXECUTABLE} -dumpversion OUTPUT_VARIABLE GCC_OUTPUT)
+#  STRING(REGEX MATCH " [0-9]+[.][0-9]+[.][0-9]* " GCC_VERSION "${GCC_OUTPUT}")
+#
+#  SET(GCC_VERSION ${GCC_VERSION} CACHE STRING "GCC Version")
+#  MARK_AS_ADVANCED(GCC_VERSION)
+#ENDIF()

 SET(GCC_VERSION_REQUIRED_AVX "4.4.0")
 SET(GCC_VERSION_REQUIRED_AVX2 "4.7.0")

-IF (GCC_VERSION VERSION_LESS GCC_VERSION_REQUIRED_AVX)
+IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_VERSION_REQUIRED_AVX)
+  MESSAGE(WARNING "GCC Version was ${CMAKE_CXX_COMPILER_VERSION}.")
   SET(OSPRAY_COMPILER_SUPPORTS_AVX FALSE)
 ELSE()
   SET(OSPRAY_COMPILER_SUPPORTS_AVX TRUE)
 ENDIF()

-IF (GCC_VERSION VERSION_LESS GCC_VERSION_REQUIRED_AVX2)
+IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_VERSION_REQUIRED_AVX2)
+  MESSAGE(WARNING "GCC Version was ${CMAKE_CXX_COMPILER_VERSION}.")
   SET(OSPRAY_COMPILER_SUPPORTS_AVX2 FALSE)
 ELSE()
   SET(OSPRAY_COMPILER_SUPPORTS_AVX2 TRUE)


Made setting compiler options across projects possible.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -9,7 +9,13 @@
   set (CMAKE_OSX_ARCHITECTURES "armv7 arm64")

   # Optimize debug build to help diagnose release build crashes.
-  #set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Os")
+    if (GCC_DEBUG_OPTIMIZATION_LEVEL)
+      set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -${GCC_DEBUG_OPTIMIZATION_LEVEL}")
+    endif()
+
+  if (MSVC_DEBUG_FLAGS)
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_DEBUG_FLAGS}")
+  endif()

   set(CURRENT_TARGET ${target})
   #message(WARNING "*${PROJECT_NAME} STREQUAL ${target}*")


Fixed flags for ARM native debug build.

Fixed flags for ARM native debug build.

Also fixed indentation style to all-tabs.

--- SetFlags.cmake
+++ SetFlags.cmake
@@ -65,9 +65,11 @@
 	elseif(APPLE)

 		if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-			execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
-                		OUTPUT_VARIABLE GCC_VERSION)
-                endif()
+			execute_process(
+				COMMAND ${CMAKE_C_COMPILER} -dumpversion
+				OUTPUT_VARIABLE GCC_VERSION
+			)
+		endif()

 		set(CMAKE_CXX_FLAGS          "${CMAKE_CXX_FLAGS}          -std=c++11")
 		set(CMAKE_CXX_FLAGS_DEBUG    "${CMAKE_CXX_FLAGS_DEBUG}    -std=c++11")
@@ -90,12 +92,14 @@
 		endif()

 		if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-			execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
-                		OUTPUT_VARIABLE GCC_VERSION)
-                endif()
+			execute_process(
+				COMMAND ${CMAKE_C_COMPILER} -dumpversion
+				OUTPUT_VARIABLE GCC_VERSION
+			)
+		endif()

 		if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
-				set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" "-fomit-frame-pointer")
+			set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fomit-frame-pointer")
 		endif()

 		set(CMAKE_CXX_FLAGS          "${CMAKE_CXX_FLAGS}          -std=c++11")
@@ -122,8 +126,8 @@
 	endif()

 	if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-        get_clang_version()
-    endif()
+		get_clang_version()
+	endif()

 	# Use static CRT in MSVC builds:


[D3D11] Update FindDirectX11.cmake - Windows SDK 8.0/8.1 and Windows Phone SDK 8.0/8.1 are supported now

--- CMake/Packages/FindDirectX11.cmake
+++ CMake/Packages/FindDirectX11.cmake
@@ -11,13 +11,40 @@
 # Find DirectX11 SDK
 # Define:
 # DirectX11_FOUND
-# DirectX11_INCLUDE_DIR
-# DirectX11_LIBRARY
-# DirectX11_ROOT_DIR
+# DirectX11_INCLUDE_DIRS
+# DirectX11_LIBRARIES

 if(WIN32) # The only platform it makes sense to check for DirectX11 SDK
 	include(FindPkgMacros)
 	findpkg_begin(DirectX11)
+
+	# assume that toolchain could not be changed on the fly, so only changes to OGRE_BUILD_PLATFORM_WINDOWS_PHONE should reset the cache
+	clear_if_changed(OGRE_BUILD_PLATFORM_WINDOWS_PHONE
+		DirectX11_INCLUDE_DIR
+	)
+
+	# Windows Phone 8.1 SDK
+	if(OGRE_BUILD_PLATFORM_WINDOWS_PHONE AND MSVC12)
+		find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Phone Kits/8.1/include" "C:/Program Files/Windows Phone Kits/8.1/include")
+		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.1/lib/${MSVC_CXX_ARCHITECTURE_ID}/"
+
+	# Windows Phone 8.0 SDK
+	elseif(OGRE_BUILD_PLATFORM_WINDOWS_PHONE AND MSVC11)
+		find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Phone Kits/8.0/include" "C:/Program Files/Windows Phone Kits/8.0/include")
+		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.0/lib/${MSVC_CXX_ARCHITECTURE_ID}/"
+
+	# Windows 8.1 SDK
+	elseif(MSVC12)
+	    find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Kits/8.1/include/um" "C:/Program Files/Windows Kits/8.1/include/um")
+		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Kits/8.1/lib/winv6.3/um/${MSVC_CXX_ARCHITECTURE_ID}/"
+
+	# Windows 8.0 SDK
+	elseif(MSVC11)
+	    find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Kits/8.0/include/um" "C:/Program Files/Windows Kits/8.0/include/um")
+		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Kits/8.0/lib/win8/um/${MSVC_CXX_ARCHITECTURE_ID}/"
+
+	# Legacy Direct X SDK
+	else()

 	# Get path, convert backslashes as ${ENV_DXSDK_DIR}
 	getenv_path(DXSDK_DIR)
@@ -38,17 +65,6 @@
 	"$ENV{ProgramFiles}/Microsoft DirectX SDK*"
 	)

-	if(OGRE_BUILD_PLATFORM_WINRT)
-		# Windows 8 SDK has custom layout
-		set(DirectX11_INC_SEARCH_PATH
-		"C:/Program Files (x86)/Windows Kits/8.0/Include/shared"
-		"C:/Program Files (x86)/Windows Kits/8.0/Include/um"
-		)
-		set(DirectX11_LIB_SEARCH_PATH
-		"C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um"
-		)
-	endif()
-
 	create_search_paths(DirectX11)
 	# redo search if prefix path changed
 	clear_if_changed(DirectX11_PREFIX_PATH
@@ -65,19 +81,17 @@
 	endif(CMAKE_CL_64)

 	# look for D3D11 components
-    find_path(DirectX11_INCLUDE_DIR NAMES D3D11Shader.h HINTS ${DirectX11_INC_SEARCH_PATH})
+    find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS ${DirectX11_INC_SEARCH_PATH})
     find_library(DirectX11_DXERR_LIBRARY NAMES DxErr HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
 	find_library(DirectX11_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
 	find_library(DirectX11_DXGI_LIBRARY NAMES dxgi HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
 	find_library(DirectX11_D3DCOMPILER_LIBRARY NAMES d3dcompiler HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
+	find_library(DirectX11_D3D11_LIBRARY NAMES d3d11 HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
+	find_library(DirectX11_D3DX11_LIBRARY NAMES d3dx11 HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})

-	find_library(DirectX11_LIBRARY NAMES d3d11 HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
-    find_library(DirectX11_D3DX11_LIBRARY NAMES d3dx11 HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
-	if (DirectX11_INCLUDE_DIR AND DirectX11_LIBRARY)
-	  set(DirectX11_D3D11_FOUND TRUE)
-	  set(DirectX11_INCLUDE_DIR ${DirectX11_INCLUDE_DIR})
+	if (DirectX11_INCLUDE_DIR AND DirectX11_D3D11_LIBRARY)
 	  set(DirectX11_D3D11_LIBRARIES ${DirectX11_D3D11_LIBRARIES}
-	    ${DirectX11_LIBRARY}
+	    ${DirectX11_D3D11_LIBRARY}
 	    ${DirectX11_DXGI_LIBRARY}
         ${DirectX11_DXGUID_LIBRARY}
         ${DirectX11_D3DCOMPILER_LIBRARY}
@@ -90,25 +104,19 @@
         set(DirectX11_D3D11_LIBRARIES ${DirectX11_D3D11_LIBRARIES} ${DirectX11_DXERR_LIBRARY})
     endif ()

-	findpkg_finish(DirectX11)
-
-	set(DirectX11_LIBRARIES
+	set(DirectX11_LIBRARY
 		${DirectX11_D3D11_LIBRARIES}
 	)

-	if (OGRE_BUILD_PLATFORM_WINDOWS_PHONE)
-		set(DirectX11_FOUND TRUE)
-        set(DirectX11_INCLUDE_DIR "C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/WPSDK/WP80/include" CACHE STRING "" FORCE)
-        set(DirectX11_LIBRARY "C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/WPSDK/WP80/lib" CACHE STRING "" FORCE)
-        set(DirectX11_LIBRARIES ${DirectX11_LIBRARY})
-		set(CMAKE_CXX_FLAGS "/EHsc"  CACHE STRING "" FORCE)
-	endif ()
-
-	mark_as_advanced(DirectX11_INCLUDE_DIR
-					 DirectX11_D3D11_LIBRARIES
+	mark_as_advanced(DirectX11_D3D11_LIBRARY
 					 DirectX11_D3DX11_LIBRARY
 					 DirectX11_DXERR_LIBRARY
 					 DirectX11_DXGUID_LIBRARY
 					 DirectX11_DXGI_LIBRARY
 					 DirectX11_D3DCOMPILER_LIBRARY)
+
+	endif () # Legacy Direct X SDK
+
+	findpkg_finish(DirectX11)
+
 endif(WIN32)


From Eric Wing,
"These enhancements make it much easier to control which libraries get
found by FIND_ using environmental variables. The problem with the old
script was that CMake searches what it considers system paths first.
This makes it difficult to override in the case where you might have a
stable version in /usr/local, but are trying to build a bleeding edge
release in the non-standard location /bleeding-edge.

I went to the CMake mailing list hoping to find a good solution to
this. Unfortunately, there isn't one, and I have to do something
rather bone-headed in the Find module. Basically, I have to run FIND_
twice: once with default search paths turned off and my environmental
variables listed, and again with standard search paths reenabled. At
least it works.

I also added a few more environmental variables, specifically:
OPENTHREADS_INCLUDE_DIR
OPENTHREADS_LIBRARY_DIR

These two variables address the shortcoming of OPENTHREADS_DIR in the
case where the include path and library path don't share a common
parent.

Put all this together, and you can setup an automated shell script or
Microsoft .bat file to configure and build your application in an
automated step.

You still should be able to use the key CMake variables like
CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to find things, but it will
occur after the environmental paths are searched. The reason for this
is that the OPENTHREADS_INCLUDE_DIR and OPENTHREADS_LIBRARY_DIR are
more specific. This prevents the accidental ordering problem where you
might use CMAKE_INCLUDE_PATH to find some other component like GLUT,
but didn't want to accidentally include an older version of
OpenThreads located in the same area.

As the ultimate override, you can still pass -DVAR=value arguments to
cmake and it will take these above all else. However, it's safer for
people to not use these in case we modify the script and change the
variable names.

Finally, I'm wondering if we can kill the ${CMAKE_INSTALL_PREFIX}
searches in the Find module. As I've said before, this is kind of a
hack and the variable wasn't really intended to be used in this way.
And I just got bitten by it in some bad corner cases. The problem is
that if you don't explicitly set the ${CMAKE_INSTALL_PREFIX}, CMake
sets a default value for it (such as /usr/local). The problem is that
/usr/local may not be the place you want searched. If you wait to set
the ${CMAKE_INSTALL_PREFIX} in the ccmake GUI, then FIND_ is already
run once on ${CMAKE_INSTALL_PREFIX=/usr/local. If you were planning to
change the value in the GUI, it's too late if you had a stuff in
/usr/local because FIND_ already found something and won't change the
value when you reconfigure since it is already set. You will have to
manually change the value yourself. Furthermore, as another problem
example, on the Mac, /Library/Frameworks is supposed to be searched
before /usr/local, but ${CMAKE_INSTALL_PREFIX} kept causing stuff in
/usr/local to be hit first which took me a really long time to
understand how this was happenning. The work around is that I must
push the ${CMAKE_INSTALL_PREFIX} search to the very end as not to
conflict with anything else. But I think it would be much better if we
removed it entirely.

And with so many different environmental variables at our disposal, I
don't think we need this one:

(Checked by CMake automatically:)
CMAKE_INCLUDE_PATH
CMAKE_SYSTEM_INCLUDE_PATH
CMAKE_LIBRARY_PATH
CMAKE_SYSTEM_LIBRARY_PATH
PATH
LIB

(Checked by us:)
OPENTHREADS_INCLUDE_DIR
OPENTHREADS_LIBRARY_DIR
OPENTHREADS_DIR
OSG_INCLUDE_DIR
OSG_LIBRARY_DIR
OSG_DIR
"

--- CMakeModules/FindOpenThreads.cmake
+++ CMakeModules/FindOpenThreads.cmake
@@ -20,70 +20,125 @@
 # Header files are presumed to be included like
 # #include <OpenThreads/Thread>

-# Try the user's environment request before anything else.
+# To make it easier for one-step automated configuration/builds,
+# we leverage environmental paths. This is preferable
+# to the -DVAR=value switches because it insulates the
+# users from changes we may make in this script.
+# It also offers a little more flexibility than setting
+# the CMAKE_*_PATH since we can target specific components.
+# However, the default CMake behavior will search system paths
+# before anything else. This is problematic in the cases
+# where you have an older (stable) version installed, but
+# are trying to build a newer version.
+# CMake doesn't offer a nice way to globally control this behavior
+# so we have to do a nasty "double FIND_" in this module.
+# The first FIND disables the CMAKE_ search paths and only checks
+# the environmental paths.
+# If nothing is found, then the second find will search the
+# standard install paths.
+# Explicit -DVAR=value arguments should still be able to override everything.

 FIND_PATH(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
-  ${CMAKE_INSTALL_PREFIX}/include
+	$ENV{OPENTHREADS_INCLUDE_DIR}
 	$ENV{OPENTHREADS_DIR}/include
 	$ENV{OPENTHREADS_DIR}
+	$ENV{OSG_INCLUDE_DIR}
 	$ENV{OSG_DIR}/include
 	$ENV{OSG_DIR}
-	~/Library/Frameworks
-	/Library/Frameworks
-	/usr/local/include
-	/usr/include
-	/sw/include # Fink
-	/opt/local/include # DarwinPorts
-	/opt/csw/include # Blastwave
-	/opt/include
-	[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
+	NO_DEFAULT_PATH
 )
+
+IF(NOT OPENTHREADS_INCLUDE_DIR)
+	FIND_PATH(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
+		~/Library/Frameworks
+		/Library/Frameworks
+		/usr/local/include
+		/usr/include
+		/sw/include # Fink
+		/opt/local/include # DarwinPorts
+		/opt/csw/include # Blastwave
+		/opt/include
+		[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
+		${CMAKE_INSTALL_PREFIX}/include # hack: this should be last because it can interfere badly with other search paths in the case where you do not explicitly set this value and CMake invokes its default value which may not be what you want.
+	)
+ENDIF(NOT OPENTHREADS_INCLUDE_DIR)

 FIND_LIBRARY(OPENTHREADS_LIBRARY
-	NAMES OpenThreads  OpenThreadsWin32
+	NAMES OpenThreads OpenThreadsWin32
 	PATHS
-	${CMAKE_INSTALL_PREFIX}/lib
+	$ENV{OPENTHREADS_LIBRARY_DIR}
 	$ENV{OPENTHREADS_DIR}/lib64
 	$ENV{OPENTHREADS_DIR}/lib
 	$ENV{OPENTHREADS_DIR}
+	$ENV{OSG_LIBRARY_DIR}
 	$ENV{OSG_DIR}/lib64
 	$ENV{OSG_DIR}/lib
 	$ENV{OSG_DIR}
-	~/Library/Frameworks
-	/Library/Frameworks
-	/usr/local/lib64
-	/usr/local/lib
-	/usr/lib64
-	/usr/lib
-	/sw/lib
-	/opt/local/lib
-	/opt/csw/lib
-	/opt/lib
-	[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+	NO_DEFAULT_PATH
 )
+
+IF(NOT OPENTHREADS_LIBRARY)
+	FIND_LIBRARY(OPENTHREADS_LIBRARY
+		NAMES OpenThreads OpenThreadsWin32
+		PATHS
+		~/Library/Frameworks
+		/Library/Frameworks
+		/usr/local/lib64
+		/usr/local/lib
+		/usr/lib64
+		/usr/lib
+		/sw/lib64
+		/sw/lib
+		/opt/local/lib64
+		/opt/local/lib
+		/opt/csw/lib64
+		/opt/csw/lib
+		/opt/lib64
+		/opt/lib
+		[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+		${CMAKE_INSTALL_PREFIX}/lib64 # hack: this should be last because it can interfere badly with other search paths in the case where you do not explicitly set this value and CMake invokes its default value which may not be what you want.
+		${CMAKE_INSTALL_PREFIX}/lib # hack
+	)
+ENDIF(NOT OPENTHREADS_LIBRARY)
+
+
 FIND_LIBRARY(OPENTHREADS_LIBRARY_DEBUG
-	NAMES  OpenThreadsd  OpenThreadsWin32d
+	NAMES OpenThreadsd OpenThreadsWin32d
 	PATHS
-	${CMAKE_INSTALL_PREFIX}/lib
+	$ENV{OPENTHREADS_LIBRARY_DIR}
 	$ENV{OPENTHREADS_DIR}/lib64
 	$ENV{OPENTHREADS_DIR}/lib
 	$ENV{OPENTHREADS_DIR}
+	$ENV{OSG_LIBRARY_DIR}
 	$ENV{OSG_DIR}/lib64
 	$ENV{OSG_DIR}/lib
 	$ENV{OSG_DIR}
-	~/Library/Frameworks
-	/Library/Frameworks
-	/usr/local/lib64
-	/usr/local/lib
-	/usr/lib64
-	/usr/lib
-	/sw/lib
-	/opt/local/lib
-	/opt/csw/lib
-	/opt/lib
-	[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+	NO_DEFAULT_PATH
 )
+
+IF(NOT OPENTHREADS_LIBRARY_DEBUG)
+	FIND_LIBRARY(OPENTHREADS_LIBRARY_DEBUG
+		NAMES OpenThreadsd OpenThreadsWin32d
+		PATHS
+		/usr/local/lib64
+		/usr/local/lib
+		/usr/lib64
+		/usr/lib
+		/sw/lib64
+		/sw/lib
+		/opt/local/lib64
+		/opt/local/lib
+		/opt/csw/lib64
+		/opt/csw/lib
+		/opt/lib64
+		/opt/lib
+		[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+		${CMAKE_INSTALL_PREFIX}/lib64 # hack: this should be last because it can interfere badly with other search paths in the case where you do not explicitly set this value and CMake invokes its default value which may not be what you want.
+		${CMAKE_INSTALL_PREFIX}/lib # hack
+	)
+ENDIF(NOT OPENTHREADS_LIBRARY_DEBUG)
+

 IF(OPENTHREADS_LIBRARY)
   IF(NOT OPENTHREADS_LIBRARY_DEBUG)


CodeGenerator: Allow profiding multiple KURENTO_MODULES_DIR

Change-Id: Ica1034bcbee286d216344b90a04731616192d314

--- CMake/CodeGenerator.cmake
+++ CMake/CodeGenerator.cmake
@@ -126,7 +126,11 @@
     endif()
   endforeach()

-  set (COMMAND_LINE -c ${PARAM_GEN_FILES_DIR} -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -it ${PARAM_INTERNAL_TEMPLATES_DIR})
+  foreach (MODULES_DIR ${KURENTO_MODULES_DIR})
+    set (KURENTO_MODULES_DIR_LINE "${KURENTO_MODULES_DIR_LINE};-dr;${MODULES_DIR}")
+  endforeach()
+
+  set (COMMAND_LINE -c ${PARAM_GEN_FILES_DIR} -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -it ${PARAM_INTERNAL_TEMPLATES_DIR})

   if (PARAM_NO_OVERWRITE)
     set (COMMAND_LINE ${COMMAND_LINE} -n)
@@ -331,7 +335,11 @@

   set(CUSTOM_PREFIX "kurento")

-  set (KTOOL_PROCESSOR_LINE -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR})
+  foreach (MODULES_DIR ${KURENTO_MODULES_DIR})
+    set (KURENTO_MODULES_DIR_LINE "${KURENTO_MODULES_DIR_LINE};-dr;${MODULES_DIR}")
+  endforeach()
+
+  set (KTOOL_PROCESSOR_LINE -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE})

   string(TOUPPER ${VALUE_CODE_IMPLEMENTATION_LIB} VALUE_CODE_IMPLEMENTATION_LIB_UPPER)

@@ -627,7 +635,7 @@
   )

   file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_kmd_include.cmake
-"  execute_process (COMMAND ${KurentoModuleCreator_EXECUTABLE} -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/)
+"  execute_process (COMMAND ${KurentoModuleCreator_EXECUTABLE} -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -o ${CMAKE_CURRENT_BINARY_DIR}/)

   file (READ ${CMAKE_CURRENT_BINARY_DIR}/${VALUE_NAME}.kmd.json KMD_DATA)

@@ -851,7 +859,7 @@
   ###############################################################

   execute_code_generator (
-    EXEC_PARAMS -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/kmd
+    EXEC_PARAMS -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -o ${CMAKE_CURRENT_BINARY_DIR}/kmd
   )

   file (GLOB_RECURSE FINAL_MODELS ${CMAKE_CURRENT_BINARY_DIR}/kmd/*kmd.json)
@@ -900,7 +908,7 @@

     execute_code_generator (
       EXEC_PARAMS
-        -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -c ${CMAKE_BINARY_DIR}/java -maven
+        -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -c ${CMAKE_BINARY_DIR}/java -maven
     )

     find_program(xmllint_EXECUTABLE NAMES xmllint)
@@ -921,7 +929,7 @@

     execute_code_generator (
       EXEC_PARAMS
-        -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -o ${CMAKE_BINARY_DIR}/java/src/main/kmd
+        -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -o ${CMAKE_BINARY_DIR}/java/src/main/kmd
     )

     if (${Maven_FOUND})
@@ -967,17 +975,17 @@

     execute_code_generator (
       EXEC_PARAMS
-        -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -c ${CMAKE_BINARY_DIR}/js -npm
+        -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -c ${CMAKE_BINARY_DIR}/js -npm
     )

     execute_code_generator (
       EXEC_PARAMS
-        -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -c ${CMAKE_BINARY_DIR}/js/lib -t ${KURENTO_CLIENT_JS_DIR}/templates
+        -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -c ${CMAKE_BINARY_DIR}/js/lib -t ${KURENTO_CLIENT_JS_DIR}/templates
     )

     execute_code_generator (
       EXEC_PARAMS
-        -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -o ${CMAKE_BINARY_DIR}/js/src
+        -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -o ${CMAKE_BINARY_DIR}/js/src
     )

     if (EXISTS ${CMAKE_SOURCE_DIR}/LICENSE)
@@ -1030,8 +1038,12 @@
     endif()
   endforeach()

+  foreach (MODULES_DIR ${KURENTO_MODULES_DIR})
+    set (KURENTO_MODULES_DIR_LINE "${KURENTO_MODULES_DIR_LINE};-dr;${MODULES_DIR}")
+  endforeach()
+
   execute_code_generator (
-    EXEC_PARAMS -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -s ${PARAM_KEYS}
+    EXEC_PARAMS -r ${PARAM_MODELS} ${KURENTO_MODULES_DIR_LINE} -s ${PARAM_KEYS}
     OUTPUT_VARIABLE PROCESSOR_OUTPUT
   )


Use Microsoft's statically-linked runtime, for consistency with core 3.0.

--- CMake/CompilerFlags.cmake
+++ CMake/CompilerFlags.cmake
@@ -50,6 +50,10 @@
     add_compile_options(
         /MP # Enable multi-processor compilation
     )
+    # Use statically-linked runtime, consistent with how core is built.
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
 endif()

 if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")


CMake-based support of LTO

CMake-based support of LTO

[skip ci]

--- flags/lto.cmake
+++ flags/lto.cmake
@@ -7,54 +7,11 @@
   set(POLLY_FLAGS_LTO_CMAKE_ 1)
 endif()

-include(polly_add_cache_flag)
 include(polly_fatal_error)

-string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android)
-
-# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all
-if(_not_android)
-  polly_add_cache_flag(CMAKE_CXX_FLAGS "-flto")
-  polly_add_cache_flag(CMAKE_C_FLAGS "-flto")
-else()
-  polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-flto")
-  polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-flto")
-
-  string(COMPARE EQUAL "${CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION}" "clang" _is_clang)
-
-  if(_is_clang)
-    # Fix for error "format not recognized"
-    # (tested with 'android-ndk-r14-api-21-arm64-v8a-clang-hid-sections-lto')
-    polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=gold")
-    polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=gold")
-  else()
-    # GCC, fix for "BFD: ... : plugin needed to handle lto object"
-    if(CMAKE_HOST_WIN32)
-      set(_host_tag "windows")
-    elseif(CMAKE_HOST_APPLE)
-      set(_host_tag "darwin")
-    else()
-      set(_host_tag "linux")
-    endif()
-
-    set(
-        CMAKE_AR
-        "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/${_host_tag}-x86_64/bin/arm-linux-androideabi-gcc-ar"
-        CACHE
-        PATH
-        ""
-        FORCE
-    )
-
-    set(
-        CMAKE_RANLIB
-        "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/${_host_tag}-x86_64/bin/arm-linux-androideabi-gcc-ranlib"
-        CACHE
-        PATH
-        ""
-        FORCE
-    )
-  endif()
+if(NOT POLICY CMP0069)
+  polly_fatal_error("Bad CMake version")
 endif()

-list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "lto")
+set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES)
+list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "lto.v2")


Set location of gray jpg image resource in fieldmodule tests.

--- tests/fieldmodule/tests.cmake
+++ tests/fieldmodule/tests.cmake
@@ -39,3 +39,4 @@
 SET(FIELDMODULE_ALLSHAPES_RESOURCE "${CMAKE_CURRENT_LIST_DIR}/allshapes.exformat")
 SET(FIELDMODULE_CUBE_XYZP_RESOURCE "${CMAKE_CURRENT_LIST_DIR}/cube_xyzp.exformat")
 SET(FIELDMODULE_CUBESQUARELINE_RESOURCE "${CMAKE_CURRENT_LIST_DIR}/cubesquareline.exformat")
+SET(TESTIMAGE_GRAY_JPG_RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/resources/testimage_gray.jpg")


Fix build w/CUDA11

Fix build w/CUDA11

--- caffe/cmake/Cuda.cmake
+++ caffe/cmake/Cuda.cmake
@@ -201,7 +201,12 @@
     set(HAVE_CUDNN  TRUE PARENT_SCOPE)
     set(CUDNN_FOUND TRUE PARENT_SCOPE)

-    file(READ ${CUDNN_INCLUDE}/cudnn.h CUDNN_VERSION_FILE_CONTENTS)
+    # CUDA 11 factored cudnn.h into separate headers
+    if(EXISTS "${CUDNN_INCLUDE}/cudnn_version.h")
+      file(READ ${CUDNN_INCLUDE}/cudnn_version.h CUDNN_VERSION_FILE_CONTENTS)
+    else()
+      file(READ ${CUDNN_INCLUDE}/cudnn.h CUDNN_VERSION_FILE_CONTENTS)
+    endif()

     # cuDNN v3 and beyond
     string(REGEX MATCH "define CUDNN_MAJOR * +([0-9]+)"