Updated android toolchain

Updated android toolchain

--- platforms/android/android.toolchain.cmake
+++ platforms/android/android.toolchain.cmake
@@ -30,17 +30,11 @@

 # ------------------------------------------------------------------------------
 #  Android CMake toolchain file, for use with the Android NDK r5-r10d
-#  Requires cmake 2.6.3 or newer (2.8.5 or newer is recommended).
+#  Requires cmake 2.6.3 or newer (2.8.9 or newer is recommended).
 #  See home page: https://github.com/taka-no-me/android-cmake
 #
 #  Usage Linux:
 #   $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
-#   $ mkdir build && cd build
-#   $ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.toolchain.cmake ..
-#   $ make -j8
-#
-#  Usage Linux (using standalone toolchain):
-#   $ export ANDROID_STANDALONE_TOOLCHAIN=/absolute/path/to/android-toolchain
 #   $ mkdir build && cd build
 #   $ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.toolchain.cmake ..
 #   $ make -j8
@@ -61,11 +55,6 @@
 #
 #  Options (can be set as cmake parameters: -D<option_name>=<value>):
 #    ANDROID_NDK=/opt/android-ndk - path to the NDK root.
-#      Can be set as environment variable. Can be set only at first cmake run.
-#
-#    ANDROID_STANDALONE_TOOLCHAIN=/opt/android-toolchain - path to the
-#      standalone toolchain. This option is not used if full NDK is found
-#      (ignored if ANDROID_NDK is set).
 #      Can be set as environment variable. Can be set only at first cmake run.
 #
 #    ANDROID_ABI=armeabi-v7a - specifies the target Application Binary
@@ -123,8 +112,8 @@
 #        * x86_64-clang3.5
 #
 #    ANDROID_FORCE_ARM_BUILD=OFF - set ON to generate 32-bit ARM instructions
-#      instead of Thumb. Is not available for "x86" (inapplicable) and
-#      "armeabi-v6 with VFP" (is forced to be ON) ABIs.
+#      instead of Thumb. Is not available for "armeabi-v6 with VFP"
+#      (is forced to be ON) ABI.
 #
 #    ANDROID_NO_UNDEFINED=ON - set ON to show all undefined symbols as linker
 #      errors even if they are not used.
@@ -132,13 +121,6 @@
 #    ANDROID_SO_UNDEFINED=OFF - set ON to allow undefined symbols in shared
 #      libraries. Automatically turned for NDK r5x and r6x due to GLESv2
 #      problems.
-#
-#    LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_SOURCE_DIR} - where to output binary
-#      files. See additional details below.
-#
-#    ANDROID_SET_OBSOLETE_VARIABLES=ON - if set, then toolchain defines some
-#      obsolete variables which were used by previous versions of this file for
-#      backward compatibility.
 #
 #    ANDROID_STL=gnustl_static - specify the runtime to use.
 #
@@ -200,12 +182,6 @@
 #    will be set true, mutually exclusive. NEON option will be set true
 #    if VFP is set to NEON.
 #
-#    LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where Android
-#    libraries will be installed.
-#    Default is ${CMAKE_SOURCE_DIR}, and the android libs will always be
-#    under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
-#    (depending on the target ABI). This is convenient for Android packaging.
-#
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
@@ -235,22 +211,22 @@
 # this one not so much
 set( CMAKE_SYSTEM_VERSION 1 )

-# rpath makes low sence for Android
+# rpath makes low sense for Android
 set( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "" )
 set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )

 # NDK search paths
 set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
-if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
+if( NOT DEFINED ANDROID_NDK_SEARCH_PATHS )
  if( CMAKE_HOST_WIN32 )
   file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
-  set( ANDROID_NDK_SEARCH_PATHS "${ANDROID_NDK_SEARCH_PATHS}/android-ndk" "$ENV{SystemDrive}/NVPACK/android-ndk" )
+  set( ANDROID_NDK_SEARCH_PATHS "${ANDROID_NDK_SEARCH_PATHS}" "$ENV{SystemDrive}/NVPACK" )
  else()
   file( TO_CMAKE_PATH "$ENV{HOME}" ANDROID_NDK_SEARCH_PATHS )
-  set( ANDROID_NDK_SEARCH_PATHS /opt/android-ndk "${ANDROID_NDK_SEARCH_PATHS}/NVPACK/android-ndk" )
- endif()
-endif()
-if(NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH)
+  set( ANDROID_NDK_SEARCH_PATHS /opt "${ANDROID_NDK_SEARCH_PATHS}/NVPACK" )
+ endif()
+endif()
+if( NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH )
  set( ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH /opt/android-toolchain )
 endif()

@@ -272,106 +248,90 @@

 macro( __LIST_FILTER listvar regex )
- if( ${listvar} )
-  foreach( __val ${${listvar}} )
-   if( __val MATCHES "${regex}" )
-    list( REMOVE_ITEM ${listvar} "${__val}" )
-   endif()
+  if( ${listvar} )
+    foreach( __val ${${listvar}} )
+      if( __val MATCHES "${regex}" )
+        list( REMOVE_ITEM ${listvar} "${__val}" )
+      endif()
+    endforeach()
+  endif()
+endmacro()
+
+macro( __INIT_VARIABLE var_name )
+  set( __test_path 0 )
+  foreach( __var ${ARGN} )
+    if( __var STREQUAL "PATH" )
+      set( __test_path 1 )
+      break()
+    endif()
   endforeach()
- endif()
+
+  if( __test_path AND NOT EXISTS "${${var_name}}" )
+    unset( ${var_name} CACHE )
+  endif()
+
+  if( " ${${var_name}}" STREQUAL " " )
+    set( __values 0 )
+    foreach( __var ${ARGN} )
+      if( __var STREQUAL "VALUES" )
+        set( __values 1 )
+      elseif( NOT __var STREQUAL "PATH" )
+        if( __var MATCHES "^ENV_.*$" )
+          string( REPLACE "ENV_" "" __var "${__var}" )
+          set( __value "$ENV{${__var}}" )
+        elseif( DEFINED ${__var} )
+          set( __value "${${__var}}" )
+        elseif( __values )
+          set( __value "${__var}" )
+        else()
+          set( __value "" )
+        endif()
+
+        if( NOT " ${__value}" STREQUAL " " AND (NOT __test_path OR EXISTS "${__value}") )
+          set( ${var_name} "${__value}" )
+          break()
+        endif()
+      endif()
+    endforeach()
+    unset( __value )
+    unset( __values )
+  endif()
+
+  if( __test_path )
+    file( TO_CMAKE_PATH "${${var_name}}" ${var_name} )
+  endif()
+  unset( __test_path )
 endmacro()

-macro( __INIT_VARIABLE var_name )
- set( __test_path 0 )
- foreach( __var ${ARGN} )
-  if( __var STREQUAL "PATH" )
-   set( __test_path 1 )
-   break()
-  endif()
- endforeach()
- if( __test_path AND NOT EXISTS "${${var_name}}" )
-  unset( ${var_name} CACHE )
- endif()
- if( "${${var_name}}" STREQUAL "" )
-  set( __values 0 )
-  foreach( __var ${ARGN} )
-   if( __var STREQUAL "VALUES" )
-    set( __values 1 )
-   elseif( NOT __var STREQUAL "PATH" )
-    set( __obsolete 0 )
-    if( __var MATCHES "^OBSOLETE_.*$" )
-     string( REPLACE "OBSOLETE_" "" __var "${__var}" )
-     set( __obsolete 1 )
-    endif()
-    if( __var MATCHES "^ENV_.*$" )
-     string( REPLACE "ENV_" "" __var "${__var}" )
-     set( __value "$ENV{${__var}}" )
-    elseif( DEFINED ${__var} )
-     set( __value "${${__var}}" )
-    else()
-     if( __values )
-      set( __value "${__var}" )
-     else()
-      set( __value "" )
-     endif()
-    endif()
-    if( NOT "${__value}" STREQUAL "" )
-     if( __test_path )
-      if( EXISTS "${__value}" )
-       file( TO_CMAKE_PATH "${__value}" ${var_name} )
-       if( __obsolete AND NOT _CMAKE_IN_TRY_COMPILE )
-        message( WARNING "Using value of obsolete variable ${__var} as initial value for ${var_name}. Please note, that ${__var} can be completely removed in future versions of the toolchain." )
-       endif()
-       break()
-      endif()
-     else()
-      set( ${var_name} "${__value}" )
-       if( __obsolete AND NOT _CMAKE_IN_TRY_COMPILE )
-        message( WARNING "Using value of obsolete variable ${__var} as initial value for ${var_name}. Please note, that ${__var} can be completely removed in future versions of the toolchain." )
-       endif()
-      break()
-     endif()
-    endif()
-   endif()
-  endforeach()
-  unset( __value )
-  unset( __values )
-  unset( __obsolete )
- elseif( __test_path )
-  file( TO_CMAKE_PATH "${${var_name}}" ${var_name} )
- endif()
- unset( __test_path )
-endmacro()
-
 macro( __DETECT_NATIVE_API_LEVEL _var _path )
- SET( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*.*$" )
- FILE( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" )
- if( NOT __apiFileContent )
-  message( SEND_ERROR "Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." )
- endif()
- string( REGEX REPLACE "${__ndkApiLevelRegex}" "\\1" ${_var} "${__apiFileContent}" )
- unset( __apiFileContent )
- unset( __ndkApiLevelRegex )
+  set( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*.*$" )
+  file( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" )
+  if( NOT __apiFileContent )
+    message( SEND_ERROR "Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." )
+  endif()
+  string( REGEX REPLACE "${__ndkApiLevelRegex}" "\\1" ${_var} "${__apiFileContent}" )
+  unset( __apiFileContent )
+  unset( __ndkApiLevelRegex )
 endmacro()

 macro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )
  if( EXISTS "${_root}" )
-  file( GLOB __gccExePath RELATIVE "${_root}/bin/" "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
-  __LIST_FILTER( __gccExePath "^[.].*" )
-  list( LENGTH __gccExePath __gccExePathsCount )
-  if( NOT __gccExePathsCount EQUAL 1  AND NOT _CMAKE_IN_TRY_COMPILE )
-   message( WARNING "Could not determine machine name for compiler from ${_root}" )
-   set( ${_var} "" )
+    file( GLOB __gccExePath RELATIVE "${_root}/bin/" "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
+    __LIST_FILTER( __gccExePath "^[.].*" )
+    list( LENGTH __gccExePath __gccExePathsCount )
+    if( NOT __gccExePathsCount EQUAL 1  AND NOT _CMAKE_IN_TRY_COMPILE )
+      message( WARNING "Could not determine machine name for compiler from ${_root}" )
+      set( ${_var} "" )
+    else()
+      get_filename_component( __gccExeName "${__gccExePath}" NAME_WE )
+      string( REPLACE "-gcc" "" ${_var} "${__gccExeName}" )
+    endif()
+    unset( __gccExePath )
+    unset( __gccExePathsCount )
+    unset( __gccExeName )
   else()
-   get_filename_component( __gccExeName "${__gccExePath}" NAME_WE )
-   string( REPLACE "-gcc" "" ${_var} "${__gccExeName}" )
-  endif()
-  unset( __gccExePath )
-  unset( __gccExePathsCount )
-  unset( __gccExeName )
- else()
-  set( ${_var} "" )
- endif()
+    set( ${_var} "" )
+  endif()
 endmacro()

@@ -419,17 +379,19 @@
 endif()

 # see if we have path to Android NDK
-__INIT_VARIABLE( ANDROID_NDK PATH ENV_ANDROID_NDK )
+if( NOT ANDROID_NDK AND NOT ANDROID_STANDALONE_TOOLCHAIN )
+  __INIT_VARIABLE( ANDROID_NDK PATH ENV_ANDROID_NDK )
+endif()
 if( NOT ANDROID_NDK )
  # see if we have path to Android standalone toolchain
- __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN OBSOLETE_ANDROID_NDK_TOOLCHAIN_ROOT OBSOLETE_ENV_ANDROID_NDK_TOOLCHAIN_ROOT )
+ __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN )

  if( NOT ANDROID_STANDALONE_TOOLCHAIN )
   #try to find Android NDK in one of the the default locations
   set( __ndkSearchPaths )
   foreach( __ndkSearchPath ${ANDROID_NDK_SEARCH_PATHS} )
    foreach( suffix ${ANDROID_SUPPORTED_NDK_VERSIONS} )
-    list( APPEND __ndkSearchPaths "${__ndkSearchPath}${suffix}" )
+    list( APPEND __ndkSearchPaths "${__ndkSearchPath}/android-ndk${suffix}" )
    endforeach()
   endforeach()
   __INIT_VARIABLE( ANDROID_NDK PATH VALUES ${__ndkSearchPaths} )
@@ -487,7 +449,7 @@
     or
       export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain
     or put the toolchain or NDK in the default path:
-      sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}
+      sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}/android-ndk
       sudo ln -s ~/my-android-toolchain ${ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH}" )
 endif()

@@ -636,7 +598,7 @@
  endif()
  if( NOT __availableToolchains )
   file( GLOB __availableToolchainsLst RELATIVE "${ANDROID_NDK_TOOLCHAINS_PATH}" "${ANDROID_NDK_TOOLCHAINS_PATH}/*" )
-  if( __availableToolchains )
+  if( __availableToolchainsLst )
    list(SORT __availableToolchainsLst) # we need clang to go after gcc
   endif()
   __LIST_FILTER( __availableToolchainsLst "^[.]" )
@@ -669,7 +631,7 @@
 endif()

 # choose target ABI
-__INIT_VARIABLE( ANDROID_ABI OBSOLETE_ARM_TARGET OBSOLETE_ARM_TARGETS VALUES ${ANDROID_SUPPORTED_ABIS} )
+__INIT_VARIABLE( ANDROID_ABI VALUES ${ANDROID_SUPPORTED_ABIS} )
 # verify that target ABI is supported
 list( FIND ANDROID_SUPPORTED_ABIS "${ANDROID_ABI}" __androidAbiIdx )
 if( __androidAbiIdx EQUAL -1 )
@@ -760,7 +722,7 @@
 endif()

 if( ANDROID_ARCH_NAME STREQUAL "arm" AND NOT ARMEABI_V6 )
- __INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD OBSOLETE_FORCE_ARM VALUES OFF )
+ __INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD VALUES OFF )
  set( ANDROID_FORCE_ARM_BUILD ${ANDROID_FORCE_ARM_BUILD} CACHE BOOL "Use 32-bit ARM instructions instead of Thumb-1" FORCE )
  mark_as_advanced( ANDROID_FORCE_ARM_BUILD )
 else()
