Remove file as its two functions were not used anywhere

--- CMake/CPackFunctions.cmake
+++ CMake/CPackFunctions.cmake
@@ -1,408 +0,0 @@
-#
-# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
-#
-# This file is part of Orfeo Toolbox
-#
-#     https://www.orfeo-toolbox.org/
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#RK: two packages.
-#function(create_cpack_config application)
-function(create_cpack_config)
-  #should we handle this when calling function ?
-  #for now mapla has no specific version or it is same as monteverdi
-  SET(CPACK_PACKAGE_VERSION "${Monteverdi_VERSION_MAJOR}.${Monteverdi_VERSION_MINOR}.${Monteverdi_VERSION_PATCH}${Monteverdi_VERSION_SUFFIX}")
-  SET(CPACK_PACKAGE_VERSION_MAJOR "${Monteverdi_VERSION_MAJOR}")
-  SET(CPACK_PACKAGE_VERSION_MINOR "${Monteverdi_VERSION_MINOR}")
-  SET(CPACK_PACKAGE_VERSION_PATCH "${Monteverdi_VERSION_PATCH}")
-  #monteverdi short version string - eg: 3.0.0-beta
-  SET(PACKAGE_SHORT_VERSION_STRING ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}${Monteverdi_VERSION_SUFFIX})
-
-  if(WIN32)
-    set(arch_prefix win32)
-    set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
-    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-      set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
-      set(arch_prefix win64)
-    endif()
-    SET(CPACK_GENERATOR "NSIS")
-    SET(CPACK_NSIS_MODIFY_PATH OFF)
-        SET(CPACK_NSIS_CONTACT "contact@orfeo-toolbox.org")
-
-    #RK: two packages.
-    #STRING(TOLOWER ${application} application_)
-    #SET(EXEFILE_NAME "${application_}.exe")
-    #SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\${EXEFILE_NAME}")
-    #SET(BATFILE_NAME "${application_}.bat")
-    #SET(CPACK_NSIS_MENU_LINKS "bin/${BATFILE_NAME}" "${application}" )
-    # SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
-    # "Delete \\\"$SMPROGRAMS\\\\${application}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}\\\\${application}.lnk\\\"  ")
-    # SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
-    #   "CreateShortCut \\\"$SMPROGRAMS\\\\${application}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}\\\\${application}.lnk\\\" \\\"$INSTDIR\\\\bin\\\\${BATFILE_NAME}\\\" \\\" \\\" \\\"$INSTDIR\\\\bin\\\\${EXEFILE_NAME}\\\"
-    # ")
-
-SET(application "Monteverdi")
-SET(startmenufolder "${application}-${PACKAGE_SHORT_VERSION_STRING}")
-
-#set(CPACK_NSIS_DEFINES "  !define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"${startmenufolder} (${arch_prefix})\\\"")
-#SET(CPACK_PACKAGE_EXECUTABLES "monteverdi.bat" "Monteverdi")
-#SET(CPACK_CREATE_DESKTOP_LINKS "monteverdi.bat" )
-
-SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\monteverdi.exe")
-SET(CPACK_PACKAGE_ICON   "${Monteverdi_SOURCE_DIR}\\\\Data\\\\Icons\\\\monteverdi.ico")
-SET(CPACK_NSIS_CREATE_ICONS "CreateShortCut '$SMPROGRAMS\\\\${startmenufolder}\\\\Monteverdi.lnk'  '$INSTDIR\\\\bin\\\\monteverdi.bat' ")
-SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\${startmenufolder}\\\\Mapla.lnk'     '$INSTDIR\\\\bin\\\\mapla.bat' ")
-SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "monteverdi.bat")
-SET(CPACK_NSIS_DELETE_ICONS
-      "Delete \\\"$SMPROGRAMS\\\\${startmenufolder}\\\\Monteverdi.lnk\\\" ")
-SET(CPACK_NSIS_DELETE_ICONS_EXTRA
-      "Delete \\\"$SMPROGRAMS\\\\${startmenufolder}\\\\Mapla.lnk\\\" ")
-
-  else(APPLE)
-      set(arch_prefix Darwin)
-     if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-      set(arch_prefix Darwin64)
-    endif()
-    SET(CPACK_GENERATOR "Bundle")
-    SET(CPACK_BUNDLE_ICON "${Monteverdi_SOURCE_DIR}/Packaging/MacOS/Monteverdi.icns" )
-    SET(CPACK_BUNDLE_NAME "${application}-${PACKAGE_SHORT_VERSION_STRING}" )
-    SET(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/Packaging/MacOS/${application}-Info.plist" )
-    SET(CPACK_BUNDLE_STARTUP_COMMAND "${Monteverdi_SOURCE_DIR}/Packaging/MacOS/${application}-StartupCommand" )
-
-  endif()
-
-  #common cpack configurations.
-
-  ##################################
-  ##################################
-  #CAUTION: Be careful when changing values below.#
-  ##################################
-  ##################################
-
-  SET(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-  SET(CPACK_MODULE_PATH "${Monteverdi_SOURCE_DIR}/CMake")
-  SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
-  SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
-  SET(CPACK_PACKAGE_CONTACT "contact@orfeo-toolbox.org")
-  SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
-  SET(CPACK_PACKAGE_DESCRIPTION_FILE "${Monteverdi_SOURCE_DIR}/Description.txt")
-
-  SET(CPACK_RESOURCE_FILE_LICENSE "${Monteverdi_SOURCE_DIR}/Copyright/Copyright.txt")
-  SET(CPACK_OUTPUT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CPackConfig-${application}.cmake")
-  SET(CPACK_NSIS_MUI_ICON    "${Monteverdi_SOURCE_DIR}/Data/Icons/monteverdi.ico")
-  SET(CPACK_NSIS_MUI_UNIICON "${Monteverdi_SOURCE_DIR}/Data/Icons/monteverdi.ico")
-
-  SET(CPACK_COMPONENTS_ALL)
-  LIST(APPEND CPACK_COMPONENTS_ALL  "Resources")
-  LIST(APPEND CPACK_COMPONENTS_ALL "Runtime")
-
-  #RK: two packages
-  #LIST(APPEND CPACK_COMPONENTS_ALL "${application}")
-  LIST(APPEND CPACK_COMPONENTS_ALL "Monteverdi")
-  LIST(APPEND CPACK_COMPONENTS_ALL "Mapla")
-
-  SET(CPACK_COMPONENT_MAPLA_DEPENDS Runtime)
-  SET(CPACK_COMPONENT_MONTEVERDI_DEPENDS Runtime)
-  SET(CPACK_COMPONENT_RUNTIME_DEPENDS Resources)
-
-  SET(CPACK_COMPONENT_RUNTIME_REQUIRED ON)
-  SET(CPACK_COMPONENT_RESOURCES_REQUIRED ON)
-  SET(CPACK_COMPONENT_MAPLA_REQUIRED ON)
-  SET(CPACK_COMPONENT_MONTEVERDI_REQUIRED ON)
-
-  SET(CPACK_COMPONENT_RESOURCES_HIDDEN ON)
-
-  if(APPLE)
-  SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};${application};ALL;/")
-  else(WIN32)
-    SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};ALL;ALL;/")
-  endif()
-  SET(CPACK_PACKAGE_VENDOR "OTB Team")
-
-  SET(CPACK_PACKAGE_NAME "${application}")
-  SET(CPACK_NSIS_DISPLAY_NAME "${application}-${PACKAGE_SHORT_VERSION_STRING}")
-  SET(CPACK_NSIS_PACKAGE_NAME "${application}-${PACKAGE_SHORT_VERSION_STRING}")
-  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${application}-${PACKAGE_SHORT_VERSION_STRING}")
-  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${application}-${PACKAGE_SHORT_VERSION_STRING}")
-  SET(CPACK_PACKAGE_FILE_NAME "${application}-${CPACK_PACKAGE_VERSION}-${arch_prefix}")
-
-  INCLUDE(InstallRequiredSystemLibraries)
-  INCLUDE(CPack)
-
-endfunction(create_cpack_config)
-
-
-
-function(configure_app_package app with_otb_apps)
-
-  string(TOLOWER ${app} EXECUTABLE_NAME)
-  set(APP_QTCONF_DIR bin)
-  set(APP_QTSQLITE_FILENAME qsqlite4.dll)
-  set(APP_QTPLUGINS_DIR lib/qt4/plugins)
-  set(APP_OTBLIBS_DIR lib/otb)
-  set(APP_I18N_DIR lib/qt4/translations)
-  set(APP_DATA_DIR share)
-  set(APP_NAME "\${CMAKE_INSTALL_PREFIX}/bin/${EXECUTABLE_NAME}.exe")
-
-  install(CODE "file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${APP_QTCONF_DIR}/qt.conf\"
-                \"[Paths]
-                  Translations=../lib/qt4/translations
-                  Plugins=../lib/qt4/plugins
-                \")"
-    COMPONENT Runtime)
-
-  install(FILES ${Monteverdi_SOURCE_DIR}/Packaging/Windows/${EXECUTABLE_NAME}.bat
-    DESTINATION bin
-    COMPONENT ${app})
-
-  if(WIN32)
-
-    if(NOT CMAKE_CROSSCOMPILING AND Monteverdi_USE_CPACK)
-
-      file(TO_CMAKE_PATH "$ENV{OSGEO4W_ROOT}" OSGEO4W_ROOT)
-      if(NOT OSGEO4W_ROOT)
-        message(FATAL_ERROR "Cannot generate installer without OSGeo4W environment : OSGEO4W_ROOT")
-      endif(NOT OSGEO4W_ROOT)
-
-      # The following DLL handling is very specific
-      # both to OSGeo4W flavour (32 bit or 64 bit), OSGeo4W package state
-      # and the compiler used to make the Monteverdi installer (VC2010)
-      # Don't expect too much of it without VC2010.
-
-      # For some reason, fixup_bundle won't package the msvc runtime dll
-      # I guess it's because cpack already handles installing the runtime,
-      # but here we build with a particular version of Visual, but
-      # some OSGeo4W dependencies are built upon other runtimes
-      set(MVD2_ADDITIONAL_DLLS
-        ${OSGEO4W_ROOT}/bin/msvcp60.dll
-        ${OSGEO4W_ROOT}/bin/msvcp70.dll
-        ${OSGEO4W_ROOT}/bin/msvcp71.dll
-        ${OSGEO4W_ROOT}/bin/msvcr71.dll
-        ${OSGEO4W_ROOT}/bin/msvcrt.dll)
-
-      # Since an upgrade in OSGeo4W-32bit of libpq (around 2013/10)
-      # libpq depends on two additional libs that cmake
-      # surprisingly miss during package generation
-      # I really don't understand why.
-      # Let's add them manually
-
-      set(MVD2_ADDITIONAL_DLLS
-        ${MVD2_ADDITIONAL_DLLS}
-        ${OSGEO4W_ROOT}/bin/libgcc_s_dw2-1.dll
-        ${OSGEO4W_ROOT}/bin/libiconv-2.dll)
-
-      foreach(dll ${MVD2_ADDITIONAL_DLLS})
-        if (EXISTS ${dll})
-          install( FILES ${dll} DESTINATION bin COMPONENT Runtime )
-        endif()
-      endforeach()
-
-      #RK: two packages
-      # set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${app}")
-      # create_cpack_config(${app})
-
-    endif() #(NOT CMAKE_CROSSCOMPILING AND Monteverdi_USE_CPACK)
-
-
-    # if(CMAKE_CROSSCOMPILING)
-    #   if(NOT DEFINED MXE_TARGET_DIR)
-    #     message(FATAL_ERROR "MXE_TARGET_DIR is missing")
-    #   endif()
-    #   if(MXE_TARGET_DIR MATCHES "i686")
-    #     set(mxearch x86)
-    #     set(archive_name ${app}-${Monteverdi_VERSION_STRING}-win32)
-    #   elseif(MXE_TARGET_DIR MATCHES "x86_64")
-    #     set(mxearch x64)
-    #     set(archive_name ${app}-${Monteverdi_VERSION_STRING}-win64)
-    #   endif()
-
-    #   execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_INSTALL_PREFIX}/${archive_name}")
-
-    #   get_filename_component(mxeroot ${MXE_TARGET_DIR} PATH)
-    #   get_filename_component(mxeroot ${mxeroot} PATH)
-    #   file(WRITE "${CMAKE_BINARY_DIR}/_mingw/${app}/CMakeLists.txt"
-    #     "cmake_minimum_required(VERSION 2.6)
-    #    include(CMakeParseArguments)
-    #    set(Monteverdi_SOURCE_DIR \"${Monteverdi_SOURCE_DIR}\")
-    #    set(OTB_MODULES_DIR \"${OTB_MODULES_DIR}\")
-    #    set(QT_PLUGINS_DIR \"${QT_PLUGINS_DIR}\")
-    #    set(QT_TRANSLATIONS_DIR \"${QT_TRANSLATIONS_DIR}\")
-    #    set(Monteverdi_BINARY_DIR \"${CMAKE_BINARY_DIR}\")
-    #    set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")
-    #    set(Monteverdi_INSTALL_DATA_DIR \"${Monteverdi_INSTALL_DATA_DIR}\")
-    #     include(${CMAKE_SOURCE_DIR}/CMake/MinGWPackage.cmake)
-    #     include(${CMAKE_SOURCE_DIR}/CMake/CPackFunctions.cmake)
-    #     package_mingw(
-    #     ARCH \"${mxearch}\"
-    #     MXEROOT \"${mxeroot}\"
-    #     PREFIX_DIR \"${archive_name}\"
-    #     PEFILES \"${APP_NAME}\"
-    #     NEEDS_OTB_APPS ${with_otb_apps}
-    #     SEARCHDIRS \"\")")
-
-    #   set(GDAL_DATA ${MXE_TARGET_DIR}/share/gdal)
-
-    #   add_custom_target(configure-${app}-mingw-package
-    #     COMMAND ${CMAKE_COMMAND}
-    #     "${CMAKE_BINARY_DIR}/_mingw/${app}"
-    #     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/_mingw/${app}")
-
-    #   add_custom_target(make-${app}-mingw-package
-    #     COMMAND ${CMAKE_COMMAND}
-    #     "--build" "${CMAKE_BINARY_DIR}/_mingw/${app}" "--target" "install"
-    #     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/_mingw/${app}"
-    #     DEPENDS configure-${app}-mingw-package)
-
-    #   find_program(ZIP_EXECUTABLE zip)
-
-    #   if(ZIP_EXECUTABLE)
-    #     add_custom_target(create-${app}-mingw-archive
-    #       COMMAND ${ZIP_EXECUTABLE} "-r" "${CMAKE_BINARY_DIR}/${archive_name}.zip" "${archive_name}"
-    #       WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
-    #       DEPENDS make-${app}-mingw-package)
-    #   else()
-    #     message(FATAL_ERROR "Cannot find zip executable. Please add it to your path")
-    #   endif()
-
-    # endif() # (CMAKE_CROSSCOMPILING)
-
-  endif(WIN32)
-
-  if(APPLE)
-    set(APP_NAME "\${CMAKE_INSTALL_PREFIX}/${app}.app")
-    set(APP_PREFIX_DIR ${app}.app/Contents) #osx prefix
-    set(APP_QTCONF_DIR ${APP_PREFIX_DIR}/Resources)
-    set(APP_QTSQLITE_FILENAME libqsqlite.dylib)
-    set(APP_QTPLUGINS_DIR ${APP_PREFIX_DIR}/plugins)
-    set(APP_OTBLIBS_DIR ${APP_PREFIX_DIR}/MacOS/otb)
-    set(APP_I18N_DIR ${APP_PREFIX_DIR}/Resources/otb/translations) #translations
-    set(APP_DATA_DIR ${APP_PREFIX_DIR}/Resources)
-
-    install(FILES ${CMAKE_SOURCE_DIR}/Packaging/MacOS/Monteverdi.icns
-      DESTINATION ${APP_PREFIX_DIR}/Resources
-      COMPONENT Resources)
-
-    install(FILES ${CMAKE_BINARY_DIR}/Code/Application/${app}/${EXECUTABLE_NAME}_start
-      DESTINATION ${APP_PREFIX_DIR}/MacOS
-      PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-      COMPONENT Runtime)
-
-    install(CODE
-      "file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${APP_QTCONF_DIR}/qt.conf\"
-     \"[Paths]
-       Translations=Resources/otb/translations
-       Plugins=plugins
-     \")"
-      COMPONENT Runtime)
-
-    file(GLOB APP_QM_TRANSLATIONS /*.qm) # qm files
-
-    file(GLOB APP_TS_FILES ${CMAKE_SOURCE_DIR}/i18n/*.ts) # qm files
-
-    foreach(APP_TS_FILE ${APP_TS_FILES})
-      get_filename_component(APP_TS_FILENAME ${APP_TS_FILE} NAME_WE)
-      install(FILES ${CMAKE_BINARY_DIR}/i18n/${APP_TS_FILENAME}.qm
-        DESTINATION ${APP_PREFIX_DIR}/${Monteverdi_INSTALL_DATA_DIR}/i18n/
-        COMPONENT Resources)
-    endforeach()
-
-    set(CPACK_BINARY_DRAGNDROP ON)
-
-  endif(APPLE)
-
-#   ################################################################################
-#   ################################################################################
-#   ################### END OF PLATFORM SPECIFIC CMAKE VARIABLES ###################
-#   ################################################################################
-#   ################################################################################
-
-#   ####################### install sqldrivers plugin #######################
-
-#   install(FILES ${QT_PLUGINS_DIR}/sqldrivers/${APP_QTSQLITE_FILENAME}
-#     DESTINATION ${APP_QTPLUGINS_DIR}/sqldrivers
-#     COMPONENT Runtime)
-
-#   ####################### install translations #######################
-#   get_qt_translation_files(QT_TRANSLATIONS_FILES)
-
-#   install(FILES ${QT_TRANSLATIONS_FILES}
-#     DESTINATION ${APP_I18N_DIR}
-#     COMPONENT Resources)
-
-#   ####################### install GDAL data #######################
-
-
-#   if(NOT DEFINED GDAL_DATA)
-#     file(TO_CMAKE_PATH "$ENV{GDAL_DATA}" GDAL_DATA)
-#     if(NOT GDAL_DATA)
-#       if(Monteverdi_USE_CPACK)
-#         message(FATAL_ERROR "Cannot generate installer without GDAL_DATA : GDAL_DATA")
-#       else()
-#         message(WARNING "Cannot generate installer without GDAL_DATA : GDAL_DATA")
-#       endif()
-#     endif()
-#   endif() #(DEFINED GDAL_DATA)
-#   # Need to include csv files provided with GDAL that contains some needed EPSG definitions
-
-#   install(DIRECTORY ${GDAL_DATA}
-#     DESTINATION ${APP_DATA_DIR}
-#     COMPONENT Resources)
-
-#   ####################### Check otb applications #######################
-
-#   if(with_otb_apps)
-# #      message(FATAL_ERROR "No OTB-applications detected")
-#     file(GLOB OTB_APPS_LIST ${OTB_MODULES_DIR}/../../../otb/applications/otbapp_*${CMAKE_SHARED_LIBRARY_SUFFIX}) # /lib/otb
-#     if(NOT OTB_APPS_LIST)
-#       message(FATAL_ERROR "No OTB-applications detected")
-#     endif()
-
-#     ## otb apps dir /lib/otb/applications
-#     install(DIRECTORY "${OTB_MODULES_DIR}/../../../otb/applications"
-#       DESTINATION ${APP_OTBLIBS_DIR}
-#       COMPONENT Runtime)
-
-#   endif(with_otb_apps)
-
-#   ## directories to look for dependencies
-#   set(SEARCH_DIRS)
-#   list(APPEND SEARCH_DIRS "${QT_PLUGINS_DIR}/sqldrivers")
-#   list(APPEND SEARCH_DIRS "${ITK_MODULES_DIR}/../../../")
-#   list(APPEND SEARCH_DIRS "${OTB_MODULES_DIR}/../../../")
-#   list(APPEND SEARCH_DIRS "${CMAKE_INSTALL_PREFIX}/lib/otb/")
-
-#   ####################### install fixup_bundle code #######################
-#   ## fixup_bundle code
-#   if(NOT CMAKE_CROSSCOMPILING)
-#     if(with_otb_apps)
-#       install(CODE
-#         "file(GLOB APP_LIBS \"${CMAKE_INSTALL_PREFIX}/${APP_OTBLIBS_DIR}/applications/otbapp_*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
-#         list(APPEND APP_LIBS \"${CMAKE_INSTALL_PREFIX}/${APP_QTPLUGINS_DIR}/sqldrivers/${APP_QTSQLITE_FILENAME}\")
-#         include(BundleUtilities)
-#         set(BU_CHMOD_BUNDLE_ITEMS ON)
-#         fixup_bundle(\"${APP_NAME}\" \"\${APP_LIBS}\" \"${SEARCH_DIRS}\")"
-#         COMPONENT ${app})
-
-#     else() #(with_otb_apps)
-#       install(CODE
-#         "file(GLOB APP_LIBS \"${CMAKE_INSTALL_PREFIX}/${APP_QTPLUGINS_DIR}/sqldrivers/${APP_QTSQLITE_FILENAME}\")
-#         include(BundleUtilities)
-#         set(BU_CHMOD_BUNDLE_ITEMS ON)
-#         fixup_bundle(\"${APP_NAME}\" \"\${APP_LIBS}\" \"${SEARCH_DIRS}\")"
-#         COMPONENT ${app})
-#     endif() #(with_otb_apps)
-#   endif() #(NOT CMAKE_CROSSCOMPILING)
-endfunction(configure_app_package)
-


Use default project-config.jam file on macOS

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -197,13 +197,17 @@

             using gcc : : /usr/bin/gcc-7.3 ;

-          We use the stream editor sed for the replacement but as macOS is
+          We use the stream editor sed for the replacement but since macOS is
           based on BSD Unix, we use the limited but portable BSD syntax
           instead of the more powerful GNU syntax. We also use | instead of
           the more commonly used / separator for sed because the replacement
-          contains slashes. ]]
-
-      if(toolset)
+          contains slashes.
+
+          2021/06/15: The custom project-config.jam does not work well with
+          SDK paths on macOS anymore, so we use a custom project-config.jam
+          only on Linux for now. ]]
+
+      if(toolset AND NOT APPLE)
         set(configure_cmd sed -i.backup "\
 s|\
 using[[:space:]][[:space:]]*${toolset}[[:space:]]*$<SEMICOLON>|\


BUGFIX: set cmake policy for CMP0054 to OLD

--- CMakeModules/Version.cmake
+++ CMakeModules/Version.cmake
@@ -1,12 +1,19 @@
 #
 # Make a version file that includes the Forge version and git revision
 #
+CMAKE_POLICY(PUSH)
+
+IF("${CMAKE_VERSION}" VERSION_GREATER "3.1" OR "${CMAKE_VERSION}" VERSION_EQUAL "3.1")
+    CMAKE_POLICY(SET CMP0054 OLD)
+ENDIF()
+
 SET(FG_VERSION_MAJOR "1")
 SET(FG_VERSION_MINOR "0")
 SET(FG_VERSION_PATCH "beta")

 SET(FG_VERSION "${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}")
 SET(FG_API_VERSION_CURRENT ${FG_VERSION_MAJOR}${FG_VERSION_MINOR})
+

 # From CMake 3.0.0 CMAKE_<LANG>_COMPILER_ID is AppleClang for OSX machines
 # that use clang for compilations
@@ -36,3 +43,5 @@
     ${CMAKE_MODULE_PATH}/version.h.in
     ${CMAKE_SOURCE_DIR}/include/fg/version.h
 )
+
+CMAKE_POLICY(POP)


BUG: missing paren

BUG: missing paren

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -109,7 +109,7 @@
 # Include directories from the PQXX build tree.
 IF(OTB_USE_PQXX)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
-  	${PQXX_INCLUDE_DIR}
+  	${PQXX_INCLUDE_DIR})
 ENDIF(OTB_USE_PQXX)


public no longer has anonymous ftp.

public no longer has anonymous ftp.

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -1,8 +1,8 @@
 # Dart server to submit results (used by client)
 SET (DROP_SITE "public.kitware.com")
 SET (DROP_LOCATION "/incoming")
-SET (DROP_SITE_USER "anonymous")
-SET (DROP_SITE_PASSWORD "vtk-tester@somewhere.com")
+SET (DROP_SITE_USER "ftpuser")
+SET (DROP_SITE_PASSWORD "public")
 SET (TRIGGER_SITE
        "http://${DROP_SITE}/cgi-bin/Submit-vtk-TestingResults.pl")


ENH: quick stab at a rollup button

ENH: quick stab at a rollup button

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -14,6 +14,7 @@
 SET (PROJECT_URL "http://www.visualizationtoolkit.org/")

 # Dart server configuration
+SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/vtk-rollup-dashboard.sh")
 SET (CVS_WEB_URL "http://${DROP_SITE}/cgi-bin/cvsweb.cgi/VTK/")
 SET (CVS_WEB_CVSROOT "VTK")
 SET (USE_DOXYGEN "On")


cmake-unit: Manually dereference VALUE when comparing strings

Earlier cmake versions do not automatically dereference the
right-hand variable.

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -1099,7 +1099,7 @@

             endif ()

-        elseif ("${${VARIABLE}}" STR${COMPARATOR} VALUE)
+        elseif ("${${VARIABLE}}" STR${COMPARATOR} "${VALUE}")

             set (${RESULT_VARIABLE} TRUE PARENT_SCOPE)

@@ -1107,7 +1107,7 @@

     elseif (TYPE MATCHES "${INTEGER_TYPE}")

-        if ("${${VARIABLE}}" ${COMPARATOR} VALUE)
+        if ("${${VARIABLE}}" ${COMPARATOR} "${VALUE}")

             set (${RESULT_VARIABLE} TRUE PARENT_SCOPE)


Issue #16: Formatting tweaks.

Issue #16: Formatting tweaks.


Fixed MSVC cmake build

Fixed MSVC cmake build

--- generate/cmake/find.cmake
+++ generate/cmake/find.cmake
@@ -42,12 +42,12 @@
 find_package(OpenGL  REQUIRED)
 find_package(Threads REQUIRED)

-if( UNIX )
+if( WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES GNU )
+   find_package(Boost 1.48.0 REQUIRED COMPONENTS system regex thread_win32 chrono filesystem )
+else()
    find_package(X11   REQUIRED)
    find_package(Boost 1.48.0 REQUIRED COMPONENTS system regex thread chrono filesystem )
-elseif( WIN32 )
-   find_package(Boost 1.48.0 REQUIRED COMPONENTS system regex thread_win32 chrono filesystem )
-endif( UNIX )
+endif( WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES GNU )

 set(ENGINE_LINK


Fix the capnproto variable setting and linking issue.

--- cmake/External/capnproto.cmake
+++ cmake/External/capnproto.cmake
@@ -44,12 +44,24 @@
       LOG_INSTALL 1
       )

+    # This will set several system default installaion dirs which capnproto is using.
+    # It's important especially for LIBDIR which varies from platform to platform.
+    include(GNUInstallDirs)
+
     set(CAPNP_FOUND TRUE)
-    set(CAPNP_EXECUTABLE ${capnp_INSTALL}/bin/capnp)
-    set(CAPNPC_CXX_EXECUTABLE ${capnp_INSTALL}/bin/capnpc-c++)
-    set(CAPNP_INCLUDE_DIRS ${capnp_INSTALL}/include)
-    set(CAPNP_INCLUDE_DIRECTORY ${capnp_INSTALL}/include)
+    set(CAPNP_EXECUTABLE ${capnp_INSTALL}/${CMAKE_INSTALL_BINDIR}/capnp)
+    set(CAPNPC_CXX_EXECUTABLE ${capnp_INSTALL}/${CMAKE_INSTALL_BINDIR}/capnpc-c++)
+    set(CAPNP_INCLUDE_DIRS ${capnp_INSTALL}/${CMAKE_INSTALL_INCLUDEDIR})
+    set(CAPNP_INCLUDE_DIRECTORY ${capnp_INSTALL}/${CMAKE_INSTALL_INCLUDEDIR})
     set(CAPNP_EXTERNAL TRUE)
+    set(CAPNP_LIBRARIES
+      ${capnp_INSTALL}/${CMAKE_INSTALL_LIBDIR}/libcapnp-rpc.a
+      ${capnp_INSTALL}/${CMAKE_INSTALL_LIBDIR}/libcapnp.a
+      ${capnp_INSTALL}/${CMAKE_INSTALL_LIBDIR}/libkj-async.a
+      ${capnp_INSTALL}/${CMAKE_INSTALL_LIBDIR}/libkj.a
+      ${CMAKE_THREAD_LIBS_INIT}
+    )
+    set(CAPNP_LIBRARY_DIRS ${capnp_INSTALL}/${CMAKE_INSTALL_LIBDIR})

     list(APPEND external_project_dependencies capnp)


forgot to remove the tag

forgot to remove the tag

--- cmake/modules/BuildGTest.cmake
+++ cmake/modules/BuildGTest.cmake
@@ -20,7 +20,7 @@
   ExternalProject_Add(
     gtest
     GIT_REPOSITORY https://github.com/google/googletest.git
-    GIT_TAG 045e7f9ee4f969ac1a3fe428f79c4b880f0aff43
+    #GIT_TAG 045e7f9ee4f969ac1a3fe428f79c4b880f0aff43
     GIT_SHALLOW true

     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${GTEST_INSTALL_DIR} -DCMAKE_CXX_FLAGS=${ADD_CXX_FLAGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_GMOCK=${BUILD_GMOCK} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -Dgmock_build_tests=OFF


CMakeLists.txt: Make pkg-config packages optional

Signed-off-by: Andrew Andrianov <02e0a999c50b1f88df7a8f5a04e1b76b35ea6a88@ncrmnt.org>

--- cmake/modules/FindHidApi.cmake
+++ cmake/modules/FindHidApi.cmake
@@ -30,29 +30,27 @@

 FIND_PACKAGE(PkgConfig)
 if (PKGCONFIG_FOUND)
-  PKG_CHECK_MODULES(HIDAPI hidapi-libusb REQUIRED)
-  if (CMAKE_BUILD_TYPE MATCHES "StaticRelease")
-    PKG_CHECK_MODULES(LIBUSB libusb-1.0 REQUIRED)
-    PKG_CHECK_MODULES(UDEV libudev REQUIRED)
+  PKG_CHECK_MODULES(HIDAPI hidapi-libusb)
+  if (HIDAPI_FOUND AND CMAKE_BUILD_TYPE MATCHES "StaticRelease")
+    PKG_CHECK_MODULES(LIBUSB libusb-1.0)
+    PKG_CHECK_MODULES(UDEV libudev)
   endif()
-  set(HIDAPI_STATIC_LIBRARIES "-Wl,-Bstatic ${HIDAPI_LDFLAGS} ${LIBUSB_LDFLAGS} -Wl,-Bdynamic  ${UDEV_LDFLAGS} -lpthread")
+  set(HIDAPI_STATIC_LIBRARIES "-Wl,-Bstatic ${HIDAPI_LDFLAGS} ${LIBUSB_LDFLAGS} -Wl,-Bdynamic ${UDEV_LDFLAGS} -lpthread")
 endif()

 if((NOT HIDAPI_FOUND))
   message(STATUS "hidapi not found via pkg-config, trying find_library()")
   find_library(HIDAPI NAMES hidapi-hidraw hidapi-libusb hidapi)
   if (NOT HIDAPI)
-    message(FATAL_ERROR "Failed to find hidapi")
+    message(STATUS "Failed to find system installation of hidapi")
+  else()
+    message(STATUS "Found HIDAPI: ${HIDAPI}")
+    set(HIDAPI_LIBRARIES "${HIDAPI}")
+    set(HIDAPI_STATIC_LIBRARIES "${HIDAPI}")
+    set(HIDAPI_FOUND YES)
+    find_path(HIDAPI_INCLUDE_DIRS hidapi/hidapi.h)
+    message(STATUS "Include files in: ${HIDAPI_INCLUDE_DIRS}")
   endif()
-
-  message(STATUS "Found HIDAPI: ${HIDAPI}")
-  set(HIDAPI_LIBRARIES "${HIDAPI}")
-  set(HIDAPI_STATIC_LIBRARIES "${HIDAPI}")
-  set(HIDAPI_FOUND YES)
-endif()
-
-if (CMAKE_BUILD_TYPE MATCHES "StaticRelease")
-
 endif()

 if (NOT HIDAPI_FOUND)


Fix the Sqlite detection.

Fix the Sqlite detection.

svn path=/trunk/kdesupport/akonadi/; revision=1106741

--- cmake/modules/FindSqlite.cmake
+++ cmake/modules/FindSqlite.cmake
@@ -5,46 +5,58 @@
 #  SQLITE_INCLUDE_DIR - the Sqlite include directory
 #  SQLITE_LIBRARIES - Link these to use Sqlite
 #  SQLITE_DEFINITIONS - Compiler switches required for using Sqlite
+#  SQLITE_MIN_VERSION - The minimum SQLite version
+#
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 #
-
-
 # Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
+# Copyright (c) 2010, Christophe Giboudeaux, <cgiboudeaux@gmail.com>
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(NOT SQLITE_MIN_VERSION)
+  set(SQLITE_MIN_VERSION "3.6.16")
+endif(NOT SQLITE_MIN_VERSION)

 if ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES )
    # in cache already
    SET(Sqlite_FIND_QUIETLY TRUE)
 endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES )

-# use pkg-config to get the directories and then use these values
-# in the FIND_PATH() and FIND_LIBRARY() calls
-#if( NOT WIN32 )
-#  find_package(PkgConfig)
-#
-#  pkg_check_modules(PC_SQLITE QUIET sqlite3)
-#
-#  set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER})
-#endif( NOT WIN32 )
+find_path(SQLITE_INCLUDE_DIR
+          NAMES sqlite3.h
+         )

-FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h
-  PATHS
-  ${PC_SQLITE_INCLUDEDIR}
-  ${PC_SQLITE_INCLUDE_DIRS}
-)
+find_library(SQLITE_LIBRARIES
+             NAMES sqlite3
+            )

-FIND_LIBRARY(SQLITE_LIBRARIES NAMES sqlite3
-  PATHS
-  ${PC_SQLITE_LIBDIR}
-  ${PC_SQLITE_LIBRARY_DIRS}
-)
+if(SQLITE_INCLUDE_DIR)
+  file(READ ${SQLITE_INCLUDE_DIR}/sqlite3.h SQLITE3_H_CONTENT)
+  string(REGEX MATCH "SQLITE_VERSION[ ]*\"[0-9.]*\"\n" SQLITE_VERSION_MATCH "${SQLITE3_H_CONTENT}")
+
+  if(SQLITE_VERSION_MATCH)
+    string(REGEX REPLACE ".*SQLITE_VERSION[ ]*\"(.*)\"\n" "\\1" SQLITE_VERSION ${SQLITE_VERSION_MATCH})
+
+    if(SQLITE_VERSION VERSION_LESS "${SQLITE_MIN_VERSION}")
+        message(STATUS "Sqlite ${SQLITE_VERSION} was found, but at least version ${SQLITE_MIN_VERSION} is required")
+        set(SQLITE_VERSION_OK FALSE)
+    else(SQLITE_VERSION VERSION_LESS "${SQLITE_MIN_VERSION}")
+        set(SQLITE_VERSION_OK TRUE)
+    endif(SQLITE_VERSION VERSION_LESS "${SQLITE_MIN_VERSION}")
+
+  endif(SQLITE_VERSION_MATCH)
+
+endif(SQLITE_INCLUDE_DIR)

 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )
+find_package_handle_standard_args( Sqlite DEFAULT_MSG
+                                   SQLITE_INCLUDE_DIR
+                                   SQLITE_LIBRARIES
+                                   SQLITE_VERSION_OK )

 # show the SQLITE_INCLUDE_DIR and SQLITE_LIBRARIES variables only in the advanced view
-MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )
+mark_as_advanced( SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )


Revert "Set -fvisibility-inlines-hidden throughout ROOT."

Breaks roottest/python/cpp, and rightfully so: static variables inside inline functions shall share their values across libraries. Which means they must be visible.

This reverts commit df0a8c4b6415a23752b035b5785faa8ddb6c5927.

--- cmake/modules/SetUpMacOS.cmake
+++ cmake/modules/SetUpMacOS.cmake
@@ -63,7 +63,7 @@
   if (CMAKE_COMPILER_IS_GNUCXX)
      message(STATUS "Found GNU compiler collection")

-     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -fvisibility-inlines-hidden")
+     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common")
      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -W -Wall -fsigned-char -fno-common")
      SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy")
      SET(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL -DG__STD_EXCEPTION")
@@ -99,7 +99,7 @@

      message(STATUS "Found LLVM compiler collection")

-     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -fvisibility-inlines-hidden")
+     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments")
      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -W -Wall -fsigned-char -fno-common -Qunused-arguments")
      SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy")
      SET(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL -DG__STD_EXCEPTION")


The system jpeg library may not be compatible with the implementation in mrpt-base for mac, thus force to use built-in jpeg library

--- cmakemodules/script_jpeg.cmake
+++ cmakemodules/script_jpeg.cmake
@@ -1,9 +1,9 @@
 # Check for system jpeglib:
 # ===================================================
 SET(CMAKE_MRPT_HAS_JPEG 1)	# Always present: system or built-in
-IF(MSVC)
+IF(MSVC OR APPLE)
 	SET(CMAKE_MRPT_HAS_JPEG_SYSTEM 0)
-ELSE(MSVC)
+ELSE(MSVC OR APPLE)
 	FIND_PACKAGE(JPEG)
 	IF(JPEG_FOUND)
 			#MESSAGE(STATUS "Found library: jpeg  - Include: ${JPEG_INCLUDE_DIR}")
@@ -15,4 +15,4 @@
 	ELSE(JPEG_FOUND)
 			SET(CMAKE_MRPT_HAS_JPEG_SYSTEM 0)
 	ENDIF(JPEG_FOUND)
-ENDIF(MSVC)
+ENDIF(MSVC OR APPLE)


cmake: Explicitly install fortran libraries only for Slicer on Linux and Windows

On macOS, the libraries should be copied into the package by the fix-up
process.

--- SPHARM-PDM.cmake
+++ SPHARM-PDM.cmake
@@ -41,10 +41,12 @@
 set(${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS "${EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS}" CACHE STRING "List of external projects to install" FORCE)

 # Install fortran runtime libraries
-Fortran_InstallLibrary(
-  FILES ${Fortran_${LAPACKE_Fortran_COMPILER_ID}_RUNTIME_LIBRARIES}
-  DESTINATION ${${LOCAL_PROJECT_NAME}_INSTALL_RUNTIME_DESTINATION} COMPONENT RuntimeLibraries
-  )
+if(DEFINED Slicer_DIR AND NOT APPLE)
+  Fortran_InstallLibrary(
+    FILES ${Fortran_${LAPACKE_Fortran_COMPILER_ID}_RUNTIME_LIBRARIES}
+    DESTINATION ${${LOCAL_PROJECT_NAME}_INSTALL_RUNTIME_DESTINATION} COMPONENT RuntimeLibraries
+    )
+endif()

 #-----------------------------------------------------------------------------
 set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};Runtime;/")


Bumped ParaView SHA...

Bumped ParaView SHA...

--- versions.cmake
+++ versions.cmake
@@ -92,7 +92,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "0b442c68528129a61a0d4a34ba5f3dc9b9736a08")
+  set(_paraview_revision "f33574399b79f32bd733a9d9cba8e4e86f872cbf")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Disable spuriuos intel warning

Disable spuriuos intel warning

--- cmake/setup_compiler_flags_intel.cmake
+++ cmake/setup_compiler_flags_intel.cmake
@@ -54,6 +54,11 @@
 # Enable verbose warnings:
 #
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-w2")
+
+#
+# Disable remarks:
+#
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-diag-disable=remark")

 #
 # Disable some warnings that lead to a lot of false positives:
@@ -133,12 +138,16 @@
 #   -w185 dynamic initialization in unreachable code
 #         When initializing a local variable in code
 #         that is executed only for one specific dimension
+#   -w186 pointless comparison of unsigned integer with zero
+#         The condition of for loops often depends on dim
+#         and happens to evaluate to zero sometimes
 #   -w280 selector expression is constant
 #         When writing 'switch(dim)'
 #
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd111")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd128")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd185")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd186")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd280")


ManageString:STRING_APPEND: Default append separator is now ''

--- Modules/ManageString.cmake
+++ Modules/ManageString.cmake
@@ -272,11 +272,7 @@
     MACRO(STRING_JOIN var delimiter)
 	SET(_ret "")
 	FOREACH(_str ${ARGN})
-	    IF(_ret STREQUAL "")
-		SET(_ret "${_str}")
-	    ELSE(_ret STREQUAL "")
-		SET(_ret "${_ret}${delimiter}${_str}")
-	    ENDIF(_ret STREQUAL "")
+	    STRING_APPEND(_ret "${_str}" "${delimiter}")
 	ENDFOREACH(_str ${ARGN})
 	SET(${var} "${_ret}")
     ENDMACRO(STRING_JOIN var delimiter)


TEST: better name for tests

TEST: better name for tests

--- Modules/Learning/Supervised/test/tests-opencv.cmake
+++ Modules/Learning/Supervised/test/tests-opencv.cmake
@@ -10,11 +10,11 @@
   ${TEMP}/ann_model.txt
   )

-otb_add_test(NAME leTvANNMachineLearningModelRegression COMMAND otbSupervisedTestDriver
+otb_add_test(NAME leTvANNMachineLearningModelRegLinMono COMMAND otbSupervisedTestDriver
   otbNeuralNetworkRegressionLinearMonovariate
   )

-otb_add_test(NAME leTvSVMMachineLearningModelRegression COMMAND otbSupervisedTestDriver
+otb_add_test(NAME leTvSVMMachineLearningModelRegLinMono COMMAND otbSupervisedTestDriver
   otbSVMRegressionLinearMonovariate
   )


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -521,10 +521,19 @@
 					DESTINATION ${BUILD_TYPE}/${_SUFFIX_DESTINATION}
 					CONFIGURATIONS ${BUILD_TYPE})
 	endforeach()
-	add_test(
-		NAME ${_TEST_NAME}_exe
-		COMMAND ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
-		WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE})
+	if (CMAKE_BUILD_TYPE STREQUAL "Release")
+		add_test(
+			NAME ${_TEST_NAME}_exe
+			COMMAND ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
+			COMMAND valgrind --tool=callgrind ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
+			WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE})
+	else()
+		add_test(
+			NAME ${_TEST_NAME}_exe
+			COMMAND ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
+			COMMAND ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
+			WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE})
+	endif()
 	generate_vcxproj_user(${_TEST_NAME})

 endfunction()


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -78,7 +78,7 @@
 		WORKING_DIRECTORY "${ARTIFACTS_PATH}"
 		OUTPUT_VARIABLE RESULT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
 	if(RESULT_VERSION)
-		set(VERSION_REQUEST ${RESULT_VERSION})
+		set(VERSION_REQUEST "${RESULT_VERSION}")
 		set(EXTRA_VERSION "--version=${VERSION_REQUEST}")
 	else()
 		set(VERSION_REQUEST "")
@@ -87,14 +87,14 @@

 	# 2.5. define flags
 	if(NOT DEFINED NOCACHE_LOCAL)
-		set(NO_USE_CACHE_LOCAL FALSE)
-	else()
-		set(NO_USE_CACHE_LOCAL ${NOCACHE_LOCAL})
+		set(NO_USE_CACHE_LOCAL "FALSE")
+	else()
+		set(NO_USE_CACHE_LOCAL "${NOCACHE_LOCAL}")
 	endif()
 	if(NOT DEFINED NOCACHE_REMOTE)
-		set(NO_USE_CACHE_REMOTE FALSE)
-	else()
-		set(NO_USE_CACHE_REMOTE ${NOCACHE_REMOTE})
+		set(NO_USE_CACHE_REMOTE "FALSE")
+	else()
+		set(NO_USE_CACHE_REMOTE "${NOCACHE_REMOTE}")
 	endif()

 	#######################################################
@@ -112,16 +112,15 @@
 		set(VERSION ${VERSION_REQUEST})
 		message("-- need build package ${PACKAGE_NAME} can't get version: ${VERSION_REQUEST}, will be generated.")
 		# avoid remote cache, need build
-		set(NO_USE_CACHE_REMOTE TRUE)
+		set(NO_USE_CACHE_REMOTE "TRUE")
 	endif()
 	#######################################################

 	# 3. si no tengo los ficheros de cmake, los intento descargar
 	set(depends_dir "${CMAKI_PATH}/../depends")
 	set(depends_bin_package "${depends_dir}/${PACKAGE}-${VERSION}")
-	set(depends_package ${CMAKE_PREFIX_PATH}/${PACKAGE}-${VERSION})
-	# if((NOT EXISTS "${depends_package}" OR NOT EXISTS "${depends_bin_package}"))
-	if(NOT EXISTS "${depends_package}" OR ${NO_USE_CACHE_LOCAL})
+	set(depends_package "${CMAKE_PREFIX_PATH}/${PACKAGE}-${VERSION}")
+	if(NOT EXISTS "${depends_package}" OR "${NO_USE_CACHE_LOCAL}")
 		# pido un paquete, en funcion de:
 		#		- paquete
 		#		- version
@@ -130,15 +129,15 @@
 		# Recibo el que mejor se adapta a mis especificaciones
 		# Otra opcion es enviar todos los ficheros de cmake de todas las versiones
 		set(package_uncompressed_file "${CMAKE_PREFIX_PATH}/${PACKAGE}.tmp")
-		set(package_cmake_filename ${PACKAGE}-${VERSION}-${CMAKI_PLATFORM}-cmake.tar.gz)
-		set(http_package_cmake_filename ${CMAKI_REPOSITORY}/download.php?file=${package_cmake_filename})
+		set(package_cmake_filename "${PACKAGE}-${VERSION}-${CMAKI_PLATFORM}-cmake.tar.gz")
+		set(http_package_cmake_filename "${CMAKI_REPOSITORY}/download.php?file=${package_cmake_filename}")
 		# 4. descargo el fichero que se supone tienes los ficheros cmake
-		if(NOT ${NO_USE_CACHE_REMOTE})
+		if(NOT "${NO_USE_CACHE_REMOTE}")
 			cmaki_download_file("${http_package_cmake_filename}" "${package_uncompressed_file}")
 			message("Downloading ${http_package_cmake_filename} ...")
 		endif()
 		# Si no puede descargar el artefacto ya hecho (es que necesito compilarlo y subirlo)
-		if(NOT "${COPY_SUCCESFUL}" OR ${NO_USE_CACHE_REMOTE})
+		if(NOT "${COPY_SUCCESFUL}" OR "${NO_USE_CACHE_REMOTE}")

 			file(REMOVE_RECURSE "${depends_bin_package}")
 			file(REMOVE_RECURSE "${depends_package}")
@@ -265,8 +264,7 @@
 	execute_process(
 		COMMAND python ${ARTIFACTS_PATH}/save_package.py --name=${PACKAGE} --version=${VERSION} --depends=${CMAKI_PATH}/../depends.json
 		WORKING_DIRECTORY "${ARTIFACTS_PATH}"
-		RESULT_VARIABLE artifacts_result
-		)
+		RESULT_VARIABLE artifacts_result)
 	if(artifacts_result)
 		message(FATAL_ERROR "can't save package version: ${PACKAGE} ${VERSION}")
 	endif()
@@ -391,9 +389,9 @@
 			# TODO: use md5sum
 			# cmaki_download_file("${http_package_cmake_filename}" "${package_compessed}" "${md5sum}" )
 			cmaki_download_file("${http_package_cmake_filename}" "${package_compessed}")
-			if( NOT "${COPY_SUCCESFUL}" )
+			if(NOT "${COPY_SUCCESFUL}")
 				file(REMOVE "${package_compessed}")
-			endif( NOT "${COPY_SUCCESFUL}" )
+			endif()
 		else()
 			MESSAGE("Checksum for ${package_name}-${CMAKI_PLATFORM}.tar.gz not found. Rejecting to download an untrustworthy file.")
 			file(REMOVE_RECURSE "${package_dir}")


FindFBX.cmake

FindFBX.cmake

--- Plugin/cmake/FindFBX.cmake
+++ Plugin/cmake/FindFBX.cmake
@@ -13,7 +13,7 @@

 find_library(FBX_LIBRARY
     NAMES fbxsdk
-    PATH_SUFFIXES lib lib/clang/release
+    PATH_SUFFIXES lib lib/clang/release lib/gcc4/x64/release
 )

 mark_as_advanced(FBX_INCLUDE_DIR)


Added MKL include dir

Added MKL include dir

--- lib/smurff-cpp/cmake/scripts/DependenciesConfig.cmake
+++ lib/smurff-cpp/cmake/scripts/DependenciesConfig.cmake
@@ -71,7 +71,9 @@

 macro(configure_mkl)
   message ("Dependency check for MKL (using MKL SDL)...")
-  find_library (MKL_LIBRARIES "mkl_rt" HINTS ENV LD_LIBRARY_PATH)
+  find_library (MKL_LIBRARIES "mkl_rt" HINTS ENV LD_LIBRARY_PATH REQUIRED)
+  find_PATH (MKL_INCLUDE_DIR "mkl.h" HINTS ENV CPATH REQUIRED)
+  include_directories(${MKL_INCLUDE_DIR})
   add_definitions(-DEIGEN_USE_MKL_ALL )

   # since we mix OpenMP and mkl we need to link this
@@ -89,7 +91,6 @@
       else()
           message(ERROR "Unknown threading library ${OpenMP_CXX_LIB_NAMES}")
       endif()
-      set(LAPACK_LIBRARIES ${LAPACK_LIBRARIES} ${INTEL_THREAD_LIBRARY})
   else()
       add_definitions(-DMKL_THREAD_LIBRARY_SEQUENTIAL )
   endif()


cmake: Do not output VTK/ITKv4/CLAPACK build artifacts in common bin directories

Since the dependencies are all build statically, it is not needed to output
the artifacts in the top-level bin directories.

This also streamline the development allowing to clear the "bin" directories
and only rebuild the inner project without having to build all dependencies.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -112,10 +112,6 @@
   CMAKE_MODULE_LINKER_FLAGS:STRING
   CMAKE_GENERATOR:STRING
   CMAKE_EXTRA_GENERATOR:STRING
-  CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH
-  CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH
-  CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH
-  CMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH
   CTEST_NEW_FORMAT:BOOL
   MEMORYCHECK_COMMAND_OPTIONS:STRING
   MEMORYCHECK_COMMAND:PATH
@@ -169,6 +165,10 @@
   COMPILE_ShapeAnalysisModule:BOOL
   COMPILE_ParticleModule:BOOL
   COMPILE_SpharmTool:BOOL
+  CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH
+  CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH
+  CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH
+  CMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH
   INSTALL_RUNTIME_DESTINATION:STRING
   INSTALL_LIBRARY_DESTINATION:STRING
   INSTALL_ARCHIVE_DESTINATION:STRING


[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] Generalised the module_python_add CMake macro to any type of scripts (Shell, Python, Perl, Ruby, etc).

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

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

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

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

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

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

-endmacro (module_python_add)
+endmacro (module_script_add)

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


lua is not used anymore, why use a scripting language for a editor which even officialy doesn'T want to build in unicode support.....

svn path=/trunk/KDE/kdelibs/kate/; revision=588957

--- part/part/config-lua.h.cmake
+++ part/part/config-lua.h.cmake
@@ -1,2 +0,0 @@
-/* TODO: for the following defines, tests have to be written: */
-#undef HAVE_LUA


STYLE: Consistently reference *_BINARY_DIR CMake variable for extension project

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -55,8 +55,8 @@
     -DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}
     -DCMAKE_CXX_EXTENSIONS:BOOL=${CMAKE_CXX_EXTENSIONS}
     # Superbuild
-    -DEXTENSION_SUPERBUILD_BINARY_DIR:PATH=${${EXTENSION_NAME}_BINARY_DIR}
     -D${LOCAL_PROJECT_NAME}_SUPERBUILD:BOOL=OFF
+    -DEXTENSION_SUPERBUILD_BINARY_DIR:PATH=${${LOCAL_PROJECT_NAME}_BINARY_DIR}
   INSTALL_COMMAND ""
   DEPENDS
     ${${LOCAL_PROJECT_NAME}_DEPENDS}


iox-#153 add '-Wconversion' only for GCC builds

Signed-off-by: Kraus Mathias (CC-AD/ESW1) <8e179faa490d2a9c134c46102c4361276a2b4d71@de.bosch.com>

--- iceoryx_utils/cmake/IceoryxPlatformDetection.cmake
+++ iceoryx_utils/cmake/IceoryxPlatformDetection.cmake
@@ -16,13 +16,13 @@
     set(ICEORYX_CXX_STANDARD 17)
 endif(LINUX)

-set (ICEORYX_WARNINGS -W -Wall -Wextra -Wconversion -Wuninitialized -Wpedantic -Wstrict-aliasing -Wcast-align -Wno-noexcept-type)
+set (ICEORYX_WARNINGS -W -Wall -Wextra -Wuninitialized -Wpedantic -Wstrict-aliasing -Wcast-align -Wno-noexcept-type)

-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     # temporary disable conversion warnings for clang
     # this needs to be fixed with iox-#163
-    set(ICEORYX_WARNINGS ${ICEORYX_WARNINGS} -Wno-conversion)
-endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    set(ICEORYX_WARNINGS ${ICEORYX_WARNINGS} -Wconversion)
+endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

 if(BUILD_STRICT)
     set(ICEORYX_WARNINGS ${ICEORYX_WARNINGS} -Werror)


cflags

cflags

--- cmake/CFlags.cmake
+++ cmake/CFlags.cmake
@@ -3,9 +3,9 @@

 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lprotobuf -lz -lpthread")

-set(CMAKE_C_FLAGS_DEBUG "-g -fsanitize=address -fsanitize=memory -Qunused-arguments ${CMAKE_CXX_FLAGS_DEBUG}")
-set(CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize=address -fsanitize=memory -Qunused-arguments ${CMAKE_CXX_FLAGS_DEBUG}")
-set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address -fsanitize=memory ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+set(CMAKE_C_FLAGS_DEBUG "-g -fsanitize=address ${CMAKE_CXX_FLAGS_DEBUG}")
+set(CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize=address ${CMAKE_CXX_FLAGS_DEBUG}")
+set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")

 # OSX FLAGS
 if(APPLE)


When looking for DM files, add check if /usr/lib64 exists, and also added lib/x86_64-linux-gnu and i386-linux-gnu as possible path suffix in such case

--- cmake/FindDM.cmake
+++ cmake/FindDM.cmake
@@ -36,11 +36,22 @@
   STRING(REPLACE "\n" "" ODBC_LIB_DIR ${result})
 ELSE()
   # Try to find the include directory, giving precedence to special variables
-  IF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
-    SET(LIB_SUFFIX "lib64")
+  SET(LIB_PATHS /usr/local /usr)
+
+  IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+    SET(LIB_PATHS "${LIB_PATHS}" "/usr/lib/x86_64-linux-gnu")
+
+    IF(EXISTS "/usr/lib64/")
+      SET(LIB_SUFFIX "lib64" "x86_64-linux-gnu")
+    ELSE()
+      SET(LIB_SUFFIX "lib" "x86_64-linux-gnu")
+    ENDIF()
+
   ELSE()
-    SET(LIB_SUFFIX "lib")
+    SET(LIB_PATHS "${LIB_PATHS}" "/usr/local/lib/i386-linux-gnu" "/usr/lib/i386-linux-gnu" "/usr/local/lib/i686-linux-gnu" "/usr/lib/i686-linux-gnu")
+    SET(LIB_SUFFIX "lib" "i386-linux-gnu" "i686-linux-gnu")
   ENDIF()
+
   FIND_PATH(ODBC_INCLUDE_DIR sql.h
       HINTS ${DM_INCLUDE_DIR}
             ${DM_DIR}
@@ -65,8 +76,7 @@
             ${DM_DIR}
             ENV DM_LIB_DIR
             ENV DM_DIR
-      PATHS /usr/local
-            /usr
+      PATHS ${LIB_PATHS}
       PATH_SUFFIXES ${LIB_SUFFIX}
       NO_DEFAULT_PATH
       DOC "Driver Manager Libraries")


drone.io complaining

drone.io complaining

--- cmake/FindDO.cmake
+++ cmake/FindDO.cmake
@@ -10,10 +10,10 @@
 ################################################################################
 # Setup DO++ once for all for every test projects in the 'test' directory.
 if (NOT DO_FOUND)
-    if (DEFINED ENV{DO_DIR} AND EXISTS "$ENV{DO_DIR}/cmake/findDO.cmake") # Check if DO++ is installed
+    if (DEFINED ENV{DO_DIR} AND EXISTS "$ENV{DO_DIR}/cmake/FindDO.cmake") # Check if DO++ is installed
         string(REPLACE "\\" "/" DO_DIR "$ENV{DO_DIR}")
         set(DO_INCLUDE_DIR ${DO_DIR}/include)
-    elseif (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/findDO.cmake.in") # DO++ needs to be built or used from source
+    elseif (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindDO.cmake") # DO++ needs to be built or used from source
         message(STATUS "Building DO++ from source")
         set(DO_DIR ${CMAKE_CURRENT_SOURCE_DIR})
         set(DO_INCLUDE_DIR ${DO_DIR}/src)


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -595,9 +595,9 @@
                 )

                 IF(WIN32)
-                    SET(QT_CONF_SOURCES_RC)
+                    SET(QT_CONF_SOURCE_RC)
                 ELSE()
-                    QT5_ADD_RESOURCES(QT_CONF_SOURCES_RC
+                    QT5_ADD_RESOURCES(QT_CONF_SOURCE_RC
                         ../../../../${QT_CONF_QRC}
                     )
                 ENDIF()
@@ -617,7 +617,7 @@
                     ${TEST_SOURCE}
                     ${TEST_SOURCES_MOC}

-                    ${QT_CONF_SOURCES_RC}
+                    ${QT_CONF_SOURCE_RC}
                 )

                 # Plugins


Fixed the issue about not being able to build OpenCOR using Xcode on OS X (closes #373).

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -70,10 +70,12 @@
         SET(LINK_FLAGS_PROPERTIES "/STACK:10000000 /MACHINE:X86")
     ELSE()
         SET(CMAKE_CXX_FLAGS "-Wall -W -Werror -std=c++0x")
-        SET(LINK_FLAGS_PROPERTIES)

         IF(APPLE)
             SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+            SET(LINK_FLAGS_PROPERTIES "-stdlib=libc++")
+        ELSE()
+            SET(LINK_FLAGS_PROPERTIES)
         ENDIF()
     ENDIF()


reverting: only adding OSPRAY_INTERSECTION_FILTER definitions if CMake option is set.

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -129,8 +129,10 @@
   INCLUDE_DIRECTORIES_ISPC(${PROJECT_SOURCE_DIR})
   INCLUDE_DIRECTORIES_ISPC(${EMBREE_INCLUDE_DIRECTORIES})

-  ADD_DEFINITIONS(-DOSPRAY_INTERSECTION_FILTER=1)
-  ADD_DEFINITIONS_ISPC(-DOSPRAY_INTERSECTION_FILTER=1)
+  IF (OSPRAY_INTERSECTION_FILTER)
+    ADD_DEFINITIONS(-DOSPRAY_INTERSECTION_FILTER=1)
+    ADD_DEFINITIONS_ISPC(-DOSPRAY_INTERSECTION_FILTER=1)
+  ENDIF()
 ENDMACRO()


cmake: FindPython3: Adjust python3 program search

Fixes: #24340

Using find_package(Python3 3.6) will select the highest available
python3.

This means that in case user has:
/usr/bin/python  --> python2.7
/usr/bin/python3 --> python3.6
/usr/bin/python3.6
/usr/bin/python3.8

then CMake will choose python 3.8.
This commit changes that behavior, so that in the above scenario, then
Python 3.6 will be preferred.

It also adds the following, python will be preferred over python3, if
both meets the minimum requirement.
For example:
/usr/bin/python  --> python3.6
/usr/bin/python3 --> python3.7
then Python 3.6 is prefered.

It further introduces PYTHON_PREFER variable, which can be used to
further control the behavior.
As example -DPYTHON_PREFER=python3.7 will choose Python 3.7 if
installed.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -9,5 +9,29 @@
   set(ENV{PYTHONIOENCODING} "utf-8")
 endif()

-find_package(Python3 3.6 REQUIRED)
+set(PYTHON_MINIMUM_REQUIRED 3.6)
+
+# We are using foreach here, instead of find_program(PYTHON_EXECUTABLE_SYSTEM_DEFAULT "python" "python3")
+# cause just using find_program directly could result in a python2.7 as python, and not finding a valid python3.
+foreach(PYTHON_PREFER ${PYTHON_PREFER} "python" "python3")
+  find_program(PYTHON_PREFER_EXECUTABLE ${PYTHON_PREFER})
+  if(PYTHON_PREFER_EXECUTABLE)
+      execute_process (COMMAND "${PYTHON_PREFER_EXECUTABLE}" -c
+                               "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:2]]))"
+                       RESULT_VARIABLE result
+                       OUTPUT_VARIABLE version
+                       ERROR_QUIET
+                       OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+     if(version VERSION_LESS PYTHON_MINIMUM_REQUIRED)
+       set_property (CACHE PYTHON_PREFER_EXECUTABLE PROPERTY VALUE "PYTHON_PREFER_EXECUTABLE-NOTFOUND")
+     else()
+       set(PYTHON_MINIMUM_REQUIRED ${version})
+       set(PYTHON_EXACT EXACT)
+       break()
+     endif()
+  endif()
+endforeach()
+
+find_package(Python3 ${PYTHON_MINIMUM_REQUIRED} REQUIRED ${PYTHON_EXACT})
 set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})


Do not use -march=native with the PGI compiler

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -66,7 +66,7 @@
 endif ()

 # On x86_64 build getarch with march=native. This is required to detect AVX512 support in getarch.
-if (X86_64)
+if (X86_64 AND NOT ${CMAKE_C_COMPILER_ID} STREQUAL "PGI")
   set(GETARCH_FLAGS "${GETARCH_FLAGS} -march=native")
 endif ()


add rvalue detect

add rvalue detect

--- project/cmake/ProjectBuildOption.cmake
+++ project/cmake/ProjectBuildOption.cmake
@@ -6,7 +6,7 @@
     FILE "${PROJECT_ALL_INCLUDE_DIR}/config/compiler_features.h"
     PREFIX UTIL_CONFIG
     COMPILERS GNU Clang AppleClang MSVC
-    FEATURES cxx_auto_type cxx_constexpr cxx_decltype cxx_decltype_auto cxx_defaulted_functions cxx_deleted_functions cxx_final cxx_override cxx_range_for cxx_noexcept cxx_nullptr cxx_static_assert cxx_thread_local cxx_variadic_templates cxx_lambdas
+    FEATURES cxx_auto_type cxx_constexpr cxx_decltype cxx_decltype_auto cxx_defaulted_functions cxx_deleted_functions cxx_final cxx_override cxx_range_for cxx_noexcept cxx_nullptr cxx_rvalue_references cxx_static_assert cxx_thread_local cxx_variadic_templates cxx_lambdas
 )
 #file(MAKE_DIRECTORY "${PROJECT_ALL_INCLUDE_DIR}/config")
 #file(RENAME "${CMAKE_BINARY_DIR}/compiler_features.h" "${PROJECT_ALL_INCLUDE_DIR}/config/compiler_features.h")


Update FindMbedTLS.cmake

Update FindMbedTLS.cmake

--- project/cmake/modules/FindMbedTLS.cmake
+++ project/cmake/modules/FindMbedTLS.cmake
@@ -60,7 +60,7 @@
 # Normal search.
 set(MbedTLS_CRYPTO_NAMES mbedcrypto libmbedcrypto)
 set(MbedTLS_TLS_NAMES mbedtls libmbedtls)
-set(MbedTLS_X509_NAMES bmbedx509 libmbedx509)
+set(MbedTLS_X509_NAMES mbedx509 libmbedx509)

 # Try each search configuration.
 find_path(MbedTLS_INCLUDE_DIRS        NAMES mbedtls/config.h        ${_MBEDTLS_SEARCH_ROOT_INC})


zenity backend file filter fix

zenity backend file filter fix

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -464,7 +464,7 @@
        add_definitions(${GTK3_CFLAGS_OTHER})

 	   if(TORQUE_UseZenity)
-			set(BLACKLIST "nfd_win.cpp" "nfd_cocoa.m"  )
+			set(BLACKLIST "nfd_win.cpp" "nfd_cocoa.m" "nfd_gtk.c" )
 	   else()
 			set(BLACKLIST "nfd_win.cpp" "nfd_cocoa.m" "simple_exec.h" "nfd_zenity.c")
 	   endif()


Able to build for FreeBSD 12 (Thanks to Jason Bacon) #6765

--- build/cmake/macros/SystemSpecificInformations.cmake
+++ build/cmake/macros/SystemSpecificInformations.cmake
@@ -265,6 +265,7 @@
     set( SYSTEM_NAME "freebsd_${FREEBSD_RELEASE}" )
     set( CONDOR_FREEBSD ON )
     set( BSD_UNIX ON )
+    # FIXME: Is there a >= to replace all the MATCHES operators below?
     if(FREEBSD_MAJOR MATCHES "4" )
       set( CONDOR_FREEBSD4 ON )
     elseif(FREEBSD_MAJOR MATCHES "5" )
@@ -284,6 +285,9 @@
     elseif(FREEBSD_MAJOR MATCHES "11" )
       set( CONDOR_FREEBSD11 ON )
       set( CONDOR_UTMPX ON )
+    elseif(FREEBSD_MAJOR MATCHES "12" )
+      set( CONDOR_FREEBSD11 ON )
+      set( CONDOR_UTMPX ON )
     endif()
     if( CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" )
       set( SYS_ARCH "x86_64")


Use the branch name directly

Use the branch name directly

--- versions.cmake
+++ versions.cmake
@@ -24,7 +24,7 @@

 add_revision(paraview
   GIT_REPOSITORY git://paraview.org/stage/ParaView.git
-  GIT_TAG 4386042d5d7ef7b7cac12e96660a7dc5a6c5191a) # lookup_table_cleanup
+  GIT_TAG lookup_table_cleanup)

 add_revision(matviz
   GIT_REPOSITORY https://github.com/cryos/matviz


Moved to the ParaView 5.2.0 tagged release

--- versions.cmake
+++ versions.cmake
@@ -92,7 +92,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "1f133bbdde4a05cbfe72b25c3b09fb564452d3b0")
+  set(_paraview_revision "7db25af8b51995d2364254f21886cfa8a5e6f666")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Passing the initial cache argument correctly to MITK

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -199,6 +199,7 @@
     -DMITK_ACCESSBYITK_FLOATING_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES}
     -DMITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES:STRING=${MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES}
     -DMITK_ACCESSBYITK_DIMENSIONS:STRING=${MITK_ACCESSBYITK_DIMENSIONS}
+  CMAKE_ARGS
     ${mitk_initial_cache_arg}

   SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}


Check against INTERFACE_LINK_LIBRARIES

Check against INTERFACE_LINK_LIBRARIES

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -333,7 +333,7 @@

     get_property (TARGET_LIBS
                   TARGET ${TARGET_NAME}
-                  PROPERTY LINK_LIBRARIES)
+                  PROPERTY INTERFACE_LINK_LIBRARIES)

     set (${RESULT_VARIABLE} FALSE PARENT_SCOPE)


