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


FindLLVM.cmake: Fix LLVM_LIBS_JIT_OBJECTS detection

--- CMake/FindLLVM.cmake
+++ CMake/FindLLVM.cmake
@@ -110,9 +110,9 @@
   exec_program(${LLVM_CONFIG_EXECUTABLE} ARGS --libs all OUTPUT_VARIABLE LLVM_LIBS_CORE )
   MESSAGE(STATUS "LLVM core libs: " ${LLVM_LIBS_CORE})
   IF(APPLE AND UNIVERSAL)
-    FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "jit native x86 PowerPC ARM" LLVM_LIBS_JIT LLVM_LIBS_JIT_OBJECTS )
+    FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "native x86 PowerPC ARM" LLVM_LIBS_JIT LLVM_LIBS_JIT_OBJECTS )
   ELSE(APPLE AND UNIVERSAL)
-    FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "jit native" LLVM_LIBS_JIT LLVM_LIBS_JIT_OBJECTS )
+    FIND_LLVM_LIBS( ${LLVM_CONFIG_EXECUTABLE} "native" LLVM_LIBS_JIT LLVM_LIBS_JIT_OBJECTS )
   ENDIF(APPLE AND UNIVERSAL)
   MESSAGE(STATUS "LLVM JIT libs: " ${LLVM_LIBS_JIT})
   MESSAGE(STATUS "LLVM JIT objs: " ${LLVM_LIBS_JIT_OBJECTS})


add log settings to config file

add log settings to config file

--- CMake/logtrace.cmake
+++ CMake/logtrace.cmake
@@ -39,6 +39,7 @@
 # -DSKV_SERVER_CURSOR_MANAGER_IF_LOG=1
 # -DSKV_SERVER_CURSOR_PREFETCH_COMMAND_SM_LOG=1
 # -DSKV_SERVER_CURSOR_RESERVE_RELEASE_BUF_LOG=1
+# -DSKV_SERVER_ENDIAN_LOG=1
 # -DSKV_SERVER_EVENT_BUFFER_LOG=1
 # -DSKV_SERVER_GET_COMMAND_LOG=1
 # -DSKV_SERVER_HEAP_MANAGER_LOG=1
@@ -73,6 +74,7 @@
 # -DSKV_CLIENT_CONN_INFO_LOG=1
 # -DSKV_CLIENT_CURSOR_LOG=1
 # -DSKV_CLIENT_CCB_MANAGER_LOG=1
+# -DSKV_CLIENT_ENDIAN_LOG=1
 # -DSKV_CLIENT_FREE_QUEUE_LOG=1
 # -DSKV_CLIENT_INSERT_COMMAND_SM_LOG=1
 # -DSKV_CLIENT_INSERT_LOG=1
@@ -86,6 +88,7 @@
 # -DSKV_CLIENT_REQUEST_COALESCING_LOG=1
 # -DSKV_CLIENT_RESPONSE_POLLING_LOG=1
 # -DSKV_CLIENT_RETRIEVE_COMMAND_SM_LOG=1
+# -DSKV_CLIENT_RETRIEVE_DIST_LOG=1
 # -DSKV_CLIENT_RETRIEVE_LOG=1
 # -DSKV_CLIENT_RETRIEVE_N_KEYS_DIST_LOG=1
 # -DSKV_CLIENT_REMOVE_LOG=1


CMake: update Boost usage, esp Boost Signals

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -316,13 +316,8 @@
 	# and this on newer CMake (>=2.6?)
 	#SET(LIBS ${LIBS} /usr/lib/libboost_signals.a /usr/lib/libboost_system.a)
 ELSE(BOOST_LINK_STATIC)
-	FIND_PACKAGE(Boost)
-	IF(Boost_signals_FOUND)
-		SET(LIBS ${LIBS} ${Boost_signals_LIBRARIES})
-	ELSE()
-		MESSAGE("boost-signals not found, trying just boost_signals-mt")
-		SET(LIBS ${LIBS} boost_signals-mt)
-	ENDIF()
+	FIND_PACKAGE(Boost COMPONENTS signals REQUIRED)
+	SET(LIBS ${Boost_LIBRARIES})
 ENDIF(BOOST_LINK_STATIC)

 IF(APPLE)


modules: updated FindMagnumIntegration.cmake.

--- modules/FindMagnumIntegration.cmake
+++ modules/FindMagnumIntegration.cmake
@@ -172,21 +172,44 @@

         # Bullet integration library
         if(_component STREQUAL Bullet)
-            find_package(Bullet)
-            set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
-                INTERFACE_INCLUDE_DIRECTORIES ${BULLET_INCLUDE_DIRS})
-            # Need to handle special cases where both debug and release
-            # libraries are available (in form of debug;A;optimized;B in
-            # BULLET_LIBRARIES), thus appending them one by one
-            foreach(lib BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY)
-                if(${lib}_DEBUG)
-                    set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
-                        INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:Debug>>:${${lib}}>;$<$<CONFIG:Debug>:${${lib}_DEBUG}>")
-                else()
-                    set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
-                        INTERFACE_LINK_LIBRARIES ${${lib}})
+            # On Emscripten, Bullet could be taken from ports. If that's the
+            # case, propagate proper compiler flag.
+            if(CORRADE_TARGET_EMSCRIPTEN)
+                find_file(_MAGNUMINTEGRATION_${_COMPONENT}_CONFIGURE_FILE configure.h
+                    HINTS ${MAGNUMINTEGRATION_INCLUDE_DIR}/Magnum/${_component}Integration)
+                file(READ ${_MAGNUMINTEGRATION_${_COMPONENT}_CONFIGURE_FILE} _magnum${_component}IntegrationConfigure)
+                string(FIND "${_magnum${_component}IntegrationConfigure}" "#define MAGNUM_USE_EMSCRIPTEN_PORTS_BULLET" _magnum${_component}Integration_USE_EMSCRIPTEN_PORTS_BULLET)
+                if(NOT _magnum${_component}Integration_USE_EMSCRIPTEN_PORTS_BULLET EQUAL -1)
+                    set(MAGNUM_USE_EMSCRIPTEN_PORTS_BULLET 1)
                 endif()
-            endforeach()
+            endif()
+
+            if(MAGNUM_USE_EMSCRIPTEN_PORTS_BULLET)
+                if(CMAKE_VERSION VERSION_LESS 3.13)
+                    message(FATAL_ERROR "BulletIntegration was compiled against emscripten-ports version but linking to it requires CMake 3.13 at least")
+                endif()
+                set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
+                    INTERFACE_COMPILE_OPTIONS "SHELL:-s USE_BULLET=1")
+                set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
+                    INTERFACE_LINK_OPTIONS "SHELL:-s USE_BULLET=1")
+            else()
+                find_package(Bullet)
+
+                set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
+                    INTERFACE_INCLUDE_DIRECTORIES ${BULLET_INCLUDE_DIRS})
+                # Need to handle special cases where both debug and release
+                # libraries are available (in form of debug;A;optimized;B in
+                # BULLET_LIBRARIES), thus appending them one by one
+                foreach(lib BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY)
+                    if(${lib}_DEBUG)
+                        set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
+                            INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:Debug>>:${${lib}}>;$<$<CONFIG:Debug>:${${lib}_DEBUG}>")
+                    else()
+                        set_property(TARGET MagnumIntegration::${_component} APPEND PROPERTY
+                            INTERFACE_LINK_LIBRARIES ${${lib}})
+                    endif()
+                endforeach()
+            endif()

             set(_MAGNUMINTEGRATION_${_COMPONENT}_INCLUDE_PATH_NAMES MotionState.h)


CMake: removing unnecessary precedence of shared MED library detection

--- salome_adm/cmake_files/FindMEDFile.cmake
+++ salome_adm/cmake_files/FindMEDFile.cmake
@@ -42,8 +42,8 @@

 FIND_PATH(MEDFILE_INCLUDE_DIRS med.h)
 #FIND_PROGRAM(MDUMP mdump)
-FIND_LIBRARY(MEDFILE_C_LIBRARIES NAMES libmedC.so medC)
-FIND_LIBRARY(MEDFILE_F_LIBRARIES NAMES libmed.so med)
+FIND_LIBRARY(MEDFILE_C_LIBRARIES NAMES medC)
+FIND_LIBRARY(MEDFILE_F_LIBRARIES NAMES med)
 IF(MEDFILE_F_LIBRARIES)
   SET(MEDFILE_LIBRARIES ${MEDFILE_C_LIBRARIES} ${MEDFILE_F_LIBRARIES})
 ELSE(MEDFILE_F_LIBRARIES)


Experiment always building pugl on macOS cmake

Signed-off-by: falkTX <d7e5958cbb080ba57e41fb602ade747e1a2da17c@falktx.com>

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -468,9 +468,9 @@
   if(NOT APPLE)
     target_sources(dgl-cairo PRIVATE
       "${DPF_ROOT_DIR}/dgl/src/pugl.cpp")
-  else() # Note: macOS pugl will be built as part of DistrhoUI_macOS.mm
-    #target_sources(dgl-opengl PRIVATE
-    #  "${DPF_ROOT_DIR}/dgl/src/pugl.mm")
+  else()
+    target_sources(dgl-opengl PRIVATE
+     "${DPF_ROOT_DIR}/dgl/src/pugl.mm")
   endif()
   target_include_directories(dgl-cairo PUBLIC
     "${DPF_ROOT_DIR}/dgl")
@@ -530,9 +530,9 @@
   if(NOT APPLE)
     target_sources(dgl-opengl PRIVATE
       "${DPF_ROOT_DIR}/dgl/src/pugl.cpp")
-  else() # Note: macOS pugl will be built as part of DistrhoUI_macOS.mm
-    #target_sources(dgl-opengl PRIVATE
-    #  "${DPF_ROOT_DIR}/dgl/src/pugl.mm")
+  else()
+    target_sources(dgl-opengl PRIVATE
+      "${DPF_ROOT_DIR}/dgl/src/pugl.mm")
   endif()
   target_include_directories(dgl-opengl PUBLIC
     "${DPF_ROOT_DIR}/dgl")


[cmake] add current matlab versions, tested on 2020a


[cmake] FindMATLAB: indentify matlab extiension

--- cmake/FindMATLAB.cmake
+++ cmake/FindMATLAB.cmake
@@ -180,6 +180,14 @@
     OUTPUT_VARIABLE MATLAB_ENG_LIBRARY
     )

+   EXECUTE_PROCESS(
+       COMMAND "${MATLAB_ROOT}/bin/mexext"
+       COMMAND xargs echo -n
+       OUTPUT_VARIABLE MATLAB_MEXEXT
+       )
+
+
+
   # Get path to the include directory
   FIND_PATH(MATLAB_INCLUDE_DIR
     "mex.h"
@@ -205,6 +213,7 @@
   MATLAB_MX_LIBRARY
   MATLAB_ENG_LIBRARY
   MATLAB_INCLUDE_DIR
+  MATLAB_MEXEXT
   MATLAB_FOUND
   MATLAB_ROOT
 )


add in remaining dependencies; switch to the ninja generator and use ninja to build; configure CSim to build and test using dependencies built with external projects; this now works on OS X to download and build all dependencies and successfully build CSim and have it pass tests.

--- cmake/SuperBuild.cmake
+++ cmake/SuperBuild.cmake
@@ -4,7 +4,6 @@
 set (DEPENDENCIES_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/local")
 set (DEPENDENCIES_CMAKE_ARGS
     -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_INSTALL_DIR}
-    -DBUILD_TESTS=OFF
     -DPACKAGE_CONFIG_DIR=cmake
     -DCMAKE_PREFIX_PATH=${DEPENDENCIES_INSTALL_DIR}/cmake
     )
@@ -23,9 +22,11 @@

   UPDATE_COMMAND ""
   PATCH_COMMAND ""
+  BUILD_COMMAND "ninja"
   TEST_COMMAND ""

-  CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS}
+  CMAKE_GENERATOR "Ninja"
+  CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS} -DBUILD_TESTS=OFF
   )

 list (APPEND DEPENDENCIES ep_libxml2)
@@ -36,9 +37,11 @@

   UPDATE_COMMAND ""
   PATCH_COMMAND ""
+  BUILD_COMMAND "ninja"
   TEST_COMMAND ""

-  CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS}
+  CMAKE_GENERATOR "Ninja"
+  CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS} -DBUILD_TESTS=OFF
   )

 # Despite the name, this is still the CellML API
@@ -50,8 +53,40 @@

   UPDATE_COMMAND ""
   PATCH_COMMAND ""
+  BUILD_COMMAND "ninja"
   TEST_COMMAND ""