@@ -845,6 +807,7 @@
   unset( __realApiLevel )
  endif()
  set( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE )
+ set( CMAKE_ANDROID_API ${ANDROID_NATIVE_API_LEVEL} )
  if( CMAKE_VERSION VERSION_GREATER "2.8" )
   list( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )
   set_property( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
@@ -863,16 +826,7 @@

 # runtime choice (STL, rtti, exceptions)
 if( NOT ANDROID_STL )
- # honor legacy ANDROID_USE_STLPORT
- if( DEFINED ANDROID_USE_STLPORT )
-  if( ANDROID_USE_STLPORT )
-   set( ANDROID_STL stlport_static )
-  endif()
-  message( WARNING "You are using an obsolete variable ANDROID_USE_STLPORT to select the STL variant. Use -DANDROID_STL=stlport_static instead." )
- endif()
- if( NOT ANDROID_STL )
   set( ANDROID_STL gnustl_static )
- endif()
 endif()
 set( ANDROID_STL "${ANDROID_STL}" CACHE STRING "C++ runtime" )
 set( ANDROID_STL_FORCE_FEATURES ON CACHE BOOL "automatically configure rtti and exceptions support based on C++ runtime" )
@@ -1033,7 +987,7 @@
   set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" )
  elseif( ANDROID_STL MATCHES "gabi" )
   if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
-   message( FATAL_ERROR "gabi++ is not awailable in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.")
+   message( FATAL_ERROR "gabi++ is not available in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.")
   endif()
   set( ANDROID_RTTI             ON )
   set( ANDROID_EXCEPTIONS       OFF )
@@ -1144,7 +1098,12 @@
  endif()
  set( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}"     CACHE PATH "assembler" )
  set( CMAKE_STRIP        "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}"   CACHE PATH "strip" )
- set( CMAKE_AR           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}"      CACHE PATH "archive" )
+ if( EXISTS "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc-ar${TOOL_OS_SUFFIX}" )
+  # Use gcc-ar if we have it for better LTO support.
+  set( CMAKE_AR           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc-ar${TOOL_OS_SUFFIX}"      CACHE PATH "archive" )
+ else()
+  set( CMAKE_AR           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}"      CACHE PATH "archive" )
+ endif()
  set( CMAKE_LINKER       "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ld${TOOL_OS_SUFFIX}"      CACHE PATH "linker" )
  set( CMAKE_NM           "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-nm${TOOL_OS_SUFFIX}"      CACHE PATH "nm" )
  set( CMAKE_OBJCOPY      "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}" CACHE PATH "objcopy" )
@@ -1233,7 +1192,7 @@

 # NDK flags
 if (ARM64_V8A )
- set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -ffunction-sections -funwind-tables" )
+ set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -funwind-tables" )
  set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
  set( ANDROID_CXX_FLAGS_DEBUG   "-fno-omit-frame-pointer -fno-strict-aliasing" )
  if( NOT ANDROID_COMPILER_IS_CLANG )
@@ -1263,7 +1222,7 @@
  set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
  set( ANDROID_CXX_FLAGS_DEBUG   "-fno-omit-frame-pointer -fno-strict-aliasing" )
 elseif( MIPS OR MIPS64 )
- set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0" )
+ set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -fno-strict-aliasing -finline-functions -funwind-tables -fmessage-length=0" )
  set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer" )
  set( ANDROID_CXX_FLAGS_DEBUG   "-fno-omit-frame-pointer" )
  if( NOT ANDROID_COMPILER_IS_CLANG )
@@ -1348,7 +1307,7 @@
 else()
  __INIT_VARIABLE( ANDROID_SO_UNDEFINED                      VALUES OFF )
 endif()
-__INIT_VARIABLE( ANDROID_NO_UNDEFINED OBSOLETE_NO_UNDEFINED VALUES ON )
+__INIT_VARIABLE( ANDROID_NO_UNDEFINED                       VALUES ON )
 __INIT_VARIABLE( ANDROID_FUNCTION_LEVEL_LINKING             VALUES ON )
 __INIT_VARIABLE( ANDROID_GOLD_LINKER                        VALUES ON )
 __INIT_VARIABLE( ANDROID_NOEXECSTACK                        VALUES ON )
@@ -1356,7 +1315,7 @@

 set( ANDROID_NO_UNDEFINED           ${ANDROID_NO_UNDEFINED}           CACHE BOOL "Show all undefined symbols as linker errors" )
 set( ANDROID_SO_UNDEFINED           ${ANDROID_SO_UNDEFINED}           CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
-set( ANDROID_FUNCTION_LEVEL_LINKING ${ANDROID_FUNCTION_LEVEL_LINKING} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
+set( ANDROID_FUNCTION_LEVEL_LINKING ${ANDROID_FUNCTION_LEVEL_LINKING} CACHE BOOL "Put each function in separate section and enable garbage collection of unused input sections at link time" )
 set( ANDROID_GOLD_LINKER            ${ANDROID_GOLD_LINKER}            CACHE BOOL "Enables gold linker" )
 set( ANDROID_NOEXECSTACK            ${ANDROID_NOEXECSTACK}            CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
 set( ANDROID_RELRO                  ${ANDROID_RELRO}                  CACHE BOOL "Enables RELRO - a memory corruption mitigation technique" )
@@ -1531,27 +1490,31 @@
 endif()

 # setup output directories
-set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
 set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )

-if(NOT _CMAKE_IN_TRY_COMPILE)
- if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
-  set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
- else()
-  set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
- endif()
- set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
+if( DEFINED LIBRARY_OUTPUT_PATH_ROOT
+      OR EXISTS "${CMAKE_SOURCE_DIR}/AndroidManifest.xml"
+      OR (EXISTS "${CMAKE_SOURCE_DIR}/../AndroidManifest.xml" AND EXISTS "${CMAKE_SOURCE_DIR}/../jni/") )
+  set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "Root for binaries output, set this to change where Android libs are installed to" )
+  if( NOT _CMAKE_IN_TRY_COMPILE )
+    if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
+      set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
+    else()
+      set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
+    endif()
+    set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for Android libs" )
+  endif()
 endif()

 # copy shaed stl library to build directory
-if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" )
- get_filename_component( __libstlname "${__libstl}" NAME )
- execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__libstl}" "${LIBRARY_OUTPUT_PATH}/${__libstlname}" RESULT_VARIABLE __fileCopyProcess )
- if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS "${LIBRARY_OUTPUT_PATH}/${__libstlname}")
-  message( SEND_ERROR "Failed copying of ${__libstl} to the ${LIBRARY_OUTPUT_PATH}/${__libstlname}" )
- endif()
- unset( __fileCopyProcess )
- unset( __libstlname )
+if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" AND DEFINED LIBRARY_OUTPUT_PATH )
+  get_filename_component( __libstlname "${__libstl}" NAME )
+  execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__libstl}" "${LIBRARY_OUTPUT_PATH}/${__libstlname}" RESULT_VARIABLE __fileCopyProcess )
+  if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS "${LIBRARY_OUTPUT_PATH}/${__libstlname}")
+    message( SEND_ERROR "Failed copying of ${__libstl} to the ${LIBRARY_OUTPUT_PATH}/${__libstlname}" )
+  endif()
+  unset( __fileCopyProcess )
+  unset( __libstlname )
 endif()

@@ -1612,25 +1575,10 @@
 endmacro()

-macro( ANDROID_GET_ABI_RAWNAME TOOLCHAIN_FLAG VAR )
- if( "${TOOLCHAIN_FLAG}" STREQUAL "ARMEABI" )
-  set( ${VAR} "armeabi" )
- elseif( "${TOOLCHAIN_FLAG}" STREQUAL "ARMEABI_V7A" )
-  set( ${VAR} "armeabi-v7a" )
- elseif( "${TOOLCHAIN_FLAG}" STREQUAL "X86" )
-  set( ${VAR} "x86" )
- elseif( "${TOOLCHAIN_FLAG}" STREQUAL "MIPS" )
-  set( ${VAR} "mips" )
- else()
-  set( ${VAR} "unknown" )
- endif()
-endmacro()
-
-
 # export toolchain settings for the try_compile() command
