additionally track ownership of reset variables - used to verify and to keep track of ownership of cached variable (e.g. PERL_EXECUTABLE might be set by user)

Change-Id: Ifb1e2618d7b36fdec0ac8f76122129bf9cca6b5a

--- external/vigra_cmake/VigraAddDep.cmake
+++ external/vigra_cmake/VigraAddDep.cmake
@@ -209,9 +209,13 @@
   # to find_package_plus(). These variables are stored in a variable called VAD_NEW_VARS_${_VAD_NAME}, which we will
   # also remove.
   foreach(_NEWVAR ${VAD_NEW_VARS_${_VAD_NAME}})
-    unset(${_NEWVAR} CACHE)
+    if (VAD_${_NEWVAR}_RESET_OWNER STREQUAL ${_VAD_NAME})
+      unset(${_NEWVAR} CACHE)
+      unset(${_NEWVAR})
+    else()
+      message(FATAL_ERROR "inconsistent variable ownership (${_VAD_NAME} tried to unset ${_NEWVAR} which was detected as set by ${VAD_${_NEWVAR}_RESET_OWNER})")
+    endif()
   endforeach()
-  unset(VAD_NEW_VARS_${_VAD_NAME} CACHE)

   # Get the list of the currently defined variables.
   get_cmake_property(_OLD_VARIABLES_${_VAD_NAME} VARIABLES)
@@ -227,37 +231,60 @@
   # We will append the detected variables to the _DIFFVARS list.
   set(_DIFFVARS)
   foreach(_NEWVAR ${_NEW_VARIABLES_${_VAD_NAME}})
-      list(FIND _OLD_VARIABLES_${_VAD_NAME} "${_NEWVAR}" _NEWVARIDX)
-
-      var_is_cached(${_NEWVAR} _NEWVAR_IS_CACHED)
-
-      if(_NEWVARIDX EQUAL -1 AND NOT _NEWVAR_IS_CACHED)
-          # New var was not found among the old ones. We check if it is not an internal variable,
-          # in which case we will add it to the cached variables.
-          # cached variables are also skipped (should not be added to diffvars so they will not be reset!
-          string(TOLOWER "${_NEWVAR}" _NEWVAR_LOW)
-          # We forcefully exclude variables named in a certain way:
-          # - starts with underscore "_",
-          # - vad-related variables,
-          # - variables set by CMake's builtin find_package,
-          # - args* (these are arguments to macros/functions).
-          if(NOT _NEWVAR_LOW MATCHES "^_" AND NOT _NEWVAR_LOW MATCHES "^vad" AND NOT _NEWVAR_LOW MATCHES "^find_package" AND NOT _NEWVAR_LOW MATCHES "^argv[0-9]*" AND NOT _NEWVAR_LOW MATCHES "^argc" AND NOT _NEWVAR_LOW MATCHES "^argn")
-            # Make sure we don't store multiline strings in the cache, as that is not supported.
-            string(REPLACE "\n" ";" _NEWVAR_NO_NEWLINES "${${_NEWVAR}}")
-            if(VAD_VERBOSE)
-              message(STATUS "Storing new variable in cache: '${_NEWVAR}:${_NEWVAR_NO_NEWLINES}'")
+      string(TOLOWER "${_NEWVAR}" _NEWVAR_LOW)
+      # We forcefully exclude variables named in a certain way:
+      # - starts with underscore "_",
+      # - vad-related variables,
+      # - variables set by CMake's builtin find_package,
+      # - args* (these are arguments to macros/functions).
+      if(NOT _NEWVAR_LOW MATCHES "^_" AND NOT _NEWVAR_LOW MATCHES "^vad" AND NOT _NEWVAR_LOW MATCHES "^find_package" AND NOT _NEWVAR_LOW MATCHES "^argv[0-9]*" AND NOT _NEWVAR_LOW MATCHES "^argc" AND NOT _NEWVAR_LOW MATCHES "^argn")
+
+        list(FIND _OLD_VARIABLES_${_VAD_NAME} "${_NEWVAR}" _NEWVARIDX)
+
+        var_is_cached(${_NEWVAR} _NEWVAR_IS_CACHED)
+
+        # variables might first be added to the cache by a package and then overwritten by the user
+        # these should stay in cache and stay in new_vars list
+        if (_NEWVAR_IS_CACHED)
+          #message("newvar ${_NEWVAR} is cached")
+          if (VAD_${_NEWVAR}_RESET_OWNER STREQUAL ${_VAD_NAME})
+            # force overwrite if it was cached by us (else ignore it), and leave/readd to diffvars
+            string(FIND "${VAD_NEW_VARS_${_VAD_NAME}}" ${_NEWVAR} _IS_NEWVAR_IDX)
+            if (NOT _IS_NEWVAR_IDX EQUAL -1)
+              get_property(_NEWVAR_CACHETYPE CACHE ${_NEWVAR} PROPERTY TYPE)
+              # FIXME get INTERNAL + ADVANCED flag? why do we rewrite this exaclty?
+              set(${_NEWVAR} ${${_NEWVAR}} CACHE ${_NEWVAR_CACHETYPE} "" FORCE)
+              list(APPEND _DIFFVARS ${_NEWVAR})
+              set(VAD_${_NEWVAR}_RESET_OWNER ${_VAD_NAME} CACHE INTERNAL "")
+            else()
+              #message("skipping variable ${_NEWVAR} is ours but not known ${VAD_${_NEWVAR}_RESET_OWNER}")
             endif()
-            if(_NEWVAR_LOW MATCHES "librar" OR _NEWVAR_LOW MATCHES "include")
-              # Variables which are likely to represent lib paths or include dirs are set as string variables,
-              # so that they are visible from the GUI.
-              set(${_NEWVAR} ${_NEWVAR_NO_NEWLINES} CACHE STRING "")
-            else()
-              # Otherwise, mark them as internal vars.
-              set(${_NEWVAR} ${_NEWVAR_NO_NEWLINES} CACHE INTERNAL "")
-            endif()
-            list(APPEND _DIFFVARS ${_NEWVAR})
+          else()
+            #message("skipping variable ${_NEWVAR} is cached by \"${VAD_${_NEWVAR}_RESET_OWNER}\" (I'm ${_VAD_NAME})")
           endif()
-      endif()
+        elseif(_NEWVARIDX EQUAL -1)
+            # New var was not found among the old ones. We check if it is not an internal variable,
+            # in which case we will add it to the cached variables.
+            # cached variables are also skipped (should not be added to diffvars so they will not be reset!
+              # Make sure we don't store multiline strings in the cache, as that is not supported.
+              string(REPLACE "\n" ";" _NEWVAR_NO_NEWLINES "${${_NEWVAR}}")
+              if(VAD_VERBOSE)
+                message(STATUS "Storing new variable in cache: '${_NEWVAR}:${_NEWVAR_NO_NEWLINES}'")
+              endif()
+              if(_NEWVAR_LOW MATCHES "librar" OR _NEWVAR_LOW MATCHES "include")
+                # Variables which are likely to represent lib paths or include dirs are set as string variables,
+                # so that they are visible from the GUI.
+                set(${_NEWVAR} ${_NEWVAR_NO_NEWLINES} CACHE STRING "")
+              else()
+                # Otherwise, mark them as internal vars.
+                set(${_NEWVAR} ${_NEWVAR_NO_NEWLINES} CACHE INTERNAL "")
+              endif()
+              list(APPEND _DIFFVARS ${_NEWVAR})
+              set(VAD_${_NEWVAR}_RESET_OWNER ${_VAD_NAME} CACHE INTERNAL "")
+        else()
+          #message("skipping known variable ${_VAD_NAME}")
+        endif() #new var
+      endif() #exclude match
   endforeach()
   # Store a list of the variables that were exported as cache variables.
   set(VAD_NEW_VARS_${_VAD_NAME} ${_DIFFVARS} CACHE INTERNAL "")
@@ -269,6 +296,7 @@
   endif()
   set(${_VARNAME} ${_VARVAL} CACHE INTERNAL "")
   set(VAD_NEW_VARS_${_VAD_NAME} "${VAD_NEW_VARS_${_VAD_NAME}};${_VARNAME}" CACHE INTERNAL "")
+  set(VAD_${_VARNAME}_RESET_OWNER ${_VAD_NAME} CACHE INTERNAL "")
 endfunction()

 # In addition to calling the builtin find_package(), this function


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


Fixes for FindGLFW on linux

Fixes for FindGLFW on linux

--- src/unit_PARALLEL/cmake/FindGLFW.cmake
+++ src/unit_PARALLEL/cmake/FindGLFW.cmake
@@ -20,7 +20,7 @@
 # Allow the user to select to link to a shared library or to a static library.

 #Search for the include file...
-FIND_PATH(GLFW_INCLUDE_DIR GLFW/glfw3.h DOC "Path to GLFW include directory."
+FIND_PATH(GLFW_INCLUDE_DIR glfw3.h DOC "Path to GLFW include directory."
   HINTS
   $ENV{GLFW_ROOT}
   PATH_SUFFIX include/GL include/GLFW #For finding the include file under the root of the glfw expanded archive, typically on Windows.
@@ -30,6 +30,8 @@
   # By default headers are under GL subfolder
   /usr/include/GL
   /usr/local/include/GL
+  /usr/include/GLFW
+  /usr/local/include/GLFW
   ${GLFW_ROOT_DIR}/include/ # added by ptr

 )


ENH: refactor ZLIB superbuild

ENH: refactor ZLIB superbuild


[test] Fix line-directive on Windows

[test] Fix line-directive on Windows

--- stdlib/cmake/modules/SwiftSource.cmake
+++ stdlib/cmake/modules/SwiftSource.cmake
@@ -640,7 +640,12 @@
   endif()

   set(line_directive_tool "${SWIFT_SOURCE_DIR}/utils/line-directive")
-  set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc")
+  # line-directive needs full path on Windows.
+  if (CMAKE_SYSTEM_NAME STREQUAL Windows)
+    set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc.exe")
+  else()
+    set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc")
+  endif()
   set(swift_compiler_tool_dep)
   if(SWIFT_INCLUDE_TOOLS)
     # Depend on the binary itself, in addition to the symlink.


Make sure pyqt uses the proper SIP and Python by setting the appropriate PYTHONPATH

--- pyqt4.cmake
+++ pyqt4.cmake
@@ -50,7 +50,7 @@
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ${BUILDEM_ENV_STRING} ${PATCH_EXE}
         ${pyqt4_SRC_DIR}/configure.py ${PATCH_DIR}/pyqt4.patch # For some reason, the configure script wants to build pyqt phonon support even if qt was built without it.  This patch simply comments out phonon support.
-    CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${PYTHON_EXE} ${pyqt4_SRC_DIR}/configure.py
+    CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} PYTHONPATH=${BUILDEM_PYTHONPATH} ${PYTHON_EXE} ${pyqt4_SRC_DIR}/configure.py
         --confirm-license
         -q "${BUILDEM_DIR}/bin/qmake"
         ${EXTRA_PYQT4_CONFIG_FLAGS}


Fixed some typos in CompilerOptions.cmake and using -march=native by default.

Signed-off-by: Étienne Schmitt <25d5031dc1a1d443222aec9a4e916501ae23c255@inria.fr>

--- cmake/CompilerOptions.cmake
+++ cmake/CompilerOptions.cmake
@@ -1,35 +1,35 @@
 include(cmake/utilities.cmake)

 # Profiler compilation flags
-if(CGOGN_USE_GPROF)
+if(CGOGN_WITH_GPROF)
 	message(STATUS "Building for code profiling")
 	add_flags(CMAKE_CXX_FLAGS -pg -DPROFILER)
 	add_flags(CMAKE_C_FLAGS -pg -DPROFILER)
-endif(CGOGN_USE_GPROF)
+endif(CGOGN_WITH_GPROF)

 # Code coverage compilation flags