+  CMAKE_GENERATOR "Ninja"
+  CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS}
+  )
+
+list (APPEND DEPENDENCIES ep_llvm)
+ExternalProject_Add (ep_llvm
+  DEPENDS ep_libxml2
+  GIT_REPOSITORY https://github.com/OpenCMISS-Dependencies/llvm
+  GIT_TAG devel
+
+  CMAKE_GENERATOR "Ninja"
+  UPDATE_COMMAND ""
+  PATCH_COMMAND ""
+  BUILD_COMMAND "ninja"
+  TEST_COMMAND ""
+
+  CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS}
+  )
+
+list (APPEND DEPENDENCIES ep_clang)
+ExternalProject_Add (ep_clang
+  DEPENDS ep_llvm ep_libxml2 ep_zlib
+  GIT_REPOSITORY https://github.com/nickerso/opencmiss-clang
+  GIT_TAG backport-3.8-libxml-patch
+
+  UPDATE_COMMAND ""
+  PATCH_COMMAND ""
+  BUILD_COMMAND "ninja"
+  TEST_COMMAND ""
+
+  CMAKE_GENERATOR "Ninja"
   CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS}
   )

@@ -61,10 +96,16 @@
 #  -DBoost_NO_SYSTEM_PATHS=ON)

 # FIXME add to default target "all"?
-#ExternalProject_Add (ep_blah
-#  DEPENDS ${DEPENDENCIES}
-#  SOURCE_DIR ${PROJECT_SOURCE_DIR}
-#  CMAKE_ARGS -DUSE_SUPERBUILD=OFF ${EXTRA_CMAKE_ARGS}
-#  INSTALL_COMMAND ""
-#  BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/blah)
+ExternalProject_Add (ep_csim
+  DEPENDS ${DEPENDENCIES}
+  SOURCE_DIR ${PROJECT_SOURCE_DIR}

+  CMAKE_GENERATOR "Ninja"
+  CMAKE_ARGS -DUSE_SUPERBUILD=OFF -DCMAKE_PREFIX_PATH=${DEPENDENCIES_INSTALL_DIR}/cmake -DBUILD_TESTING=ON
+
+  TEST_COMMAND "ctest"
+  INSTALL_COMMAND ""
+  BUILD_COMMAND "ninja"
+  BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/csim
+)
+


revert some version changes

revert some version changes

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -12,7 +12,8 @@
 endif()

 set(libbot_url https://github.com/openhumanoids/libbot.git)
-set(libbot_revision 92cf3eaef17659990104da40866c5d466a453b17)
+#set(libbot_revision 92cf3eaef17659990104da40866c5d466a453b17) # this revision needs a few more fixes
+set(libbot_revision eb61f9bed5df654ffb0ce47ce44ca3d379a6e6e8)
 set(libbot_depends ${lcm_proj})

 set(Eigen_pod_url https://github.com/RobotLocomotion/eigen-pod.git)
@@ -42,7 +43,8 @@
   )

 set(pcl_url http://github.com/pointcloudlibrary/pcl.git)
-set(pcl_revision pcl-1.7.2)
+#set(pcl_revision pcl-1.7.2) # this version introduces some missing openni pkg-config file bug
+set(pcl_revision pcl-1.7.1)
 set(pcl_depends flann Eigen_pod)
 set(pcl_external_args
   CMAKE_CACHE_ARGS
@@ -82,7 +84,8 @@
 set(bullet_depends)

 set(fovis_url ssh://git@github.com/fovis/fovis.git)
-set(fovis_revision 2862e080dee2519932585b46cc301a38d8cad1f4)
+#set(fovis_revision 2862e080dee2519932585b46cc301a38d8cad1f4) # this is the newer version, but removes fovis-bot2
+set(fovis_revision ee2fe6593ed9e7e5ce2b2f6f1c64b627da119090)
 set(fovis_depends libbot)

 set(estimate-pose_url https://github.com/openhumanoids/estimate-pose.git)


Update hunter gate

Update hunter gate

--- HunterGate.cmake
+++ HunterGate.cmake
@@ -14,8 +14,8 @@

 cmake_minimum_required(VERSION 2.8.10)

-set(HUNTER_MINIMUM_VERSION "0.3.3")
-set(HUNTER_MINIMUM_VERSION_HASH 2c94192b1fedca076888ed83261ffd51c735219b)
+set(HUNTER_MINIMUM_VERSION "0.3.7")
+set(HUNTER_MINIMUM_VERSION_HASH 2e0fd774b5f03bd0789964aadbe0c90eb6ffff6b)

 # Set HUNTER_ROOT cmake variable to suitable value.
 # Info about variable can be found in HUNTER_ROOT_INFO.
@@ -226,6 +226,7 @@
   message(
       FATAL_ERROR
       "Internal error: HUNTER_VERSION is not set in `version.cmake`"
+      " (${HUNTER_ROOT_INFO})"
   )
 endif()

@@ -240,6 +241,8 @@
     message(
         FATAL_ERROR
         "Please update version manually or remove directory `${HUNTER_ROOT}`."
+        " Version read from file `${HUNTER_ROOT}/Source/cmake/version.cmake`."
+        " (${HUNTER_ROOT_INFO})"
     )
   endif()

@@ -247,6 +250,7 @@
     message(
         FATAL_ERROR
         "Internal error: `installed.by.gate` and `.git`"
+        " (${HUNTER_ROOT_INFO})"
     )
   endif()
   # File `${HUNTER_ROOT}/installed.by.gate` exists, hence current version


experimental emscripten support

experimental emscripten support

--- build_options.cmake
+++ build_options.cmake
@@ -63,6 +63,9 @@
     include( "${CMAKE_CURRENT_LIST_DIR}/toolchains/linux.toolchain.cmake" )
 elseif( ANDROID_TOOLCHAIN ) # TNUN android.toolchain.cmake does not define this variable, while native Android Studio toolchain does
     include( "${CMAKE_CURRENT_LIST_DIR}/toolchains/android-studio.toolchain.cmake" )
+elseif( "${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten" )
+    include( "${CMAKE_CURRENT_LIST_DIR}/toolchains/clang.cmake" )
+    include( "${CMAKE_CURRENT_LIST_DIR}/toolchains/gcc_compatibles_stl.cmake" )
 else()
     # Android and iOS (crosscompiling platforms) have to specify the toolchain
     # file explicitly.


fix compilation errors when it can't find correct library dirs

The reason is that we specify `LLVM_LIBRARY_DIRS` in
`backend/src/CMakeLists.txt`, while in `FindLLVM.cmake`, we name it wrong.

--- CMake/FindLLVM.cmake
+++ CMake/FindLLVM.cmake
@@ -1,7 +1,7 @@
 # Find the native LLVM includes and library
 #
 #  LLVM_INCLUDE_DIR - where to find llvm include files
-#  LLVM_LIBRARY_DIR - where to find llvm libs
+#  LLVM_LIBRARY_DIRS - where to find llvm libs
 #  LLVM_CFLAGS      - llvm compiler flags
 #  LLVM_LFLAGS      - llvm linker flags
 #  LLVM_MODULE_LIBS - list of llvm libs for working with modules.
@@ -39,7 +39,7 @@

 execute_process(
   COMMAND ${LLVM_CONFIG_EXECUTABLE} --libdir
-  OUTPUT_VARIABLE LLVM_LIBRARY_DIR
+  OUTPUT_VARIABLE LLVM_LIBRARY_DIRS
   OUTPUT_STRIP_TRAILING_WHITESPACE
 )


cmake: dont use _AI_DEBUG

cmake: dont use _AI_DEBUG

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -206,7 +206,7 @@

 IF(DEBUG)
-	ADD_DEFINITIONS(-DDEBUG=1 -D_AI_DEBUG)
+	ADD_DEFINITIONS(-DDEBUG=1)
 ENDIF(DEBUG)

 IF(MEMSTATS)


Added logic to set ENV variables for MUMPS compilation

--- ydbcmake/CMakeDetermineMUMPSCompiler.cmake
+++ ydbcmake/CMakeDetermineMUMPSCompiler.cmake
@@ -33,6 +33,51 @@
 set(YOTTADB_INCLUDE_DIRS ${YOTTADB_INCLUDE_DIR})

 if(MUMPS_UTF8_MODE)
+find_program(ICUCONFIG NAMES icu-config)
+  if(ICUCONFIG)
+    execute_process(
+      COMMAND ${ICUCONFIG} --version
+      OUTPUT_VARIABLE icu_version
+      RESULT_VARIABLE icu_failed
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      )
+    if(icu_failed)
+      message(FATAL_ERROR "Command\n ${ICUCONFIG} --version\nfailed (${icu_failed}).")
+    elseif("x${icu_version}" MATCHES "^x([0-9]+\\.[0-9]+)")
+      set(ydb_icu_version "${CMAKE_MATCH_1}")
+    else()
+      message(FATAL_ERROR "Command\n ${ICUCONFIG} --version\nproduced unrecognized output:\n ${icu_version}")
+    endif()
+  else()
+    message(FATAL_ERROR "Unable to find 'icu-config'.  Set ICUCONFIG in CMake cache.")
+  endif()
+
+  find_program(LOCALECFG NAMES locale)
+  if(LOCALECFG)
+    execute_process(
+      COMMAND ${LOCALECFG} -a
+      OUTPUT_VARIABLE locale_list
+      RESULT_VARIABLE locale_failed
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      )
+    if(locale_failed)
+      message(FATAL_ERROR "Command\n ${LOCALECFG} -a\nfailed (${locale_failed}).")
+    endif()
+    STRING(REGEX REPLACE "\n" ";" locale_list "${locale_list}")
+    foreach(lc ${locale_list})
+      string(TOLOWER "${lc}" lc_lower)
+      if("x${lc_lower}" MATCHES "^x[a-zA-Z_]+\\.?utf-?8")
+        set(LC_ALL ${lc})
+        message("-- Setting locale to ${LC_ALL}")
+        break()
+      endif()
+    endforeach(lc)
+    if("${LC_ALL}" STREQUAL "")
+      message("Locale undefined. Expect to see NONUTF8LOCALE during MUMPS routine compilation: ${locale_list}\n")
+    endif()
+  else()
+    message(FATAL_ERROR "Unable to find 'locale'.  Set LOCALECFG in CMake cache.")
+  endif()
   set(CMAKE_MUMPS_COMPILER ${YOTTADB_INCLUDE_DIRS}/utf8/mumps)
 else()
   set(CMAKE_MUMPS_COMPILER ${YOTTADB_INCLUDE_DIRS}/mumps)


Pass CMAKE_GENERATOR_PLATFORM to MITK-Configure

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -353,6 +353,7 @@
   LIST_SEPARATOR ${sep}
   DOWNLOAD_COMMAND ""
   CMAKE_GENERATOR ${gen}
+  CMAKE_GENERATOR_PLATFORM ${gen_platform}
   CMAKE_CACHE_ARGS
     # --------------- Build options ----------------
     -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}


Execute checks PRE_LINK.

Execute checks PRE_LINK.

This ensures that they occurr after source files have been generated
but before the final target was linked, so that if errors are generated
as a result of the check process then the target won't be marked
as successfully built.

--- CPPCheck.cmake
+++ CPPCheck.cmake
@@ -44,7 +44,7 @@
     endif (ADD_CHECKS_OPTIONS_COMMENT)

     add_custom_command (TARGET ${TARGET}
-                        POST_BUILD
+                        PRE_LINK
                         COMMAND
                         ${CPPCHECK_EXECUTABLE}
                         ARGS


Enable address sanitizer on gcc >= 4.8

Enable address sanitizer on gcc >= 4.8

--- Compiler.cmake
+++ Compiler.cmake
@@ -55,6 +55,9 @@
   endif()
   if(CMAKE_COMPILER_IS_CLANG)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+  endif()
+  if(NOT GCC_COMPILER_VERSION VERSION_LESS 4.8)
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
   endif()

 # icc


Update CTest.cmake

Update CTest.cmake

--- SuperBuild/CTest.cmake
+++ SuperBuild/CTest.cmake
@@ -61,4 +61,4 @@

 ctest_configure()
 ctest_build()
-ctest_submit( PARTS Configure Build Update )
+# ctest_submit( PARTS Configure Build Update )


Allow re-inclusion of Common, needed for Eq build

--- Common.cmake
+++ Common.cmake
@@ -8,6 +8,11 @@
 # Output Variables
 # * COMMON_INCLUDES: generated include files (version, defines, api)
 # * COMMON_SOURCES: generated cpp files (version)
+
+if(COMMON_INCLUDED)
+  return()
+endif()
+set(COMMON_INCLUDED 1)

 if(CMAKE_INSTALL_PREFIX STREQUAL CMAKE_BINARY_DIR)
   message(FATAL_ERROR "Cannot install into build directory")


support clang-3.9

support clang-3.9

--- test/EnableMaxWarnings.cmake
+++ test/EnableMaxWarnings.cmake
@@ -15,8 +15,7 @@
           -pedantic-errors -Wshadow -Wcast-qual -Wmissing-include-dirs
           -Wnon-virtual-dtor -Wconversion -Wsign-conversion -Wfloat-equal
           -Winvalid-pch -Wuninitialized -Wunused -Wunused-parameter -Wformat=2
-          -Wdisabled-optimization -Wvla -Wundef -Wzero-as-null-pointer-constant
-          -Wmissing-declarations)
+          -Wdisabled-optimization -Wvla -Wundef -Wmissing-declarations)

     # clang or gcc
     if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR
@@ -26,6 +25,14 @@
                 -Wstack-protector -Wpacked -Wnull-dereference -Wregister
                 -Wold-style-cast -Wdouble-promotion -Wformat-nonliteral
                 -Wmissing-noreturn -Wctor-dtor-privacy -Winline)
+    endif()
+
+    # gcc or clang6.0 (or higher)
+    if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
+               ((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND
+               (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)))
+        target_compile_options(${target} PRIVATE
+                -Wzero-as-null-pointer-constant)
     endif()

     # clang, or gcc10(or higher)
@@ -44,33 +51,36 @@
         target_compile_options(${target} PRIVATE  -ferror-limit=3
                 -Wcast-align -Wmismatched-tags -Wabstract-vbase-init
                 -Warray-bounds-pointer-arithmetic -Wassign-enum
-                -Watomic-properties -Wauto-import -Wbinary-literal
-                -Wc++14-compat-pedantic -Wc++14-extensions
-                -Wc++17-compat-pedantic -Wc++17-extensions -Wclass-varargs
-                -Wcomma -Wconditional-uninitialized -Wconsumed
-                -Wcuda-compat -Wdeprecated
-                -Wduplicate-enum -Wformat-non-iso -Wformat-pedantic -Wgcc-compat
-                -Wgnu -Wheader-hygiene -Widiomatic-parentheses
-                -Wimplicitly-unsigned-literal
-                -Winconsistent-missing-destructor-override -Wloop-analysis
-                -Wmicrosoft -Wmissing-variable-declarations -Wnewline-eof
-                -Wnon-gcc -Wnonportable-system-include-path
+                -Watomic-properties -Wauto-import -Wc++14-compat-pedantic
+                -Wc++14-extensions -Wclass-varargs -Wcomma
+                -Wconditional-uninitialized -Wconsumed -Wcuda-compat
+                -Wdeprecated -Wduplicate-enum -Wformat-non-iso -Wformat-pedantic
+                -Wgcc-compat -Wgnu -Wheader-hygiene -Widiomatic-parentheses
+                -Wimplicitly-unsigned-literal -Wloop-analysis -Wmicrosoft
+                -Wmissing-variable-declarations -Wnewline-eof -Wnon-gcc
+                -Wnonportable-system-include-path
                 -Wnullable-to-nonnull-conversion -Wopenmp-clauses -Wover-aligned
                 -Wpedantic-core-features -Wpointer-arith
-                -Wpointer-to-int-cast -Wpragma-pack -Wpragmas
-                -Wprofile-instr-missing -Wredundant-parens -Wreserved-id-macro
+                -Wpointer-to-int-cast -Wpragmas -Wreserved-id-macro
                 -Wreserved-user-defined-literal -Wretained-language-linkage
-                -Wshadow-all -Wshift-sign-overflow -Wsigned-enum-bitfield
-                -Wsource-uses-openmp -Wspir-compat -Wstatic-in-inline
-                -Wstrict-selector-match -Wswitch-enum
-                -Wtautological-constant-in-range-compare -Wthread-safety
+                -Wshadow-all -Wshift-sign-overflow
+                -Wsource-uses-openmp -Wstatic-in-inline
+                -Wstrict-selector-match -Wswitch-enum -Wthread-safety
                 -Wthread-safety-negative -Wundefined-func-template
                 -Wundefined-reinterpret-cast -Wunguarded-availability
                 -Wunnamed-type-template-args -Wunreachable-code-aggressive
                 -Wunsupported-dll-base-class-template
                 -Wunused-exception-parameter -Wunused-member-function
-                -Wunused-template -Wvector-conversion
-                -Wwritable-strings)
+                -Wvector-conversion -Wwritable-strings)
+        if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
+            target_compile_options(${target} PRIVATE
+                -Wbinary-literal -Wc++17-compat-pedantic -Wc++17-extensions
+                -Winconsistent-missing-destructor-override -Wpragma-pack
+                -Wprofile-instr-missing -Wredundant-parens
+                -Wsigned-enum-bitfield -Wspir-compat
+                -Wtautological-constant-in-range-compare -Wunused-template
+                )
+        endif()
         # gtest has problems with -Wcovered-switch-default and
         # -Wused-but-marked-unused, so we don't use them.
         if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)