-if( NOT PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
+if( NOT _CMAKE_IN_TRY_COMPILE )
  set( __toolchain_config "")
- foreach( __var NDK_CCACHE  LIBRARY_OUTPUT_PATH_ROOT  ANDROID_FORBID_SYGWIN  ANDROID_SET_OBSOLETE_VARIABLES
+ foreach( __var NDK_CCACHE  LIBRARY_OUTPUT_PATH_ROOT  ANDROID_FORBID_SYGWIN
                 ANDROID_NDK_HOST_X64
                 ANDROID_NDK
                 ANDROID_NDK_LAYOUT
@@ -1652,7 +1600,7 @@
                 ANDROID_APP_PIE
                 )
   if( DEFINED ${__var} )
-   if( "${__var}" MATCHES " ")
+   if( ${__var} MATCHES " ")
     set( __toolchain_config "${__toolchain_config}set( ${__var} \"${${__var}}\" CACHE INTERNAL \"\" )\n" )
    else()
     set( __toolchain_config "${__toolchain_config}set( ${__var} ${${__var}} CACHE INTERNAL \"\" )\n" )
@@ -1674,16 +1622,6 @@
  enable_language( CXX )
  # unset( CMAKE_COMPILER_IS_MINGW ) # can't unset because CMake does not convert back-slashes in response files without it
  unset( MINGW )
-endif()
-
-
-# set some obsolete variables for backward compatibility
-set( ANDROID_SET_OBSOLETE_VARIABLES ON CACHE BOOL "Define obsolete Andrid-specific cmake variables" )
-mark_as_advanced( ANDROID_SET_OBSOLETE_VARIABLES )
-if( ANDROID_SET_OBSOLETE_VARIABLES )
- set( ANDROID_API_LEVEL ${ANDROID_NATIVE_API_LEVEL} )
- set( ARM_TARGET "${ANDROID_ABI}" )
- set( ARMEABI_NDK_NAME "${ANDROID_NDK_ABI_NAME}" )
 endif()

@@ -1700,22 +1638,15 @@
 #   ANDROID_RELRO : ON/OFF
 #   ANDROID_FORCE_ARM_BUILD : ON/OFF
 #   ANDROID_STL_FORCE_FEATURES : ON/OFF
-#   ANDROID_SET_OBSOLETE_VARIABLES : ON/OFF
+#   ANDROID_LIBM_PATH : path to libm.so (set to something like $(TOP)/out/target/product/<product_name>/obj/lib/libm.so) to workaround unresolved `sincos`
 # Can be set only at the first run:
-#   ANDROID_NDK
-#   ANDROID_STANDALONE_TOOLCHAIN
+#   ANDROID_NDK : path to your NDK install
+#   NDK_CCACHE : path to your ccache executable
 #   ANDROID_TOOLCHAIN_NAME : the NDK name of compiler toolchain
 #   ANDROID_NDK_HOST_X64 : try to use x86_64 toolchain (default for x64 host systems)
 #   ANDROID_NDK_LAYOUT : the inner NDK structure (RELEASE, LINARO, ANDROID)
 #   LIBRARY_OUTPUT_PATH_ROOT : <any valid path>
-#   NDK_CCACHE : <path to your ccache executable>
-# Obsolete:
-#   ANDROID_API_LEVEL : superseded by ANDROID_NATIVE_API_LEVEL
-#   ARM_TARGET : superseded by ANDROID_ABI
-#   ARM_TARGETS : superseded by ANDROID_ABI (can be set only)
-#   ANDROID_NDK_TOOLCHAIN_ROOT : superseded by ANDROID_STANDALONE_TOOLCHAIN (can be set only)
-#   ANDROID_USE_STLPORT : superseded by ANDROID_STL=stlport_static
-#   ANDROID_LEVEL : superseded by ANDROID_NATIVE_API_LEVEL (completely removed)
+#   ANDROID_STANDALONE_TOOLCHAIN
 #
 # Primary read-only variables:
 #   ANDROID : always TRUE
@@ -1729,7 +1660,6 @@
 #   X86_64 : TRUE if configured for x86_64
 #   MIPS : TRUE if configured for mips
 #   MIPS64 : TRUE if configured for mips64
-#   BUILD_ANDROID : always TRUE
 #   BUILD_WITH_ANDROID_NDK : TRUE if NDK is used
 #   BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
 #   ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
@@ -1740,8 +1670,6 @@
 #   ANDROID_SYSROOT : path to the compiler sysroot
 #   TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
 #   ANDROID_COMPILER_IS_CLANG : TRUE if clang compiler is used
-# Obsolete:
-#   ARMEABI_NDK_NAME : superseded by ANDROID_NDK_ABI_NAME
 #
 # Secondary (less stable) read-only variables:
 #   ANDROID_COMPILER_VERSION : GCC version used (not Clang version)
@@ -1756,12 +1684,10 @@
 #   ANDROID_RTTI : if rtti is enabled by the runtime
 #   ANDROID_EXCEPTIONS : if exceptions are enabled by the runtime
 #   ANDROID_GCC_TOOLCHAIN_NAME : read-only, differs from ANDROID_TOOLCHAIN_NAME only if clang is used
-#   ANDROID_LIBM_PATH : path to libm.so (set to something like $(TOP)/out/target/product/<product_name>/obj/lib/libm.so) to workaround unresolved `sincos`
 #
 # Defaults:
 #   ANDROID_DEFAULT_NDK_API_LEVEL
 #   ANDROID_DEFAULT_NDK_API_LEVEL_${ARCH}
 #   ANDROID_NDK_SEARCH_PATHS
-#   ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH
 #   ANDROID_SUPPORTED_ABIS_${ARCH}
 #   ANDROID_SUPPORTED_NDK_VERSIONS


Add missing testing dependency for Rendering/Matplotlib.

Change-Id: I01a62e68faa43e35ea5f60cff929d75ed8b2cbe6

--- Rendering/Matplotlib/module.cmake
+++ Rendering/Matplotlib/module.cmake
@@ -8,6 +8,7 @@
     vtkInteractionImage
     vtkInteractionWidgets
     vtkIOExport
+    vtkIOGeometry
     vtkTestingRendering
     vtkRenderingGL2PS
     vtkRenderingOpenGL


COMP: Disable less used components to speed up build time and reduce binary size

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -55,33 +55,34 @@
   -DUSE_BSplineResampleInterpolator:BOOL=ON
   -DUSE_BSplineResampleInterpolatorFloat:BOOL=ON
   -DUSE_BSplineStackTransform:BOOL=ON
-  -DUSE_BSplineTransformWithDiffusion:BOOL=ON
-  -DUSE_CMAEvolutionStrategy:BOOL=ON
+  -DUSE_BSplineTransformWithDiffusion:BOOL=OFF
+  -DUSE_CMAEvolutionStrategy:BOOL=OFF
   -DUSE_CUDAResampler:BOOL=OFF
-  -DUSE_ConjugateGradient:BOOL=ON
-  -DUSE_ConjugateGradientFRPR:BOOL=ON
+  -DUSE_ConjugateGradient:BOOL=OFF
+  -DUSE_ConjugateGradientFRPR:BOOL=OFF
   -DUSE_CorrespondingPointsEuclideanDistanceMetric:BOOL=ON
   -DUSE_DeformationFieldTransform:BOOL=ON
   -DUSE_DisplacementMagnitudePenalty:BOOL=ON
-  -DUSE_DistancePreservingRigidityPenalty:BOOL=ON
+  -DUSE_DistancePreservingRigidityPenalty:BOOL=OFF
   -DUSE_EulerTransformElastix:BOOL=ON
-  -DUSE_FiniteDifferenceGradientDescent:BOOL=ON
-  -DUSE_FixedGenericPyramid:BOOL=ON
-  -DUSE_FixedRecursivePyramid:BOOL=ON
+  -DUSE_FiniteDifferenceGradientDescent:BOOL=OFF
+  -DUSE_FixedGenericPyramid:BOOL=OFF
+  -DUSE_FixedRecursivePyramid:BOOL=OFF
   -DUSE_FixedShrinkingPyramid:BOOL=ON
   -DUSE_FixedSmoothingPyramid:BOOL=ON
-  -DUSE_FullSampler:BOOL=ON
-  -DUSE_FullSearch:BOOL=ON
-  -DUSE_GradientDifferenceMetric:BOOL=ON
+  -DUSE_FullSampler:BOOL=OFF
+  -DUSE_FullSearch:BOOL=OFF
+  -DUSE_GradientDifferenceMetric:BOOL=OFF
   -DUSE_GridSampler:BOOL=ON
   -DUSE_KNNGraphAlphaMutualInformationMetric:BOOL=OFF
   -DUSE_LinearInterpolator:BOOL=ON
   -DUSE_LinearResampleInterpolator:BOOL=ON
-  -DUSE_MissingStructurePenalty:BOOL=ON
-  -DUSE_MovingRecursivePyramid:BOOL=ON
+  -DUSE_MissingStructurePenalty:BOOL=OFF
+  -DUSE_MovingGenericPyramid:BOOL=OFF
+  -DUSE_MovingRecursivePyramid:BOOL=OFF
   -DUSE_MovingShrinkingPyramid:BOOL=ON
   -DUSE_MovingSmoothingPyramid:BOOL=ON
-  -DUSE_MultiBSplineTransformWithNormal:BOOL=ON
+  -DUSE_MultiBSplineTransformWithNormal:BOOL=OFF
   -DUSE_MultiInputRandomCoordinateSampler:BOOL=ON
   -DUSE_MultiMetricMultiResolutionRegistration:BOOL=ON
   -DUSE_MultiResolutionRegistration:BOOL=ON
@@ -94,30 +95,30 @@
   -DUSE_NormalizedMutualInformationMetric:BOOL=ON
   -DUSE_PCAMetric:BOOL=ON
   -DUSE_PCAMetric2:BOOL=ON
-  -DUSE_PatternIntensityMetric:BOOL=ON
-  -DUSE_PolydataDummyPenalty:BOOL=ON
-  -DUSE_Powell:BOOL=ON
+  -DUSE_PatternIntensityMetric:BOOL=OFF
+  -DUSE_PolydataDummyPenalty:BOOL=OFF
+  -DUSE_Powell:BOOL=OFF
   -DUSE_QuasiNewtonLBFGS:BOOL=ON
   -DUSE_RSGDEachParameterApart:BOOL=ON
   -DUSE_RandomCoordinateSampler:BOOL=ON
   -DUSE_RandomSampler:BOOL=ON
   -DUSE_RandomSamplerSparseMask:BOOL=ON
-  -DUSE_RayCastInterpolator:BOOL=ON
-  -DUSE_RayCastResampleInterpolator:BOOL=ON
+  -DUSE_RayCastInterpolator:BOOL=OFF
+  -DUSE_RayCastResampleInterpolator:BOOL=OFF
   -DUSE_ReducedDimensionBSplineInterpolator:BOOL=ON
   -DUSE_ReducedDimensionBSplineResampleInterpolator:BOOL=ON
-  -DUSE_RegularStepGradientDescent:BOOL=ON
+  -DUSE_RegularStepGradientDescent:BOOL=OFF
   -DUSE_SimilarityTransformElastix:BOOL=ON
-  -DUSE_Simplex:BOOL=ON
-  -DUSE_SimultaneousPerturbation:BOOL=ON
+  -DUSE_Simplex:BOOL=OFF
+  -DUSE_SimultaneousPerturbation:BOOL=OFF
   -DUSE_SplineKernelTransform:BOOL=ON
   -DUSE_StandardGradientDescent:BOOL=ON
-  -DUSE_StatisticalShapePenalty:BOOL=ON
+  -DUSE_StatisticalShapePenalty:BOOL=OFF
   -DUSE_TransformBendingEnergyPenanalty:BOOL=ON
   -DUSE_TransformRigidityPenalty:BOOL=ON
   -DUSE_TranslationTransformElastix:BOOL=ON
   -DUSE_VarianceOverLastDimensionMetric:BOOL=ON
-  -DUSE_ViolaWellsMutualInformationMetric:BOOL=ON
+  -DUSE_ViolaWellsMutualInformationMetric:BOOL=OFF
   -DUSE_WeightedCombinationTransformElastix:BOOL=ON
   DEPENDS ${${CMAKE_PROJECT_NAME}_DEPENDENCIES}
 )


register algorithms in test

register algorithms in test

--- test/util/testsuite.cmake
+++ test/util/testsuite.cmake
@@ -37,9 +37,11 @@
       ${PROJECT_SOURCE_DIR}/src/register/sequential_prefix_counting.cpp
       ${PROJECT_SOURCE_DIR}/src/register/sequential_prefix_counting_single_scan.cpp
       ${PROJECT_SOURCE_DIR}/src/register/sequential_prefix_sorting.cpp
+      ${PROJECT_SOURCE_DIR}/src/register/huff_naive.cpp
+      ${PROJECT_SOURCE_DIR}/src/register/huff_dd_naive.cpp
       )
   else()
-    unset(CONSTRUCTION_ALGORITHMS)
+    unset(CONSTRUCTION_ALGORITHMS)
   endif()

   add_executable(${test_target}_testrunner


boards: adafruit_feather_nrf52840: fix pyocd integration

Fix the --target value so flashing works regardless of image address.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- boards/arm/adafruit_feather_nrf52840/board.cmake
+++ boards/arm/adafruit_feather_nrf52840/board.cmake
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: Apache-2.0

 board_runner_args(jlink "--device=nrf52" "--speed=4000")
-board_runner_args(pyocd "--target=nrf52" "--frequency=4000000")
+board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000")
 board_runner_args(blackmagicprobe "--gdb-serial=/dev/ttyBmpGdb")
 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
 include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)


Fix the find_package call

Fix the find_package call

--- input/cmake/FindGluonInput.cmake
+++ input/cmake/FindGluonInput.cmake
@@ -21,7 +21,7 @@
     set(_gluonInputReq "REQUIRED")
 endif (GluonInput_FIND_REQUIRED)

-find_package(GluonCore _gluonInputReq)
+find_package(GluonCore ${_gluonInputReq})

 set(CMAKE_MODULE_PATH ${SHARE_INSTALL_DIR}/gluon/cmake)

@@ -64,4 +64,4 @@
 )

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(KCL DEFAULT_MSG GLUON_INPUT_LIBRARY GLUON_INPUT_INCLUDE_DIR)
+find_package_handle_standard_args(GluonInput DEFAULT_MSG GLUON_INPUT_LIBRARY GLUON_INPUT_INCLUDE_DIR)


Fix a minor problem with automated tests not setting CUDA_ARCH_LIST

--- test/ctest/test_setup.cmake
+++ test/ctest/test_setup.cmake
@@ -46,5 +46,5 @@
 CMAKE_CXX_FLAGS:STRING=${COVERAGE_FLAGS}
 MEMORYCHECK_COMMAND:FILEPATH=${MEMORYCHECK_COMMAND}
 MEMORYCHECK_SUPPRESSIONS_FILE:FILEPATH=${CTEST_CHECKOUT_DIR}/test/unit/combined_valgrind.supp
-CUDA_ARCH:STRING=${CUDA_ARCH}
+CUDA_ARCH_LIST:STRING=${CUDA_ARCH_LIST}
 ")


Restoring i18n-copy-mo* targets

Restoring i18n-copy-mo* targets

--- cmake/UraniumTranslationTools.cmake
+++ cmake/UraniumTranslationTools.cmake
@@ -17,6 +17,13 @@

 ## Translation tools:
+
+option(CURA_BINARY_DATA_DIRECTORY "Directory to the cura-binary-data repository")
+
+if(NOT CURA_BINARY_DATA_DIRECTORY AND NOT DEFINED $ENV{CURA_BINARY_DATA_DIRECTORY})
+    message(STATUS "Using CURA_BINARY_DATA_DIRECTORY from set of environment variables...")
+    SET(CURA_BINARY_DATA_DIRECTORY $ENV{CURA_BINARY_DATA_DIRECTORY})
+endif()

 # Dynamically creates targets for each language to create a *.po-file
 MACRO(TARGETS_FOR_PO_FILES language)
@@ -44,12 +51,24 @@
     message(STATUS "Creating target i18n-create-mo-${language}")
     add_custom_target(i18n-create-mo-${language})
     add_dependencies(i18n-create-mo i18n-create-mo-${language})
+    if(TARGET i18n-copy-mo)
+        message(STATUS "Creating target i18n-copy-mo-${language}")
+        add_custom_target(i18n-copy-mo-${language})
+        add_dependencies(i18n-copy-mo i18n-copy-mo-${language})
+    endif()
     file(GLOB po_files ${CMAKE_SOURCE_DIR}/resources/i18n/${language}/*.po)
     foreach(po_file ${po_files})
         string(REGEX REPLACE ".*/(.*).po" "${CMAKE_BINARY_DIR}/resources/i18n/${language}/LC_MESSAGES/\\1.mo" mo_file ${po_file})
         add_custom_command(TARGET i18n-create-mo-${language} POST_BUILD
                            COMMAND mkdir ARGS -p ${CMAKE_BINARY_DIR}/resources/i18n/${language}/LC_MESSAGES/
                            COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} ARGS ${po_file} -o ${mo_file} -f)
+        if(TARGET i18n-copy-mo-${language})
+             string(REGEX REPLACE ".*/(.*).po" "${CURA_BINARY_DATA_DIRECTORY}/${PROJECT_NAME}/resources/i18n/${language}/LC_MESSAGES/\\1.mo" mo_file_binary_copy ${po_file})
+             add_custom_command(TARGET i18n-copy-mo-${language} POST_BUILD
+                                COMMAND mkdir ARGS -p ${CURA_BINARY_DATA_DIRECTORY}/resources/i18n/${language}/LC_MESSAGES/
+                                COMMAND cp ARGS -fv ${mo_file} ${mo_file_binary_copy})
+             add_dependencies(i18n-copy-mo-${language} i18n-create-mo-${language})
+        endif()
     endforeach()
 ENDMACRO()

@@ -67,6 +86,17 @@
     else()
         message(WARNING "GETTEXT_MSGINIT_EXECUTABLE is undefined!\nSkipping to create i18n-create-po* targets...")
     endif()