improved error messages

improved error messages

--- VigraAddExternal.cmake
+++ VigraAddExternal.cmake
@@ -31,16 +31,16 @@
     # Repo could come from cache variables, or from function option. Cached variable overrides the
     # function argument.
     if(DEPENDENCY_${AD_NAME}_REPO)
-      message(STATUS "Setting the repository for dependency '${AD_NAME}' to the value from cache '${DEPENDENCY_${AD_NAME}_REPO}'.")
+      message(STATUS "Cloning dependency '${AD_NAME}' from cached repo '${DEPENDENCY_${AD_NAME}_REPO}'.")
       set(AD_REPO "${DEPENDENCY_${AD_NAME}_REPO}")
     elseif(AD_REPO)
-      message(STATUS "Setting the repository for dependency '${AD_NAME}' to the value '${AD_REPO}' specified to the add_dependency() call.")
+      message(STATUS "Cloning dependency '${AD_NAME}' from REPO '${AD_REPO}' specified in vigra_add_external().")
     else()
-      message(FATAL_ERROR "The repository of the dependency was not specified in the add_dependency() call, nor it was found in the cached variables.")
+      message(FATAL_ERROR "No repository for dependency '${AD_NAME}' was specified in vigra_add_external() or the cache. Run cmake with '-DDEPENDENCY_${AD_NAME}_REPO=<repo_url>'.")
     endif()
     # Check the branch and commit arguments.
     if(AD_BRANCH AND AD_COMMIT)