added cmake find mkldnn lib

added cmake find mkldnn lib

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -143,5 +143,8 @@
 ENDIF()

 IF(USE_MKLDNN)
-    LIST(APPEND SINGA_LINKER_LIBS mkldnn)
+    FIND_PATH(MKLDNN_INCLUDE_DIR NAME "mkldnn.hpp" PATHS "$ENV{CMAKE_INCLUDE_PATH}")
+    FIND_LIBRARY(MKLDNN_LIBRARIES NAME "libmkldnn.so" PATHS "$ENV{CMAKE_LIBRARY_PATH}")
+    INCLUDE_DIRECTORIES(SYSTEM ${MKLDNN_INCLUDE_DIR})
+    LIST(APPEND SINGA_LINKER_LIBS ${MKLDNN_LIBRARIES})
 ENDIF()


Fixed if clause.

Fixed if clause.

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -158,7 +158,7 @@
     set(COVERAGE_FLAGS "-fprofile-arcs -ftest-coverage")
   else(EIGEN_COVERAGE_TESTING)
     set(COVERAGE_FLAGS "")
-  endif(EIGEN_ENABLE_COVERAGE_TESTING)
+  endif(EIGEN_COVERAGE_TESTING)
   if(CMAKE_SYSTEM_NAME MATCHES Linux)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2")
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2")


nifti 2022-08-03 (3146cac8)

nifti 2022-08-03 (3146cac8)

Code extracted from:

    https://github.com/NIFTI-Imaging/nifti_clib.git

at commit 3146cac8ef7addc8dfd3b67734c2bf97ee611f3b (master).

--- cmake/nifti_macros.cmake
+++ cmake/nifti_macros.cmake
@@ -135,7 +135,6 @@
             COMPONENT Development
           INCLUDES
             DESTINATION ${NIFTI_INSTALL_INCLUDE_DIR}
-            COMPONENT Development
           )
 endfunction()


* Remove used compiler in package names as binaries can now be used with both, clang and gcc

git-svn-id: ff420cdfd4b96e96fca1ec56388a20c3b5ac679c@329 9e4c620c-c391-4b63-a7fb-4924991ea895

--- package/version.cmake
+++ package/version.cmake
@@ -69,9 +69,9 @@
 set( CPACK_COMPONENT_LIBXDISPATCH_DISPLAY_NAME "XDispatch")
 set( CPACK_COMPONENT_LIBXDISPATCH_DESCRIPTION "C++ API for Grand Central Dispatch")
 if(APPLE)
-    set( CPACK_COMPONENT_LIBXDISPATCH_DEPENDS libdispatch)
+    set( CPACK_COMPONENT_LIBXDISPATCH_DEPENDS )
 else()
-    set( CPACK_COMPONENT_LIBXDISPATCH_DEPENDS )
+    set( CPACK_COMPONENT_LIBXDISPATCH_DEPENDS libdispatch )
 endif()
 set( CPACK_COMPONENT_LIBXDISPATCH-DEV_DISPLAY_NAME "XDispatch - Development Files")
 set( CPACK_COMPONENT_LIBXDISPATCH-DEV_DESCRIPTION "C++ API for Grand Central Dispatch")
@@ -90,7 +90,7 @@
 set( CPACK_PACKAGE_VERSION_MINOR 	"${XDISPATCH_VERSION_MINOR}")
 set( CPACK_PACKAGE_VERSION_PATCH 	"${XDISPATCH_VERSION_PATCH}")
 set( CPACK_PACKAGE_VERSION 		"${XDISPATCH_VERSION}")
-set( CPACK_PACKAGE_FILE_NAME 		"${XDISPATCH_LIBRARY_NAME}_${CPACK_PACKAGE_VERSION}_${CMAKE_SYSTEM_NAME}_${PACKAGE_COMPILER}_${PACKAGE_ARCH}")
+set( CPACK_PACKAGE_FILE_NAME 		"${XDISPATCH_LIBRARY_NAME}_${CPACK_PACKAGE_VERSION}_${CMAKE_SYSTEM_NAME}_${PACKAGE_ARCH}")

 # some debugging output


CELIX-237: added x86_64-linux-gnu as path suffixes

--- cmake/FindFFI.cmake
+++ cmake/FindFFI.cmake
@@ -34,12 +34,13 @@

 find_library(FFI_LIBRARY NAMES ffi libffi
         PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr/local /opt/local
+        PATH_SUFFIXES lib x86_64-linux-gnu lib/x86_64-linux-gnu lib64
         HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS}
 )

 find_path(FFI_INCLUDE_DIR ffi.h
 		PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local
-        PATH_SUFFIXES include include/ffi
+        PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu x86_64-linux-gnu
         HINTS ${PC_LIBFFI_INCLUDEDIR} ${PC_LIBFFI_INCLUDE_DIRS}
 )


cmake: dont require the TBB debug and malloc libs

We dont use them and travis dont supply them

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -116,7 +116,8 @@
     message ( "TBB_ROOT: " ${TBB_ROOT} )

     include( FindPackageHandleStandardArgs )
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS( TBB DEFAULT_MSG TBB_LIBRARY TBB_MALLOC_LIBRARY TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG TBB_INCLUDE_DIRS TBB_ROOT)
+    #FIND_PACKAGE_HANDLE_STANDARD_ARGS( TBB DEFAULT_MSG TBB_LIBRARY TBB_MALLOC_LIBRARY TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG TBB_INCLUDE_DIRS TBB_ROOT)
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS( TBB DEFAULT_MSG TBB_LIBRARY TBB_INCLUDE_DIRS TBB_ROOT)

     if( NOT TBB_FOUND )
         message( STATUS "FindTBB looked for libraries named tbb but could not find" )


[refactor] Use lidarview_executables on bundle.

We now use the lidarview_executables list to install
all the programs for the UNIX bundle.

--- Superbuild/Projects/unix/lidarview.bundle.cmake
+++ Superbuild/Projects/unix/lidarview.bundle.cmake
@@ -12,10 +12,16 @@
   "lib"
   SEARCH_DIRECTORIES  "${library_paths}")

-# Install PacketFileSender executables.
-superbuild_unix_install_program("${superbuild_install_location}/bin/PacketFileSender"
-  "lib"
-  SEARCH_DIRECTORIES  "${library_paths}")
+# Remove "LidarView" from the list since we just installed it above.
+list(REMOVE_ITEM lidarview_executables
+  ${SOFTWARE_NAME})
+
+# Install other executables.
+foreach (executable IN LISTS lidarview_executables)
+  superbuild_unix_install_program("${superbuild_install_location}/bin/${executable}"
+    "lib"
+    SEARCH_DIRECTORIES  "${library_paths}")
+endforeach ()

 # install paraview plugins
 foreach (lidarview_plugin_path IN LISTS lidarview_plugin_paths)