+    if(CURA_BINARY_DATA_DIRECTORY)
+        if(EXISTS ${CURA_BINARY_DATA_DIRECTORY})
+            message(STATUS "CURA_BINARY_DATA_DIRECTORY: ${CURA_BINARY_DATA_DIRECTORY}")
+            message(STATUS "Creating target i18n-copy-mo")
+            add_custom_target(i18n-copy-mo)
+        else()
+            message(WARNING "CURA_BINARY_DATA_DIRECTORY does not exist! (${CURA_BINARY_DATA_DIRECTORY})")
+        endif()
+    else()
+        message(WARNING "CURA_BINARY_DATA_DIRECTORY is not set!")
+    endif()
     message(STATUS "Creating target i18n-update-po")
     add_custom_target(i18n-update-po)
     message(STATUS "Creating target i18n-update-mo")


CXX-1687 remove testing from dist check

CXX-1687 remove testing from dist check

--- cmake/make_dist/MakeDistCheck.cmake
+++ cmake/make_dist/MakeDistCheck.cmake
@@ -72,15 +72,6 @@
       ERROR_MSG "Make install failed."
    )

-   # Run make test in the build directory
-   set (test_opts $ENV{DISTCHECK_CHECK_OPTS})
-   separate_arguments (test_opts)
-   execute_process_and_check_result (
-      COMMAND ${MY_CMAKE_COMMAND} ${MAKE_COMMAND} CTEST_OUTPUT_ON_FAILURE=1 test ${test_opts}
-      WORKING_DIRECTORY ${BUILD_DIR}
-      ERROR_MSG "Make test failed."
-   )
-
    # Run make dist
    execute_process_and_check_result (
       COMMAND ${MY_CMAKE_COMMAND} ${MAKE_COMMAND} dist


Switch to teem master branch.

Switch to teem master branch.

--- src/CMake/TeemConfig.cmake
+++ src/CMake/TeemConfig.cmake
@@ -49,7 +49,7 @@

   IF(${compress_type} MATCHES "GIT")

-    SET(teem_GIT_TAG "origin/external_build")
+    SET(teem_GIT_TAG "origin/master")

     # TODO: fix install step
     #


Add sse options for use of intrinics with older compilers

--- cmake/cc.cmake
+++ cmake/cc.cmake
@@ -124,10 +124,19 @@
 	if (HAVE_AVX)
         set (CCOMMON_OPT  "${CCOMMON_OPT} -mavx")
 	endif ()
+	if (HAVE_SSE)
+	set (CCOMMON_OPT  "${CCOMMON_OPT} -msse")
+	endif ()
+	if (HAVE_SSE2)
+        set (CCOMMON_OPT  "${CCOMMON_OPT} -msse2")
+	endif ()
 	if (HAVE_SSE3)
         set (CCOMMON_OPT  "${CCOMMON_OPT} -msse3")
 	endif ()
 	if (HAVE_SSSE3)
         set (CCOMMON_OPT  "${CCOMMON_OPT} -mssse3")
 	endif ()
+	if (HAVE_SSE4_1)
+	set (CCOMMON_OPT  "${CCOMMON_OPT} -msse4.1")
+	endif ()
 endif()


Fix target test

Fix target test

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -85,8 +85,10 @@
 endif ()

 if (DYNAMIC_ARCH)
+if (TARGET)
 if (${TARGET} STREQUAL "GENERIC")
   set(NO_EXPRECISION 1)
+endif ()
 endif ()
 endif ()


Ticket #2062: Move /scratch/condor/externals -> /scratch/condor_externals as not to collide

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -426,7 +426,7 @@
 	#	set (EXTERNAL_STAGE /p/condor/workspaces/externals/cmake/${OS_NAME}/${SYS_ARCH})
 	#else()
 		# in case someone tries something funky insert OS & ARCH in path
-		set (EXTERNAL_STAGE /scratch/condor/externals) #${OS_NAME}/${SYS_ARCH})
+		set (EXTERNAL_STAGE /scratch/condor_externals) #${OS_NAME}/${SYS_ARCH})
 	#endif()
 endif(WINDOWS)


Put MAKEINFO_OUTEXT in the cache.

Put MAKEINFO_OUTEXT in the cache.

	* build-aux/cmake/modules/Makeinfo.cmake: Do that.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/Makeinfo.cmake
+++ build-aux/cmake/modules/Makeinfo.cmake
@@ -25,10 +25,12 @@

 # Set MAKEINFO_OUTEXT
 if(UNIX AND NOT CYGWIN AND NOT APPLE)
-  set(MAKEINFO_OUTEXT "")
+  set(ext "")
 else()
-  set(MAKEINFO_OUTEXT ".html")
+  set(ext ".html")
 endif()
+set(MAKEINFO_OUTEXT ${ext} CACHE INTERNAL "Extension of texinfo output file.")
+set(ext)

 # Compile a texinfo file. Typically, readme, news, knownbugs, etc...
 # Expect input file as first arguement and output as second. Finally, a list


In FindCuDNN.cmake, prioritize explicit variables over environment variables

--- chainerx_cc/cmake/FindCuDNN.cmake
+++ chainerx_cc/cmake/FindCuDNN.cmake
@@ -15,46 +15,56 @@
 include(FindPackageHandleStandardArgs)

 # Determine CUDNN_ROOT_DIR
-if(DEFINED ENV{CUDNN_ROOT_DIR})
-  set(CUDNN_ROOT_DIR $ENV{CUDNN_ROOT_DIR})
-else()
-  set(CUDNN_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA cuDNN")
+if(NOT DEFINED CUDNN_ROOT_DIR)
+  if(DEFINED ENV{CUDNN_ROOT_DIR})
+    set(CUDNN_ROOT_DIR $ENV{CUDNN_ROOT_DIR})
+  else()
+    set(CUDNN_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA cuDNN")
+  endif()
 endif()

 # Determine CUDNN_INCLUDE_DIR
-if(DEFINED ENV{CUDNN_INCLUDE_DIR})
-  set(CUDNN_INCLUDE_DIR $ENV{CUDNN_INCLUDE_DIR})
-else()
-  find_path(CUDNN_INCLUDE_DIR cudnn.h
-    HINTS ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR}
-    PATH_SUFFIXES cuda/include include)
+if(NOT DEFINED CUDNN_INCLUDE_DIR)
+  if(DEFINED ENV{CUDNN_INCLUDE_DIR})
+    set(CUDNN_INCLUDE_DIR $ENV{CUDNN_INCLUDE_DIR})
+  else()
+    find_path(CUDNN_INCLUDE_DIR cudnn.h
+      HINTS ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR}
+      PATH_SUFFIXES cuda/include include)
+  endif()
 endif()

 # Determine CUDNN_LIB_DIR
-if(DEFINED ENV{CUDNN_LIB_DIR})
-  set(CUDNN_LIB_DIR $ENV{CUDNN_LIB_DIR})
+if(NOT DEFINED CUDNN_LIB_DIR)
+  if(DEFINED ENV{CUDNN_LIB_DIR})
+    set(CUDNN_LIB_DIR $ENV{CUDNN_LIB_DIR})
+  endif()
 endif()

 # Determine CUDNN_LIBNAME
-if(DEFINED ENV{CUDNN_LIBNAME})
-  # libname from envvar
-  set(CUDNN_LIBNAME $ENV{CUDNN_LIBNAME})
-elseif(DEFINED ENV{USE_STATIC_CUDNN})
-  # Static library
-  MESSAGE(STATUS "USE_STATIC_CUDNN detected. Linking against static CUDNN library")
-  set(CUDNN_LIBNAME "libcudnn_static.a")
-else()
-  # Dynamic library
-  set(CUDNN_LIBNAME "cudnn")
+if(NOT DEFINED CUDNN_LIBNAME)
+  if(DEFINED ENV{CUDNN_LIBNAME})
+    # libname from envvar
+    set(CUDNN_LIBNAME $ENV{CUDNN_LIBNAME})
+  elseif(DEFINED ENV{USE_STATIC_CUDNN})
+    # Static library
+    MESSAGE(STATUS "USE_STATIC_CUDNN detected. Linking against static CUDNN library")
+    set(CUDNN_LIBNAME "libcudnn_static.a")
+  else()
+    # Dynamic library
+    set(CUDNN_LIBNAME "cudnn")
+  endif()
 endif()

 # Determine CUDNN_LIBRARY
-if(DEFINED ENV{CUDNN_LIBRARY})
-  SET(CUDNN_LIBRARY $ENV{CUDNN_LIBRARY})
-else()
-  find_library(CUDNN_LIBRARY ${CUDNN_LIBNAME}
-    HINTS ${CUDNN_LIB_DIR} ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR}
-    PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64)
+if(NOT DEFINED CUDNN_LIBRARY)
+  if(DEFINED ENV{CUDNN_LIBRARY})
+    SET(CUDNN_LIBRARY $ENV{CUDNN_LIBRARY})
+  else()
+    find_library(CUDNN_LIBRARY ${CUDNN_LIBNAME}
+      HINTS ${CUDNN_LIB_DIR} ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR}
+      PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64)
+  endif()
 endif()

 # Misc.


Removed unused option from add_python_module

--- scripts/PythonModule.cmake
+++ scripts/PythonModule.cmake
@@ -325,9 +325,9 @@

     # Parses arguments
     cmake_parse_arguments(${module}
-        "FAKE_INIT;NOINSTALL;INSTALL;CPP;ROOT_LOCATION;NOCONFIG"
-        "HEADER_DESTINATION;TARGETNAME;LANGUAGE;LOCATION"
-        "SOURCES;HEADERS;EXCLUDE;LIBRARIES"
+        "FAKE_INIT;NOINSTALL;INSTALL;CPP;NOCONFIG"
+        "HEADER_DESTINATION;TARGETNAME;LOCATION"
+        "SOURCES;EXCLUDE;LIBRARIES"
         ${ARGN}
     )
     list(APPEND ${module}_SOURCES ${${module}_UNPARSED_ARGUMENTS})


[Fuchsia] Remove LLDB from the toolchain distribution

This is currently not being used so disable it to reduce toolchain size.

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

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

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -18,10 +18,6 @@
   set(LLVM_ENABLE_LLD ON CACHE BOOL "")
   set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
   set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
-endif()
-
-if(APPLE)
-  set(LLDB_CODESIGN_IDENTITY "" CACHE STRING "")
 endif()

 set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
@@ -84,8 +80,6 @@
 set(LLVM_DISTRIBUTION_COMPONENTS
   clang
   lld
-  lldb
-  liblldb
   LTO
   clang-format
   clang-headers


cmake: httplib: force require openssl

cmake: httplib: force require openssl

--- cmake/external_dependencies.cmake
+++ cmake/external_dependencies.cmake
@@ -106,6 +106,7 @@
           httplib::Client cli(\"http://127.0.0.1\");
           return 0;
         }")
+    set(HTTPLIB_REQUIRE_OPENSSL ON)
     setup_library("${CHECK_SOURCE}"
                   NAME httplib
                   GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git


From Pere:
correct gcc version detection.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@44212 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -25,9 +25,9 @@
 #---Obtain the major and minor version of the GNU compiler-------------------------------------------
 if (CMAKE_COMPILER_IS_GNUCXX)
   exec_program(${CMAKE_C_COMPILER} ARGS "-dumpversion" OUTPUT_VARIABLE _gcc_version_info)
-  string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]" "\\1" GCC_MAJOR "${_gcc_version_info}")
-  string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]" "\\1" GCC_MINOR "${_gcc_version_info}")
-  string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9])" "\\1" GCC_PATCH "${_gcc_version_info}")
+  string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.?([0-9])?" "\\1" GCC_MAJOR "${_gcc_version_info}")
+  string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.?([0-9])?" "\\2" GCC_MINOR "${_gcc_version_info}")
+  string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.?([0-9])?" "\\3" GCC_PATCH "${_gcc_version_info}")
   message(STATUS "Found GCC. Major version ${GCC_MAJOR}, minor version ${GCC_MINOR}")
   set(COMPILER_VERSION gcc${GCC_MAJOR}${GCC_MINOR}${GCC_PATCH})
 else()


Fix for error if include_directories are empty

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -294,7 +294,10 @@
     endif()
   endforeach()

-  list(REMOVE_DUPLICATES includedirs)
+  if(includedirs)
+    list(REMOVE_DUPLICATES includedirs)
+  endif()
+
   #---Get the list of definitions---------------------------
   get_directory_property(defs COMPILE_DEFINITIONS)
   foreach( d ${defs})


Correct typo in variable name resulting in missing part of the commandline

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -240,8 +240,8 @@
   #---Get the library and module dependencies-----------------
   if(ARG_MODULE)
     set(target_lib_common ${libprefix}${ARG_MODULE})
-    set(rootmap_name ${targetLibCommon}.rootmap)
-    set(library_name ${targetLibCommon}${libsuffix})
+    set(rootmap_name ${target_lib_common}.rootmap)
+    set(library_name ${target_lib_common}${libsuffix})
     set(newargs -s ${library_name})
     set(rootmapargs -rml ${library_name} -rmf ${rootmap_name})
     set(pcm_name ${libprefix}${ARG_MODULE}_rdict.pcm)


Add the path to the test name, following roottest convention.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -1093,7 +1093,19 @@
   # to implement because some ROOT components create more than one library.
   ROOT_EXECUTABLE(${test_suite} ${source_files} LIBRARIES ${ARG_LIBRARIES})
   target_link_libraries(${test_suite} gtest gtest_main gmock gmock_main)