-if(CGOGN_USE_GCOV)
+if(CGOGN_WITH_GCOV)
 	message(STATUS "Building for coverage analysis")
 	add_flags(CMAKE_CXX_FLAGS --coverage)
 	add_flags(CMAKE_C_FLAGS --coverage)
-endif(CGOGN_USE_GCOV)
+endif(CGOGN_WITH_GCOV)

 # Compilation flags for Google's AddressSanitizer
 # These flags can only be specified for dynamic builds
-if(CGOGN_USE_ASAN)
+if(CGOGN_WITH_ASAN)
 	message(STATUS "Building with AddressSanitizer (debug only)")
 	add_flags(CMAKE_CXX_FLAGS_DEBUG -fsanitize=address -fno-omit-frame-pointer -O1)
 	add_flags(CMAKE_C_FLAGS_DEBUG -fsanitize=address -fno-omit-frame-pointer -O1)
-endif(CGOGN_USE_ASAN)
+endif(CGOGN_WITH_ASAN)
 #TODO Use native GCC stack smash Protection and buffer overflow detection in debug when no asan ??

 # Compilation flags for Google's ThreadSanitizer
 # Does not work for the moment: cannot figure out how to link with library libtsan
-if(CGOGN_USE_TSAN)
+if(CGOGN_WITH_TSAN)
 	message(STATUS "Building with ThreadSanitizer (debug only)")
 	add_flags(CMAKE_CXX_FLAGS_DEBUG -fsanitize=thread)
 	add_flags(CMAKE_C_FLAGS_DEBUG -fsanitize=thread)
-endif(CGOGN_USE_TSAN)
+endif(CGOGN_WITH_TSAN)

 if (NOT MSVC)
 # This is the correcty way to activate threads. It should be prefered to "-lpthread"
@@ -111,9 +111,16 @@
 		endif(${CGOGN_USE_GLIBCXX_DEBUG})
 	endif(${CGOGN_USE_PARALLEL_GLIBCXX})

-	# Enable SSE3 instruction set
-	add_flags(CMAKE_CXX_FLAGS "-msse3")
-	add_flags(CMAKE_C_FLAGS "-msse3")
+	# Tellls gcc/clang to generate code specific to our CPU. Enable SSE and AVX when available.
+	# WARNING: Do not use when compiling with distcc
+	if (NOT CMAKE_CXX_COMPILER MATCHES "distcc")
+		add_flags(CMAKE_CXX_FLAGS "-march=native")
+		add_flags(CMAKE_C_FLAGS "-march=native")
+	else()
+		add_flags(CMAKE_CXX_FLAGS "-msse3")
+		add_flags(CMAKE_C_FLAGS "-msse3")
+	endif()
+

 	# Always generate position independant code
 	# (to allow linking with DLLs)


Call fix.

Call fix.

--- cmake/EmbeddedContent.cmake
+++ cmake/EmbeddedContent.cmake
@@ -11,7 +11,6 @@

 add_custom_command(OUTPUT Embedded.cpp
                         COMMAND ${PYTHON} ${SCRIPT} ${EMBEDDED_FILES} $<ANGLE-R> Embedded.cpp
-                        BYPRODUCTS Embedded.cpp
                         COMMENT "Generate embedded content"
                         )


remove cpuid

remove cpuid

--- cmake/EthDependencies.cmake
+++ cmake/EthDependencies.cmake
@@ -101,14 +101,6 @@
 find_package (CURL)
 message(" - curl header: ${CURL_INCLUDE_DIRS}")
 message(" - curl lib   : ${CURL_LIBRARIES}")
-
-# cpuid required for eth
-find_package (Cpuid)
-if (CPUID_FOUND)
-	message(" - cpuid header: ${CPUID_INCLUDE_DIRS}")
-	message(" - cpuid lib   : ${CPUID_LIBRARIES}")
-endif()
-
 find_package (OpenCL)
 if (OpenCL_FOUND)
 	message(" - opencl header: ${OpenCL_INCLUDE_DIRS}")


CMake: Replace a previously missed instance of 'git am'

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -37,7 +37,7 @@
             ext_mkldnn
             GIT_REPOSITORY ${MKLDNN_GIT_REPO_URL}
             UPDATE_COMMAND ""
-            PATCH_COMMAND git am ${CMAKE_SOURCE_DIR}/third-party/patches/mkldnn-cmake-openmp.patch
+            PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/third-party/patches/mkldnn-cmake-openmp.patch
             CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
             BUILD_BYPRODUCTS "${EXTERNAL_INSTALL_LOCATION}/include/mkldnn.hpp"
             )


CMake: Correctly add Poco libraries on Linux x86_64

--- cmake/macros/FindPoco.cmake
+++ cmake/macros/FindPoco.cmake
@@ -42,7 +42,7 @@
 IF ( UNIX )
     set (POCO_LIBRARIES_DIR "${POCO_LIBRARIES_DIR}/Linux")

-    IF (PLATFORM EQUAL 64)
+    IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
         set (POCO_LIBRARIES_DIR "${POCO_LIBRARIES_DIR}/x86_64")
     else()
         set (POCO_LIBRARIES_DIR "${POCO_LIBRARIES_DIR}/i386")


[CMake] Make it possible to set the RPATH in add_lldb_exectable.

Make it possible to pass a build and install RPATH to
add_lldb_executable instead of having to call lldb_setup_rpaths after
the fact.

This fixes a real issue where setting an install RPATH with
lldb_setup_rpaths would only affect the symroot installation component.
Given that lldb_setup_rpaths sets a target property I would expect this
to be orthogonal to installation components. Regardless, it makes sense
to integrate this functionality in add_lldb_exectable.

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

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -148,7 +148,7 @@
   cmake_parse_arguments(ARG
     "GENERATE_INSTALL"
     "INSTALL_PREFIX;ENTITLEMENTS"
-    "LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS"
+    "LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS;BUILD_RPATH;INSTALL_RPATH"
     ${ARGN}
     )

@@ -175,13 +175,26 @@
   endif()
   set_target_properties(${name} PROPERTIES FOLDER "lldb executables")