fix checking boolean variable which might contain a string (#165)

--- rmw/cmake/get_rmw_typesupport.cmake
+++ rmw/cmake/get_rmw_typesupport.cmake
@@ -37,7 +37,7 @@
     set(resource_type "${resource_type}_${ARG_LANGUAGE}")
   endif()
   ament_index_has_resource(has_resource "${resource_type}" "${rmw_implementation}")
-  if(${has_resource})
+  if(has_resource)
     ament_index_get_resource(resource "${resource_type}" "${rmw_implementation}")
   else()
     set(resource "")


Fix typo in comment

Fix typo in comment

--- cmake/Modules/GroupTargetSources.cmake
+++ cmake/Modules/GroupTargetSources.cmake
@@ -1,5 +1,5 @@
-# group_target_sources(target) - group target's source files on based on
-# their directory.
+# group_target_sources(target) - group target's source files based on
+# their path.

 function(group_target_sources target)
   get_target_property(sources ${target} SOURCES)
@@ -14,4 +14,4 @@
     string(REGEX REPLACE "/" "\\\\" win_path "${path}")
     source_group("${win_path}" REGULAR_EXPRESSION "${path}/[^/\\]+\\..*")
   endforeach()
-endfunction()+endfunction()


C++ build templates should use the C++ compiler

--- cmake/platform/android.toolchain.cmake
+++ cmake/platform/android.toolchain.cmake
@@ -1283,9 +1283,9 @@
 endif()

 if( ANDROID_STL MATCHES "gnustl" AND (EXISTS "${__libstl}" OR EXISTS "${__libsupcxx}") )
- set( CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
- set( CMAKE_CXX_CREATE_SHARED_MODULE  "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
- set( CMAKE_CXX_LINK_EXECUTABLE       "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" )
+ set( CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
+ set( CMAKE_CXX_CREATE_SHARED_MODULE  "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
+ set( CMAKE_CXX_LINK_EXECUTABLE       "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" )
 else()
  set( CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
  set( CMAKE_CXX_CREATE_SHARED_MODULE  "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )


Remove duplicates from toolchain.info

Remove duplicates from toolchain.info

Fix #1589

--- scripts/create-toolchain-info.cmake
+++ scripts/create-toolchain-info.cmake
@@ -114,7 +114,7 @@

 split_string("${outresult}" list_of_strings)

-set(macroses "")
+set(macros_list "")
 foreach(x ${list_of_strings})
   string(
       REGEX
@@ -132,13 +132,22 @@
         result_x
         "${x}"
     )
-    set(macroses "${macroses}${result_x}\n")
+
+    string(FIND "${result_x}" ";" semicolon_pos)
+    if(NOT semicolon_pos EQUAL "-1")
+      hunter_internal_error("Semicolon in string: '${result_x}'")
+    endif()
+
+    list(APPEND macros_list "${result_x}")
   endif()
 endforeach()

-string(COMPARE EQUAL "${macroses}" "" is_empty)
+list(REMOVE_DUPLICATES macros_list)
+string(REPLACE ";" "\n" macros_string "${macros_list}")
+
+string(COMPARE EQUAL "${macros_string}" "" is_empty)
 if(is_empty)
   hunter_fatal_error("No toolchain info generated" WIKI error.no.toolchain.info)
 endif()

-file(APPEND "${TOOLCHAIN_INFO_FILE}" "Predefined macroses:\n${macroses}")
+file(APPEND "${TOOLCHAIN_INFO_FILE}" "Predefined macroses:\n${macros_string}")


[Build] Generalised the module_python_add CMake macro to any type of scripts (Shell, Python, Perl, Ruby, etc).

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -1483,8 +1483,15 @@
 endmacro (module_binary_add)

 ##
-# Add a Python script to be installed
-macro (module_python_add _script_file)
+# Add a (Shell, Python, Perl, Ruby, etc) script to be installed.
+#
+# The parameter is the relative file path of the (template) script to
+# be installed. That template file must end with the '.in' suffix.
+# Indeed, the project variables (wrapped by @@ signs) of the template file
+# are evaluated and expanded thanks to the configure command.
+# The '.in' extension of the script is dropped once installed.
+#
+macro (module_script_add _script_file)
   #
   set (_full_script_src_path ${CMAKE_CURRENT_SOURCE_DIR}/${_script_file}.in)
   set (_full_script_path ${CMAKE_CURRENT_BINARY_DIR}/${_script_file})
@@ -1492,11 +1499,14 @@
 	#
     configure_file (${_full_script_src_path} ${_full_script_path} @ONLY)

-    # Add the 'scripts_${MODULE_NAME}' target, depending on the
-    # converted (Python) scripts
-    add_custom_target (scripts_${MODULE_NAME} ALL DEPENDS ${_full_script_path})
-
-    # Install the (Python) script file
+	# Extract the file name (only) from the full file path
+	get_filename_component (_script_alone ${_script_file} NAME)
+
+	# Add the 'scripts_${MODULE_NAME}' target, depending on the
+    # converted (Shell, Python, Perl, Ruby, etc) scripts
+    add_custom_target (${_script_alone}_script ALL DEPENDS ${_full_script_path})
+
+    # Install the (Shell, Python, Perl, Ruby, etc) script file
     install (PROGRAMS ${_full_script_path} DESTINATION bin COMPONENT devel)

   else (EXISTS ${_full_script_src_path})
@@ -1505,7 +1515,6 @@
   endif (EXISTS ${_full_script_src_path})

   # Register the binary target in the project (for reporting purpose)
-  get_filename_component (_script_alone ${_script_file} NAME)
   list (APPEND PROJ_ALL_BIN_TARGETS ${_script_alone})
   set (PROJ_ALL_BIN_TARGETS ${PROJ_ALL_BIN_TARGETS} PARENT_SCOPE)

@@ -1514,7 +1523,7 @@
   list (APPEND ${MODULE_NAME}_ALL_EXECS ${_script_alone})
   set (${MODULE_NAME}_ALL_EXECS ${${MODULE_NAME}_ALL_EXECS} PARENT_SCOPE)

-endmacro (module_python_add)
+endmacro (module_script_add)

 ##
 # Installation of the CMake import helper, so that third party projects


Fix spelling error in CMake file.

Fix spelling error in CMake file.

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -276,7 +276,7 @@
 endif ()

 if(OGRE_CONFIG_STATIC_LINK_CRT)
-#We statically link to reduce dependancies
+#We statically link to reduce dependencies
 foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
     if(${flag_var} MATCHES "/MD")
         string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")


ENH: Update RigidAlignment

ENH: Update RigidAlignment

--- SuperBuild/External_RigidAlignment.cmake
+++ SuperBuild/External_RigidAlignment.cmake
@@ -22,13 +22,13 @@

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

   ExternalProject_SetIfNotDefined(
     ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG
-    "4435e0bd07a82d4077c66b0ba52a0b651b857936" # slicersalt-0.0.0-2017-09-11-ca0c6dfff1
+    "6545c99d5d301912e6f9471eb21754b4846b92d9" # slicersalt-0.0.0-2017-09-11-ca0c6dfff1
     QUIET
     )


COMP: On some project configure may not copy right away

--- Utilities/kwsys/CheckCXXSourceRuns.cmake
+++ Utilities/kwsys/CheckCXXSourceRuns.cmake
@@ -30,7 +30,7 @@
     ENDIF(CMAKE_REQUIRED_INCLUDES)
     SET(CMAKE_EMPTY_INPUT_FILE_CONTENT "${SOURCE}")
     CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CMakeEmptyInputFile.in"
-      "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx")
+      "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx" IMMEDIATE)

     MESSAGE(STATUS "Performing Test ${COMMENT}")
     TRY_RUN(${VAR} HAVE_${VAR}


xpCommonFlags: remove SunOS support

xpCommonFlags: remove SunOS support

issue https://github.com/smanders/externpro/issues/338

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1968,19 +1968,6 @@
       add_definitions(-D_DEBUG)
     endif()
     include(CheckCCompilerFlag)
-    if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
-      # Solaris hard-coded to 64-bit compile
-      # The check below fails on *linking* unless the flag is already set
-      # (CMAKE_EXE_LINKER_FLAGS has no effect, either)
-      xpStringAppendIfDne(CMAKE_C_FLAGS "-m64")
-      check_c_compiler_flag("-m64" has_c_m64)
-      if(!has_c_m64)
-        message(SEND_ERROR "64-bit c build not supported")
-      endif()
-      xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "-m64")
-      xpStringAppendIfDne(CMAKE_MODULE_LINKER_FLAGS "-m64")
-      xpStringAppendIfDne(CMAKE_SHARED_LINKER_FLAGS "-m64")
-    endif() # CMAKE_SYSTEM_NAME (SunOS)
     check_c_compiler_flag("-fPIC" has_c_fPIC)
     if(has_c_fPIC)
       xpStringAppendIfDne(CMAKE_C_FLAGS "-fPIC")
@@ -1996,39 +1983,9 @@
     if(has_c_StrongSP)
       xpStringAppendIfDne(CMAKE_C_FLAGS "-fstack-protector-strong")
     endif()
-    if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
-      include(CheckLibraryExists)
-      check_library_exists(ssp __stack_chk_guard "" HAVE_LIB_SSP)
-      if(has_c_StrongSP AND HAVE_LIB_SSP)
-        xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "-lssp")
-        xpStringAppendIfDne(CMAKE_MODULE_LINKER_FLAGS "-lssp")
-        xpStringAppendIfDne(CMAKE_SHARED_LINKER_FLAGS "-lssp")
-      endif()
-      # Libumem is a library used to detect memory management bugs in applications.
-      # It's available as a standard part of Solaris from Solaris 9 Update 3 onwards.
-      # Functions in this library provide fast, scalable object-caching memory
-      # allocation with multithreaded application support.
-      check_library_exists(umem umem_alloc "" HAVE_LIB_UMEM)
-      if(HAVE_LIB_UMEM)
-        xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "-lumem")
-        xpStringAppendIfDne(CMAKE_MODULE_LINKER_FLAGS "-lumem")
-        xpStringAppendIfDne(CMAKE_SHARED_LINKER_FLAGS "-lumem")
-      endif(HAVE_LIB_UMEM)
-      # curl needs _REENTRANT defined for errno calls to work (Solaris only)
-      add_definitions(-D_REENTRANT)
-    endif() # CMAKE_SYSTEM_NAME (SunOS)
     # C++
     if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
       include(CheckCXXCompilerFlag)
-      if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
-        # see comment above for CMAKE_C_FLAGS "-m64"
-        # TRICKY: this needs to be done before any other check_cxx_compiler_flag calls
-        xpStringAppendIfDne(CMAKE_CXX_FLAGS "-m64")
-        check_cxx_compiler_flag("-m64" has_cxx_m64)
-        if(!has_cxx_m64)
-          message(SEND_ERROR "64-bit cxx build not supported")
-        endif()
-      endif() # CMAKE_SYSTEM_NAME (SunOS)
       if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
         check_cxx_compiler_flag("-stdlib=libc++" has_libcxx)
         if(has_libcxx)
@@ -2053,14 +2010,6 @@
       if(has_cxx_StrongSP)
         xpStringAppendIfDne(CMAKE_CXX_FLAGS "-fstack-protector-strong")
       endif()
-      if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
-        check_library_exists(ssp __stack_chk_guard "" HAVE_LIB_SSP)
-        if(has_cxx_StrongSP AND HAVE_LIB_SSP)
-          xpStringAppendIfDne(CMAKE_EXE_LINKER_FLAGS "-lssp")
-          xpStringAppendIfDne(CMAKE_MODULE_LINKER_FLAGS "-lssp")
-          xpStringAppendIfDne(CMAKE_SHARED_LINKER_FLAGS "-lssp")
-        endif()
-      endif() # CMAKE_SYSTEM_NAME (SunOS)
       if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
         check_cxx_compiler_flag("-arch x86_64" has_cxx_arch)
         if(has_cxx_arch)


pw_build: Stricter CMake argument parsing

- Fix incorrect argument prefix in _pw_parse_argv_strict.
- Use _pw_parse_argv_strict in more places.

Change-Id: I3c6b62ddc1cec584063c0c05852cfb0108e51752
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/28683
Commit-Queue: Auto-Submit <14637eda5603879df170705285bf30f5996692f0@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <69344103cc60b36d6e1fbdc31ce6504b2286c646@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -12,6 +12,21 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 include_guard(GLOBAL)
+
+# Wrapper around cmake_parse_arguments that fails with an error if any arguments
+# remained unparsed.
+macro(_pw_parse_argv_strict function start_arg options one multi)
+  cmake_parse_arguments(PARSE_ARGV
+      "${start_arg}" arg "${options}" "${one}" "${multi}"
+  )
+  if(NOT "${arg_UNPARSED_ARGUMENTS}" STREQUAL "")
+    set(_all_args ${options} ${one} ${multi})
+    message(FATAL_ERROR
+        "Unexpected arguments to ${function}: ${arg_UNPARSED_ARGUMENTS}\n"
+        "Valid arguments: ${_all_args}"
+    )
+  endif()
+endmacro()

 # Automatically creates a library and test targets for the files in a module.
 # This function is only suitable for simple modules that meet the following
@@ -44,8 +59,11 @@
 #   PRIVATE_DEPS - private target_link_libraries arguments
 #
 function(pw_auto_add_simple_module MODULE)
-  set(multi PUBLIC_DEPS PRIVATE_DEPS TEST_DEPS)
-  cmake_parse_arguments(PARSE_ARGV 1 arg "" "IMPLEMENTS_FACADE" "${multi}")
+  _pw_parse_argv_strict(pw_auto_add_simple_module 1
+      ""
+      "IMPLEMENTS_FACADE"
+      "PUBLIC_DEPS;PRIVATE_DEPS;TEST_DEPS"
+  )

   file(GLOB all_sources *.cc *.c)

@@ -98,7 +116,11 @@
 #  GROUPS - groups in addition to MODULE to which to add these tests
 #
 function(pw_auto_add_module_tests MODULE)
-  cmake_parse_arguments(PARSE_ARGV 1 arg "" "" "PRIVATE_DEPS;GROUPS")
+  _pw_parse_argv_strict(pw_auto_add_module_tests 1
+      ""
+      ""
+      "PRIVATE_DEPS;GROUPS"
+  )

   file(GLOB cc_tests *_test.cc)

@@ -122,22 +144,10 @@
   endforeach()
 endfunction(pw_auto_add_module_tests)

-# Wrapper around cmake_parse_arguments that fails with an error if any arguments
-# remained unparsed.
-macro(_pw_parse_argv_strict function start_arg options one multi)
-  cmake_parse_arguments(PARSE_ARGV
-      "${start_arg}" arg "${options}" "${one}" "${multi}"
-  )
-
-  if(NOT "${${prefix}_UNPARSED_ARGUMENTS}" STREQUAL "")
-    message(FATAL_ERROR
-        "Unexpected arguments to ${function}: ${${prefix}_UNPARSED_ARGUMENTS}"
-    )
-  endif()
+# Sets the provided variable to the common library arguments.
+macro(_pw_library_args variable)
+  set("${variable}" SOURCES HEADERS PUBLIC_DEPS PRIVATE_DEPS ${ARGN})
 endmacro()
-
-# Common arguments for libraries.
-set(_common_args SOURCES HEADERS PUBLIC_DEPS PRIVATE_DEPS)

 # Creates a library in a module. The library has access to the public/ include
 # directory.
@@ -151,7 +161,7 @@
 #   IMPLEMENTS_FACADES - which facades this library implements
 #
 function(pw_add_module_library NAME)
-  set(list_args ${_common_args} IMPLEMENTS_FACADES)
+  _pw_library_args(list_args IMPLEMENTS_FACADES)
   _pw_parse_argv_strict(pw_add_module_library 1 "" "" "${list_args}")

   # Check that the library's name is prefixed by the module name.
@@ -202,7 +212,8 @@
 #  DEFAULT_BACKEND - which backend to use by default
 #
 function(pw_add_facade NAME)
-  _pw_parse_argv_strict(pw_add_facade 1 "" "DEFAULT_BACKEND" "${_common_args}")
+  _pw_library_args(list_args)
+  _pw_parse_argv_strict(pw_add_facade 1 "" "DEFAULT_BACKEND" "${list_args}")

   # If no backend is set, a script that displays an error message is used
   # instead. If the facade is used in the build, it fails with this error.
@@ -260,7 +271,7 @@
 #       added to the 'default' and 'all' groups
 #
 function(pw_add_test NAME)
-  cmake_parse_arguments(PARSE_ARGV 1 arg "" "" "SOURCES;DEPS;GROUPS")
+  _pw_parse_argv_strict(pw_add_test 1 "" "" "SOURCES;DEPS;GROUPS")

   add_executable("${NAME}" EXCLUDE_FROM_ALL ${arg_SOURCES})
   target_link_libraries("${NAME}"


Diagnosing by build script

Diagnosing by build script

--- appveyor.cmake
+++ appveyor.cmake
@@ -1,2 +1,2 @@
 set(BUILD_DIR C:/projects/morebin CACHE PATH "")
-set(BOOST_ROOT C:/Libraries/boost_1_60_0 CACHE_PATH "")
+set(BOOST_ROOT "C:\Libraries\boost_1_60_0" CACHE_PATH "")


- Remove unneeded file

- Remove unneeded file

--- modules/std/clever/cmake_install.cmake
+++ modules/std/clever/cmake_install.cmake
@@ -1,34 +0,0 @@
-# Install script for directory: /home/felipe/dev/clever/modules/std/clever
-
-# Set the install prefix
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  SET(CMAKE_INSTALL_PREFIX "/usr/local")
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  IF(BUILD_TYPE)
-    STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  ELSE(BUILD_TYPE)
-    SET(CMAKE_INSTALL_CONFIG_NAME "Debug")
-  ENDIF(BUILD_TYPE)
-  MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-
-# Set the component getting installed.
-IF(NOT CMAKE_INSTALL_COMPONENT)
-  IF(COMPONENT)
-    MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
-    SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  ELSE(COMPONENT)
-    SET(CMAKE_INSTALL_COMPONENT)
-  ENDIF(COMPONENT)
-ENDIF(NOT CMAKE_INSTALL_COMPONENT)
-
-# Install shared libraries without execute permission?
-IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  SET(CMAKE_INSTALL_SO_NO_EXE "1")
-ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-


Fixing a documentation typo, DIRS -> DIR in HINTS variables.

Change-Id: I42b75a5e0b8a451c3a43ab29d0c14856e4b86ab8

--- cmake/FindGlog.cmake
+++ cmake/FindGlog.cmake
@@ -39,10 +39,10 @@
 #
 # The following variables control the behaviour of this module:
 #
-# GLOG_INCLUDE_DIRS_HINTS: List of additional directories in which to
-#                          search for glog includes, e.g: /timbuktu/include.
-# GLOG_LIBRARY_DIRS_HINTS: List of additional directories in which to
-#                          search for glog libraries, e.g: /timbuktu/lib.
+# GLOG_INCLUDE_DIR_HINTS: List of additional directories in which to
+#                         search for glog includes, e.g: /timbuktu/include.
+# GLOG_LIBRARY_DIR_HINTS: List of additional directories in which to
+#                         search for glog libraries, e.g: /timbuktu/lib.
 #
 # The following variables are also defined by this module, but in line with
 # CMake recommended FindPackage() module style should NOT be referenced directly


Fix missing LLVM ldflags

Fix missing LLVM ldflags

--- cmake/FindLLVM.cmake
+++ cmake/FindLLVM.cmake
@@ -39,16 +39,16 @@
         set(LLVM_LIBS ${LLVM_CONFIG_libs_output})
     endif()

-    execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} --libdir ${COMPONENTS}
-        RESULT_VARIABLE LLVM_CONFIG_libdir_result
-        OUTPUT_VARIABLE LLVM_CONFIG_libdir_output
-        ERROR_VARIABLE LLVM_CONFIG_libdir_error
+    execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} --ldflags
+        RESULT_VARIABLE LLVM_CONFIG_ldflags_result
+        OUTPUT_VARIABLE LLVM_CONFIG_ldflags_output
+        ERROR_VARIABLE LLVM_CONFIG_ldflags_error
         OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-    if(NOT ${LLVM_CONFIG_libdir_result} EQUAL 0)
-        message(SEND_ERROR "Command \"${LLVM_CONFIG_EXECUTABLE} --libdir\" failed with output: ${LLVM_CONFIG_libdir_error}")
+    if(NOT ${LLVM_CONFIG_ldflags_result} EQUAL 0)
+        message(SEND_ERROR "Command \"${LLVM_CONFIG_EXECUTABLE} --ldflags\" failed with output: ${LLVM_CONFIG_ldflags_error}")
     else()
-        set(LLVM_LIBS "-L${LLVM_CONFIG_libdir_output} ${LLVM_LIBS}")
+        set(LLVM_LIBS "${LLVM_CONFIG_ldflags_output} ${LLVM_LIBS}")
     endif()

     execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} --bindir ${COMPONENTS}


clang add -Wunused-result to enable [[nodiscard]]. (#219)

--- cmake/bde_ufid.cmake
+++ cmake/bde_ufid.cmake
@@ -418,7 +418,6 @@
                 -Wsign-compare
                 -Wstrict-overflow=1
                 -Wtype-limits
-                -Wunused-result
                 -Wvla
                 -Wvolatile-register-var
                 -Wwrite-strings
@@ -428,6 +427,7 @@
                 -Wno-string-conversion
                 -Wno-unknown-pragmas
                 -Wno-unused-value
+                -Wunused-result
             >
             $<$<CXX_COMPILER_ID:Clang>:
                 $<IF:${bde_ufid_is_exc},
@@ -453,7 +453,6 @@
                 -Wsign-compare
                 -Wstrict-overflow=1
                 -Wtype-limits
-                -Wunused-result
                 -Wvla
                 -Wvolatile-register-var
                 -Wwrite-strings
@@ -463,6 +462,7 @@
                 -Wno-string-conversion
                 -Wno-unknown-pragmas
                 -Wno-unused-value
+                -Wunused-result
             >
             $<$<CXX_COMPILER_ID:GNU>:
                 $<${bde_ufid_is_opt}:


Correct port for web sockets.

Correct port for web sockets.

--- cmake/defaults.cmake
+++ cmake/defaults.cmake
@@ -7,7 +7,7 @@
 IF(CONFIG_JETWS_PORT)
 	SET(CONFIG_JETWS_PORT ${CONFIG_JETWS_PORT} CACHE STRING "" FORCE)
 ELSE()
-	SET(CONFIG_JETWS_PORT 11122)
+	SET(CONFIG_JETWS_PORT 11123)
 ENDIF()

 IF(CONFIG_LISTEN_BACKLOG)


Modify oglft CMake Modul to find lib & header if

the subversion trunk version is used.

--- CMake/Modules/FindOGLFT.cmake
+++ CMake/Modules/FindOGLFT.cmake
@@ -28,12 +28,14 @@
       /opt/local/include
     PATH_SUFFIXES
       oglft
+      OGLFT
   )

   find_library(OGLFT_LIBRARIES
     NAMES
       OpenGL-FT
       OGLFT
+      oglft
     PATHS
       /usr/lib
       /usr/local/lib


Added the latest directx sdk release (June 2008) to the list that cmake searches for. -Reviewed by bos

--- indra/cmake/DirectX.cmake
+++ indra/cmake/DirectX.cmake
@@ -3,6 +3,7 @@
 if (VIEWER AND WINDOWS)
   find_path(DIRECTX_INCLUDE_DIR dxdiag.h
             "$ENV{DXSDK_DIR}/Include"
+            "C:/Program Files/Microsoft DirectX SDK (June 2008)/Include"
             "C:/Program Files/Microsoft DirectX SDK (March 2008)/Include"
             "C:/Program Files/Microsoft DirectX SDK (November 2007)/Include"
             "C:/Program Files/Microsoft DirectX SDK (August 2007)/Include"
@@ -21,6 +22,7 @@

   find_path(DIRECTX_LIBRARY_DIR dxguid.lib
             "$ENV{DXSDK_DIR}/Lib/x86"
+            "C:/Program Files/Microsoft DirectX SDK (June 2008)/Lib/x86"
             "C:/Program Files/Microsoft DirectX SDK (March 2008)/Lib/x86"
             "C:/Program Files/Microsoft DirectX SDK (November 2007)/Lib/x86"
             "C:/Program Files/Microsoft DirectX SDK (August 2007)/Lib/x86"


ctkMacroCompilePythonScript - "Copy*PythonFiles" target added appropriately

Instead of added the target only if resources are specifed, the copy
target is added only if file have been copied.

--- CMake/ctkMacroCompilePythonScript.cmake
+++ CMake/ctkMacroCompilePythonScript.cmake
@@ -62,12 +62,13 @@
                           OUTPUT ${tgt}
                           COMMENT "Copying python resource: ${file}")
     ENDFOREACH()
-
+  ENDIF()
+
+  IF(copied_files)
     ADD_CUSTOM_TARGET(Copy${MY_TARGET_NAME}PythonFiles
                       ALL
                       DEPENDS ${copied_files})
-  ENDIF()
-
+  ENDIF()

   # Byte compile the Python files.
   SET(compile_all_script "${CMAKE_CURRENT_BINARY_DIR}/compile_${MY_TARGET_NAME}_python_scripts.py")


[FIX] VS builds: Fixes issue to find correct contribs package.

--- util/cmake/SeqAnContribs.cmake
+++ util/cmake/SeqAnContribs.cmake
@@ -36,7 +36,7 @@

 if (WIN32)
   # For all contrib versions...
-  foreach (_SEQAN_CONTRIB_VERSION D20111031 D20130710 D20131121)
+  foreach (_SEQAN_CONTRIB_VERSION D20160115)
     set (_SEQAN_CONTRIB_DIR "seqan-contrib-${_SEQAN_CONTRIB_VERSION}")

 	  # Determine architecture for the precompiled contribs.


cmake/BuildPCRE2.cmake: cosmetic change [ci skip]

--- cmake/BuildPCRE2.cmake
+++ cmake/BuildPCRE2.cmake
@@ -21,11 +21,11 @@
   CMAKE_ARGS ${_PCRE2_CMAKE_ARGS}
   )
 SET (PCRE2_INCLUDE_DIR "${3RDPARTY_OUTPUT_PATH}/include")
-IF ((WIN32) AND (CMAKE_BUILD_TYPE MATCHES Debug))
+IF (WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))
   SET (PCRE2_LINK_FLAGS  "${3RDPARTY_OUTPUT_PATH}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pcre2-8d${CMAKE_STATIC_LIBRARY_SUFFIX}")
-ELSE ((WIN32) AND (CMAKE_BUILD_TYPE MATCHES Debug))
+ELSE (WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))
   SET (PCRE2_LINK_FLAGS  "${3RDPARTY_OUTPUT_PATH}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pcre2-8${CMAKE_STATIC_LIBRARY_SUFFIX}")