-  ROOT_ADD_TEST(gtest-${test_suite} COMMAND ${test_suite})
+
+  # Mangle the path to the test name.
+  # FIXME: Copied and modified from ROOTTEST_TARGETNAME_FROM_FILE. We should find a common place for that code.
+  set(filename ${test_suite})
+  get_filename_component(realfp ${filename} ABSOLUTE)
+  get_filename_component(filename_we ${filename} NAME_WE)
+
+  string(REPLACE "${CMAKE_SOURCE_DIR}" "" relativepath ${realfp})
+  string(REPLACE "${filename}" "" relativepath ${relativepath})
+
+  string(REPLACE "/" "-" targetname ${relativepath}${filename_we})
+
+  ROOT_ADD_TEST(gtest${targetname} COMMAND ${test_suite})
 endfunction()


Remove rlibmap; follow rename rootcling_tmp -> rootcling_stage1.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -52,13 +52,11 @@
 #---Modify the behaviour for local and non-local builds--------------------------------------------

 if(CMAKE_PROJECT_NAME STREQUAL ROOT)
-  set(rootcint_cmd rootcling_tmp)
-  set(rlibmap_cmd rlibmap)
+  set(rootcint_cmd rootcling_stage1)
   set(genreflex_cmd genreflex)
-  set(ROOTCINTDEP rootcling_tmp)
+  set(ROOTCINTDEP rootcling_stage1)
 else()
   set(rootcint_cmd rootcling)
-  set(rlibmap_cmd rlibmap)
   set(genreflex_cmd genreflex)
   set(ROOTCINTDEP)
 endif()
@@ -334,7 +332,7 @@

   #---what rootcling command to use--------------------------
   if(ARG_STAGE1)
-    set(command rootcling_tmp)
+    set(command rootcling_stage1)
     set(pcm_name)
   else()
     if(CMAKE_PROJECT_NAME STREQUAL ROOT)
@@ -675,9 +673,9 @@
     set(_library ${libprefix}${library}${CMAKE_SHARED_LIBRARY_SUFFIX})
   endif()
   #---Build the rootmap file--------------------------------------
-  add_custom_command(OUTPUT ${outfile}
-                     COMMAND ${rlibmap_cmd} -o ${outfile} -l ${_library} -d ${_dependencies} -c ${_linkdef}
-                     DEPENDS ${_linkdef} ${rlibmap_cmd} )
+  #add_custom_command(OUTPUT ${outfile}
+  #                   COMMAND ${rlibmap_cmd} -o ${outfile} -l ${_library} -d ${_dependencies} -c ${_linkdef}
+  #                   DEPENDS ${_linkdef} ${rlibmap_cmd} )
   add_custom_target( ${libprefix}${library}.rootmap ALL DEPENDS  ${outfile})
   set_target_properties(${libprefix}${library}.rootmap PROPERTIES FOLDER RootMaps )
   #---Install the rootmap file------------------------------------


Use of SuiteSparse_VERBOSE in all module outputs

--- cmakemodule/FindSuiteSparse.cmake
+++ cmakemodule/FindSuiteSparse.cmake
@@ -157,7 +157,9 @@
 		)
 		## check if found
 		if(NOT SuiteSparse_${suitesparseCompUC}_INCLUDE_DIR)
-			message(WARNING "   Failed to find ${suitesparseComp} :\nSuiteSparse_${suitesparseCompUC}_INCLUDE_DIR not found.\nCheck you write correctly the component name (case sensitive),\nor set the SuiteSparse_${suitesparseCompUC}_DIR to look inside")
+			if (SuiteSparse_VERBOSE)
+				message(WARNING "   Failed to find ${suitesparseComp} :\nSuiteSparse_${suitesparseCompUC}_INCLUDE_DIR not found.\nCheck you write correctly the component name (case sensitive),\nor set the SuiteSparse_${suitesparseCompUC}_DIR to look inside")
+			endif()
 		else()
 			list(APPEND SuiteSparse_INCLUDE_DIRS	${SuiteSparse_${suitesparseCompUC}_INCLUDE_DIR})
 		endif()
@@ -200,11 +202,13 @@

 		## check and append the and SuiteSparse_LIBRARIES list, and warn if not found (release and debug) otherwise
 		if(NOT SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE AND NOT SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG)