-      message(FATAL_ERROR "At most one of branch and commit must be specified when using add_dependency().")
+      message(FATAL_ERROR "At most one of BRANCH and COMMIT can be passed to vigra_add_external().")
     endif()

     # Try to check out the dependency.


Don't put EXPORT_MACRO in front of function definitions.

This results in a compiler error.

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -415,7 +415,7 @@
         foreach (FUNCTION ${GET_CREATED_FUNCTIONS})

             list (APPEND CONTENTS
-                  "${EXPORT_MACRO} int ${FUNCTION} ()"
+                  "int ${FUNCTION} ()"
                   "{"
                   "    return 0@SEMICOLON@"
                   "}")


Removing extra dl link flag.

Removing extra dl link flag.

--- targets/target-x86-linux-native/CMake/toolchain.cmake
+++ targets/target-x86-linux-native/CMake/toolchain.cmake
@@ -11,5 +11,3 @@
 if(NOT (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux"))
     message(FATAL_ERROR "This Linux native target will not work on non-Linux platforms (your platform is ${CMAKE_HOST_SYSTEM_NAME}), use `yotta target` to set the target.")
 endif()
-
-set(CMAKE_C_LINK_FLAGS    "${CMAKE_C_LINK_FLAGS} -Wl,-ldl")


Fix typo

Fix typo

--- FindHWLOC.cmake
+++ FindHWLOC.cmake
@@ -30,7 +30,7 @@
 if(HWLOC_FOUND)
   find_library(HWLOC_LIBRARY hwloc
     HINTS $ENV{HWLOC_ROOT} ${HWLOC_ROOT}
-    PATHS ${HWLOC__LIBRARY_DIRS}
+    PATHS ${HWLOC_LIBRARY_DIRS}
     PATH_SUFFIXES lib)
   set(HWLOC_LIBRARIES ${HWLOC_LIBRARY})


libchen: update

libchen: update

--- lib/libchen/cmake/ChenUtil.cmake
+++ lib/libchen/cmake/ChenUtil.cmake
@@ -30,16 +30,17 @@

 # generate definitions about build information
 function(chen_build_system)
+    find_program(perl "perl")
     find_program(lsb_release "lsb_release")

-    if(APPLE)
+    if(APPLE AND perl)
         execute_process(
                 COMMAND bash -c "system_profiler SPSoftwareDataType | perl -0 -pe 's/^.*System Version: ([^\n]+).*$/\\1/s'"
                 OUTPUT_VARIABLE system
                 OUTPUT_STRIP_TRAILING_WHITESPACE
         )
         add_definitions(-DCHEN_BUILD_SYSTEM="${system}")
-    elseif(UNIX AND lsb_release)
+    elseif(UNIX AND lsb_release AND perl)
         execute_process(
                 COMMAND bash -c "lsb_release -d -s | perl -0 -pe 's/^\"(.*)\"$/\\1/s'"
                 OUTPUT_VARIABLE system


Added support for COMPONENTS in FindROOT.cmake (ROOT-6717)

--- etc/cmake/FindROOT.cmake
+++ etc/cmake/FindROOT.cmake
@@ -3,48 +3,62 @@
 # It defines:
 # ROOT_FOUND          If the ROOT is found
 # ROOT_INCLUDE_DIR    PATH to the include directory
+# ROOT_INCLUDE_DIRS   PATH to the include directories (not cached)
 # ROOT_LIBRARIES      Most common libraries
+# ROOT_<name>_LIBRARY Full path to the library <name>
 # ROOT_LIBRARY_DIR    PATH to the library directory
 #
 # Updated by K. Smith (ksmith37@nd.edu) to properly handle
-#  dependncies in ROOT_GENERATE_DICTIONARY
+#  dependencies in ROOT_GENERATE_DICTIONARY

 find_program(ROOT_CONFIG_EXECUTABLE root-config
   PATHS $ENV{ROOTSYS}/bin)

-if(NOT ROOT_CONFIG_EXECUTABLE)
-  set(ROOT_FOUND FALSE)
-else()
-  set(ROOT_FOUND TRUE)
-
-  execute_process(
+execute_process(
     COMMAND ${ROOT_CONFIG_EXECUTABLE} --prefix
     OUTPUT_VARIABLE ROOTSYS
     OUTPUT_STRIP_TRAILING_WHITESPACE)

-  execute_process(
+execute_process(
     COMMAND ${ROOT_CONFIG_EXECUTABLE} --version
     OUTPUT_VARIABLE ROOT_VERSION
     OUTPUT_STRIP_TRAILING_WHITESPACE)

-  execute_process(
+execute_process(
     COMMAND ${ROOT_CONFIG_EXECUTABLE} --incdir
     OUTPUT_VARIABLE ROOT_INCLUDE_DIR
     OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(ROOT_INCLUDE_DIRS ${ROOT_INCLUDE_DIR})

-  execute_process(
-    COMMAND ${ROOT_CONFIG_EXECUTABLE} --libs
-    OUTPUT_VARIABLE ROOT_LIBRARIES
+execute_process(
+    COMMAND ${ROOT_CONFIG_EXECUTABLE} --libdir
+    OUTPUT_VARIABLE ROOT_LIBRARY_DIR
     OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(ROOT_LIBRARY_DIRS ${ROOT_LIBRARY_DIR})

-  #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lThread -lMinuit -lHtml -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lProof)
-  #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lProofPlayer -lMLP -lSpectrum -lEve -lRGL -lGed -lXMLParser -lPhysics)
-  set(ROOT_LIBRARY_DIR ${ROOTSYS}/lib)
-endif()
+set(rootlibs Core Cint RIO Net Hist Graf Graf3d Gpad Tree Rint Postscript Matrix Physics MathCore Thread)
+set(ROOT_LIBRARIES)
+foreach(_cpt ${rootlibs} ${ROOT_FIND_COMPONENTS})
+  find_library(ROOT_${_cpt}_LIBRARY ${_cpt} HINTS ${ROOT_LIBRARY_DIR})
+  if(ROOT_${_cpt}_LIBRARY)
+    mark_as_advanced(ROOT_${_cpt}_LIBRARY)
+    list(APPEND ROOT_LIBRARIES ${ROOT_${_cpt}_LIBRARY})
+    list(REMOVE_ITEM ROOT_FIND_COMPONENTS ${_cpt})
+  endif()
+endforeach()
+list(REMOVE_DUPLICATES ROOT_LIBRARIES)
+
+execute_process(
+  COMMAND ${ROOT_CONFIG_EXECUTABLE} --features
+  OUTPUT_VARIABLE _root_options
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
+foreach(_opt ${_root_options})
+  set(ROOT_${_opt}_FOUND TRUE)
+endforeach()

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(ROOT DEFAULT_MSG ROOT_CONFIG_EXECUTABLE
-    ROOTSYS ROOT_VERSION ROOT_INCLUDE_DIR ROOT_LIBRARIES   ROOT_LIBRARY_DIR)
+    ROOTSYS ROOT_VERSION ROOT_INCLUDE_DIR ROOT_LIBRARIES ROOT_LIBRARY_DIR)

 mark_as_advanced(ROOT_CONFIG_EXECUTABLE)


BUG: libkml not included for other platforms

--- CMake/External_libKML.cmake
+++ CMake/External_libKML.cmake
@@ -49,11 +49,9 @@
   endif()

   if(MSVC)
-    set(${proj}_DEPENDENCIES)
-
     set(LIBKML_SB_BOOST_CONFIG)
     set(LIBKML_SB_ZLIB_CONFIG)
-
+  endif()

   ExternalProject_Add(${proj}
     PREFIX ${proj}
@@ -70,10 +68,8 @@
       ${LIBKML_SB_EXPAT_CONFIG}
       ${LIBKML_SB_BOOST_CONFIG}
       ${LIBKML_SB_ZLIB_CONFIG}
-
     )

   message(STATUS "  Using libKML SuperBuild version")
-  endif()

 endif()


BUG: Fix install rule variable name typos in ITKModuleMacros

Change-Id: I1541739bad23de58f87e50d6605a44276666158b

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -195,8 +195,8 @@
   install(TARGETS ${_name}
     EXPORT  ${${itk-module}-targets}
     RUNTIME DESTINATION ${${itk-module}_INSTALL_RUNTIME_DIR}
-    LIBRARY DESTINATION ${${itk-module}_INSTALL_ARCHIVE_DIR}
-    ARCHIVE DESTINATION ${${itk-module}_INSTALL_LIBRARY_DIR}
+    LIBRARY DESTINATION ${${itk-module}_INSTALL_LIBRARY_DIR}
+    ARCHIVE DESTINATION ${${itk-module}_INSTALL_ARCHIVE_DIR}
     )
 endmacro()


valgrind fixed; updates #16'

valgrind fixed; updates #16'

--- Utilities.cmake
+++ Utilities.cmake
@@ -63,9 +63,9 @@
     ${EFU_COMMON_LIBS}
     ${GTEST_LIBRARIES})

-  if(${CMAKE_COMPILER_IS_GNUCXX})
-    add_linker_flags(${exec_name} "-Wl,--no-as-needed")
-  endif()
+#  if(${CMAKE_COMPILER_IS_GNUCXX})
+#    add_linker_flags(${exec_name} "-Wl,--no-as-needed")
+#  endif()

   add_test(NAME regular_${exec_name}
     COMMAND ${exec_name}
@@ -76,7 +76,7 @@
     CACHE INTERNAL "All test targets")

   enable_coverage(${exec_name})
-  memcheck_test(${exec_name} ${CMAKE_BINARY_DIR}/bin)
+  memcheck_test(${exec_name} ${CMAKE_BINARY_DIR}/unit_tests)
 endfunction(create_test_executable)

 function(create_integration_test_executable exec_name)


Kill the CMake Error -- clang/clang++  is not a full path and was not found in the PATH.

CMake Error at CMakeLists.txt:3 (project):
The CMAKE_CXX_COMPILER:

clang++

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:3 (project):
The CMAKE_C_COMPILER:

clang

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

--- toolchain/iOS.cmake
+++ toolchain/iOS.cmake
@@ -47,8 +47,8 @@

 # Force the compilers to gcc for iOS
 include (CMakeForceCompiler)
-CMAKE_FORCE_C_COMPILER (clang Apple)
-CMAKE_FORCE_CXX_COMPILER (clang++ Apple)
+CMAKE_FORCE_C_COMPILER (/usr/bin/gcc Apple)
+CMAKE_FORCE_CXX_COMPILER (/usr/bin/g++ Apple)
 set(CMAKE_AR ar CACHE FILEPATH "" FORCE)

 # Skip the platform compiler checks for cross compiling


CMake: Sync'ed DataTypes.h.cmake with DataTypes.h.in.

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

--- include/llvm/Support/DataTypes.h.cmake
+++ include/llvm/Support/DataTypes.h.cmake
@@ -38,6 +38,11 @@
 // we define it here, we define it on the g++ command line (in Makefile.rules).
 #if !defined(__STDC_LIMIT_MACROS)
 # error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
+#endif
+
+#if !defined(__STDC_CONSTANT_MACROS)
+# error "Must #define __STDC_CONSTANT_MACROS before " \
+        "#including Support/DataTypes.h"
 #endif

 // Note that <inttypes.h> includes <stdint.h>, if this is a C99 system.
@@ -108,6 +113,14 @@
 #define INT32_MAX 2147483647
 #define INT32_MIN -2147483648
 #define UINT32_MAX 4294967295U
+#define INT8_C(C)   C
+#define UINT8_C(C)  C
+#define INT16_C(C)  C
+#define UINT16_C(C) C
+#define INT32_C(C)  C
+#define UINT32_C(C) C ## U
+#define INT64_C(C)  ((int64_t) C ## LL)
+#define UINT64_C(C) ((uint64_t) C ## ULL)
 #endif /* _MSC_VER */

 /* Set defaults for constants which we cannot find. */