-ENDIF ((WIN32) AND (CMAKE_BUILD_TYPE MATCHES Debug))
+ENDIF (WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))
 SET (PCRE2_LIBRARIES   "${PCRE2_LINK_FLAGS}")
 MESSAGE(STATUS "-----------------------------------------")
 MESSAGE(STATUS "Setup PCRE2:")


cmake: made FindGSSAPI.cmake able to detect kerberos versions such as: "Kerberos 5 release 1.18-prerelease".

--- cmake/FindGSSAPI.cmake
+++ cmake/FindGSSAPI.cmake
@@ -115,7 +115,7 @@
     string(STRIP "${_GSS_VENDOR}" _GSS_VENDOR)
     if((GSS_FLAVOUR STREQUAL "Heimdal" AND NOT _GSS_VENDOR STREQUAL "Heimdal")
        OR (GSS_FLAVOUR STREQUAL "MIT" AND NOT _GSS_VENDOR STREQUAL "Massachusetts Institute of Technology"))
-      message(SEND_ERROR "GSS vendor and GSS flavour are not matching : _GSS_VENDOR=${_GSS_VENDOR} ; GSS_FLAVOUR=${GSS_FLAVOUR}")
+      message(SEND_ERROR "GSS vendor and GSS flavour are not matching : _GSS_VENDOR=${_GSS_VENDOR} ; GSS_FLAVOUR=${GSS_FLAVOUR}")
       message(STATUS "Try to set the path to GSS root folder in the system variable GSS_ROOT_DIR")
     endif()
   else()