+			if (SuiteSparse_VERBOSE)
 			message(WARNING "   Failed to find ${suitesparseComp} :
 			Check you write correctly the component name (case sensitive),
 			or set the SuiteSparse_${suitesparseCompUC}_DIR to look inside,
 			or set directly SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG and SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE
 			")
+			endif ()
 		else()
 			list(APPEND SuiteSparse_LIBRARIES	optimized "${SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE}" debug "${SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG}")
 		endif()


Crosscompiler support

Crosscompiler support

--- cmake/configs/posix_rpi2_release.cmake
+++ cmake/configs/posix_rpi2_release.cmake
@@ -1,6 +1,15 @@
 include(posix/px4_impl_posix)

-set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-native.cmake)
+if ("${RPI_TOOLCHAIN_DIR}" STREQUAL "")
+	set(RPI_TOOLCHAIN_DIR /opt/rpi_toolchain)
+endif()
+
+set(CMAKE_PROGRAM_PATH
+	"${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin"
+	${CMAKE_PROGRAM_PATH}
+	)
+
+set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake)

 set(config_module_list
 	drivers/device


cmake: Avoid leading space in LLVM_DEFINITIONS.

Summary: Unnecessary space at the beginning of LLVM_DEFINITIONS in cmake shared files can break projects that use the variable.

Subscribers: llvm-commits

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

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

--- cmake/modules/AddLLVMDefinitions.cmake
+++ cmake/modules/AddLLVMDefinitions.cmake
@@ -7,7 +7,11 @@
 macro(add_llvm_definitions)
   # We don't want no semicolons on LLVM_DEFINITIONS:
   foreach(arg ${ARGN})
-    set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
+    if(DEFINED LLVM_DEFINITIONS)
+      set(LLVM_DEFINITIONS "${LLVM_DEFINITIONS} ${arg}")
+    else()
+      set(LLVM_DEFINITIONS ${arg})
+    endif()
   endforeach(arg)
   add_definitions( ${ARGN} )
 endmacro(add_llvm_definitions)


[Build] Added full support for SEvMgr, TraDemGen, TravelCCM, AirSched, AvlCal, SimFQT, SimLFS and SimCRS.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -590,6 +590,134 @@

 endmacro (get_stdair)

+# ~~~~~~~~~~ SEvMgr ~~~~~~~~~
+macro (get_sevmgr)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires SEvMgr-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires SEvMgr without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (SEvMgr ${_required_version} REQUIRED
+	HINTS ${WITH_SEVMGR_PREFIX})
+  if (SEvMgr_FOUND)
+    #
+    message (STATUS "Found SEvMgr version: ${SEVMGR_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${SEVMGR_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${SEVMGR_LIBRARIES})
+
+  else (SEvMgr_FOUND)
+    set (ERROR_MSG "The SEvMgr library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_SEVMGR_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<SEvMgr install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (SEvMgr_FOUND)
+
+endmacro (get_sevmgr)
+
+# ~~~~~~~~~~ TraDemGen ~~~~~~~~~
+macro (get_trademgen)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires TraDemGen-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires TraDemGen without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (TraDemGen ${_required_version} REQUIRED
+	HINTS ${WITH_TRADEMGEN_PREFIX})
+  if (TraDemGen_FOUND)
+    #
+    message (STATUS "Found TraDemGen version: ${TRADEMGEN_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${TRADEMGEN_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${TRADEMGEN_LIBRARIES})
+
+  else (TraDemGen_FOUND)
+    set (ERROR_MSG "The TraDemGen library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_TRADEMGEN_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<TraDemGen install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (TraDemGen_FOUND)
+
+endmacro (get_trademgen)
+
+# ~~~~~~~~~~ TravelCCM ~~~~~~~~~
+macro (get_travelccm)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires TravelCCM-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires TravelCCM without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (TravelCCM ${_required_version} REQUIRED
+	HINTS ${WITH_TRAVELCCM_PREFIX})
+  if (TravelCCM_FOUND)
+    #
+    message (STATUS "Found TravelCCM version: ${TRAVELCCM_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${TRAVELCCM_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${TRAVELCCM_LIBRARIES})
+
+  else (TravelCCM_FOUND)
+    set (ERROR_MSG "The TravelCCM library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_TRAVELCCM_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<TravelCCM install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (TravelCCM_FOUND)
+
+endmacro (get_travelccm)
+
+# ~~~~~~~~~~ AirSched ~~~~~~~~~
+macro (get_airsched)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires AirSched-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires AirSched without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (AirSched ${_required_version} REQUIRED
+	HINTS ${WITH_AIRSCHED_PREFIX})
+  if (AirSched_FOUND)
+    #
+    message (STATUS "Found AirSched version: ${AIRSCHED_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${AIRSCHED_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${AIRSCHED_LIBRARIES})
+
+  else (AirSched_FOUND)
+    set (ERROR_MSG "The AirSched library cannot be found. If it is installed")
+    set (ERROR_MSG "${ERROR_MSG} in a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_AIRSCHED_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<AirSched install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (AirSched_FOUND)
+
+endmacro (get_airsched)
+
 # ~~~~~~~~~~ AirRAC ~~~~~~~~~
 macro (get_airrac)
   unset (_required_version)
@@ -654,21 +782,21 @@

 endmacro (get_rmol)

-# ~~~~~~~~~~ Airinv ~~~~~~~~~
+# ~~~~~~~~~~ AirInv ~~~~~~~~~
 macro (get_airinv)
   unset (_required_version)
   if (${ARGC} GREATER 0)
     set (_required_version ${ARGV0})
-    message (STATUS "Requires Airinv-${_required_version}")
+    message (STATUS "Requires AirInv-${_required_version}")
   else (${ARGC} GREATER 0)
-    message (STATUS "Requires Airinv without specifying any version")
+    message (STATUS "Requires AirInv without specifying any version")
   endif (${ARGC} GREATER 0)

-  find_package (Airinv ${_required_version} REQUIRED
+  find_package (AirInv ${_required_version} REQUIRED
 	HINTS ${WITH_AIRINV_PREFIX})
-  if (Airinv_FOUND)
+  if (AirInv_FOUND)
     #
-    message (STATUS "Found Airinv version: ${AIRINV_VERSION}")
+    message (STATUS "Found AirInv version: ${AIRINV_VERSION}")

     # Update the list of include directories for the project
     include_directories (${AIRINV_INCLUDE_DIRS})
@@ -676,15 +804,143 @@
     # Update the list of dependencies for the project
     set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${AIRINV_LIBRARIES})

-  else (Airinv_FOUND)
-    set (ERROR_MSG "The Airinv library cannot be found. If it is installed in")
+  else (AirInv_FOUND)
+    set (ERROR_MSG "The AirInv library cannot be found. If it is installed in")
     set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
     set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_AIRINV_PREFIX=")
-    set (ERROR_MSG "${ERROR_MSG}<Airinv install path> variable.")
+    set (ERROR_MSG "${ERROR_MSG}<AirInv install path> variable.")
     message (FATAL_ERROR "${ERROR_MSG}")
-  endif (Airinv_FOUND)
+  endif (AirInv_FOUND)

 endmacro (get_airinv)
+
+# ~~~~~~~~~~ AvlCal ~~~~~~~~~
+macro (get_avlcal)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires AvlCal-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires AvlCal without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (AvlCal ${_required_version} REQUIRED
+	HINTS ${WITH_AVLCAL_PREFIX})
+  if (AvlCal_FOUND)
+    #
+    message (STATUS "Found AvlCal version: ${AVLCAL_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${AVLCAL_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${AVLCAL_LIBRARIES})
+
+  else (AvlCal_FOUND)
+    set (ERROR_MSG "The AvlCal library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_AVLCAL_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<AvlCal install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (AvlCal_FOUND)
+
+endmacro (get_avlcal)
+
+# ~~~~~~~~~~ SimFQT ~~~~~~~~~
+macro (get_simfqt)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires SimFQT-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires SimFQT without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (SimFQT ${_required_version} REQUIRED
+	HINTS ${WITH_SIMFQT_PREFIX})
+  if (SimFQT_FOUND)
+    #
+    message (STATUS "Found SimFQT version: ${SIMFQT_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${SIMFQT_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${SIMFQT_LIBRARIES})
+
+  else (SimFQT_FOUND)
+    set (ERROR_MSG "The SimFQT library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_SIMFQT_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<SimFQT install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (SimFQT_FOUND)
+
+endmacro (get_simfqt)
+
+# ~~~~~~~~~~ SimLFS ~~~~~~~~~
+macro (get_simlfs)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires SimLFS-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires SimLFS without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (SimLFS ${_required_version} REQUIRED
+	HINTS ${WITH_SIMLFS_PREFIX})
+  if (SimLFS_FOUND)
+    #
+    message (STATUS "Found SimLFS version: ${SIMLFS_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${SIMLFS_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${SIMLFS_LIBRARIES})
+
+  else (SimLFS_FOUND)
+    set (ERROR_MSG "The SimLFS library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_SIMLFS_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<SimLFS install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (SimLFS_FOUND)
+
+endmacro (get_simlfs)
+
+# ~~~~~~~~~~ SimCRS ~~~~~~~~~
+macro (get_simcrs)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires SimCRS-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires SimCRS without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (SimCRS ${_required_version} REQUIRED
+	HINTS ${WITH_SIMCRS_PREFIX})
+  if (SimCRS_FOUND)
+    #
+    message (STATUS "Found SimCRS version: ${SIMCRS_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${SIMCRS_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${SIMCRS_LIBRARIES})
+
+  else (SimCRS_FOUND)
+    set (ERROR_MSG "The SimCRS library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_SIMCRS_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<SimCRS install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (SimCRS_FOUND)
+
+endmacro (get_simcrs)

 ##############################################
@@ -1667,6 +1923,62 @@
   endif (StdAir_FOUND)
 endmacro (display_stdair)

+# SEvMgr
+macro (display_sevmgr)
+  if (SEvMgr_FOUND)
+    message (STATUS)
+    message (STATUS "* SEvMgr:")
+    message (STATUS "  - SEVMGR_VERSION ............. : ${SEVMGR_VERSION}")
+    message (STATUS "  - SEVMGR_BINARY_DIRS ......... : ${SEVMGR_BINARY_DIRS}")
+    message (STATUS "  - SEVMGR_EXECUTABLES ......... : ${SEVMGR_EXECUTABLES}")
+    message (STATUS "  - SEVMGR_LIBRARY_DIRS ........ : ${SEVMGR_LIBRARY_DIRS}")
+    message (STATUS "  - SEVMGR_LIBRARIES ........... : ${SEVMGR_LIBRARIES}")
+    message (STATUS "  - SEVMGR_INCLUDE_DIRS ........ : ${SEVMGR_INCLUDE_DIRS}")
+  endif (SEvMgr_FOUND)
+endmacro (display_sevmgr)
+
+# TraDemGen
+macro (display_trademgen)
+  if (TraDemGen_FOUND)
+    message (STATUS)
+    message (STATUS "* TraDemGen:")
+    message (STATUS "  - TRADEMGEN_VERSION .......... : ${TRADEMGEN_VERSION}")
+    message (STATUS "  - TRADEMGEN_BINARY_DIRS ...... : ${TRADEMGEN_BINARY_DIRS}")
+    message (STATUS "  - TRADEMGEN_EXECUTABLES ...... : ${TRADEMGEN_EXECUTABLES}")
+    message (STATUS "  - TRADEMGEN_LIBRARY_DIRS ..... : ${TRADEMGEN_LIBRARY_DIRS}")
+    message (STATUS "  - TRADEMGEN_LIBRARIES ........ : ${TRADEMGEN_LIBRARIES}")
+    message (STATUS "  - TRADEMGEN_INCLUDE_DIRS ..... : ${TRADEMGEN_INCLUDE_DIRS}")
+  endif (TraDemGen_FOUND)
+endmacro (display_trademgen)
+
+# TravelCCM
+macro (display_travelccm)
+  if (TravelCCM_FOUND)
+    message (STATUS)
+    message (STATUS "* TravelCCM:")
+    message (STATUS "  - TRAVELCCM_VERSION .......... : ${TRAVELCCM_VERSION}")
+    message (STATUS "  - TRAVELCCM_BINARY_DIRS ...... : ${TRAVELCCM_BINARY_DIRS}")
+    message (STATUS "  - TRAVELCCM_EXECUTABLES ...... : ${TRAVELCCM_EXECUTABLES}")
+    message (STATUS "  - TRAVELCCM_LIBRARY_DIRS ..... : ${TRAVELCCM_LIBRARY_DIRS}")
+    message (STATUS "  - TRAVELCCM_LIBRARIES ........ : ${TRAVELCCM_LIBRARIES}")
+    message (STATUS "  - TRAVELCCM_INCLUDE_DIRS ..... : ${TRAVELCCM_INCLUDE_DIRS}")
+  endif (TravelCCM_FOUND)
+endmacro (display_travelccm)
+
+# AirSched
+macro (display_airsched)
+  if (AirSched_FOUND)
+    message (STATUS)
+    message (STATUS "* AirSched:")
+    message (STATUS "  - AIRSCHED_VERSION ........... : ${AIRSCHED_VERSION}")
+    message (STATUS "  - AIRSCHED_BINARY_DIRS ....... : ${AIRSCHED_BINARY_DIRS}")
+    message (STATUS "  - AIRSCHED_EXECUTABLES ....... : ${AIRSCHED_EXECUTABLES}")
+    message (STATUS "  - AIRSCHED_LIBRARY_DIRS ...... : ${AIRSCHED_LIBRARY_DIRS}")
+    message (STATUS "  - AIRSCHED_LIBRARIES ......... : ${AIRSCHED_LIBRARIES}")
+    message (STATUS "  - AIRSCHED_INCLUDE_DIRS ...... : ${AIRSCHED_INCLUDE_DIRS}")
+  endif (AirSched_FOUND)
+endmacro (display_airsched)
+
 # AirRAC
 macro (display_airrac)
   if (AirRAC_FOUND)
@@ -1695,19 +2007,75 @@
   endif (RMOL_FOUND)
 endmacro (display_rmol)

-# Airinv
+# AirInv
 macro (display_airinv)
-  if (Airinv_FOUND)
+  if (AirInv_FOUND)
     message (STATUS)
-    message (STATUS "* Airinv:")
+    message (STATUS "* AirInv:")
     message (STATUS "  - AIRINV_VERSION ............. : ${AIRINV_VERSION}")
     message (STATUS "  - AIRINV_BINARY_DIRS ......... : ${AIRINV_BINARY_DIRS}")
     message (STATUS "  - AIRINV_EXECUTABLES ......... : ${AIRINV_EXECUTABLES}")
     message (STATUS "  - AIRINV_LIBRARY_DIRS ........ : ${AIRINV_LIBRARY_DIRS}")
     message (STATUS "  - AIRINV_LIBRARIES ........... : ${AIRINV_LIBRARIES}")
     message (STATUS "  - AIRINV_INCLUDE_DIRS ........ : ${AIRINV_INCLUDE_DIRS}")
-  endif (Airinv_FOUND)
+  endif (AirInv_FOUND)
 endmacro (display_airinv)
+
+# AvlCal
+macro (display_avlcal)
+  if (AvlCal_FOUND)
+    message (STATUS)
+    message (STATUS "* AvlCal:")
+    message (STATUS "  - AVLCAL_VERSION ............. : ${AVLCAL_VERSION}")
+    message (STATUS "  - AVLCAL_BINARY_DIRS ......... : ${AVLCAL_BINARY_DIRS}")
+    message (STATUS "  - AVLCAL_EXECUTABLES ......... : ${AVLCAL_EXECUTABLES}")
+    message (STATUS "  - AVLCAL_LIBRARY_DIRS ........ : ${AVLCAL_LIBRARY_DIRS}")
+    message (STATUS "  - AVLCAL_LIBRARIES ........... : ${AVLCAL_LIBRARIES}")
+    message (STATUS "  - AVLCAL_INCLUDE_DIRS ........ : ${AVLCAL_INCLUDE_DIRS}")
+  endif (AvlCal_FOUND)
+endmacro (display_avlcal)
+
+# SimFQT
+macro (display_simfqt)
+  if (SimFQT_FOUND)
+    message (STATUS)
+    message (STATUS "* SimFQT:")
+    message (STATUS "  - SIMFQT_VERSION ............. : ${SIMFQT_VERSION}")
+    message (STATUS "  - SIMFQT_BINARY_DIRS ......... : ${SIMFQT_BINARY_DIRS}")
+    message (STATUS "  - SIMFQT_EXECUTABLES ......... : ${SIMFQT_EXECUTABLES}")
+    message (STATUS "  - SIMFQT_LIBRARY_DIRS ........ : ${SIMFQT_LIBRARY_DIRS}")
+    message (STATUS "  - SIMFQT_LIBRARIES ........... : ${SIMFQT_LIBRARIES}")
+    message (STATUS "  - SIMFQT_INCLUDE_DIRS ........ : ${SIMFQT_INCLUDE_DIRS}")
+  endif (SimFQT_FOUND)
+endmacro (display_simfqt)
+
+# SimLFS
+macro (display_simlfs)
+  if (SimLFS_FOUND)
+    message (STATUS)
+    message (STATUS "* SimLFS:")
+    message (STATUS "  - SIMLFS_VERSION ............. : ${SIMLFS_VERSION}")
+    message (STATUS "  - SIMLFS_BINARY_DIRS ......... : ${SIMLFS_BINARY_DIRS}")
+    message (STATUS "  - SIMLFS_EXECUTABLES ......... : ${SIMLFS_EXECUTABLES}")
+    message (STATUS "  - SIMLFS_LIBRARY_DIRS ........ : ${SIMLFS_LIBRARY_DIRS}")
+    message (STATUS "  - SIMLFS_LIBRARIES ........... : ${SIMLFS_LIBRARIES}")
+    message (STATUS "  - SIMLFS_INCLUDE_DIRS ........ : ${SIMLFS_INCLUDE_DIRS}")
+  endif (SimLFS_FOUND)
+endmacro (display_simlfs)
+
+# SimCRS
+macro (display_simcrs)
+  if (SimCRS_FOUND)
+    message (STATUS)
+    message (STATUS "* SimCRS:")
+    message (STATUS "  - SIMCRS_VERSION ............. : ${SIMCRS_VERSION}")
+    message (STATUS "  - SIMCRS_BINARY_DIRS ......... : ${SIMCRS_BINARY_DIRS}")
+    message (STATUS "  - SIMCRS_EXECUTABLES ......... : ${SIMCRS_EXECUTABLES}")
+    message (STATUS "  - SIMCRS_LIBRARY_DIRS ........ : ${SIMCRS_LIBRARY_DIRS}")
+    message (STATUS "  - SIMCRS_LIBRARIES ........... : ${SIMCRS_LIBRARIES}")
+    message (STATUS "  - SIMCRS_INCLUDE_DIRS ........ : ${SIMCRS_INCLUDE_DIRS}")
+  endif (SimCRS_FOUND)
+endmacro (display_simcrs)

 ##
 macro (display_status_all_modules)
@@ -1793,9 +2161,17 @@
   display_mysql ()
   display_soci ()
   display_stdair ()
+  display_sevmgr ()
+  display_trademgen ()
+  display_travelccm ()
+  display_airsched ()
   display_airrac ()
   display_rmol ()
   display_airinv ()
+  display_avlcal ()
+  display_simfqt ()
+  display_simlfs ()
+  display_simcrs ()
   #
   message (STATUS)
   message (STATUS "Change a value with: cmake -D<Variable>=<Value>" )


[Build] Suppressed wrong end-of-lines.

[Build] Suppressed wrong end-of-lines.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -1280,9 +1280,7 @@

   # Convenient message to the user/developer
   if (NOT CMAKE_INSTALL_RPATH_USE_LINK_PATH)
-    install (CODE "message (\"On Unix-based platforms, run "
-	  "export LD_LIBRARY_PATH=${INSTALL_LIB_DIR}:\$LD_LIBRARY_PATH "
-	  "once per session\")")
+    install (CODE "message (\"On Unix-based platforms, run export LD_LIBRARY_PATH=${INSTALL_LIB_DIR}:\$LD_LIBRARY_PATH once per session\")")
   endif (NOT CMAKE_INSTALL_RPATH_USE_LINK_PATH)

 endmacro (module_library_add_standard)


[Build] Fixed the CMake build on the trunk branch.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -669,19 +669,21 @@
 #  * The short name of the library to be built.
 #    Note that the library (CMake) target is derived directly from the library
 #    short name: a 'lib' suffix is just appended to the short name.
+#  * The directory where to find the header files.
 #  * The header files to be published/installed along with the library.
 #  * The source files to build the library.
 #    Note that the source files contain at least the header files. Hence,
 #    even when there are no .cpp source files, the .hpp files will appear.
 #
-# Note that the source files should be given as a single parameter,
+# Note that the header and source files should be given as single parameters,
 # i.e., enclosed by double quotes (").
 #
 # The additional parameters, if given, correspond to the names of the
 # modules this current module depends upon. Dependencies on the
 # external libraries (e.g., Boost, SOCI, StdAir) are automatically
 # appended, thanks to the get_external_libs() macro.
-macro (module_library_add_specific _lib_short_name _lib_headers _lib_sources)
+macro (module_library_add_specific
+	_lib_short_name _lib_dir _lib_headers _lib_sources)
   # Derive the library (CMake) target from its name
   set (_lib_target ${_lib_short_name}lib)

@@ -693,7 +695,7 @@
   set (_intermodule_dependencies "")
   foreach (_arg_module ${ARGV})

-    if (NOT "${_lib_short_name};${_lib_headers};${_lib_sources}"
+    if (NOT "${_lib_dir};${_lib_short_name};${_lib_headers};${_lib_sources}"
 	MATCHES "${_arg_module}")
       list (APPEND _intermodule_dependencies ${_arg_module}lib)
     endif ()
@@ -731,22 +733,16 @@
   # DEBUG
   #message ("DEBUG -- [${_lib_target}] _lib_headers = ${_lib_headers}")

-  # Register the library target in the project (for reporting purpose)
-  set (PROJ_ALL_LIB_TARGETS
-	${PROJ_ALL_LIB_TARGETS} ${MODULE_LIB_TARGET} PARENT_SCOPE)
-
   ##
   # Library name (and soname)
   if (WIN32)
     set_target_properties (${_lib_target} PROPERTIES
       OUTPUT_NAME ${_lib_short_name}
-      VERSION ${GENERIC_LIB_VERSION}
-      PUBLIC_HEADER "${_lib_headers}")
+      VERSION ${GENERIC_LIB_VERSION})
   else (WIN32)
     set_target_properties (${_lib_target} PROPERTIES
       OUTPUT_NAME ${_lib_short_name}
-      VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
-      PUBLIC_HEADER "${_lib_headers}")
+      VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
   endif (WIN32)

   # If everything else is not enough for CMake to derive the language to


scripts: rename .reuse/dep to copyright

scripts: rename .reuse/dep to copyright

as suggested by @robaerd

--- scripts/cmake/Modules/PackagingFedora.cmake
+++ scripts/cmake/Modules/PackagingFedora.cmake
@@ -21,13 +21,13 @@

 execute_process (COMMAND bash "${CMAKE_SOURCE_DIR}/scripts/packaging/fedora/map_licenses.sh" "${CMAKE_SOURCE_DIR}/.reuse/dep5"
 		 OUTPUT_VARIABLE THIR_PARTY_LICENSES_STR)
-set (CPACK_RPM_PACKAGE_LICENSE "${THIR_PARTY_LICENSES_STR} \n # For a breakdown of the licensing, see .reuse/dep5")
+set (CPACK_RPM_PACKAGE_LICENSE "${THIR_PARTY_LICENSES_STR} \n # For a breakdown of the licensing, see copyright (.reuse/dep5)")
 # install license files
 configure_file ("${CMAKE_SOURCE_DIR}/LICENSE.md" "${CMAKE_BINARY_DIR}/doc/LICENSE" COPYONLY)
-configure_file ("${CMAKE_SOURCE_DIR}/.reuse/dep5" "${CMAKE_BINARY_DIR}/.reuse/dep5" COPYONLY)
+configure_file ("${CMAKE_SOURCE_DIR}/.reuse/dep5" "${CMAKE_BINARY_DIR}/doc/copyright" COPYONLY)
 foreach (component ${PACKAGES})
 	install (
-		FILES "${CMAKE_BINARY_DIR}/doc/LICENSE" "${CMAKE_BINARY_DIR}/.reuse/dep5"
+		FILES "${CMAKE_BINARY_DIR}/doc/LICENSE" "${CMAKE_BINARY_DIR}/doc/copyright"
 		COMPONENT ${component}
 		DESTINATION "share/licenses/${component}")
 endforeach ()


modules: updated FindCorrade.cmake.

modules: updated FindCorrade.cmake.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -34,6 +34,8 @@
 # Features of found Corrade library are exposed in these variables:
 #  CORRADE_GCC47_COMPATIBILITY  - Defined if compiled with compatibility
 #   mode for GCC 4.7
+#  CORRADE_MSVC2015_COMPATIBILITY - Defined if compiled with compatibility
+#   mode for MSVC 2015
 #  CORRADE_BUILD_DEPRECATED     - Defined if compiled with deprecated APIs
 #   included
 #  CORRADE_BUILD_STATIC         - Defined if compiled as static libraries
@@ -191,6 +193,7 @@
 file(READ ${CORRADE_INCLUDE_DIR}/Corrade/configure.h _corradeConfigure)
 set(_corradeFlags
     GCC47_COMPATIBILITY
+    MSVC2015_COMPATIBILITY
     BUILD_DEPRECATED
     BUILD_STATIC
     TARGET_UNIX


Add Boost on the include and link path.

Add Boost on the include and link path.

It was only done when the auto-build was triggered, resulting in build errors
when Boost is available on the system but not on the standard paths.

--- modules/boost/boost.cmake
+++ modules/boost/boost.cmake
@@ -150,10 +150,10 @@
         list(APPEND Boost_LIBRARIES ${Boost_${_COMP}_LIBRARY})
     endforeach()
     set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
-    include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
     set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR})
     if(CMAKE_SYSTEM_NAME MATCHES "Linux")
         list(APPEND Boost_LIBRARIES rt)
     endif()
-    link_directories(${Boost_LIBRARY_DIRS})
 endif(BUILD_CUSTOM_BOOST)
+include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})


better doc for definitions.cmake

better doc for definitions.cmake

--- modules/definitions.cmake
+++ modules/definitions.cmake
@@ -1,6 +1,7 @@
 #.rst:
 #
-# Add preprocessor definitions.
+# Add preprocessor definitions (example: --add-definitions="-DTHIS -DTHAT=137").
+# These are passed all the way down to the compiler.
 #
 # Variables used::
 #


Missing change for last merge

Missing change for last merge

--- Common.cmake
+++ Common.cmake
@@ -76,7 +76,7 @@
 endif()

 include(Compiler) # compiler-specific default options and warnings
-include(TestFinalOverride)
+include(TestCPP11)

 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
   set(LINUX TRUE)


Another attempt at fixing mono script

Another attempt at fixing mono script

--- build/modules/FindMono.cmake
+++ build/modules/FindMono.cmake
@@ -84,8 +84,7 @@
     GET_FILENAME_COMPONENT(GMCS_EXECUTABLE ${GMCS_EXECUTABLE_DIR} ABSOLUTE)
     GET_FILENAME_COMPONENT(GACUTIL_EXECUTABLE ${GACUTIL_EXECUTABLE_DIR} ABSOLUTE)
   ENDIF()
-
-  IF(EXISTS MONO_EXECUTABLE AND EXISTS MCS_EXECUTABLE AND EXISTS GMCS_EXECUTABLE AND EXISTS GACUTIL_EXECUTABLE)
+  IF(EXISTS ${MONO_EXECUTABLE} AND EXISTS ${MCS_EXECUTABLE} AND EXISTS ${GMCS_EXECUTABLE} AND EXISTS ${GACUTIL_EXECUTABLE})
     SET(MONO_LOOK_FOR_LIBRARIES TRUE)
   ELSE()
     SET(MONO_FOUND FALSE)


Use MODULE_IS_ENABLED to decide whether or not to add a test case

--- CMake/mitkFunctionAddCustomModuleTest.cmake
+++ CMake/mitkFunctionAddCustomModuleTest.cmake
@@ -8,9 +8,9 @@
 #!
 function(mitkAddCustomModuleTest test_name test_function)

-  if (BUILD_TESTING AND ${MODULE_NAME}_IS_ENABLED OR MODULE_NAME STREQUAL "Mitk")
-      add_test(${test_name} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${test_function} ${ARGN})
-      set_property(TEST ${test_name} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
+  if (BUILD_TESTING AND MODULE_IS_ENABLED)
+    add_test(${test_name} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} ${test_function} ${ARGN})
+    set_property(TEST ${test_name} PROPERTY LABELS ${MODULE_SUBPROJECTS} MITK)
   endif()

 endfunction()


[CMake] Fixing a typo in variable name ARG_*->LIB_*

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -186,7 +186,7 @@
     "PARENT_TARGET;OUTPUT_DIR;INSTALL_DIR"
     "LIPO_FLAGS;DEPENDS"
     ${ARGN})
-  if(ARGN_DEPENDS AND ARG_LIPO_FLAGS)
+  if(LIB_DEPENDS AND LIB_LIPO_FLAGS)
     add_custom_command(OUTPUT ${LIB_OUTPUT_DIR}/lib${name}.a
       COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR}
       COMMAND lipo -output


Drop HAVE_LIBM and NO_MINUS_C_MINUS_O which are unused.

svn path=/trunk/; revision=6895

--- config.h.cmake
+++ config.h.cmake
@@ -86,9 +86,6 @@
 /* Define to 1 if you have the <libgnomeprint/gnome-print.h> header file. */
 #cmakedefine HAVE_LIBGNOMEPRINT_GNOME_PRINT_H 1

-/* Define to 1 if you have the `m' library (-lm). */
-#cmakedefine HAVE_LIBM 1
-
 /* Define if libunicode is available */
 #cmakedefine HAVE_LIBUNICODE

@@ -163,9 +160,6 @@
 /* Include sys/type.h if needed */
 #cmakedefine NEED_SYS_TYPE_H

-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#cmakedefine NO_MINUS_C_MINUS_O 1
-
 /* Name of package */
 #define PACKAGE "${PACKAGE}"


BUG: CMakeModules dependency not added to OSSIM

--- CMake/External_ossim.cmake
+++ CMake/External_ossim.cmake
@@ -83,10 +83,13 @@
     set(${proj}_DEPENDENCIES ossim_cmakemodules)

   set(OSSIM_CXX_FLAGS  -D__STDC_CONSTANT_MACROS)
+ list(APPEND ${proj}_DEPENDENCIES ossim_cmakemodules)
+
   if(MSVC)
     #checkout cmakeModules
-    set(${proj}_DEPENDENCIES ossim_cmakemodules)
+     set(${proj}_DEPENDENCIES ossim_cmakemodules)
      list(APPEND ${proj}_DEPENDENCIES OPENTHREAD)
+     list(APPEND ${proj}_DEPENDENCIES GEOTIFF)
     #cmake flags for exception handling in c++
     set(OSSIM_CXX_FLAGS /EHsc)
     #clear all dependent library settings except GEOTIFF as we link with gdal_i.
@@ -95,8 +98,9 @@
     set(OSSIM_SB_GEOS_CONFIG)
     set(OSSIM_SB_JPEG_CONFIG)
     set(OSSIM_SB_OPENTHREAD_CONFIG)
+    set(OSSIM_SB_GEOTIFF_CONFIG)
     #build geotiff and use it
-    set(OSSIM_SB_GEOTIFF_CONFIG -DGEOTIFF_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/gdal_i.lib)
+    #set(OSSIM_SB_GEOTIFF_CONFIG -DGEOTIFF_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/gdal_i.lib)
   endif()

   ExternalProject_Add(${proj}
@@ -105,6 +109,7 @@
     SVN_REVISION -r 23087
     BINARY_DIR ${OSSIM_SB_BUILD_DIR}
     INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
+    CMAKE_GENERATOR "NMake Makefiles"
     CMAKE_CACHE_ARGS
       -DOSSIM_VERSION:STRING=1.8.18-1
       -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}


Fix DCMTK linking issue by explicitly passing fPIC flag

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -28,6 +28,21 @@
         -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
         -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET})
     endif()
+
+    #-----------------------------------------------------------------------------
+    # HACK Waiting upstream DCMTK is fixed, specify -fPIC here.
+    #      See http://public.kitware.com/pipermail/ctk-developers/2011-August/000725.html
+    #-----------------------------------------------------------------------------
+    set(dcmtk_cxx_flags ${ep_common_cxx_flags})
+    set(dcmtk_c_flags ${ep_common_c_flags})
+    # To fix compilation problem: relocation R_X86_64_32 against `a local symbol' can not be
+    # used when making a shared object; recompile with -fPIC
+    # See http://www.cmake.org/pipermail/cmake/2007-May/014350.html
+    #
+    IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+      set(dcmtk_cxx_flags "${ep_common_cxx_flags} -fPIC")
+      set(dcmtk_c_flags "${ep_common_c_flags} -fPIC")
+    ENDIF()

     ExternalProject_Add(${proj}
       SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
@@ -39,8 +54,8 @@
       BUILD_COMMAND ""
       CMAKE_ARGS
         -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-        -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}
-        -DCMAKE_C_FLAGS:STRING=${ep_common_c_flags}
+        -DCMAKE_CXX_FLAGS:STRING=${dcmtk_cxx_flags}
+        -DCMAKE_C_FLAGS:STRING=${dcmtk_c_flags}
         -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
         ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS}
         -DBUILD_TESTING:BOOL=OFF


Mark MKL_*_DLL_LIBRARY cmake vars as advanced

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -155,6 +155,8 @@
         PROPERTIES
           IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_DLL_LIBRARY}"
           IMPORTED_IMPLIB "${MKL_${mkl_args_NAME}_LINK_LIBRARY}")
+
+      mark_as_advanced(MKL_${mkl_args_NAME}_DLL_LIBRARY)
     endif()
 endfunction()


ASAN: use portable thread library linking

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -71,8 +71,8 @@
 	if (CMAKE_COMPILER_IS_GNUCXX)
 		set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
 		# this is currently a workaround so gtests compile with ASAN
-		#TODO someone with expertise migrate this into LibAddTest
-		set (COMMON_FLAGS "${COMMON_FLAGS} -lpthread")
+		find_package(Threads)
+		set (COMMON_FLAGS "${COMMON_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
 	endif ()
 	set (DISABLE_LSAN "LSAN_OPTIONS=detect_leaks=0") #this is needed so ASAN is not used during GIR compilation
 	message (STATUS "To use ASAN:\n"


Disable compile flag -Wmaybe-uninitialized on Apple

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -85,6 +85,10 @@
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wshadow")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wcomments -Wtrigraphs -Wundef")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wuninitialized -Winit-self")
+# Apple does not support -Wmaybe-uninitialized
+if (!APPLE)
+	set (COMMON_FLAGS "${COMMON_FLAGS} -Wmaybe-uninitialized")
+endif (!APPLE)

 #set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--unresolved-symbols=ignore-in-shared-libs")


Remove one more if(__ANDROID_NDK__) I missed

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

--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -147,15 +147,13 @@
   )

 set(LLDB_SYSTEM_LIBS)
-if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND NOT __ANDROID_NDK__)
-  if (NOT LLDB_DISABLE_LIBEDIT)
-    list(APPEND LLDB_SYSTEM_LIBS edit)
-  endif()
-  if (NOT LLDB_DISABLE_CURSES)
-    list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
-    if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
-      list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
-    endif()
+if (NOT LLDB_DISABLE_LIBEDIT)
+  list(APPEND LLDB_SYSTEM_LIBS edit)
+endif()
+if (NOT LLDB_DISABLE_CURSES)
+  list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
+  if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
+    list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
   endif()
 endif()


[build] Pass target argument to the linker if needed (#31794)

Following #31125 and #31612, `-target` is not added automatically to
linker flags when that's needed (e.g. when building for Apple SDKs) --
mimic the logic used to add it for compiler flags.

Addresses rdar://63138761

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -555,6 +555,15 @@
       target_link_options(${name} PRIVATE
         "LINKER:-current_version,${SWIFT_COMPILER_VERSION}")
     endif()
+
+    set(DEPLOYMENT_VERSION "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}")
+    # MSVC, clang-cl, gcc don't understand -target.
+    if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+      get_target_triple(target target_variant "${SWIFT_HOST_VARIANT_SDK}" "${SWIFT_HOST_VARIANT_ARCH}"
+        MACCATALYST_BUILD_FLAVOR ""
+        DEPLOYMENT_VERSION "${DEPLOYMENT_VERSION}")
+      target_link_options(${name} PRIVATE -target;${target})
+    endif()
   endif()

   add_dependencies(dev ${name})


packaging: exclude components where deps are not fulfilled

--- scripts/cmake/ElektraPackaging.cmake
+++ scripts/cmake/ElektraPackaging.cmake
@@ -1,3 +1,75 @@
+# ~~~
+# check_component_dependencies
+#
+# check and excludes a component from packaging if
+# the plugin/binding/tool the component depends on
+# is missing
+#
+# dependency_name  name of the dependency the component depends on
+# component_name   name of the component
+# PLUGIN           whether the dependency is a plugin
+# BINDING          whether the dependency is a binding
+# TOOL             whether the dependency is a tool
+# ADDITIONAL_DEPENDENCIES additional dependencies if the component
+#				          has multiple dependencies
+# ~~~
+macro (check_component_dependencies dependency_name component_name)
+	cmake_parse_arguments (
+			ARG
+			"PLUGIN;BINDING;TOOL" # optional keywords
+			"" # one value keywords
+			"ADDITIONAL_DEPENDENCIES" # multi value keywords
+			${ARGN})
+
+	set (TMP_DEPENDENCY_NAMES ${dependency_name})
+	if (ARG_ADDITIONAL_DEPENDENCIES)
+		list (APPEND TMP_DEPENDENCY_NAMES "${ARG_ADDITIONAL_DEPENDENCIES}")
+	endif ()
+
+	set (TMP_UNFULFILLED_DEPENDENCIES "")
+
+	foreach (name ${TMP_DEPENDENCY_NAMES})
+
+		if (ARG_PLUGIN)
+			if (NOT ${name} IN_LIST ADDED_PLUGINS)
+				set (TMP_DEPENDENCY_TYPE "plugin")
+				list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name})
+			endif ()
+		endif ()
+		if (ARG_BINDING)
+			if (NOT ${name} IN_LIST ADDED_BINDINGS)
+				set (TMP_DEPENDENCY_TYPE "binding")
+				list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name})
+			endif ()
+		endif ()
+		if (ARG_TOOL)
+			if (NOT ${name} IN_LIST TOOLS)
+				message (STATUS "ADDED_TOOLS: ${ADDED_TOOLS}")
+				set (TMP_DEPENDENCY_TYPE "tool")
+				list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name})
+			endif ()
+		endif ()
+
+	endforeach ()
+
+	list (LENGTH TMP_UNFULFILLED_DEPENDENCIES UNFULFILLED_DEPENDENCIES_AMOUNT)
+	list (LENGTH TMP_DEPENDENCY_NAMES EXPECTED_DEPENDENCIES_AMOUNT)
+	if (${UNFULFILLED_DEPENDENCIES_AMOUNT} GREATER 1)
+		set (TMP_DEPENDENCY_TYPE "${TMP_DEPENDENCY_TYPE}s")
+	endif ()
+	string (REPLACE ";" ", " TMP_UNFULFILLED_DEPENDENCIES_STR "${TMP_UNFULFILLED_DEPENDENCIES}")
+	if (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} EQUAL ${EXPECTED_DEPENDENCIES_AMOUNT})
+		# all dependencies of component are missing
+		message (STATUS "Exclude component ${component_name} because ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE} excluded.")
+		list (APPEND EXCLUDED_COMPONENTS ${component_name})
+	elseif (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} LESS ${EXPECTED_DEPENDENCIES_AMOUNT})
+		# at least one but not all dependencies of a component are missing
+		message (STATUS "Component ${component_name} is missing ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE}. This package will still be generated.")
+	endif ()
+
+endmacro (check_component_dependencies)
+
+
 set (PACKAGE_URL "https://www.libelektra.org/")
 set (PACKAGE_BUGREPORT "https://bugs.libelektra.org/")
 set (PROJECT_VERSION "${KDB_VERSION}")