+  if (ARG_BUILD_RPATH)
+    set_target_properties(${name} PROPERTIES BUILD_RPATH "${ARG_BUILD_RPATH}")
+  endif()
+
+  if (ARG_INSTALL_RPATH)
+    set_target_properties(${name} PROPERTIES
+      BUILD_WITH_INSTALL_RPATH OFF
+      INSTALL_RPATH "${ARG_INSTALL_RPATH}")
+  endif()
+
   if(ARG_GENERATE_INSTALL)
     set(install_dest bin)
     if(ARG_INSTALL_PREFIX)
       set(install_dest ${ARG_INSTALL_PREFIX})
     endif()
     install(TARGETS ${name} COMPONENT ${name}
-            RUNTIME DESTINATION ${install_dest})
+            RUNTIME DESTINATION ${install_dest}
+            LIBRARY DESTINATION ${install_dest}
+            BUNDLE DESTINATION ${install_dest}
+            FRAMEWORK DESTINATION ${install_dest})
     if (NOT CMAKE_CONFIGURATION_TYPES)
       add_llvm_install_targets(install-${name}
                                DEPENDS ${name}


Ensure newer versions of LCM (including LCM provided by Drake) are found

--- cmake/modules/FindLCM.cmake
+++ cmake/modules/FindLCM.cmake
@@ -7,6 +7,14 @@
 # <package>_INCLUDE_DIRS
 # <package>_LIBRARIES

+find_package(lcm QUIET CONFIG)
+if(lcm_FOUND)
+  set(LCM_LIBRARIES ${LCM_NAMESPACE}lcm)
+  if(TARGET ${LCM_NAMESPACE}lcm-static)
+    set(LCM_STATIC_LIBRARIES ${LCM_NAMESPACE}lcm-static)
+  endif()
+  return()
+endif()

 macro(pkg_config_find_module varname pkgname header library pathsuffix)


Fix recently introduced Boolean logic bug for deciding whether
documentation can be built.

Note this bug would have only been exercised on the rare occasions
when someone attempts to build the documentation on platforms
other than Linux or Cygwin.

--- cmake/modules/docbook.cmake
+++ cmake/modules/docbook.cmake
@@ -1,7 +1,7 @@
 # cmake/modules/docbook.cmake
 #
 # Copyright (C) 2006  Andrew Ross
-# Copyright (C) 2006  Alan W. Irwin
+# Copyright (C) 2006-2015  Alan W. Irwin
 #
 # This file is part of PLplot.
 #
@@ -22,9 +22,8 @@

 option(BUILD_DOC "Enable build of DocBook documentation" OFF)

-# documentation can now build on Cygwin - remove the linux requirement
-#if(NOT (PERL_FOUND AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
-if(NOT PERL_FOUND)
+# documentation can now build on both Linux and Cygwin.
+if(NOT (PERL_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")))
   set(
   BUILD_DOC OFF CACHE INTERNAL
   "Enable build of DocBook documentation"


Reverted useless cmakedefine.

Reverted useless cmakedefine.

--- include/zorba/config.h.cmake
+++ include/zorba/config.h.cmake
@@ -157,7 +157,7 @@
 #cmakedefine ZORBA_WITH_BIG_INTEGER
 #cmakedefine ZORBA_WITH_DEBUGGER
 #cmakedefine ZORBA_WITH_FILE_ACCESS
-// #cmakedefine ZORBA_WITH_JSON
+#cmakedefine ZORBA_WITH_JSON
 #cmakedefine ZORBA_WITH_LIBXML2_SAX

 // Zorba parser configuration


G-API: Update ADE to v0.1.2a to fix new Windows warnings

--- modules/gapi/cmake/DownloadADE.cmake
+++ modules/gapi/cmake/DownloadADE.cmake
@@ -1,7 +1,7 @@
 set(ade_src_dir "${OpenCV_BINARY_DIR}/3rdparty/ade")
-set(ade_filename "v0.1.2.zip")
-set(ade_subdir "ade-0.1.2")
-set(ade_md5 "561c1e28ccf27ad0557a18e251c22226")
+set(ade_filename "v0.1.2a.zip")
+set(ade_subdir "ade-0.1.2a")
+set(ade_md5 "fa4b3e25167319cb0fa9432ef8281945")
 ocv_download(FILENAME ${ade_filename}
              HASH ${ade_md5}
              URL


Automatically determine BUILD_X64 option (if unset).

Previously, this option was chosen based on the name of the currently
running schroot session. This would cause non-schroot-based builds to
fail unless the user manually passed something like "-DBUILD_X64=On".

Instead, we can examine the size of a void pointer to automatically
determine whether to do a 32-bit or 64-bit build. This should work for
both the schroot-based and non-schroot-based builds.

Note: If the user manually specifies -DBUILD_X64=On|Off at the
command-line, this still takes precedence over the automatic detection
of the native target.

--- src/build_options.cmake
+++ src/build_options.cmake
@@ -10,7 +10,8 @@
 #
 cmake_minimum_required(VERSION 2.8)

-option(BUILD_X64 "build 64-bit" FALSE)
+set(BUILD_X64 "" CACHE STRING "whether to perform 64-bit build: ON or OFF overrides default detection")
+
 option(CMAKE_VERBOSE "Verbose CMake" FALSE)
 if( CMAKE_VERBOSE )
     SET(CMAKE_VERBOSE_MAKEFILE ON)
@@ -28,14 +29,14 @@
 option(CLANG_EVERYTHING "Do clang build with -Weverything" OFF)
 option(USE_TELEMETRY "Build with Telemetry" OFF)

-if( NOT BUILD_X64 )
-  # If we're in our 64-bit chroot, default to 64-bit, else 32-bit
-  if( "$ENV{SCHROOT_CHROOT_NAME}" MATCHES "(.*)amd64(.*)" )
+# Unless user specifies BUILD_X64 explicitly, assume native target
+if( BUILD_X64 STREQUAL "" )
+  if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
     set(BUILD_X64 "TRUE")
   else()
     set(BUILD_X64 "FALSE")
   endif()
-endif( NOT BUILD_X64 )
+endif( BUILD_X64 STREQUAL "" )

 # Generate bitness suffix to use
 if (BUILD_X64)


BUMP: Bump TubeTk to benefit from CLP fixes

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/TubeTK/TubeTK.git"
-    GIT_TAG "e8c6fea59c794a7f8d16bd072182dd7e920dbed4"
+    GIT_TAG "8c53b6d06b4003bc5f31c6d2a8ca3598c7579da3"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


ENH: Fixed pathing to output directory.

ENH: Fixed pathing to output directory.

--- ANTS.cmake
+++ ANTS.cmake
@@ -25,7 +25,7 @@
 set(DEVIL_IMAGE ${DATA_DIR}/Frown.nii)
 set(ANGEL_IMAGE ${DATA_DIR}/Smile.nii)
 set(SEG_IMAGE ${DATA_DIR}/nslice.nii.gz)
-set(TEST_BINARY_DIR ${CMAKE_BINARY_DIR}/Examples)
+set(TEST_BINARY_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

 ###
 #  ANTS metric testing


Specify root ownership as 0.0, not root.root. Works on systems where UID or GID 0 has another name (MacOS: wheel.wheel, AIX root.?)

--- build/cmake/TarGz.cmake
+++ build/cmake/TarGz.cmake
@@ -1,7 +1,7 @@
 add_custom_command(
 	OUTPUT ${CPACK_PACKAGE_FILE_NAME}.tar.gz
 	COMMAND mv ARGS ${CMAKE_INSTALL_PREFIX} ${CPACK_PACKAGE_FILE_NAME}
-	COMMAND tar ARGS czf ${CPACK_PACKAGE_FILE_NAME}.tar.gz --owner=root --group=root --blocking-factor=2048 ${CPACK_PACKAGE_FILE_NAME}
+	COMMAND tar ARGS czf ${CPACK_PACKAGE_FILE_NAME}.tar.gz --owner=0 --group=0 --numeric-owner --blocking-factor=2048 ${CPACK_PACKAGE_FILE_NAME}
 	COMMAND mv ARGS ${CPACK_PACKAGE_FILE_NAME} ${CMAKE_INSTALL_PREFIX}
 )
 add_custom_target(targz DEPENDS ${CPACK_PACKAGE_FILE_NAME}.tar.gz)


- Add gdbserver to Debug-mode APKs

- Add gdbserver to Debug-mode APKs


Dev Checkpoint 201901211444

Dev Checkpoint 201901211444

--- FindImpactSockets.cmake
+++ FindImpactSockets.cmake
@@ -23,12 +23,14 @@
         /usr/include/sockets
         /usr/local/include/sockets
     )
-
+
     FIND_LIBRARY(SOCKETS_LIBRARY
         NAMES ImpactSockets
         PATHS
         /usr/lib
         /usr/local/lib
+        PATH_SUFFIXES
+        ${CMAKE_FIND_LIBRARY_SUFFIXES}
         # Windows MSVC prebuilts:
         # <->lib
         # lib<->_imp
@@ -36,7 +38,7 @@
         # Windows older "Win32 - MSVC" prebuilts
         # lib<->
     )
-
+
     #IF (SOCKETS_INCLUDE_DIR)
     #    IF (EXISTS "${SOCKETS_INCLUDE_DIR}/SocVersion.h")
     #        FILE(STRINGS "${SOCKETS_INCLUDE_DIR}/SocVersion.h" soc_version_str REGEX "^#define[\t ]+SOCKETS_VERSION[\t ]+\".*\"")
@@ -44,7 +46,7 @@
     #        UNSET(soc_version_str)
     #    ENDIF ()
     #ENDIF ()
-
+
     IF (SOCKETS_INCLUDE_DIR AND SOCKETS_LIBRARY)
         SET(SOCKETS_FOUND TRUE)
     ENDIF ()
@@ -62,4 +64,4 @@
     )

     MARK_AS_ADVANCED(SOCKETS_INCLUDE_DIRS SOCKETS_LIBRARIES)
-ENDIF (SOCKETS_LIBRARIES AND SOCKETS_INCLUDE_DIRS)+ENDIF (SOCKETS_LIBRARIES AND SOCKETS_INCLUDE_DIRS)


CMake: Fix Lua build with older versions

--- src/platform/cmake/FindFeature.cmake
+++ src/platform/cmake/FindFeature.cmake
@@ -42,6 +42,11 @@
 					set(${UREQUIRE}_INCLUDE_DIRS ${${REQUIRE}_INCLUDE_DIRS} PARENT_SCOPE)
 				elseif(DEFINED ${UREQUIRE}_INCLUDE_DIRS)
 					set(${UREQUIRE}_INCLUDE_DIRS ${${UREQUIRE}_INCLUDE_DIRS} PARENT_SCOPE)
+				endif()
+				if(DEFINED ${REQUIRE}_INCLUDE_DIR)
+					set(${UREQUIRE}_INCLUDE_DIR ${${REQUIRE}_INCLUDE_DIR} PARENT_SCOPE)
+				elseif(DEFINED ${UREQUIRE}_INCLUDE_DIR)
+					set(${UREQUIRE}_INCLUDE_DIR ${${UREQUIRE}_INCLUDE_DIR} PARENT_SCOPE)
 				endif()
 				if(DEFINED ${REQUIRE}_VERSION_STRING)
 					set(${UREQUIRE}_VERSION_STRING ${${REQUIRE}_VERSION_STRING} PARENT_SCOPE)


fix build

fix build

--- KF5KirigamiMacros.cmake
+++ KF5KirigamiMacros.cmake
@@ -25,7 +25,6 @@
              file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/32/${icon}.svg )
             if (NOT EXISTS ${path})
                 file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/22/${icon}.svg )
-                endif()
             endif()
         endif()
         if (NOT EXISTS ${path})


Just use the source dir to search the deps

--- CMake/toolchain/android.toolchain.cmake
+++ CMake/toolchain/android.toolchain.cmake
@@ -961,7 +961,7 @@
 set( BUILD_ANDROID True )

 # where is the target environment
-set( CMAKE_FIND_ROOT_PATH "/" "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )
+set( CMAKE_FIND_ROOT_PATH "${CMAKE_SOURCE_DIR}" "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )

 # only search for libraries and includes in the ndk toolchain
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )


LargeAdressaware option and don't warn about variadic macros

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@966 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCompiler.cmake
+++ cmake/ACGCompiler.cmake
@@ -15,11 +15,11 @@
   set( ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS )

   if ( WINDOWS_LARGE_MEMORY_SUPPORT )
-        if( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
-	  list(APPEND ADDITIONAL_CMAKE_EXE_LINKER_FLAGS       "/LARGEADDRESSAWARE" )
-  	  list(APPEND ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
-	  list(APPEND ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
-        endif()
+    if( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
+	list(APPEND ADDITIONAL_CMAKE_EXE_LINKER_FLAGS       "/LARGEADDRESSAWARE" )
+	list(APPEND ADDITIONAL_CMAKE_SHARED_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+	list(APPEND ADDITIONAL_CMAKE_MODULE_LINKER_FLAGS    "/LARGEADDRESSAWARE" )
+    endif()
   endif()

@@ -61,7 +61,7 @@
   list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS          "-DINCLUDE_TEMPLATES" )
   list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS        "-DINCLUDE_TEMPLATES" )
   list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-DINCLUDE_TEMPLATES" )
-
+
   # add our standard flags for Template inclusion
   list(APPEND ADDITIONAL_C_DEBUG_FLAGS            "-DINCLUDE_TEMPLATES" )
   list(APPEND ADDITIONAL_C_RELEASE_FLAGS          "-DINCLUDE_TEMPLATES" )
@@ -104,11 +104,13 @@

     IF ( APPLE  )
       # Skip unused parameters as it has to be used for the documentation via doxygen and the interfaces
-      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+    elseif ("${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" MATCHES ".*clang")
+      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wextra" "-Wno-non-virtual-dtor" "-Wno-unused-parameter" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
     ELSEIF ( CMAKE_SYSTEM MATCHES "SunOS*" )
       set ( COMPILER_WARNINGS "" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
     ELSE ()
-      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
+      set ( COMPILER_WARNINGS "-W" "-Wall" "-Wno-unused" "-Wextra" "-Wno-variadic-macros" CACHE STRINGLIST "This list contains the warning flags used during compilation " )
     ENDIF()

   endif ( NOT COMPILER_WARNINGS )


Fix some linking issues on g++, and fix a small apple ommission

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -328,14 +328,8 @@
             set_target_properties(${CEGUI_TARGET_NAME}_Static PROPERTIES LINK_FLAGS_DEBUG /NODEFAULTLIB:freeglut.lib)
         endif()

-        target_link_libraries(${CEGUI_TARGET_NAME}_Static
-            ${CEGUI_STATIC_XMLPARSER_MODULE}_Static
-            ${CEGUI_STATIC_IMAGECODEC_MODULE}_Static
-            ${CEGUI_FALAGARD_WR_LIBNAME}_Static
-        )
-
         if (APPLE)
-            cegui_apple_app_setup(${CEGUI_TARGET_NAME} TRUE)
+            cegui_apple_app_setup(${CEGUI_TARGET_NAME}_Static TRUE)
         endif()
     endif()

@@ -369,10 +363,22 @@
         cegui_apple_app_setup(${CEGUI_TARGET_NAME} FALSE)
     endif()

+
+    ###########################################################################
+    #                      LIBRARY LINK SETUP
+    ###########################################################################
     cegui_target_link_libraries(${CEGUI_TARGET_NAME}
         ${CEGUI_BASE_LIBNAME}
         ${CEGUI_SAMPLEHELPER_LIBNAME}
     )
+
+    if (CEGUI_BUILD_STATIC_CONFIGURATION)
+        target_link_libraries(${CEGUI_TARGET_NAME}_Static
+            ${CEGUI_STATIC_XMLPARSER_MODULE}_Static
+            ${CEGUI_STATIC_IMAGECODEC_MODULE}_Static
+            ${CEGUI_FALAGARD_WR_LIBNAME}_Static
+        )
+    endif()

     ###########################################################################
     #                           INSTALLATION


Fixes wrong pubsub alias cmake target setup

--- cmake/CelixConfig.cmake
+++ cmake/CelixConfig.cmake
@@ -69,13 +69,13 @@
 endif ()

 #Setting up pubsub admin alias to the v1 version.
-if (TARGET Celix::pubsub_admin_zmq_v1)
+if (TARGET Celix::celix_pubsub_admin_zmq_v1)
   add_library(Celix::celix_pubsub_admin_zmq ALIAS Celix::celix_pubsub_admin_zmq_v1)
 endif ()
-if (TARGET Celix::pubsub_admin_tcp_v1)
+if (TARGET Celix::celix_pubsub_admin_tcp_v1)
   add_library(Celix::celix_pubsub_admin_tcp ALIAS Celix::celix_pubsub_admin_tcp_v1)
 endif ()
-if (TARGET Celix::pubsub_admin_websocket_v1)
+if (TARGET Celix::celix_pubsub_admin_websocket_v1)
   add_library(Celix::celix_pubsub_admin_websocket ALIAS Celix::celix_pubsub_admin_websocket_v1)
 endif ()


Find clang-format correctly

Find clang-format correctly

--- cmake/ClangFormat.cmake
+++ cmake/ClangFormat.cmake
@@ -1,8 +1,8 @@
 if(NOT CLANG_FORMAT_COMMAND)
-    set(CLANG_FORMAT_COMMAND "clang-format-6" "clang-format-7" "clang-format-8" "clang-format")
+    set(CLANG_FORMAT_COMMAND "clang-format-9" "clang-format-8" "clang-format-7" "clang-format-6.0" "clang-format")
 endif()

-find_program(CLANG_FORMAT_PROGRAM ${CLANG_FORMAT_COMMAND})
+find_program(CLANG_FORMAT_PROGRAM NAMES ${CLANG_FORMAT_COMMAND})
 if(NOT CLANG_FORMAT_PROGRAM)
     message(STATUS "clang-format not found")
     function(format)


do not install dev ectoConfig* fixes #262

--- cmake/ectoInstall.cmake
+++ cmake/ectoInstall.cmake
@@ -26,12 +26,6 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 #### install stuff #####
-#install the ectoConfig.cmake and ectoConfig-version.cmake
-install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake
-        DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
-        COMPONENT main
-)
-
 #regular headers
 install(DIRECTORY ${ecto_SOURCE_DIR}/include/ecto/
         DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}


BUMP: Bump TubeTK to include SegmentTubes fixes

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
-    GIT_TAG "8c53b6d06b4003bc5f31c6d2a8ca3598c7579da3"
+    GIT_TAG "9991aa672c990ff76b028a3afdcc5325c328ba71"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


Fix minor version extraction

Fix minor version extraction

--- CMake/mitkFunctionGetMSVCVersion.cmake
+++ CMake/mitkFunctionGetMSVCVersion.cmake
@@ -1,16 +1,10 @@
-#! \brief Get diverse visual studio ids not directly provided by CMake
-#!
-#! Sets the following variables in the parent scope
-#!   VISUAL_STUDIO_VERSION_MAJOR - The Visual Studio Version
-#!   VISUAL_STUDIO_PRODUCT_NAME - The Visual Studio Product Name
-
 function(mitkFunctionGetMSVCVersion )

 if(MSVC)
-  if(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 2000)
+  if(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
     set(VISUAL_STUDIO_PRODUCT_NAME "Visual Studio 2017" PARENT_SCOPE)
     set(VISUAL_STUDIO_VERSION_MAJOR 14 PARENT_SCOPE)
-    string(SUBSTRING ${MSVC_VERSION} 3 -1 version_minor)
+    string(SUBSTRING ${MSVC_VERSION} 2 -1 version_minor)
     set(VISUAL_STUDIO_VERSION_MINOR ${version_minor} PARENT_SCOPE)
   else()
     message(WARNING "Unknown Visual Studio version ${MSVC_VERSION} (CMake/mitkFunctionGetMSVCVersion.cmake)")


updates

updates

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -47,6 +47,7 @@
 ENDIF()

 # check ISPC version
+MESSAGE("${ISPC_EXECUTABLE}")
 EXECUTE_PROCESS(COMMAND ${ISPC_EXECUTABLE} --version OUTPUT_VARIABLE ISPC_OUTPUT)
 MESSAGE("${ISPC_OUTPUT}")
 STRING(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev|knl)? " DUMMY "${ISPC_OUTPUT}")


Create tbag_modules__update_cuda_objects() cmake method.

--- cmake/TbagModules.cmake
+++ cmake/TbagModules.cmake
@@ -24,26 +24,6 @@
     message (STATUS "TBAG_PROJECT_CONST_DIR_NAME: ${TBAG_PROJECT_CONST_DIR_NAME}")
     message (STATUS "TBAG_PROJECT_CONST_TYPE: ${TBAG_PROJECT_CONST_TYPE}")
     message (STATUS "TBAG_PROJECT_CONST_NAME: ${TBAG_PROJECT_CONST_NAME}")
-endmacro ()
-
-## ------------------
-## Find object files.
-## ------------------
-
-#/// Find & register object files.
-#///
-#/// @param __find_dir [in] find directory.
-#/// @param __suffix   [in] file suffix.
-macro (tbag_modules__update_objects __find_dir __suffix)
-    get_filename_component (__find_dir_absolute "${__find_dir}" ABSOLUTE)
-    file (GLOB_RECURSE __find_compile_objs "${__find_dir_absolute}/*${__suffix}")
-    list (APPEND TBAG_PROJECT_OBJECTS ${__find_compile_objs})
-endmacro ()
-
-macro (tbag_modules__update_default_objects)
-    tbag_modules__update_objects ("${TBAG_PROJECT_CONST_DIR_PATH}" ".c")
-    tbag_modules__update_objects ("${TBAG_PROJECT_CONST_DIR_PATH}" ".cc")
-    tbag_modules__update_objects ("${TBAG_PROJECT_CONST_DIR_PATH}" ".cpp")
 endmacro ()

 ## -----------------
@@ -169,13 +149,13 @@
     endforeach ()
 endmacro ()

-macro (tbag_modules__apply_cublas)
-    list (APPEND TBAG_PROJECT_LDFLAGS ${CUDA_CUBLAS_LIBRARIES})
-endmacro ()
-
 macro (tbag_modules__apply_cuda)
     list (APPEND TBAG_PROJECT_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS})
     list (APPEND TBAG_PROJECT_LDFLAGS      ${CUDA_LIBRARIES})
+endmacro ()
+
+macro (tbag_modules__apply_cublas)
+    list (APPEND TBAG_PROJECT_LDFLAGS ${CUDA_CUBLAS_LIBRARIES})
 endmacro ()

 macro (tbag_modules__apply_cudnn)
@@ -519,6 +499,40 @@
     list (APPEND TBAG_PROJECT_LDFLAGS      ${UV_LIBRARIES})
 endmacro ()

+## ------------------
+## Find object files.
+## ------------------
+
+function (tbag_modules__find_files __result __find_dir __suffix)
+    set (${__result})
+
+    get_filename_component (__find_dir_absolute "${__find_dir}" ABSOLUTE)
+    file (GLOB_RECURSE ${__result} "${__find_dir_absolute}/*${__suffix}")
+
+    # update result.
+    set (${__result} ${${__result}} PARENT_SCOPE)
+endfunction ()
+
+#/// Find & register object files.
+#///
+#/// @param __find_dir [in] find directory.
+#/// @param __suffix   [in] file suffix.
+macro (tbag_modules__update_objects __find_dir __suffix)
+    tbag_modules__find_files (__find_compile_objs "${__find_dir}" "${__suffix}")
+    list (APPEND TBAG_PROJECT_OBJECTS ${__find_compile_objs})
+endmacro ()
+
+macro (tbag_modules__update_default_objects)
+    tbag_modules__update_objects ("${TBAG_PROJECT_CONST_DIR_PATH}" ".c")
+    tbag_modules__update_objects ("${TBAG_PROJECT_CONST_DIR_PATH}" ".cc")
+    tbag_modules__update_objects ("${TBAG_PROJECT_CONST_DIR_PATH}" ".cpp")
+endmacro ()
+
+macro (tbag_modules__update_cuda_objects)
+    tbag_modules__find_files (__find_cuda_objs "${TBAG_PROJECT_CONST_DIR_PATH}" ".cu")
+    tbag_modules__build_cuda (${__find_cuda_objs})
+endmacro ()
+
 ## --------------
 ## Final process.
 ## --------------


All installs under same heading.

All installs under same heading.

--- cmake/ectoInstall.cmake
+++ cmake/ectoInstall.cmake
@@ -56,7 +56,7 @@

 install(FILES ${ecto_PYTHON_FILES}
-  DESTINATION ${ecto_PYTHON_INSTALL}/ecto COMPONENT ecto_python
+  DESTINATION ${ecto_PYTHON_INSTALL}/ecto COMPONENT ecto
   )

@@ -65,13 +65,13 @@
   )

 install(FILES ${CMAKE_BINARY_DIR}/unix_install/python_path.sh
-        DESTINATION share/ecto COMPONENT ecto_python
+        DESTINATION share/ecto COMPONENT ecto
   )
 install(FILES ${CMAKE_SOURCE_DIR}/cmake/python_path.sh.user.in
-        DESTINATION share/ecto COMPONENT ecto_python
+        DESTINATION share/ecto COMPONENT ecto
   )

 set(ECTO_CONFIG_PATH  ${CMAKE_INSTALL_PREFIX}/share/ecto)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/ectoConfig.cmake.in
   ${CMAKE_BINARY_DIR}/unix_install/ectoConfig.cmake @ONLY)
-
+


added macr PCL_CUDA_ADD_EXECUTABLE

added macr PCL_CUDA_ADD_EXECUTABLE

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

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -152,6 +152,31 @@
         COMPONENT ${_component})
 endmacro(PCL_ADD_EXECUTABLE)

+
+###############################################################################
+# Add an executable target.
+# _name The executable name.
+# _component The part of PCL that this library belongs to.
+# ARGN the source files for the library.
+macro(PCL_CUDA_ADD_EXECUTABLE _name _component)
+    cuda_add_executable(${_name} ${ARGN})
+    # must link explicitly against boost.
+    target_link_libraries(${_name} ${Boost_LIBRARIES})
+    #
+    # Only link if needed
+    if(WIN32 AND MSVC)
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX})
+    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
+    else()
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
+    endif()
+    #
+    set(PCL_EXECUTABLES ${PCL_EXECUTABLES} ${_name})
+    install(TARGETS ${_name} RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+        COMPONENT ${_component})
+endmacro(PCL_CUDA_ADD_EXECUTABLE)
+
 ###############################################################################
 # Add a test target.
 # _name The test name.


Added info for extra target for external projects

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -289,6 +289,7 @@
         list(GET external_project_with_build_dir_list 0 external_project)
         list(GET external_project_with_build_dir_list 1 external_project_test_dir)
         list(GET external_project_with_build_dir_list 2 external_project_build_dir)
+        list(GET external_project_with_build_dir_list 3 external_project_extra_target)

         if (NOT external_project_build_dir)
           set(external_project_build_dir ${external_project_test_dir})
@@ -301,6 +302,9 @@

         # Build the "all" target for the external project
         func_build_target("" "${CTEST_BINARY_DIRECTORY}/${external_project_build_dir}")
+        if(external_project_extra_target)
+          func_build_target("${external_project_extra_target}" "${CTEST_BINARY_DIRECTORY}/${external_project_build_dir}")
+        endif()

         # HACK Unfortunately ctest_coverage ignores the build argument, try to force it...
         file(READ "${CTEST_BINARY_DIRECTORY}/${external_project_test_dir}/CMakeFiles/TargetDirectories.txt" mitk_build_coverage_dirs)


Fixed reversed logic for mbits detection

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -41,9 +41,9 @@
 file(DOWNLOAD "http://mbits" "${CTEST_SCRIPT_DIRECTORY}/mbits.html" TIMEOUT 2 STATUS _status)
 list(GET _status 0 _status_code)
 if (_status_code EQUAL 6) # couldn't resovle host name
+  set(MBITS_AVAILABLE 0)
+else()
   set(MBITS_AVAILABLE 1)
-else()
-  set(MBITS_AVAILABLE 0)
 endif()

 #


Disable warning on `std::strerror()` from Visual Studio

--- cmake/ApplyStrictCompileOptions.cmake
+++ cmake/ApplyStrictCompileOptions.cmake
@@ -2,6 +2,6 @@
 	if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wpedantic -Werror)
 	elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