@@ -428,13 +428,17 @@
   string(REGEX REPLACE "\\." "" GSS_VERSION_MAJOR "${GSS_VERSION_MAJOR}")
   string(REGEX MATCH "\\.([0-9]+)$" GSS_VERSION_MINOR ${GSS_RELEASE_NUMBER})
   if(NOT GSS_VERSION_MINOR)
-    string(REGEX MATCH "\\.([0-9]+)\\." GSS_VERSION_MINOR ${GSS_RELEASE_NUMBER})
-    string(REGEX REPLACE "\\." "" GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
-    string(REGEX REPLACE "\\." "" GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
-    string(REGEX MATCH "([0-9]+)$" GSS_VERSION_PATCH ${GSS_RELEASE_NUMBER})
-    string(REGEX REPLACE "\\." "" GSS_VERSION_PATCH "${GSS_VERSION_PATCH}")
+    string(REGEX MATCH "\\.([0-9]+)[-\\.]" GSS_VERSION_MINOR ${GSS_RELEASE_NUMBER})
+    string(REGEX REPLACE "\\." ""     GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
+    string(REGEX REPLACE "\\." ""     GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
+    string(REGEX REPLACE "-"   ""     GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
+    string(REGEX MATCH "\\.([0-9]+)$" GSS_VERSION_PATCH "${GSS_RELEASE_NUMBER}")
+    string(REGEX REPLACE "\\." ""     GSS_VERSION_PATCH "${GSS_VERSION_PATCH}")
+    if(NOT GSS_VERSION_PATCH)
+      set(GSS_VERSION_PATCH "0")
+    endif()
   else()
-    string(REGEX REPLACE "\\." "" GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
+    string(REGEX REPLACE "\\." ""     GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
     set(GSS_VERSION_PATCH "0")
   endif()
   if(GSS_VERSION_MAJOR AND GSS_VERSION_MINOR)
@@ -443,6 +447,7 @@
   else()
     message(SEND_ERROR "Failed to retrieved Kerberos version number")
   endif()
+  message(STATUS "Located Kerberos ${GSS_VERSION_MAJOR}.${GSS_VERSION_MINOR}.${GSS_VERSION_PATCH}")
 endif()

 mark_as_advanced(GSS_INCLUDE_DIR GSS_LIBRARIES)


Accept luajit as DSO

Accept luajit as DSO

Some Linux distributions (at least Fedora and RHEL) do not provide
libluajit as an archive and instead only as a DSO.  Using the DSO
does not have any negative impact but the cmake script does not
check for the DSO files and instead fails to find luajit.

This simple change causes cmake to find the file as named in the
above distributions.  Maybe more change or a generalized method are
needed in future.  The prefered way to detect the DSO for Fedora/RHEL
would be to use pkgconfig but I don't propose to use it at this time.

--- cmake/FindLuaJIT.cmake
+++ cmake/FindLuaJIT.cmake
@@ -44,7 +44,7 @@
 )

 FIND_LIBRARY(LUAJIT_LIBRARY
-  NAMES libluajit-51.a libluajit-5.1.a libluajit.a
+  NAMES libluajit-51.a libluajit-5.1.a libluajit.a libluajit-5.1.so
   HINTS
   $ENV{LUAJIT_DIR}
   PATH_SUFFIXES lib64 lib


To make UVify device compatible with upload script, we changed device name to be more generalized.

--- platforms/nuttx/cmake/upload.cmake
+++ platforms/nuttx/cmake/upload.cmake
@@ -56,7 +56,7 @@
 		/dev/serial/by-id/pci-Bitcraze*
 		/dev/serial/by-id/usb-Gumstix*
 		/dev/serial/by-id/usb-Hex_ProfiCNC*
-		/dev/serial/by-id/usb-UVify_FMU_BL*
+		/dev/serial/by-id/usb-UVify*
 		)

 elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")


cmake: use STREQUAL to compare strings

cmake: use STREQUAL to compare strings

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

--- cmake/hg.cmake
+++ cmake/hg.cmake
@@ -45,7 +45,7 @@
 	"{ifeq(latesttagdistance,0,\"{latesttag}\",\"{latesttag}-{latesttagdistance}-{node|short}\")}"
 	"${JEFFPC_VERSION}")

-if(${HG_COMMIT_STR} EQUAL "0000000000000000000000000000000000000000")
+if(${HG_COMMIT_STR} STREQUAL "0000000000000000000000000000000000000000")
 	message(WARNING "Failed to get revision info from Mercurial.")
 endif()


Revert "Qt graph: no need to add dependencies of dependency"

This reverts commit cf240c6b55ce7acef1ce46560d76452fff9dbfcc.

--- cmake/modules/hunter_qt_add_module.cmake
+++ cmake/modules/hunter_qt_add_module.cmake
@@ -24,5 +24,15 @@
     return()
   endif()

-  set(component_${x_NAME}_depends_on "${x_COMPONENTS}" PARENT_SCOPE)
+  set(dep_list "${x_COMPONENTS}")
+
+  foreach(dep ${dep_list})
+    list(APPEND dep_list ${component_${dep}_depends_on})
+  endforeach()
+
+  list(REMOVE_ITEM dep_list "") # remove empty elements
+  list(REMOVE_DUPLICATES dep_list)
+  list(SORT dep_list)
+
+  set(component_${x_NAME}_depends_on "${dep_list}" PARENT_SCOPE)
 endfunction()


Add selector for SDIOCLK frequency in case standard clock config is off

--- source/chip/STM32/STM32F4/distortos-sources.cmake
+++ source/chip/STM32/STM32F4/distortos-sources.cmake
@@ -1,7 +1,7 @@
 #
 # file: distortos-sources.cmake
 #
-# author: Copyright (C) 2018-2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
+# author: Copyright (C) 2018-2020 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
 #
 # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 # distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -320,6 +320,25 @@
 		OUTPUT_NAME DISTORTOS_CHIP_RCC_PPRE2
 		OUTPUT_TYPES INTEGER)

+if(NOT distortos_Clocks_00_Standard_configuration_of_clocks)
+
+	if(NOT DISTORTOS_CHIP MATCHES "STM32F410")
+
+		distortosSetConfiguration(INTEGER
+				distortos_Clocks_15_SDIOCLK_frequency
+				0
+				MIN 0
+				MAX 48000000
+				HELP "Frequency of SDIOCLK, Hz.
+
+				RCC must be configured by user to achieve that frequency. SDIOCLK frequency must not exceed 48 MHz. Set
+				to 0 if SDIOCLK is not available."
+				OUTPUT_NAME DISTORTOS_CHIP_RCC_SDIOCLK_FREQUENCY)
+
+	endif(NOT DISTORTOS_CHIP MATCHES "STM32F410")
+
+endif(NOT distortos_Clocks_00_Standard_configuration_of_clocks)
+
 if(DISTORTOS_CHIP_VDD_MV GREATER_EQUAL 2100)

 	distortosSetConfiguration(BOOLEAN


Update config.h.cmake

Update config.h.cmake

Adding and setting CPPUTEST_HAS_INF and CPPUTEST_HAS_NAN

--- config.h.cmake
+++ config.h.cmake
@@ -3,6 +3,9 @@

 #cmakedefine CPPUTEST_MEM_LEAK_DETECTION_DISABLED
 #cmakedefine CPPUTEST_USE_LONG_LONG
+
+#cmakedefine CPPUTEST_HAS_INF
+#cmakedefine CPPUTEST_HAS_NAN

 #cmakedefine CPPUTEST_STD_C_LIB_DISABLED
 #cmakedefine CPPUTEST_STD_CPP_LIB_DISABLED


Enable -march=native in OS X clang builds

--- CMake/hoomd/HOOMDCFlagsSetup.cmake
+++ CMake/hoomd/HOOMDCFlagsSetup.cmake
@@ -14,7 +14,7 @@
         endif(${CMAKE_GENERATOR} STREQUAL "Xcode")
     endif(NOT CMAKE_BUILD_TYPE AND NOT HONOR_GENTOO_FLAGS)

-    if(CMAKE_COMPILER_IS_GNUCXX)
+    if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
         # special handling to honor gentoo flags
         if (HONOR_GENTOO_FLAGS)
         set(CMAKE_CXX_FLAGS_DEBUG "-Wall" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
@@ -53,7 +53,7 @@

     else(CMAKE_COMPILER_IS_GNUCXX)
         message(STATUS "No default CXXFLAGS for your compiler, set them manually")
-    endif(CMAKE_COMPILER_IS_GNUCXX)
+    endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

 SET(PASSED_FIRST_CONFIGURE ON CACHE INTERNAL "First configure has run: CXX_FLAGS have had their defaults changed" FORCE)
 endif(NOT PASSED_FIRST_CONFIGURE)


FindVOTCA_TOOLS.cmake: fix adding eigen3 includedir

--- CMakeModules/FindVOTCA_TOOLS.cmake
+++ CMakeModules/FindVOTCA_TOOLS.cmake
@@ -43,7 +43,7 @@

 find_library(VOTCA_TOOLS_LIBRARY NAMES votca_tools HINTS ${PC_VOTCA_TOOLS_LIBRARY_DIRS} )

-set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR};${SQLITE3_INCLUDE_DIR};${EIGEN3_INCLUDE_DIRS};${MKL_INCLUDE_DIRS}" )
+set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR};${SQLITE3_INCLUDE_DIR};${EIGEN3_INCLUDE_DIR};${MKL_INCLUDE_DIRS}" )
 set(VOTCA_TOOLS_LIBRARIES "${VOTCA_TOOLS_LIBRARY};${MKL_LIBRARIES}" )

 include(FindPackageHandleStandardArgs)


ENH: Updating CIP git tag

ENH: Updating CIP git tag

--- SuperBuild/External_CIP.cmake
+++ SuperBuild/External_CIP.cmake
@@ -25,7 +25,7 @@
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${git_protocol}://github.com/acil-bwh/ChestImagingPlatform.git"
-    GIT_TAG "8a9ef5d09cf7d58ac6ca54c0cfbd78289d9a9de3" # use develop branch to include CLI modules
+    GIT_TAG "2ed4062859db304e80120fa0acf00ed692847bbd" # use develop branch in CIP
     #DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Remove this line and uncomment GIT_REPOSITORY and GIT_TAG"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${proj}-build


Update Superbuild ITK version along 4.13 release branch

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -51,7 +51,7 @@
 mark_as_advanced(ITK_GIT_REPOSITORY)
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

-set(ITK_GIT_TAG "f255188244973c105545222bd072a8d5b66a7d7e" CACHE STRING "Tag in ITK git repo")
+set(ITK_GIT_TAG "090984d7fe80d911c61f0213ffc1da208ca1d0b9" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


Use Appveyor branch name for builds if it exists.

--- cmake/CSEVersion.cmake
+++ cmake/CSEVersion.cmake
@@ -1,15 +1,18 @@
 # Generate CSE Version header

-execute_process(
-  COMMAND git rev-parse --abbrev-ref HEAD
-  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-  RESULT_VARIABLE git_branch_exit_status
-  OUTPUT_VARIABLE GIT_BRANCH
-  OUTPUT_STRIP_TRAILING_WHITESPACE
-)
-
-if (NOT ${git_branch_exit_status} MATCHES "0")
-  set(GIT_BRANCH "unknown-branch")
+if(DEFINED ENV{APPVEYOR_REPO_BRANCH})
+  set(GIT_BRANCH "$ENV{APPVEYOR_REPO_BRANCH}")
+else()
+  execute_process(
+    COMMAND git rev-parse --abbrev-ref HEAD
+    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+    RESULT_VARIABLE git_branch_exit_status
+    OUTPUT_VARIABLE GIT_BRANCH
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+  if (NOT ${git_branch_exit_status} MATCHES "0")
+    set(GIT_BRANCH "unknown-branch")
+  endif()
 endif()

 execute_process(
@@ -75,4 +78,3 @@
   "${PROJECT_SOURCE_DIR}/src/csevrsn.h.in"
   "${PROJECT_SOURCE_DIR}/src/csevrsn.h"
 )
-


Only add explicit shared extentions if shared libs are enabled

--- cmake/Extensions.cmake
+++ cmake/Extensions.cmake
@@ -145,7 +145,7 @@
         set_property(GLOBAL APPEND PROPERTY extension_${name}_definitions ${ADD_PYTHON_EXTENSION_DEFINITIONS})
     elseif(WIN32 AND NOT BUILD_SHARED)
         # Extensions cannot be built against a static libpython on windows
-    else(BUILTIN_${upper_name})
+    elseif(BUILD_SHARED)
         add_library(${target_name} SHARED ${absolute_sources})
         include_directories(${ADD_PYTHON_EXTENSION_INCLUDEDIRS})
         target_link_libraries(${target_name} ${ADD_PYTHON_EXTENSION_LIBRARIES})


Also look for "caf" folder in FindLibcaf script

--- cmake/FindLibcaf.cmake
+++ cmake/FindLibcaf.cmake
@@ -31,8 +31,13 @@
   # look for headers: give CMake hints where to find non-installed CAF versions
   # note that we look for the headers of each component individually: this is
   # necessary to support non-installed versions of CAF, i.e., accessing the
-  # checked out "actor-framework" directory structure directly
-  set(HDRHINT "actor-framework/libcaf_${comp}")
+  # checked out "actor-framework" or "caf" directory structure directly
+  unset(HDRHINT)
+  foreach(dir ".." "../.." "../../..")
+    foreach(subdir "actor-framework" "caf")
+      set(HDRHINT ${HDRHINT} "${dir}/${subdir}/libcaf_${comp}")
+    endforeach()
+  endforeach()
   find_path(LIBCAF_INCLUDE_DIR_${UPPERCOMP}
             NAMES
               ${HDRNAME}
@@ -43,9 +48,7 @@
               /opt/local/include
               /sw/include
               ${CMAKE_INSTALL_PREFIX}/include
-              ../${HDRHINT}
-              ../../${HDRHINT}
-              ../../../${HDRHINT})
+              ${HDRHINT})
   mark_as_advanced(LIBCAF_INCLUDE_DIR_${UPPERCOMP})
   if (NOT "${LIBCAF_INCLUDE_DIR_${UPPERCOMP}}" STREQUAL "LIBCAF_INCLUDE_DIR_${UPPERCOMP}-NOTFOUND")
     # mark as found (set back to false in case library cannot be found)
@@ -63,6 +66,13 @@
     # look for (.dll|.so|.dylib) file, again giving hints for non-installed CAFs
     # skip probe_event as it is header only
     if (NOT ${comp} STREQUAL "probe_event")
+      unset(LIBHINT)
+      foreach(dir ".." "../.." "../../..")
+        foreach(subdir "actor-framework" "caf")
+          set(LIBHINT ${LIBHINT} "${dir}/${subdir}/build/lib")
+        endforeach()
+      endforeach()
+      message(STATUS "libhint: ${LIBHINT}")
       find_library(LIBCAF_LIBRARY_${UPPERCOMP}
                    NAMES
                      "caf_${comp}"
@@ -73,9 +83,7 @@
                      /opt/local/lib
                      /sw/lib
                      ${CMAKE_INSTALL_PREFIX}/lib
-                     ../actor-framework/build/lib
-                     ../../actor-framework/build/lib
-                     ../../../actor-framework/build/lib)
+                     ${LIBHINT})
       mark_as_advanced(LIBCAF_LIBRARY_${UPPERCOMP})
       if ("${LIBCAF_LIBRARY_${UPPERCOMP}}" STREQUAL "LIBCAF_LIBRARY-NOTFOUND")
         set(Libcaf_${comp}_FOUND false)


Fix a copy-paste error in the header

Fix a copy-paste error in the header

--- cmake/FindVulkan.cmake
+++ cmake/FindVulkan.cmake
@@ -1,6 +1,6 @@
 # Locate the Vulkan SDK
 # This module defines
-#  Vulkan_FOUND, if false, do not try to link to Lua
+#  Vulkan_FOUND
 #  Vulkan_INCLUDE_DIR
 #  Vulkan_LIBRARY
 #


FindZeroMQ

FindZeroMQ

--- cmake/FindZeroMQ.cmake
+++ cmake/FindZeroMQ.cmake
@@ -1,36 +1,85 @@
-# Copyright (c) 2010-2011 Phorm, Inc.
-# License: GNU LGPL v 3.0, see http://www.gnu.org/licenses/lgpl-3.0-standalone.html
-# Author: Andrey Skryabin <andrew@zmqmessage.org>, et al.
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# *                                                                        *
+# * Author: The ALICE Off-line Project.                                    *
+# * Contributors are mentioned in the code where appropriate.              *
+# *                                                                        *
+# * Permission to use, copy, modify and distribute this software and its   *
+# * documentation strictly for non-commercial purposes is hereby granted   *
+# * without fee, provided that the above copyright notice appears in all   *
+# * copies and that both the copyright notice and this permission notice   *
+# * appear in the supporting documentation. The authors make no claims     *
+# * about the suitability of this software for any purpose. It is          *
+# * provided "as is" without express or implied warranty.                  *
+# **************************************************************************

-# - Find 0mq
-# Find the zeromq includes and library
-#
-#  ZEROMQ_INCLUDE_DIR - Where to find zeromq include sub-directory.
-#  ZEROMQ_LIBRARIES   - List of libraries when using zeromq.
-#  ZEROMQ_FOUND       - True if zeromq found.
+# Checks for a ZeroMQ installation
+# ZeroMQ custom installation can be pointed using -DZEROMQ
+#       - ZEROMQ_INCLUDE_DIR - Where to find zeromq include sub-directory.
+#       - ZEROMQ_LIBRARIES   - List of libraries when using zeromq.
+#       - ZEROMQ_LIBRARIES_STATIC   - List of static libraries when using zeromq.
+#       - ZEROMQ_FOUND       - True if zeromq found.

-IF (ZEROMQ_INCLUDE_DIR)
-  # Already in cache, be silent.
-  SET(ZEROMQ_FIND_QUIETLY TRUE)
-ENDIF (ZEROMQ_INCLUDE_DIR)
+message(STATUS "Checking for ZeroMQ ${ZEROMQ}")

-FIND_PATH(ZEROMQ_INCLUDE_DIR zmq.hpp)
+set(ZEROMQ_FOUND FALSE)

-SET(ZEROMQ_NAMES zmq)
-FIND_LIBRARY(ZEROMQ_LIBRARY NAMES ${ZEROMQ_NAMES} )
+if(ZEROMQ)
+    # ZeroMQ is installed in a custom place
+    find_library(ZEROMQ_LIBRARIES NAMES zmq
+                PATH ${ZEROMQ}/lib
+                NO_DEFAULT_PATH
+                DOC "Path to libzmq)"
+            )

-# Handle the QUIETLY and REQUIRED arguments and set ZEROMQ_FOUND to
-# TRUE if all listed variables are TRUE.
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(
-  ZEROMQ DEFAULT_MSG
-  ZEROMQ_LIBRARY ZEROMQ_INCLUDE_DIR
-)
+    find_library(ZEROMQ_LIBRARIES_STATIC NAMES libzmq.a
+                PATH ${ZEROMQ}/lib
+                NO_DEFAULT_PATH
+                DOC "Path to libzmq)"
+            )
+
+    find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.hh zmq_utils.h}
+                PATHS ${ZEROMQ}/include
+                NO_DEFAULT_PATH
+                DOC "Path to ZeroMQ include header files."
+            )
+else(ZEROMQ)
+    # Check is the library is installed on the system
+    find_library(ZEROMQ_LIBRARIES NAMES zmq
+                DOC "Path to libzmq)"
+            )

-IF(ZEROMQ_FOUND)
-  SET( ZEROMQ_LIBRARIES ${ZEROMQ_LIBRARY} )
-ELSE(ZEROMQ_FOUND)
-  SET( ZEROMQ_LIBRARIES )
-ENDIF(ZEROMQ_FOUND)
+    find_library(ZEROMQ_LIBRARIES_STATIC NAMES libzmq.a
+                DOC "Path to libzmq)"
+            )
+
+    find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.hpp zmq_utils.h}
+                DOC "Path to ZeroMQ include header files."
+            )
+endif(ZEROMQ)
+
+set(ZEROMQ_DISABLED FALSE)
+
+if(NOT ZEROMQ_LIBRARIES)
+    message(STATUS "ZeroMQ library not found. Disabling ZeroMQ support")
+    set(ZEROMQ_DISABLED TRUE)
+endif()
+
+if(NOT ZEROMQ_LIBRARIES_STATIC AND NOT ZEROMQ_DISABLED)
+    message(STATUS "ZeroMQ static library not found. Disabling ZeroMQ support")
+    set(ZEROMQ_DISABLED TRUE)
+endif()
+
+if(NOT ZEROMQ_INCLUDE_DIR AND NOT ZEROMQ_DISABLED)
+    message(STATUS "ZeroMQ headers not found. Please install development package. Disabling ZeroMQ support")
+    set(ZEROMQ_DISABLED TRUE)
+endif()
+
+if(ZEROMQ_LIBRARIES AND ZEROMQ_LIBRARIES_STATIC AND ZEROMQ_INCLUDE_DIR)
+    message(STATUS "Found ZeroMQ ${ZEROMQ_LIBRARIES}")
+    set(ZEROMQ_FOUND TRUE)
+endif()