@@ -55,6 +127,8 @@
 endforeach ()
 string (REPLACE ";" ", " ALL_PLUGINS_STR "${ALL_PLUGINS}")

+set (EXCLUDED_COMPONENTS "")
+
 set (
 	PACKAGE_DESCRIPTION
 	"Elektra provides a universal and secure framework to store configuration parameters in a global, hierarchical key database. The core is a small library implemented in C. The plugin-based framework fulfills many configuration-related tasks to avoid any unnecessary code duplication across applications while it still allows the core to stay without any external dependency.  Elektra abstracts from cross-platform-related issues with an consistent API, and allows applications to be aware of other applications' configurations, leveraging easy application integration."
@@ -127,10 +201,12 @@
 	set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DISPLAY_NAME "libelektra4-augeas")
 	set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DESCRIPTION "This package contains the 'augeas' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DEPENDS "libelektra4")
+	check_component_dependencies(augeas libelektra4-augeas PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DISPLAY_NAME "libelektra4-dbus")
 	set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DESCRIPTION "This package contains the 'dbus' plugins.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DEPENDS "libelektra4")
+	check_component_dependencies(dbus libelektra4-dbus PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA-DEV_DISPLAY_NAME "libelektra-dev")
 	set (CPACK_COMPONENT_LIBELEKTRA-DEV_DESCRIPTION "This package contains the development files for the main Elektra library.")