-		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS /W4 /wd4244 /wd4805 /wd4389 /wd4267 /WX)
+		set_property(DIRECTORY PROPERTY COMPILE_OPTIONS /W4 /wd4244 /wd4805 /wd4389 /wd4267 /wd4996 /WX)
 	endif ()
 endmacro ()


fix indenting

fix indenting

--- cmake/configure/configure_boost.cmake
+++ cmake/configure/configure_boost.cmake
@@ -121,14 +121,14 @@
         )
       IF(NOT ${BOOST_IOSTREAMS_USABLE})
         MESSAGE(STATUS
-                "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled "
-                "with zlib support but a simple test failed! "
-                "Therefore, the bundled boost package is used."
-               )
+          "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled "
+          "with zlib support but a simple test failed! "
+          "Therefore, the bundled boost package is used."
+          )
         SET(BOOST_ADDITIONAL_ERROR_STRING
-            "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled "
-            "with zlib support but a simple test failed! "
-           )
+          "DEAL_II_WITH_ZLIB=ON requires Boost.Iostreams to be compiled "
+          "with zlib support but a simple test failed! "
+          )
         SET(${var} FALSE)
       ENDIF()
       RESET_CMAKE_REQUIRED()
@@ -146,16 +146,16 @@
           FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug)
           EXECUTE_PROCESS(
             COMMAND ${CMAKE_COMMAND}
-                      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-                      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-                      "-DBOOST_INCLUDE_DIRS=${BOOST_INCLUDE_DIRS}"
-                      "-DBOOST_LIBRARIES=${BOOST_LIBRARIES}"
-                      ${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure/TestBoostBug
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug
+              -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+              -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+              "-DBOOST_INCLUDE_DIRS=${BOOST_INCLUDE_DIRS}"
+              "-DBOOST_LIBRARIES=${BOOST_LIBRARIES}"
+              ${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure/TestBoostBug
+            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug
             RESULT_VARIABLE _result
             OUTPUT_QUIET
             ERROR_QUIET
-          )
+            )
           IF(${_result} EQUAL 0)
             EXECUTE_PROCESS(
               COMMAND ${CMAKE_COMMAND} --build . --target run
@@ -163,7 +163,7 @@
               RESULT_VARIABLE _result
               OUTPUT_QUIET
               ERROR_QUIET
-            )
+              )
           ENDIF()
         ENDIF()
         IF(${_result} EQUAL 0)