+
+


fix(cmake): Check compiler version

fix(cmake): Check compiler version

--- cmake/build/core.cmake
+++ cmake/build/core.cmake
@@ -32,11 +32,19 @@

 # Check compiler
 if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
-  message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}" 32)
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.4.0")
+    message_colored(FATAL_ERROR "Compiler not supported (Requires clang-3.4+ or gcc-5.1+)" 31)
+  else()
+    message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}" 32)
+  endif()
 elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
-  message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}" 32)
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1.0")
+    message_colored(FATAL_ERROR "Compiler not supported (Requires clang-3.4+ or gcc-5.1+)" 31)
+  else()
+    message_colored(STATUS "Using supported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}" 32)
+  endif()
 else()
-  message_colored(WARNING "Using unsupported compiler ${CMAKE_CXX_COMPILER_ID} !" 31)
+  message_colored(WARNING "Using unsupported compiler ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION} !" 31)
 endif()

 # Set compiler and linker flags for preferred C++ library


If qt is not found cmake will error out, since QT_VERSION_MINOR is not defined. Move if(QT4_FOUND) before we use anything qt specific.

svn path=/trunk/; revision=9733

--- cmake/modules/qt.cmake
+++ cmake/modules/qt.cmake
@@ -38,11 +38,11 @@

 find_package(Qt4)
 if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt)
-  if(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2)
-    set(QT_USE_QTSVG 1)
-  endif(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2)
-  include(${QT_USE_FILE})
   if(QT4_FOUND)
+		if(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2)
+			set(QT_USE_QTSVG 1)
+		endif(PLD_svgqt AND ${QT_VERSION_MINOR} GREATER 2)
+		include(${QT_USE_FILE})
     set(qt_COMPILE_FLAGS)
     foreach(DIR ${QT_INCLUDES})
       set(qt_COMPILE_FLAGS "${qt_COMPILE_FLAGS} -I${DIR}")


modified test target hierarchy to only clean all test results when running all tests

--- cmake/test/tests.cmake
+++ cmake/test/tests.cmake
@@ -23,10 +23,9 @@
   # clean out previous test results before running tests
   add_custom_target(clean-test-results
     COMMAND ${CMAKE_COMMAND} -E remove_directory ${CATKIN_TEST_RESULTS_DIR})
-  # make the 'tests' target depend on 'clean-test-results'
-  # which will ensure that test results are deleted before we try to build tests
-  # and thus before we try to run tests
-  add_dependencies(tests clean-test-results)
+  # make the 'run_tests' target depend on 'clean-test-results'
+  # which will ensure that test results are deleted before we try to run all tests
+  add_dependencies(run_tests clean-test-results)
 endif()

 #


Backed up from supporting projects within projects.  Minor tweaks.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -95,9 +95,10 @@

 macro(create_header_library target)
   if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}-config.cmake")