@@ -139,58 +215,72 @@
 	set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DISPLAY_NAME "libelektra4-zeromq")
 	set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DESCRIPTION "This package contains the 'zeromq' plugins.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DEPENDS "libelektra4")
+	check_component_dependencies(zeromqrecv libelektra4-zeromq PLUGIN ADDITIONAL_DEPENDENCIES zeromqsend)

 	set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DISPLAY_NAME "libelektra4-xmltool")
 	set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DESCRIPTION "This package contains the 'xmltool' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DEPENDS "libelektra4")
+	check_component_dependencies(xmltool libelektra4-xmltool PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DISPLAY_NAME "libelektra4-xerces")
 	set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DESCRIPTION "This package contains the 'xerces' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DEPENDS "libelektra4")
+	check_component_dependencies(xerces libelektra4-xerces PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DISPLAY_NAME "libelektra4-yajl")
 	set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DESCRIPTION "This package contains the 'yajl' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DEPENDS "libelektra4")
+	check_component_dependencies(yajl libelektra4-yajl PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DISPLAY_NAME "libelektra4-crypto")
 	set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DESCRIPTION "This package contains the crypto plugins.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DEPENDS "libelektra4")
+	check_component_dependencies(crypto libelektra4-crypto PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DISPLAY_NAME "libelektra4-curl")
 	set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DESCRIPTION "This package contains the 'curlget' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DEPENDS "libelektra4")
+	check_component_dependencies(curlget libelektra4-curl PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DISPLAY_NAME "libelektra4-journald")
 	set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DESCRIPTION "This package contains the 'journald' plugins.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DEPENDS "libelektra4")
+	check_component_dependencies(journald libelektra4-journald PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DISPLAY_NAME "libelektra4-yamlcpp")
 	set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DESCRIPTION "This package contains the 'yamlcpp' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DEPENDS "libelektra4")
+	check_component_dependencies(yamlcpp libelektra4-yamlcpp PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DISPLAY_NAME "libelektra4-java")
 	set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DESCRIPTION "This package contains the 'jni' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DEPENDS "libelektra4" "java-elektra")
+	check_component_dependencies(jni libelektra4-java PLUGIN)

 	set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DISPLAY_NAME "libelektra4-lua")
 	set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DESCRIPTION "This package contains the 'lua' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DEPENDS "libelektra4")
+	check_component_dependencies(lua libelektra4-lua PLUGIN)

 	set (CPACK_COMPONENT_JAVA-ELEKTRA_DISPLAY_NAME "java-elektra")
 	set (CPACK_COMPONENT_JAVA-ELEKTRA_DESCRIPTION "This package contains the Java bindings.")
 	set (CPACK_COMPONENT_JAVA-ELEKTRA_DEPENDS "libelektra4")
+	check_component_dependencies(jna java-elektra BINDING)

 	set (CPACK_COMPONENT_LUA-ELEKTRA_DISPLAY_NAME "lua-elektra")
 	set (CPACK_COMPONENT_LUA-ELEKTRA_DESCRIPTION "This package contains the Lua bindings.")
 	set (CPACK_COMPONENT_LUA-ELEKTRA_DEPENDS "libelektra4")
+	check_component_dependencies(lua lua-elektra BINDING)

 	set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DISPLAY_NAME "python3-elektra")
 	set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DESCRIPTION "This package contains the Python 3 bindings.")
 	set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DEPENDS "libelektra4")
+	check_component_dependencies(python python3-elektra BINDING)

 	set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DISPLAY_NAME "libelektra4-python")
 	set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DESCRIPTION "This package contains the 'python' plugin.")
 	set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DEPENDS "libelektra4" "python3-elektra")
+	check_component_dependencies(python libelektra4-python PLUGIN)

 	set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DISPLAY_NAME "elektra-bin-extra")
 	set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DESCRIPTION
@@ -200,6 +290,7 @@
 	set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DISPLAY_NAME "elektra-qt-gui")
 	set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DESCRIPTION "This package contains a Qt-based graphical interface for Elektra.")
 	set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DEPENDS "libelektra4")
+	check_component_dependencies(qt-gui elektra-qt-gui TOOL)

 	set (CPACK_COMPONENT_ELEKTRA-TESTS_DISPLAY_NAME "elektra-tests")
 	set (CPACK_COMPONENT_ELEKTRA-TESTS_DESCRIPTION "This package contains the Elektra test suite.")
@@ -210,7 +301,7 @@

 	set (CPACK_COMPONENT_LIBELEKTRA4-ALL_DISPLAY_NAME "libelektra4-all")
 	set (CPACK_COMPONENT_LIBELEKTRA4-ALL_DESCRIPTION
-	     "This package contains extra command line utilities for Elektra written in non-shell languages like python.")
+	     "This package provides the dependencies for all Elektra packages.")
 	set (
 		CPACK_COMPONENT_LIBELEKTRA4-ALL_DEPENDS
 		"libelektra4"
@@ -240,6 +331,17 @@
 	set (CPACK_COMPONENT_ELEKTRA-MISC_DISPLAY_NAME "elektra-misc")
 	set (CPACK_COMPONENT_ELEKTRA-MISC_DESCRIPTION "This package contains all files not part of any of the released Elektra packages.")

+	# exclude components for package generation where dependencies are not fulfilled.
+	foreach(component ${EXCLUDED_COMPONENTS})
+		list (REMOVE_ITEM PACKAGES ${component})
+	endforeach(component)
+	# remove libelektra4-all package if a component is excluded
+	if (EXCLUDED_COMPONENTS)
+		list (REMOVE_ITEM PACKAGES libelektra4-all)
+		string (REPLACE ";" ", " EXCLUDED_COMPONENTS_STR "${EXCLUDED_COMPONENTS}")
+		message (STATUS "Excluding libelektra4-all because following components are excluded: ${EXCLUDED_COMPONENTS_STR}".)
+		list (APPEND EXCLUDED_COMPONENTS libelektra4-all)
+	endif()
 	# For Debian-based distros we want to create DEB packages.
 	if ("${OS_NAME}" MATCHES "Ubuntu|Debian")
 		set (DEBIAN_DBG_PACKAGE_NAMES "")
@@ -250,7 +352,6 @@
 		endforeach ()
 		string (REPLACE ";" ", " DEBIAN_DBG_PACKAGE_NAMES_STR "${DEBIAN_DBG_PACKAGE_NAMES}")

-		# needed by ifs below
 		include (PackagingDebian)

 	elseif ("${OS_NAME}" MATCHES "Fedora|CentOS")


gnuinstall should not imply rpath

gnuinstall should not imply rpath

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -228,7 +228,7 @@
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # point to directories outside the build tree to the install RPATH

 # Check whether to add RPATH to the installation (the build tree always has the RPATH enabled)
-if(rpath OR gnuinstall)
+if(rpath)
   set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) # install LIBDIR
   set(CMAKE_SKIP_INSTALL_RPATH FALSE)          # don't skip the full RPATH for the install tree
 elseif(APPLE)


Re-enable several default build options on Windows

Don't turn OFF builtin_tbb, dataframe, imt, roofit, and tmva by default on Windows

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -305,17 +305,12 @@

 #---Changes in defaults due to platform-------------------------------------------------------
 if(WIN32)
-  set(builtin_tbb_defvalue OFF)
-  set(dataframe_defvalue OFF)
   set(davix_defvalue OFF)
-  set(imt_defvalue OFF)
   set(memstat_defvalue OFF)
   set(pyroot_legacy_defvalue OFF)
-  set(roofit_defvalue OFF)
   set(roottest_defvalue OFF)
   set(runtime_cxxmodules_defvalue OFF)
   set(testing_defvalue OFF)
-  set(tmva_defvalue OFF)
   set(vdt_defvalue OFF)
   set(x11_defvalue OFF)
   set(xrootd_defvalue OFF)


RootBuildOptions.cmake: drop removed table option

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -231,7 +231,6 @@
  set(roofit_defvalue ON)
  set(root7_defvalue ON)
  set(shadowpw_defvalue ON)
- set(table_defvalue ON)
  set(unuran_defvalue ON)
  set(vc_defvalue ON)
  set(vmc_defvalue ON)


DOC: allow the configure step to print detected Qt5 version

--- Modules/ThirdParty/Qt/otb-module-init.cmake
+++ Modules/ThirdParty/Qt/otb-module-init.cmake
@@ -24,3 +24,5 @@
 find_package(Qt5OpenGL REQUIRED)
 find_package(Qt5LinguistTools)
 mark_as_advanced( QT_QMAKE_EXECUTABLE )
+
+set(QT_VERSION_STRING ${Qt5Core_VERSION})