@@ -177,16 +177,16 @@

       IF(NOT ${BOOST_SERIALIZATION_USABLE})
         MESSAGE(STATUS
-                "The externally provided Boost.Serialization library "
-                "failed to pass a crucial test. \n"
-                "Therefore, the bundled boost package is used. \n"
-                "The configured testing project can be found at "
-                "${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug"
-               )
+          "The externally provided Boost.Serialization library "
+          "failed to pass a crucial test. \n"
+          "Therefore, the bundled boost package is used. \n"
+          "The configured testing project can be found at "
+          "${CMAKE_CURRENT_BINARY_DIR}/cmake/configure/TestBoostBug"
+          )
         SET(BOOST_ADDITIONAL_ERROR_STRING
-            "The externally provided Boost.Serialization library "
-            "failed to pass a crucial test."
-           )
+          "The externally provided Boost.Serialization library "
+          "failed to pass a crucial test."
+          )
         SET(${var} FALSE)
       ENDIF()
     ENDIF() # DEAL_II_ALLOW_PLATFORM_INTROSPECTION


[CMake][cygming] Disable --out-implib from executables.

It doesn't make sense even with --export-all-symbols.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -399,6 +399,15 @@
   endif()
 endif()

+if(CYGWIN OR MINGW)
+  # Prune --out-implib from executables. It doesn't make sense even
+  # with --export-all-symbols.
+  string(REGEX REPLACE "-Wl,--out-implib,[^ ]+ " " "
+    CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE}")
+  string(REGEX REPLACE "-Wl,--out-implib,[^ ]+ " " "
+    CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE}")
+endif()
+
 if(MSVC)
   # Remove flags here, for exceptions and RTTI.
   # Each target property or source property should be responsible to control


RE-ARRANGING THE ORDER OF THE LIBRARIES:

- LIB-PNG AND LIB-JPEG
- AND THEN: ZLIB

OTHERWISE: IT FAILS AT LINKING, AT LEAST ON MXE AND EMSCRIPTEN!

--- core/cmake/sketch.cmake
+++ core/cmake/sketch.cmake
@@ -9,6 +9,24 @@

 list(APPEND INCLUDE_DIRS
   ${GLM_INCLUDE_DIR}
+)
+
+# ---
+
+set(JPEG_INCLUDE_DIR "${JPEG_ROOT}/include")
+set(JPEG_LIBRARY "${JPEG_ROOT}/lib/${PLATFORM}/libjpeg.a")
+
+set(PNG_INCLUDE_DIRS "${PNG_ROOT}/include")
+set(PNG_LIBRARIES "${PNG_ROOT}/lib/libpng17.a")
+
+list(APPEND INCLUDE_DIRS
+  ${JPEG_INCLUDE_DIR}
+  ${PNG_INCLUDE_DIRS}
+)
+
+list(APPEND LIBRARIES
+  ${JPEG_LIBRARY}
+  ${PNG_LIBRARIES}
 )

 # ---
@@ -31,24 +49,6 @@

 list(APPEND LIBRARIES
   ${ZLIB_LIBRARIES}
-)
-
-# ---
-
-set(JPEG_INCLUDE_DIR "${JPEG_ROOT}/include")
-set(JPEG_LIBRARY "${JPEG_ROOT}/lib/${PLATFORM}/libjpeg.a")
-
-set(PNG_INCLUDE_DIRS "${PNG_ROOT}/include")
-set(PNG_LIBRARIES "${PNG_ROOT}/lib/libpng17.a")
-
-list(APPEND INCLUDE_DIRS
-  ${JPEG_INCLUDE_DIR}
-  ${PNG_INCLUDE_DIRS}
-)
-
-list(APPEND LIBRARIES
-  ${JPEG_LIBRARY}
-  ${PNG_LIBRARIES}
 )

 # ---


Exclude freetype form iOS and andriod

Exclude freetype form iOS and andriod

Remove freetype OpenGL2 form the OpenGL2 backend when building
android or iOS.

Change-Id: I6ec244c368eb69b60ea79e3ec3d6a06850d07c60

--- Rendering/FreeTypeOpenGL2/module.cmake
+++ Rendering/FreeTypeOpenGL2/module.cmake
@@ -1,10 +1,13 @@
+if (NOT ANDROID AND NOT APPLE_IOS)
+  set(include_in_backend BACKEND OpenGL2)
+endif()
+
 vtk_module(vtkRenderingFreeTypeOpenGL2
   IMPLEMENTS
     vtkRenderingCore
   TCL_NAME
     vtkRenderingFreeTypeOpenGLII
-  BACKEND
-    OpenGL2
+  ${include_in_backend}
   DEPENDS
     vtkRenderingFreeType
     vtkRenderingOpenGL2


BUG: Don't use "=" in cmake variable name

When testing the flag option "Wformat=2" the '=' character was in the
cmake variable. This causes the test to be run every time cmake is
run.

Change-Id: I028a4c2d9ad4ff88437f1fcfbeeedd26905e11fa

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -26,8 +26,9 @@
   set(local_c_flags "")
   set(flag_list "${ARGN}")
   foreach(flag IN LISTS flag_list)
-    ITK_CHECK_C_COMPILER_FLAG(${flag} C_HAS_WARNING${flag})
-    if(${C_HAS_WARNING${flag}})
+    string(REPLACE "=" "_" flag_var ${flag} )
+    ITK_CHECK_C_COMPILER_FLAG(${flag} C_HAS_WARNING${flag_var})
+    if(${C_HAS_WARNING${flag_var}})
       set(local_c_flags "${local_c_flags} ${flag}")
     endif()
   endforeach()
@@ -39,8 +40,9 @@
   set(local_cxx_flags "")
   set(flag_list "${ARGN}")
   foreach(flag IN LISTS flag_list)
-    ITK_CHECK_CXX_COMPILER_FLAG(${flag} CXX_HAS_WARNING${flag})
-    if(${CXX_HAS_WARNING${flag}})
+    string(REPLACE "=" "_" flag_var ${flag} )
+    ITK_CHECK_CXX_COMPILER_FLAG(${flag} CXX_HAS_WARNING${flag_var})
+    if(${CXX_HAS_WARNING${flag_var}})
       set(local_cxx_flags "${local_cxx_flags} ${flag}")
     endif()
   endforeach()


TRAVIS: fix build name for travis builds

--- Utilities/Maintenance/TravisBuild.cmake
+++ Utilities/Maintenance/TravisBuild.cmake
@@ -7,7 +7,7 @@
 set(CTEST_DASHBOARD_ROOT "/home/travis/build")
 #set(CTEST_DASHBOARD_ROOT "/tmp/temp")
 # define build name&co for easier identification on CDash
-set(CTEST_BUILD_NAME "travis-$ENV{TRAVIS_BUILD_NUMBER}-$ENV{TRAVIS_REPO_SLUG}-$ENV{TRAVIS_BRANCH}-$ENV{BUILD_NAME}-$ENV{CXX}")
+set(CTEST_BUILD_NAME "travis-$ENV{TRAVIS_BUILD_NUMBER}-$ENV{TRAVIS_REPO_SLUG}-$ENV{TRAVIS_BRANCH}-$ENV{CC}")
 set(CTEST_SITE "travis-ci.org")
 #set(CTEST_SOURCE_DIRECTORY "$ENV{SOURCE_DIRECTORY}")
 #set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/../_build")


BUG: Remove ITKTubeTK remote

BUG: Remove ITKTubeTK remote

This remote module was added pre-emptively before it was ready. It never
built. Re-add it when Stephen says it is ready.

Change-Id: Iff8e78d9e2a128f1793e5c53450d6beb7ae1e572

--- Modules/Remote/TubeTKITK.remote.cmake
+++ Modules/Remote/TubeTKITK.remote.cmake
@@ -1,5 +0,0 @@
-itk_fetch_module(TubeTKITK
-  "A toolkit for the segmentation, registration, and analysis of tubes and surfaces in images"
-  GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/TubeTK.git
-  GIT_TAG 0df10c65a8442b7fa46e6e17da6b7cea715fef66
-  )


COMP: Deactivated ToFNrrdImageWriterTest

--- Modules/ToFHardware/Testing/files.cmake
+++ Modules/ToFHardware/Testing/files.cmake
@@ -22,7 +22,7 @@
   #mitkToFImageRecorderTest.cpp
   #mitkToFImageRecorderFilterTest.cpp
   mitkToFImageWriterTest.cpp
-  mitkToFNrrdImageWriterTest.cpp
+  #mitkToFNrrdImageWriterTest.cpp
   mitkToFOpenCVImageGrabberTest.cpp
   #mitkKinectControllerTest.cpp
   #mitkKinectDeviceTest.cpp


ENH: Update ITKUltrasound to 2016-07-09

ENH: Update ITKUltrasound to 2016-07-09

--- SuperBuild/External_ITKUltrasound.cmake
+++ SuperBuild/External_ITKUltrasound.cmake
@@ -7,8 +7,8 @@
 set(${proj}_DEPENDENCIES )
 ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj}_DEPENDENCIES)