-    set(${target}_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL "${target} path")
-  else ()
-    set(${target}_includes "${CMAKE_CURRENT_LIST_DIR}/source" PARENT_SCOPE)
+    set(${target}_project_path ${CMAKE_CURRENT_LIST_DIR})
+    set(${target}_project_path ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
+  else ()
+    set(${target}_project_includes "${CMAKE_CURRENT_LIST_DIR}/source" PARENT_SCOPE)
   endif ()
 endmacro(create_header_library)

@@ -122,7 +123,7 @@
 #    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
 #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 #    project(${project_name})
-#    set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
+#    set(${project_name}_project_path ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
 #    include(${project_name}-config.cmake)
 #  endmacro(add_project)
 #else ()
@@ -134,10 +135,14 @@

     project(${project_name})
     if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${project_name}-config.cmake")
-      set(${project_name}_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE INTERNAL "${project_name} dir")
+#      message("* ${CMAKE_CURRENT_LIST_DIR}/${project_name}-config.cmake")
+      set(${project_name}_project_path ${CMAKE_CURRENT_LIST_DIR})
+      set(${project_name}_project_path ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
       include(${project_name}-config.cmake)
     else ()
-      set(${project_name}_includes "${CMAKE_CURRENT_LIST_DIR}/source" PARENT_SCOPE)
+#      message(${CMAKE_CURRENT_LIST_DIR}/source)
+      set(${project_name}_project_includes "${CMAKE_CURRENT_LIST_DIR}/source")
+      set(${project_name}_project_includes "${CMAKE_CURRENT_LIST_DIR}/source" PARENT_SCOPE)
       include_directories(${CMAKE_CURRENT_LIST_DIR}/source)
     endif ()

@@ -265,10 +270,10 @@
 endmacro()

 macro(include_project library_name)
-  if (${library_name}_includes)
-    include_directories(${${library_name}_includes})
-  else ()
-    include(${${library_name}_DIR}/${library_name}-config.cmake)
+  if (${library_name}_project_includes)
+    include_directories(${${library_name}_project_includes})
+  else ()
+    include(${${library_name}_project_path}/${library_name}-config.cmake)
   endif ()
 endmacro()


Quote user-supplied paths. Search CMAKE_INSTALL_PREFIX last to prefer local installs.

--- common/FindclFFT.cmake
+++ common/FindclFFT.cmake
@@ -36,29 +36,37 @@
 ENDIF (CLFFT_INCLUDE_DIRS)

 FIND_PATH(CLFFT_SOURCE_DIR
-        NAMES src/include/clFFT.h
-        HINTS ${CMAKE_SOURCE_DIR}/clFFT ${CMAKE_SOURCE_DIR}/../clFFT ${CMAKE_SOURCE_DIR}/../../clFFT
-        DOC "clFFT source directory.")
+    NAMES src/include/clFFT.h
+    HINTS   "${CMAKE_SOURCE_DIR}/clFFT"
+            "${CMAKE_SOURCE_DIR}/../clFFT"
+            "${CMAKE_SOURCE_DIR}/../../clFFT"
+    DOC "clFFT source directory.")

 FIND_PATH(CLFFT_BUILD_DIR
-        NAMES ./install_manifest.txt
-        HINTS ${CLFFT_SOURCE_DIR}/build ${CLFFT_SOURCE_DIR}/src/build
-        DOC "clFFT build directory.")
+    NAMES ./install_manifest.txt
+    HINTS   "${CLFFT_SOURCE_DIR}/build"
+            "${CLFFT_SOURCE_DIR}/src/build"
+    DOC "clFFT build directory.")

 FIND_PATH(CLFFT_ROOT_DIR
     NAMES include/clFFT.h
-    HINTS /usr/local/ $ENV{CLFFT_ROOT} ${CMAKE_SOURCE_DIR}/..  ${CMAKE_SOURCE_DIR}/../.. ${CLFFT_BUILD_DIR}/package
+    HINTS   "$ENV{CLFFT_ROOT}"
+            "${CMAKE_SOURCE_DIR}/.."
+            "${CMAKE_SOURCE_DIR}/../.."
+            "${CLFFT_BUILD_DIR}/package"
+            "${CMAKE_INSTALL_PREFIX}"
     DOC "clFFT root directory.")

 FIND_PATH(_CLFFT_INCLUDE_DIRS
     NAMES clFFT.h
-    HINTS ${CLFFT_ROOT_DIR}/include
+    HINTS "${CLFFT_ROOT_DIR}/include"
     DOC "clFFT Include directory")

 FIND_LIBRARY(_CLFFT_LIBRARY
     NAMES clFFT
-    HINTS 	${CLFFT_ROOT_DIR}/lib64
-			${CLFFT_ROOT_DIR}/lib64/import)
+    HINTS 	"${CLFFT_ROOT_DIR}/lib64"
+		    "${CLFFT_ROOT_DIR}/lib64/import"
+		    "${CMAKE_INSTALL_PREFIX}")

 SET(CLFFT_INCLUDE_DIRS ${_CLFFT_INCLUDE_DIRS})
 SET(CLFFT_LIBRARIES ${_CLFFT_LIBRARY})


pw_build/cmake: Require pw_add_module_facade to use BACKEND

Updates pw_add_module_facade to require the use of BACKEND. As
part of this, the DEFAULT_BACKEND argument is deprecated and
additional checks are added across the facade CMake functions.

Change-Id: I905f54d8a69255170bfb2b2f150194aa24632b1f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117415
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Commit-Queue: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>
Commit-Queue: Auto-Submit <14637eda5603879df170705285bf30f5996692f0@pigweed.google.com.iam.gserviceaccount.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -540,38 +540,28 @@
 # MODULE_NAME.facade.
 #
 # pw_add_module_facade accepts the same arguments as pw_add_module_library,
-# except for IMPLEMENTS_FACADES. It also accepts the following argument:
+# except for IMPLEMENTS_FACADES. It also requires the following argument:
 #
 #  BACKEND - The name of the facade's backend variable.
-#  DEFAULT_BACKEND - which backend to use by default, ignored if BACKEND is
-#                    specified.
-#
-# TODO(ewout, hepler): Deprecate DEFAULT_BACKEND and make BACKEND required.
 function(pw_add_module_facade NAME)
   _pw_add_library_multi_value_args(list_args)
   pw_parse_arguments_strict(pw_add_module_facade 1 ""
                             "DEFAULT_BACKEND;BACKEND"
                             "${list_args}")

-  # TODO(ewout, hepler): Remove this conditional block and instead require
-  # BACKEND and assert that it is DEFINED.
-  if(NOT "${arg_BACKEND}" STREQUAL "")
-    string(REGEX MATCH ".+_BACKEND" backend_ends_in_backend "${arg_BACKEND}")
-    if(NOT backend_ends_in_backend)
-      message(FATAL_ERROR "The ${NAME} pw_add_module_facade's BACKEND argument "
-              "(${arg_BACKEND}) must end in _BACKEND (${name_ends_in_backend})")
-    endif()
-
-
-    if(NOT "${arg_DEFAULT_BACKEND}" STREQUAL "")
-      message(FATAL_ERROR
-              "${NAME}'s DEFAULT_BACKEND is ignored as BACKEND was provided")
-    endif()
-  else()
-    set(arg_BACKEND "${NAME}_BACKEND")
-    # Declare the backend variable for this facade.
-    set("${NAME}_BACKEND" "${arg_DEFAULT_BACKEND}" CACHE STRING
-        "Backend for ${NAME}")
+  if("${arg_BACKEND}" STREQUAL "")
+    message(FATAL_ERROR "The ${NAME} pw_add_module_facade is missing the "
+            "BACKEND variable")
+  endif()
+  if(NOT DEFINED "${arg_BACKEND}")
+    message(FATAL_ERROR "${NAME}'s backend variable ${arg_BACKEND} has not "
+            "been defined, you may be missing a pw_add_backend_variable or "
+            "the *.cmake import to that file.")
+  endif()
+  string(REGEX MATCH ".+_BACKEND" backend_ends_in_backend "${arg_BACKEND}")
+  if(NOT backend_ends_in_backend)
+    message(FATAL_ERROR "The ${NAME} pw_add_module_facade's BACKEND argument "
+            "(${arg_BACKEND}) must end in _BACKEND (${name_ends_in_backend})")
   endif()

   # Define the facade library, which is used by the backend to avoid circular
@@ -630,6 +620,7 @@
     message(FATAL_ERROR "The ${NAME} pw_add_backend_variable's NAME argument "
             "must end in _BACKEND")
   endif()
+
   set("${NAME}" "${OPTIONAL_DEFAULT_BACKEND}" CACHE STRING
       "${NAME} backend variable for a facade")
 endfunction()
@@ -643,6 +634,11 @@
   if(NOT name_ends_in_backend)
     set(NAME "${NAME}_BACKEND")
   endif()
+  if(NOT DEFINED "${NAME}")
+    message(WARNING "${NAME} was not defined when pw_set_backend was invoked, "
+            "you may be missing a pw_add_backend_variable or the *.cmake "
+            "import to that file.")
+  endif()

   set("${NAME}" "${BACKEND}" CACHE STRING "backend variable for a facade" FORCE)
 endfunction(pw_set_backend)


Attempt to fix BuildBot breakage with MSVC.

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

--- include/llvm/Support/DataTypes.h.cmake
+++ include/llvm/Support/DataTypes.h.cmake
@@ -95,6 +95,11 @@
 #include <stdlib.h>
 #include <stddef.h>
 #include <sys/types.h>
+#ifdef __cplusplus
+#include <cmath>
+#else
+#include <math.h>
+#endif
 typedef __int64 int64_t;
 typedef unsigned __int64 uint64_t;
 typedef signed int int32_t;


CMake: fix incorrect variable check

CMake: fix incorrect variable check

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -707,7 +707,7 @@
 ####################################################################
 # Some architectures have -march and -mcpu reversed

-if(NOT DEFINED ${CLANG_MARCH_FLAG})
+if(NOT DEFINED CLANG_MARCH_FLAG)
   message(STATUS "Checking clang -march vs. -mcpu flag")
   custom_try_compile_clang_silent("" "return 0;" RES ${CLANG_TARGET_OPTION}${LLC_TRIPLE} -march=${LLC_HOST_CPU})
   if(NOT RES)


restore PRESCOTT default for DYNAMIC_LIST

--- cmake/arch.cmake
+++ cmake/arch.cmake
@@ -79,7 +79,7 @@
       string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
     endif ()
     if (DYNAMIC_LIST)
-	set(DYNAMIC_CORE ${DYNAMIC_LIST})
+      set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST})
     endif ()
   endif ()


fix MSVC warning levels, move _CRT_SECURE_NO_WARNINGS define to sources

--- cmake/dist.cmake
+++ cmake/dist.cmake
@@ -78,7 +78,7 @@

 # In MSVC, prevent warnings that can occur when using standard libraries.
 if ( MSVC )
-  add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
+  add_compile_definitions (_CRT_SECURE_NO_WARNINGS)
 endif ()

 # RPath and relative linking


Fix a small style nit

Fix a small style nit

--- cmake/test.cmake
+++ cmake/test.cmake
@@ -152,7 +152,8 @@
 endmacro (vistk_build_test)

 function (vistk_make_test testname instance)
-  add_test(NAME test-${testname}-${instance}
+  add_test(
+    NAME    test-${testname}-${instance}
     COMMAND ${test_runner}
             "${test_output_path}/test-${testname}"
             ${instance}


linux-x86: Tweak toolchain comment associated with CMAKE_IGNORE_PATH

--- linux-x86/Toolchain.cmake
+++ linux-x86/Toolchain.cmake
@@ -14,7 +14,8 @@
 set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
 set(CMAKE_AR /usr/${cross_triple}/bin/${cross_triple}-ar)

-# Prevent 64-bit libraries from being discovered
+# Discard path returned by pkg-config and associated with HINTS in module
+# like FindOpenSSL.
 set(CMAKE_IGNORE_PATH /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/lib/)

 set(CMAKE_CROSSCOMPILING_EMULATOR sh -c)


#1338 - Updated OpenIGTLink version to latest.

git-svn-id: f70d4c833b20674991d6651a5f592bbdbe6b47b2@8709 30ced1d1-d8fb-0310-b896-84269ee58dd6

--- CMake/CMakeExternals/OPENIGTLINK.cmake
+++ CMake/CMakeExternals/OPENIGTLINK.cmake
@@ -35,7 +35,7 @@
 IF(NOT DEFINED OpenIGTLink_DIR)

     #1273 - OpenIGTLink version update due to bugfixes.
-    SET(revision_tag 67c6c750ca)
+    SET(revision_tag f3d67288cc)
     IF(${proj}_REVISION_TAG)
         SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


modules: updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -36,6 +36,7 @@
 #  CORRADE_TARGET_NACL_GLIBC    - Defined if compiled for Google Chrome
 #   Native Client with `glibc` toolchain
 #  CORRADE_TARGET_EMSCRIPTEN    - Defined if compiled for Emscripten
+#  CORRADE_TARGET_ANDROID       - Defined if compiled for Android
 #
 # If CORRADE_BUILD_DEPRECATED is defined, the CORRADE_INCLUDE_DIR variable also
 # contains path directly to Corrade directory (i.e. for includes without
@@ -201,6 +202,10 @@
 if(NOT _TARGET_EMSCRIPTEN EQUAL -1)
     set(CORRADE_TARGET_EMSCRIPTEN 1)
 endif()
+string(FIND "${_corradeConfigure}" "#define CORRADE_TARGET_ANDROID" _TARGET_ANDROID)
+if(NOT _TARGET_ANDROID EQUAL -1)
+    set(CORRADE_TARGET_ANDROID 1)
+endif()

 set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARY})
 set(CORRADE_INTERCONNECT_LIBRARIES ${CORRADE_INTERCONNECT_LIBRARY} ${CORRADE_UTILITY_LIBRARIES})


r9985/sofa : Fix: CGAL library found on MacOS (at least when installed with macports)

Former-commit-id: e39345a54ebbad89ab050e07dd1b022c2f45619a

--- cmake/FindCGAL.cmake
+++ cmake/FindCGAL.cmake
@@ -17,7 +17,6 @@
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)

 if ( NOT CGAL_DIR )
-
   # Get the system search path as a list.
   if(UNIX)
     string(REGEX MATCHALL "[^:]+" CGAL_DIR_SEARCH1 "$ENV{PATH}")
@@ -81,6 +80,18 @@
 endif()

 if( NOT CGAL_FOUND)
+  # try to find the paths manually...
+  find_path(CGAL_DIR NAMES include/CGAL/Polyhedron_3.h)
+  find_library(CGAL_LIBRARIES NAMES CGAL)
+  if(EXISTS "${CGAL_DIR}/include/CGAL/Polyhedron_3.h" AND EXISTS ${CGAL_LIBRARIES})
+    set(CGAL_FOUND TRUE)
+    message(STATUS "CGAL found: ${CGAL_LIBRARIES} ${CGAL_DIR}")
+    mark_as_advanced(CGAL_DIR CGAL_LIBRARIES)
+
+  endif()
+endif()
+
+if( NOT CGAL_FOUND)
   if(CGAL_FIND_REQUIRED)
     MESSAGE(FATAL_ERROR ${CGAL_DIR_MESSAGE})
   else()