-# disable-wrapping 2016-06-01
-set(${proj}_GIT_TAG 3468f98076b617ea2d1704a78db4a0f6e6b8cedf)
+# disable-wrapping 2016-08-09
+set(${proj}_GIT_TAG 0cb92288333a9779da57511f779d0bde5ca35275)
 ExternalProject_Add(${proj}
   ${${proj}_EP_ARGS}
   GIT_REPOSITORY ${git_protocol}://github.com/thewtex/ITKUltrasound.git


Building openSUSE rpms

Building openSUSE rpms

--- build/cmake/SystemSpecificInformations.cmake
+++ build/cmake/SystemSpecificInformations.cmake
@@ -149,15 +149,23 @@
         set(LINUX_NAME "Debian")
 	set(LINUX_VER "${CMAKE_MATCH_1}")
       endif(LINUX_ISSUE MATCHES "Debian")
-      # Open SuSE case
-      if(LINUX_ISSUE MATCHES "SUSE")
-        string(REGEX MATCH "SUSE  ([0-9]+\\.[0-9]+)" SUSE "${LINUX_ISSUE}")
-        set(LINUX_NAME "openSUSE")
-	set(LINUX_VER "${CMAKE_MATCH_1}")
+      # SuSE / openSUSE case
+      if(LINUX_ISSUE MATCHES "openSUSE")
+        string(REGEX MATCH "openSUSE ([0-9]+\\.[0-9]+)" OPENSUSE "${LINUX_ISSUE}")
+        set(LINUX_NAME "openSUSE")
+	set(LINUX_VER "${CMAKE_MATCH_1}")
+	set(RPM_SYSTEM_NAME "openSUSE${CMAKE_MATCH_1}")
 	if (LINUX_VER MATCHES "/")
 		string(REPLACE "/" "_" LINUX_VER ${LINUX_VER})
 	endif()
-      endif(LINUX_ISSUE MATCHES "SUSE")
+      elseif(LINUX_ISSUE MATCHES "SUSE")
+        string(REGEX MATCH "SUSE ([0-9]+\\.[0-9]+)" SUSE "${LINUX_ISSUE}")
+        set(LINUX_NAME "SUSE")
+	set(LINUX_VER "${CMAKE_MATCH_1}")
+	if (LINUX_VER MATCHES "/")
+		string(REPLACE "/" "_" LINUX_VER ${LINUX_VER})
+	endif()
+      endif()
       # Mandriva case
       # TODO


Copy from vc Vcmacro.cmake file (remove my changes for suppressing unused function warning)

--- math/vc/cmake/VcMacros.cmake
+++ math/vc/cmake/VcMacros.cmake
@@ -370,9 +370,6 @@
       vc_add_compiler_flag(Vc_DEFINITIONS "-Wno-local-type-template-args")
       vc_add_compiler_flag(Vc_DEFINITIONS "-Wno-unnamed-type-template-args")

-      #LM: disable this warning appearing from version 3.4 (5.1)
-      vc_add_compiler_flag(Vc_DEFINITIONS "-Wno-unused-function")
-
       if(NOT DEFINED Vc_INSIDE_ROOT)  # ROOT has to set this up
          AddCompilerFlag(-stdlib=libc++)
       endif()


ENH: Bump version for style fixups.

ENH: Bump version for style fixups.

Change-Id: Ifc84ff3b3243bb86e70c1d38510e738a07d25da6

--- Modules/Remote/TwoProjectionRegistration.remote.cmake
+++ Modules/Remote/TwoProjectionRegistration.remote.cmake
@@ -18,5 +18,5 @@
   December, 2010.
 "
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTwoProjectionRegistration.git
-  GIT_TAG 153bbefae1a4ed4d0e0174ad48e2d82daf245860
+  GIT_TAG 0d4167b2e986a00979cf132da1a97e8833bebb2a
   )


get abis from llvm-libc++ if ndk version greater than 17

--- arcbuild/toolchains/android-ndk.cmake
+++ arcbuild/toolchains/android-ndk.cmake
@@ -168,7 +168,13 @@
 message(STATUS "SDK_ARCH: ${SDK_ARCH}")
 message(STATUS "SDK_ARCH_ABI: ${SDK_ARCH_ABI}")
 message(STATUS "SDK_PROCESSOR: ${SDK_PROCESSOR}")
-set(_lib_root "${SDK_ROOT}/sources/cxx-stl/stlport/libs")
+
+if(NDK_VERSION VERSION_LESS 17)
+  set(_lib_root "${SDK_ROOT}/sources/cxx-stl/stlport/libs")
+else()
+  set(_lib_root "${SDK_ROOT}/sources/cxx-stl/llvm-libc++/libs")
+endif()
+
 file(GLOB SDK_ARCH_ABI_SUPPORTED RELATIVE "${_lib_root}" "${_lib_root}/*")
 list(FIND SDK_ARCH_ABI_SUPPORTED ${SDK_ARCH_ABI} SDK_ARCH_ABI_FOUND)
 if(SDK_ARCH_ABI_FOUND EQUAL -1)


boards: arm: blackpill_f411ce: add blackmagicprobe

Adds support for flashing the blackmagicprobe target
for the blackpill_f411ce board.

Signed-off-by: Kalyan Sriram <0a87ba2c04b2161fe6afda1ecf1461a7d5060e39@coderkalyan.com>

--- boards/arm/blackpill_f411ce/board.cmake
+++ boards/arm/blackpill_f411ce/board.cmake
@@ -6,3 +6,4 @@
 include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
 include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
+include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)


Postpone dldep handling of MacOSX .

Postpone dldep handling of MacOSX .

	* build-aux/cmake/modules/DynLibDep.cmake: Here.

--- build-aux/cmake/modules/DynLibDep.cmake
+++ build-aux/cmake/modules/DynLibDep.cmake
@@ -217,20 +217,33 @@
   function(dldep binary outlist)

     if(UNIX)
-      dldep_ldd(${binary} lib_names lib_dirs)
-      dldep_filter(
-	"${lib_names}"
-	"${lib_dirs}"
-	"${DLDEP_UNIX_EXCLUSION_LIST}"
-	outlist_)
+      if(APPLE)
+
+	# Macosx/Darwin
+	echo("WARNING: dldep does not support apple yet !")
+
+      else(APPLE)
+
+	# Linux/Unix
+	dldep_ldd(${binary} lib_names lib_dirs)
+	dldep_filter(
+	  "${lib_names}"
+	  "${lib_dirs}"
+	  "${DLDEP_UNIX_EXCLUSION_LIST}"
+	  outlist_)
+
+      endif(APPLE)
     else(UNIX)
       if(WIN32)
+
+	# Windows
 	dldep_cygcheck(${binary} lib_names lib_dirs)
 	dldep_filter(
 	  "${lib_names}"
 	  "${lib_dirs}"
 	  "${DLDEP_WIN32_EXCLUSION_LIST}"
 	  outlist_)
+
       endif(WIN32)
     endif(UNIX)


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -100,7 +100,7 @@
     # if we could extract them, compare with the requested version number
     if (SFML_VERSION_MAJOR)
         # transform version numbers to an integer
-		math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100" )
+		math(EXPR SFML_VERSION "2 * 10000 + 1 * 100" )

         # compare them
         if(SFML_VERSION LESS SFML_REQUESTED_VERSION)


Updates zstd cmake to build only shared or static lib.

--- dep/zstd.cmake
+++ dep/zstd.cmake
@@ -9,7 +9,15 @@

 PROJECT(zstd)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
-#OPTION(ZSTD_BUILD_STATIC "must be static" ON)
+IF (BUILD_SHARED_LIBS)
+    message("DISABLING STATIC")
+    OPTION(ZSTD_BUILD_STATIC "must be shared" OFF)
+    SET(ZSTD_BUILD_SHARED ON CACHE BOOL "must be shared" FORCE)
+ELSE()
+    message("ENABLING STATIC")
+    OPTION(ZSTD_BUILD_STATIC "must be static" ON)
+    SET(ZSTD_BUILD_SHARED OFF CACHE BOOL "must be static" FORCE)
+ENDIF()
 SET(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
 LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/CMakeModules")

@@ -28,7 +36,7 @@
 ELSE (UNIX)
     OPTION(ZSTD_MULTITHREAD_SUPPORT "MULTITHREADING SUPPORT" OFF)
 ENDIF (UNIX)
-OPTION(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" ON)
+OPTION(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF)
 OPTION(ZSTD_BUILD_CONTRIB "BUILD CONTRIB" OFF)
 OPTION(ZSTD_BUILD_TESTS "BUILD TESTS" OFF)

@@ -43,7 +51,6 @@
 #-----------------------------------------------------------------------------
 # Add source directories
 #-----------------------------------------------------------------------------
-#SET(ZSTD_BUILD_SHARED OFF CACHE BOOL "must be static" FORCE)
 ADD_SUBDIRECTORY(build/cmake/lib)

 IF (ZSTD_BUILD_PROGRAMS)


update(build): updated libs.

update(build): updated libs.

Signed-off-by: Federico Di Pierro <6c3e26470d5343bb7a522873746c21bb7fcc0d20@gmail.com>

--- cmake/modules/falcosecurity-libs.cmake
+++ cmake/modules/falcosecurity-libs.cmake
@@ -20,8 +20,8 @@
 # default below In case you want to test against another falcosecurity/libs version just pass the variable - ie., `cmake
 # -DFALCOSECURITY_LIBS_VERSION=dev ..`
 if(NOT FALCOSECURITY_LIBS_VERSION)
-  set(FALCOSECURITY_LIBS_VERSION "cb9bb5e4e0c5fe1542482af802d38a8da8f83c03")
-  set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=8c5c7cb8ac2b8e82eefa6a84bd3d43198f28221966c7faddb13d0912230b2aad")
+  set(FALCOSECURITY_LIBS_VERSION "a77eefdf338facc3b5adc00876f6b1af08096cf8")
+  set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=b10817cd2234c9450d2213decce217a30db0089879f9724ec8942e95ed2e777d")
 endif()

 # cd /path/to/build && cmake /path/to/source


MAINT: fix missing copy of CMake script `DO_SaraConfig.cmake`.

--- cmake/sara_installation_settings.cmake
+++ cmake/sara_installation_settings.cmake
@@ -35,7 +35,7 @@
        cmake/FindVisualLeakDetector.cmake)
   file(COPY ${SARA_CMAKE_SCRIPTS} DESTINATION ${CMAKE_BINARY_DIR}/cmake)

-  install(FILES ${SARA_CMAKE_SCRIPTS}
+  install(DIRECTORY ${CMAKE_BINARY_DIR}/cmake
           DESTINATION share/DO_Sara
           COMPONENT Sources)


[CMake][Python] The Python installation directory is now the standard one.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -113,8 +113,6 @@
   # Offer the user the choice of overriding the installation directories
   set (INSTALL_LIB_DIR ${LIBDIR} CACHE PATH
 	"Installation directory for libraries")
-  set (INSTALL_PY_LIB_DIR ${LIBDIR}/python${PYTHONLIBS_VERSION}/${PROJECT_NAME}
-	CACHE PATH "Installation directory for Python libraries")
   set (INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
   set (INSTALL_LIBEXEC_DIR CACHE PATH
 	"Installation directory for internal executables")
@@ -498,7 +496,11 @@
       PYTHONLIBS_VERSION "${PYTHONLIBS_LIB_FILENAME}")
 	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION}")

-    # Update the list of include directories for the project
+	# Set the Python installation directory
+	set (INSTALL_PY_LIB_DIR ${INSTALL_LIB_DIR}/python${PYTHONLIBS_VERSION}/site-packages/libpy${PROJECT_NAME}
+	  CACHE PATH "Installation directory for Python libraries")
+
+	# Update the list of include directories for the project
     include_directories (${PYTHON_INCLUDE_DIRS})

     # Update the list of dependencies for the project
@@ -1420,7 +1422,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/${PACKAGE})
+  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/site-packages/libpy${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)


[Build] 1. Added support for ICU. 2. Improved support for Boost. 3. Added the module_config_add() macro.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -110,18 +110,17 @@

   # Offer the user the choice of overriding the installation directories
   set (INSTALL_LIB_DIR ${LIBDIR} CACHE PATH
-    "Installation directory for libraries")
+	"Installation directory for libraries")
   set (INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
   set (INSTALL_INCLUDE_DIR include CACHE PATH
     "Installation directory for header files")
-  set (INSTALL_DATA_DIR share CACHE PATH
-    "Installation directory for data files")
+  set (INSTALL_DATA_DIR share CACHE PATH "Installation directory for data files")
   set (INSTALL_SAMPLE_DIR share/${PROJECT_NAME}/samples CACHE PATH
     "Installation directory for (CSV) sample files")
+  set (INSTALL_ETC_DIR etc CACHE PATH "Installation directory for Config files")

   # GCOV
-  option (RUN_GCOV "Set to OFF to skip code coverage"
-    ${_run_gcov})
+  option (RUN_GCOV "Set to OFF to skip code coverage" ${_run_gcov})

   # Make relative paths absolute (needed later on)
   foreach (_path_type LIB BIN INCLUDE DATA SAMPLE)
@@ -197,6 +196,8 @@
     "Set to OFF to skip build/check unit tests" FORCE)
   set (INSTALL_DOC "${INSTALL_DOC}" CACHE BOOL
     "Set to OFF to skip build/install Documentation" FORCE)
+  set (RUN_GCOV "${RUN_GCOV}" CACHE BOOL
+    "Set to OFF to skip coverage tests" FORCE)
 endmacro (store_in_cache)

@@ -263,11 +264,11 @@
     CACHE INTERNAL "tarball basename")
   set (AUTOTOOLS_IGNRD "/tmp/;/tmp2/;/autom4te\\\\.cache/;autogen\\\\.sh$")
   set (PACK_IGNRD
-    "${CMAKE_CURRENT_BINARY_DIR};${CPACK_PACKAGE_NAME}\\\\.spec;\\\\.gz$;\\\\.bz2$")
+	"${CMAKE_CURRENT_BINARY_DIR};${CPACK_PACKAGE_NAME}\\\\.spec;\\\\.gz$;\\\\.bz2$")
   set (EDIT_IGNRD "\\\\.swp$;\\\\.#;/#;~$")
   set (SCM_IGNRD
     "/CVS/;/\\\\.svn/;/\\\\.bzr/;/\\\\.hg/;/\\\\.git/;\\\\.gitignore$")
-  set (PYTHON_IGNRD "\\\\.pyc$")
+  set (PYTHON_IGNRD "\\\\.pyc$;\\\\.pyo$")
   set (JS_IGNRD "/browser/js/libs;/browser/js/mylibs;/browser/libs")
   set (CPACK_SOURCE_IGNORE_FILES
     "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD};${PYTHON_IGNRD};${JS_IGNRD}"
@@ -325,6 +326,10 @@
     if (${_arg_lower} STREQUAL "python")
       get_python (${_arg_version})
     endif (${_arg_lower} STREQUAL "python")
+
+    if (${_arg_lower} STREQUAL "icu")
+      get_icu (${_arg_version})
+    endif (${_arg_lower} STREQUAL "icu")

     if (${_arg_lower} STREQUAL "zeromq")
       get_zeromq (${_arg_version})
@@ -491,6 +496,37 @@

 endmacro (get_python)

+# ~~~~~~~~~~ ICU ~~~~~~~~~
+macro (get_icu)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires ICU-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires ICU without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  #
+  set (ICU_REQUIRED_COMPONENTS i18n uc data)
+  find_package (ICU ${_required_version}
+	COMPONENTS ${ICU_REQUIRED_COMPONENTS} REQUIRED)
+
+  icudebug (ICU_I18N_FOUND)
+  if (ICU_FOUND)
+	#
+	#if (ICU_I18N_FOUND)
+	#  icudebug (ICU_I18N_FOUND)
+	#endif (ICU_I18N_FOUND)
+
+    # Update the list of include directories for the project
+    include_directories (${ICU_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${ICU_LIBRARIES})
+  endif (ICU_FOUND)
+
+endmacro (get_icu)
+
 # ~~~~~~~~~~ ZeroMQ ~~~~~~~~~
 macro (get_zeromq)
   unset (_required_version)
@@ -514,6 +550,23 @@
 endmacro (get_zeromq)

 # ~~~~~~~~~~ BOOST ~~~~~~~~~~
+#
+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)
+  endforeach (_lib_cpt ${_boost_lib_list})
+endmacro (register_boost_lib _boost_lib_list_name _boost_lib_list)
+
+#
 macro (get_boost)
   unset (_required_version)
   if (${ARGC} GREATER 0)
@@ -530,12 +583,20 @@
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
-  set (BOOST_REQUIRED_COMPONENTS
-    regex program_options date_time iostreams serialization filesystem
-    unit_test_framework python)
+  set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
+    date_time iostreams serialization filesystem system locale python)
+  set (BOOST_REQUIRED_COMPONENTS_FOR_BIN regex program_options)
+  set (BOOST_REQUIRED_COMPONENTS_FOR_TST unit_test_framework)
+  set (BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS_FOR_LIB}
+	${BOOST_REQUIRED_COMPONENTS_FOR_BIN} ${BOOST_REQUIRED_COMPONENTS_FOR_TST})

   # The first check is for the required components.
   find_package (Boost COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
+
+  # Fix a bug for some old CMake package finder scripts (e.g., on Fedora 15)
+  if (Boost_VERSION)
+    set (Boost_FOUND ON)
+  endif (Boost_VERSION)

   # The second check is for the required version (FindBoostWrapper.cmake is
   # provided by us). Indeed, the Fedora/RedHat FindBoost.cmake does not seem
@@ -546,21 +607,21 @@
     # Update the list of include directories for the project
     include_directories (${Boost_INCLUDE_DIRS})

-    # Update the list of dependencies for the project
-    list (APPEND PROJ_DEP_LIBS_FOR_LIB
-      ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
-	  ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
-	  ${Boost_DATE_TIME_LIBRARY} ${Boost_PYTHON_LIBRARY})
-    list (APPEND PROJ_DEP_LIBS_FOR_BIN
-	  ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
-    list (APPEND PROJ_DEP_LIBS_FOR_TST ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-    # For display purposes
-    set (BOOST_REQUIRED_LIBS
-      ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
-	  ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
-	  ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
-	  ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_PYTHON_LIBRARY})
+	# 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}")
+
+    # Update the list of binary dependencies for the project
+	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}")
+
   endif (Boost_FOUND)

 endmacro (get_boost)
@@ -576,6 +637,9 @@
   endif (${ARGC} GREATER 0)

   # The first check is to get Xapian installation details
+  if (${CMAKE_VERSION} VERSION_LESS 2.8.0)
+	set (Xapian_DIR /usr/${LIBDIR}/cmake/xapian)
+  endif (${CMAKE_VERSION} VERSION_LESS 2.8.0)
   find_package (Xapian)

   # The second check is for the required version (FindXapianWrapper.cmake is
@@ -1149,10 +1213,10 @@
   #    will set CMAKE_CXX_FLAGS as being equal to -O2.
   if (NOT CMAKE_CXX_FLAGS)
 	#set (CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror")
-        if (${RUN_GCOV} STREQUAL "ON")
+    if (${RUN_GCOV} STREQUAL "ON")
 	  set (CMAKE_CXX_FLAGS "-Wall -Werror -fprofile-arcs -ftest-coverage")
-        else (${RUN_GCOV} STREQUAL "ON")
-          set (CMAKE_CXX_FLAGS "-Wall -Werror")
+    else (${RUN_GCOV} STREQUAL "ON")
+      set (CMAKE_CXX_FLAGS "-Wall -Werror")
 	endif (${RUN_GCOV} STREQUAL "ON")
   endif (NOT CMAKE_CXX_FLAGS)
   # Tell the source code the version of Boost (only once)
@@ -1578,6 +1642,30 @@
 endmacro (module_binary_add)

 ##
+# Installation of the configuration INI file (format cfg).
+# The two parameters (among which only the first one is mandatory) are:
+#  * The path/directory where the configuration file can be found.
+#  * If specified, the name to be given to the file. If no such name
+#    is given as parameter, the configuration file is given the name of
+#    the current module.
+macro (module_config_add _config_source_dir)
+  # First, derive the name to be given to the config file, defaulting
+  # to the name of the module
+  set (_config_name ${MODULE_NAME})
+  if (${ARGC} GREATER 1})
+    set (_config_name ${ARGV1})
+  endif (${ARGC} GREATER 1})
+
+  # Define the macro path of the configuration file
+  set (PROJ_PATH_CFG_SRC ${_config_source_dir}/${_config_name}.cfg)
+
+  # Installation of the cfg file
+  install (FILES ${PROJ_PATH_CFG_SRC}
+    DESTINATION "${INSTALL_ETC_DIR}" COMPONENT runtime)
+
+endmacro (module_config_add)
+
+##
 # Add a (Shell, Python, Perl, Ruby, etc) script to be installed.
 #
 # The parameter is the relative file path of the (template) script to
@@ -2013,7 +2101,7 @@

 	  # Transpose the man-page-related operation into a target, so that CMake
 	  # can handle it properly
-	  add_custom_target (man_${man_sect}
+	  add_custom_target (man_${man_sect}
 		ALL DEPENDS ${DOXYGEN_OUTPUT${man_sect}})
 	  list (APPEND MAN_ALL_TARGETS man_${man_sect})

@@ -2041,33 +2129,42 @@

 macro (gcov_task)
   if (${RUN_GCOV} STREQUAL "ON")
-    set (GCDA_GCNO_PATH "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/CMakeFiles/${PROJECT_NAME}lib.dir")
+    set (GCDA_GCNO_PATH
+	  "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/CMakeFiles/${PROJECT_NAME}lib.dir")
     set (GCDA_FILE "${GCDA_GCNO_PATH}/command/CmdBomSerialiser.cpp.gcda")
     set (GCNO_FILE "${GCDA_GCNO_PATH}/command/CmdBomSerialiser.cpp.gcno")
-    # Removed generated gcda and gcno files relative to the CmdBomSerialiser object:
-    # gcov failed processing the CmdBomSerialiser.cpp.gcda file without displaying a clear message
+	# Removed generated gcda and gcno files relative to the CmdBomSerialiser
+	# object: gcov failed processing the CmdBomSerialiser.cpp.gcda file
+	# without displaying a clear message
     add_custom_command (TARGET check
-                        # This task is post-build and post-check
-                        POST_BUILD
-                        # Because the "-f" option is given, the commands do not fail when the files are missing
-	                COMMAND "rm" "-f" "${GCDA_FILE}"
-                        COMMAND "rm" "-f" "${GCNO_FILE}"
-                        )
-    # Build a coverage report info and html pages using gcda and gcno files
+	  # This task is post-build and post-check
+      POST_BUILD
+      # Because the "-f" option is given, the commands do not fail
+	  # when the files are missing
+	  COMMAND "rm" "-f" "${GCDA_FILE}"
+      COMMAND "rm" "-f" "${GCNO_FILE}"
+      )
+	# Build a coverage report info and html pages using gcda and gcno files
     add_custom_command (TARGET check
-                        # This task is post-build and post-check
-                        POST_BUILD
-                        # Create a directory for the gcov reports
-                        COMMAND "mkdir" "-p" "${CMAKE_BINARY_DIR}/gcov"
-                        # Generate a global gcov report using the directory containing the gcda/gcno files
-                        COMMAND "geninfo" "${GCDA_GCNO_PATH}" "-o" "${CMAKE_BINARY_DIR}/gcov/gcov_tmp_report.info"
-                        # Extract from the global report the data relative to the module files (i, e remove external libraries) and copy them in a second report
-			COMMAND "lcov" "-e" "${CMAKE_BINARY_DIR}/gcov/gcov_tmp_report.info" "'${CMAKE_CURRENT_SOURCE_DIR}/*'" ">>" "${CMAKE_BINARY_DIR}/gcov/gcov_report.info"
-                        # Generate html documentation about the module files coverage
-                        COMMAND "genhtml" "-o" "${CMAKE_BINARY_DIR}/gcov" "-p" "${CMAKE_CURRENT_SOURCE_DIR}*" "${CMAKE_BINARY_DIR}/gcov/gcov_report.info"
-                        # Delete heavy .info files
-                        COMMAND "rm" "${CMAKE_BINARY_DIR}/gcov/*.info"
-	               )
+      # This task is post-build and post-check
+      POST_BUILD
+      # Create a directory for the gcov reports
+      COMMAND "mkdir" "-p" "${CMAKE_BINARY_DIR}/gcov"
+      # Generate a global gcov report using the directory containing
+	  # the gcda/gcno files
+      COMMAND "geninfo" "${GCDA_GCNO_PATH}" "-o"
+	  "${CMAKE_BINARY_DIR}/gcov/gcov_tmp_report.info"
+      # Extract from the global report the data relative to the module files
+	  # (i, e remove external libraries) and copy them in a second report
+	  COMMAND "lcov" "-e" "${CMAKE_BINARY_DIR}/gcov/gcov_tmp_report.info"
+	  "'${CMAKE_CURRENT_SOURCE_DIR}/*'" ">>"
+	  "${CMAKE_BINARY_DIR}/gcov/gcov_report.info"
+      # Generate html documentation about the module files coverage
+      COMMAND "genhtml" "-o" "${CMAKE_BINARY_DIR}/gcov" "-p"
+	  "${CMAKE_CURRENT_SOURCE_DIR}*" "${CMAKE_BINARY_DIR}/gcov/gcov_report.info"
+      # Delete heavy .info files
+      COMMAND "rm" "${CMAKE_BINARY_DIR}/gcov/*.info"
+	  )
   endif (${RUN_GCOV} STREQUAL "ON")
 endmacro (gcov_task)

@@ -2134,7 +2231,6 @@
   message (STATUS "  - DOXYGEN_DOT_PATH .............. : ${DOXYGEN_DOT_PATH}")
 endmacro (display_doxygen)

-
 # Gcov
 macro (display_gcov)
   if (${RUN_GCOV} STREQUAL "ON")
@@ -2173,6 +2269,17 @@
   endif (PYTHONLIBS_FOUND)
 endmacro (display_python)

+# ICU
+macro (display_icu)
+  if (ICU_FOUND)
+    message (STATUS)
+	message (STATUS "* ICU:")
+	message (STATUS "  - ICU_VERSION ................... : ${ICU_VERSION}")
+	message (STATUS "  - ICU_LIBRARIES ................. : ${ICU_LIBRARIES}")
+	message (STATUS "  - ICU_INCLUDE_DIRS .............. : ${ICU_INCLUDE_DIR}")
+  endif (ICU_FOUND)
+endmacro (display_icu)
+
 # ZeroMQ
 macro (display_zeromq)
   if (ZEROMQ_FOUND)
@@ -2195,6 +2302,9 @@
     message (STATUS "  - Boost_INCLUDE_DIRS ............ : ${Boost_INCLUDE_DIRS}")
     message (STATUS "  - Boost required components ..... : ${BOOST_REQUIRED_COMPONENTS}")
     message (STATUS "  - Boost required libraries ...... : ${BOOST_REQUIRED_LIBS}")
+    message (STATUS "  - Boost required libs for lib ... : ${PROJ_DEP_LIBS_FOR_LIB}")
+    message (STATUS "  - Boost required libs for bin ... : ${PROJ_DEP_LIBS_FOR_BIN}")
+    message (STATUS "  - Boost required libs for test .. : ${PROJ_DEP_LIBS_FOR_TST}")
   endif (Boost_FOUND)
 endmacro (display_boost)

@@ -2512,6 +2622,7 @@
   message (STATUS " * BUILD_FLAGS .................... : ${BUILD_FLAGS}")
   message (STATUS " * COMPILE_FLAGS .................. : ${COMPILE_FLAGS}")
   message (STATUS "ENABLE_TEST ....................... : ${ENABLE_TEST}" )
+  message (STATUS "RUN_GCOV .......................... : ${RUN_GCOV}" )
   message (STATUS "CMAKE_MODULE_PATH ................. : ${CMAKE_MODULE_PATH}")
   message (STATUS "CMAKE_INSTALL_PREFIX .............. : ${CMAKE_INSTALL_PREFIX}")
   display_doxygen ()
@@ -2549,6 +2660,7 @@
   message (STATUS "------------------------------------")
   #
   display_python ()
+  display_icu ()
   display_zeromq ()
   display_boost ()
   display_xapian ()


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


[Config][CMake] Migrated to new FindPython3 (from deprecated FindPythonLibs)

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -479,48 +479,36 @@
   unset (_required_version)
   if (${ARGC} GREATER 0)
     set (_required_version ${ARGV0})
-    message (STATUS "Requires PythonLibs-${_required_version}")
+    message (STATUS "Requires Python with version ${_required_version}; however just Python3 is considered here")
   else (${ARGC} GREATER 0)
-    message (STATUS "Requires PythonLibs without specifying any version")
+    message (STATUS "Requires Python3; any version will do")
   endif (${ARGC} GREATER 0)

   # The first check searches for the libraries and include paths.
   # However, on some older versions (e.g., on RedHat/CentOS 5.x),
   # only the static library is searched.
-  find_package (PythonLibs ${_required_version} REQUIRED)
+  find_package (Python3 COMPONENTS Interpreter Development REQUIRED)

   # The second check is to get the dynamic library for sure.
-  find_package (PythonLibsWrapper ${_required_version} REQUIRED)
-
-  if (PYTHONLIBS_FOUND)
-	# Derive the version of Python (for whatever reason, FindPythonLibs
-	# does not seem to provide that version variable.
-	get_filename_component (PYTHONLIBS_LIB_FILENAME ${PYTHON_LIBRARIES} NAME)
-	string (REGEX REPLACE "^libpython([0-9]+.[0-9]+).*$" "\\1"
-	  PYTHONLIBS_VERSION "${PYTHONLIBS_LIB_FILENAME}")
-
-	if (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-	  set (PY_MAJOR_VERSION "${CMAKE_MATCH_1}")
-	  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
-	set (INSTALL_PY_LIB_DIR
-	  ${INSTALL_LIB_DIR}/python${PYTHONLIBS_VERSION}/site-packages/py${PROJECT_NAME}
-	  CACHE PATH "Installation directory for Python libraries")
-
-	# Update the list of include directories for the project
-    include_directories (${PYTHON_INCLUDE_DIRS})
+  #find_package (PythonLibsWrapper ${_required_version} REQUIRED)
+
+  if (Python3_FOUND)
+    message (STATUS "Found Python3 ${Python3_VERSION} (${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH})")
+
+    # Set the Python installation directory
+    set (INSTALL_PY_LIB_DIR
+      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
+      CACHE PATH "Installation directory for Python libraries")
+
+    # Update the list of include directories for the project
+    include_directories (${Python3_INCLUDE_DIRS})

     # Update the list of dependencies for the project
-    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${PYTHON_LIBRARIES})
-
-  else (PYTHONLIBS_FOUND)
+    list (APPEND PROJ_DEP_LIBS_FOR_LIB ${Python3_LIBRARIES})
+
+  else (Python3_FOUND)
 	message (FATAL_ERROR "Python libraries are missing. Please install them (e.g., 'python-devel' for the Fedora/RedHat package)")
-  endif (PYTHONLIBS_FOUND)
+  endif (Python3_FOUND)

 endmacro (get_python)

@@ -618,8 +606,8 @@
   #         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 (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
+  set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
@@ -1473,7 +1461,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/site-packages/py${PACKAGE})
+  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)
@@ -2555,27 +2543,26 @@

 # Python
 macro (display_python)
-  if (PYTHONLIBS_FOUND)
+  if (Python3_FOUND)
     message (STATUS)
-	message (STATUS "* Python:")
-	message (STATUS "  - PYTHONLIBS_VERSION ............ : ${PYTHONLIBS_VERSION}")
-	message (STATUS "  - PY_{MAJOR,MINOR,PATCH}_VERSION  : ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION}")
-	message (STATUS "  - PYTHON_LIBRARIES .............. : ${PYTHON_LIBRARIES}")
-	message (STATUS "  - PYTHON_INCLUDE_PATH ........... : ${PYTHON_INCLUDE_PATH}")
-	message (STATUS "  - PYTHON_INCLUDE_DIRS ........... : ${PYTHON_INCLUDE_DIRS}")
-	message (STATUS "  - PYTHON_DEBUG_LIBRARIES ........ : ${PYTHON_DEBUG_LIBRARIES}")
-	message (STATUS "  - Python_ADDITIONAL_VERSIONS .... : ${Python_ADDITIONAL_VERSIONS}")
-  endif (PYTHONLIBS_FOUND)
+    message (STATUS "* Python:")
+    message (STATUS "  - Python3_VERSION ............... : ${Python3_VERSION}")
+    message (STATUS "  - Python3_VERSION_{MJR,MNR,PTCH}  : ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH}")
+    message (STATUS "  - Python3_INCLUDE_DIRS .......... : ${Python3_INCLUDE_DIRS}")
+    message (STATUS "  - Python3_LIBRARIES ............. : ${Python3_LIBRARIES}")
+    message (STATUS "  - Python3_LIBRARY_DIRS .......... : ${Python3_LIBRARY_DIRS}")
+    message (STATUS "  - Python3_RUNTIME_LIBRARY_DIRS .. : ${Python3_RUNTIME_LIBRARY_DIRS}")
+  endif (Python3_FOUND)
 endmacro (display_python)

 # ICU
 macro (display_icu)
   if (ICU_FOUND)
     message (STATUS)
-	message (STATUS "* ICU:")
-	message (STATUS "  - ICU_VERSION ................... : ${ICU_VERSION}")
-	message (STATUS "  - ICU_LIBRARIES ................. : ${ICU_LIBRARIES}")
-	message (STATUS "  - ICU_INCLUDE_DIRS .............. : ${ICU_INCLUDE_DIR}")
+    message (STATUS "* ICU:")
+    message (STATUS "  - ICU_VERSION ................... : ${ICU_VERSION}")
+    message (STATUS "  - ICU_LIBRARIES ................. : ${ICU_LIBRARIES}")
+    message (STATUS "  - ICU_INCLUDE_DIRS .............. : ${ICU_INCLUDE_DIR}")
   endif (ICU_FOUND)
 endmacro (display_icu)


Fix for finding OpenSSL on Windows without building Couchbase Server

Change-Id: If3cf591eeb40b77549fcec9cf7ec2832e3e8744b
Reviewed-on: http://review.couchbase.org/70004
Reviewed-by: Sundararaman Sridharan <333a3f71d3ad6e01fc953c4fa06bc1f3cd014910@couchbase.com>
Tested-by: Sundararaman Sridharan <333a3f71d3ad6e01fc953c4fa06bc1f3cd014910@couchbase.com>

--- cmake/Modules/FindEncryptionLib.cmake
+++ cmake/Modules/FindEncryptionLib.cmake
@@ -19,7 +19,7 @@

     MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
     ADD_DEFINITIONS(-D_CRYPTO_OPENSSL=1)
-    set(CRYPTO_LIB ${OPENSSL_LIBRARIES})
+    set(CRYPTO_LIB ${OPENSSL_CRYPTO_LIBRARY})

 ELSEIF ("${_ENCRYPTION}" STREQUAL "libtomcrypt")
     FIND_PATH(LIBTOMCRYPT_INCLUDE_DIR tomcrypt.h


-fvisibility-inlines-hidden is a c++ only option.
Thanks to Peter Collingbourne for noticing it.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -95,7 +95,6 @@
       check_cxx_compiler_flag("-fvisibility-inlines-hidden" SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG)
       if( SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG )
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility-inlines-hidden")
       endif()
      endif()
   endif()


Silence all C4592 warnings with MSVC 2015 Update 1. This warning produces false positives that Microsoft says will be fixed in Update 2. Until this produces reliable diagnostics, it is safe to disable the diagnostic -- the compiler is not doing anything different than it previously did aside from issuing the diagnostic.

(Note, this silences at least one false positive in LLVM with FeatureBitset uses.)

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -317,6 +317,9 @@
     -wd4204 # Suppress 'nonstandard extension used : non-constant aggregate initializer'
     -wd4577 # Suppress 'noexcept used with no exception handling mode specified; termination on exception is not guaranteed'
     -wd4091 # Suppress 'typedef: ignored on left of '' when no variable is declared'
+        # C4592 is disabled because of false positives in Visual Studio 2015
+        # Update 1. Re-evaluate the usefulness of this diagnostic with Update 2.
+    -wd4592 # Suppress ''var': symbol will be dynamically initialized (implementation limitation)

 	# Ideally, we'd like this warning to be enabled, but MSVC 2013 doesn't
 	# support the 'aligned' attribute in the way that clang sources requires (for