FIX: Correct Python path to use in the conventions parsing

Suggested by JC

--- SuperBuild/External_CIP.cmake
+++ SuperBuild/External_CIP.cmake
@@ -31,8 +31,6 @@
   endif()
   message(STATUS ${VTK_DIR})

-  get_filename_component(Slicer_PYTHON_DIR ${SlicerExecutionModel_DIR} PATH)
-
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${git_protocol}://github.com/acil-bwh/ChestImagingPlatform.git"
@@ -53,8 +51,9 @@
       -DBUILD_GENERATEMODEL:BOOL=OFF
       -DBUILD_GENERATESIMPLELUNGMASK:BOOL=OFF # temporarily off due to lack of VtkGlue
       -DBUILD_ComputeAirwayWallFromParticles:BOOL=OFF # temporarily off due to lack of VtkGlue
-      -DCIP_BUILD_TESTING_PYTHON:BOOL=OFF # to exclude cip_python from CIP build
       -DSLICER_PYTHON_CMD:FILEPATH=${PYTHON_EXECUTABLE}
+      -DCIP_PYTHON_DIR:PATH=${PYTHON_EXECUTABLE}    # To parse the convention files
+      -DCIP_BUILD_TESTING_PYTHON:BOOL=OFF
       -DSlicerExecutionModel_DIR:STRING=${SlicerExecutionModel_DIR}
       -DSlicer_BUILD_CLI:BOOL=ON
       -DSlicer_BUILD_CLI_SUPPORT:BOOL=ON
@@ -72,7 +71,7 @@
       -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
       -DBUILD_TESTING:BOOL=OFF
       -DCMAKE_CXX_FLAGS:STRING=${CIP_CMAKE_CXX_FLAGS}
-      -DCIP_PYTHON_DIR:PATH=${Slicer_PYTHON_DIR}/python-install
+

     #CONFIGURE_COMMAND ${CMAKE_COMMAND}
     #-E echo


Update ITK Superbuild version along release towards 4.9.1

Change-Id: I16dc343b5eff75ca51f13582fc00b5ebfb7cb18f

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.9.0 )
+set(ITK_TAG_COMMAND GIT_TAG 863e0e3d6ae63f1099b454ebb0148c4948eaa3df )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


BUG: Do not depend on the VTK/OpenCV build when system provided.

When a VTK_DIR or OpenCV_DIR are given, a dependency on a non-existant target
would result.

Change-Id: I180214ae03ea03f8e300b3433b8d075f50a5e2cb

--- Superbuild/External-ITK.cmake
+++ Superbuild/External-ITK.cmake
@@ -13,7 +13,9 @@
     -DModule_ITKVtkGlue:BOOL=ON
     -DModule_ITKLevelSetsv4Visualization:BOOL=ON
     )
-  set( _vtk_depends VTK )
+  if( NOT VTK_DIR )
+    set( _vtk_depends VTK )
+  endif()
 else()
   set( _vtk_args
     -DModule_ITKVtkGlue:BOOL=OFF
@@ -27,7 +29,9 @@
   set( _opencv_args "-DOpenCV_DIR:PATH=${OpenCV_DIR}"
     -DModule_ITKVideoBridgeOpenCV:BOOL=ON
     )
-  set( _opencv_depends OpenCV )
+  if( NOT OpenCV_DIR )
+    set( _opencv_depends OpenCV )
+  endif()
 else()
   set( _opencv_args
     -DModule_ITKVideoBridgeOpenCV:BOOL=OFF


Move ParaView forward

Move ParaView forward

Brings in support for:

* dockable console widget
* direct scalar coloring of textures by floating point types for
  Slice and Orthogonal Slice modules.

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


python: use updated prebuilt python

python: use updated prebuilt python

These python binaries have files laid out in the way that pybind11
expects them.

--- versions.cmake
+++ versions.cmake
@@ -47,11 +47,11 @@
 if (WIN32)
   if (64bit_build)
     add_revision(python
-      URL "http://www.paraview.org/files/dependencies/python+deps.tar.bz2"
+      URL "http://www.tomviz.org/files/python-2.7.3-win64.tar.gz"
       URL_MD5 "4318b8f771eda5606d9ce7f0be9f82e1")
   else ()
     add_revision(python
-      URL "http://www.paraview.org/files/dependencies/python+deps-x32.tar.bz2"
+      URL "http://www.tomviz.org/files/python-2.7.3-win32.tar.gz"
       URL_MD5 "6ba441784a672e08379d23ddd61146f0")
   endif ()
 else()


Fixing installation issues on Windows

Fixing installation issues on Windows

--- Resources/CMake/CMakeMacros.cmake
+++ Resources/CMake/CMakeMacros.cmake
@@ -291,7 +291,7 @@
               set(${upperlib}_LIBRARY_DLL_${TYPE}  ${${upperlib}_LIBRARY_DLL_${TYPE}}/${lib_name}.dll)
               message(STATUS "${upperlib}_LIBRARY_DLL_${TYPE}: ${${upperlib}_LIBRARY_DLL_${TYPE}}")
               message(STATUS "Generating Install Rule for ${btype} Version of ${upperlib}_LIBRARY_${TYPE}")
-              INSTALL(FILES ${${upperlib}_LIBRARY_DLL_${TYPE}}/${lib_name}.dll
+              INSTALL(FILES ${${upperlib}_LIBRARY_DLL_${TYPE}}
                 DESTINATION ${destination}
                 CONFIGURATIONS ${BTYPE}
                 COMPONENT Runtime)


Install vespa-gbdt-converter and vespa-treenet-converter.

--- install_java.cmake
+++ install_java.cmake
@@ -16,6 +16,7 @@
 install_java_artifact(jdisc_jetty)
 install_java_artifact_dependencies(jdisc_jetty)
 install_java_artifact_dependencies(vespa_jersey2)
+install_java_artifact(searchlib)
 install_java_artifact(vespajlib)

 install_fat_java_artifact(application-preprocessor)
@@ -61,6 +62,8 @@
 vespa_install_script(config-model/src/main/perl/vespa-replicate-log-stream bin)
 vespa_install_script(config-model/src/main/sh/vespa-validate-application bin)
 vespa_install_script(container-disc/src/main/sh/vespa-start-container-daemon.sh vespa-start-container-daemon bin)
+vespa_install_script(searchlib/src/main/sh/vespa-gbdt-converter bin)
+vespa_install_script(searchlib/src/main/sh/vespa-treenet-converter bin)
 vespa_install_script(vespaclient-java/src/main/sh/vespa-document-statistics.sh vespa-document-statistics bin)
 vespa_install_script(vespaclient-java/src/main/sh/vespa-stat.sh vespa-stat bin)
 vespa_install_script(vespaclient-java/src/main/sh/vespa-query-profile-dump-tool.sh vespa-query-profile-dump-tool bin)


Add result_var to svn_unpackage(), and abort early if there is a problem applying a changes file.

--- test/remote/SvnPackage.cmake
+++ test/remote/SvnPackage.cmake
@@ -28,11 +28,11 @@

   # create path to execute zorba
   IF (WIN32)
-		IF(NOT ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
-			SET(ZORBA_EXE_SCRIPT "${ZORBA_BUILD_DIR}/scripts/zorba_cmake.bat")
-		ELSE(NOT ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
-			SET(ZORBA_EXE_SCRIPT "${ZORBA_BUILD_DIR}/zorba.exe")
-		ENDIF(NOT ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
+    IF(NOT ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
+      SET(ZORBA_EXE_SCRIPT "${ZORBA_BUILD_DIR}/scripts/zorba_cmake.bat")
+    ELSE(NOT ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
+      SET(ZORBA_EXE_SCRIPT "${ZORBA_BUILD_DIR}/zorba.exe")
+    ENDIF(NOT ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
   ELSE (WIN32)
     SET(ZORBA_EXE_SCRIPT "${ZORBA_BUILD_DIR}/bin/zorba")
   ENDIF (WIN32)
@@ -133,7 +133,10 @@
 #   tmpdir - directory to temporarily unpack changefile into
 #   svnlogfile - file to output SVN checkout messages into
 #   changeslogfile - file to output change-application log messages into
-macro (svn_unpackage changefile svndir tmpdir svnlogfile changeslogfile)
+#   result_var - if the variable named by "result" is non-zero or contains a
+#     message after svn_unpackage() returns, an error was encountered
+function (svn_unpackage changefile svndir tmpdir svnlogfile changeslogfile
+    result_var)
   find_prereqs ()

   # Unpack changes.tgz into working dir
@@ -173,8 +176,12 @@
     # These are absolute paths from the client; convert to relative paths
     file (RELATIVE_PATH relpath "${clientroot}" "${filepath}")
     execute_process (COMMAND "${svn}" delete "${svndir}/${relpath}"
-      OUTPUT_VARIABLE output ERROR_VARIABLE output)
+      OUTPUT_VARIABLE output ERROR_VARIABLE output RESULT_VARIABLE result)
     file (APPEND "${changeslogfile}" "${output}")
+    if (result_var)
+      set (${result_var} ${result} PARENT_SCOPE)
+      return ()
+    endif ()
   endforeach (filepath ${deletefiles})

   # Now add any new files, using the local output of "svn status" to
@@ -186,11 +193,15 @@
   get_files_with_status (addfiles "${chgdir}/svn-status.xml" "" unversioned)
   foreach (filepath ${addfiles})
     execute_process (COMMAND "${svn}" add "${filepath}"
-      OUTPUT_VARIABLE output ERROR_VARIABLE output)
+      OUTPUT_VARIABLE output ERROR_VARIABLE output RESULT_VARIABLE result)
     file (APPEND "${changeslogfile}" "${output}")
+    if (result_var)
+      set (${result_var} ${result} PARENT_SCOPE)
+      return ()
+    endif ()
   endforeach (filepath ${addfiles})

   # Remove temporary unpackaged workingset
-  file (REMOVE_RECURSE "${chgdir}")
-
-endmacro (svn_unpackage)
+  #file (REMOVE_RECURSE "${chgdir}")
+
+endfunction (svn_unpackage)


change test feature comparison operators

Filenames can not contain < or > under windows, so version comparisons
are now done with ".geq.", ".leq.", ".ge.", ".le.", "=" instead of ">=",
"<=", ">", "<", "=".

--- cmake/macros/macro_deal_ii_pickup_tests.cmake
+++ cmake/macros/macro_deal_ii_pickup_tests.cmake
@@ -158,8 +158,10 @@
     # set _define_test to FALSE:
     #

+    SET(_op_regex "=|\\.geq\\.|\\.leq\\.|\\.ge\\.|\\.le\\.")
+
     STRING(REGEX MATCHALL
-      "with_([0-9]|[a-z]|_)*(=|>=|<=|>|<)(on|off|yes|no|true|false|[0-9]+(\\.[0-9]+)*)"
+      "with_([0-9]|[a-z]|_)*(${_op_regex})(on|off|yes|no|true|false|[0-9]+(\\.[0-9]+)*)"
       _matches ${_test}
       )

@@ -168,10 +170,10 @@
       # Extract feature name, comparison operator, (a possible) boolean and
       # (a possible) version number from the feature constraint:
       #
-      STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(>=|<=|=|>|<).*" "\\1" _feature ${_match})
+      STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(${_op_regex}).*" "\\1" _feature ${_match})
       STRING(TOUPPER ${_feature} _feature)
-      STRING(REGEX MATCH "(>=|<=|=|>|<)" _operator ${_match})
-      STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(>=|<=|=|>|<).*$" "\\3" _operator ${_match})
+      STRING(REGEX MATCH "(${_op_regex})" _operator ${_match})
+      STRING(REGEX REPLACE "^with_(([0-9]|[a-z]|_)*)(${_op_regex}).*$" "\\3" _operator ${_match})
       STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
       STRING(REGEX MATCH "([0-9]+(\\.[0-9]+)*)$" _version ${_match})

@@ -213,13 +215,13 @@
         IF( ( NOT ${DEAL_II_WITH_${_feature}} ) OR
             ( "${_operator}" STREQUAL "=" AND
               NOT "${DEAL_II_${_feature}_VERSION}" VERSION_EQUAL "${_version}" ) OR
-            ( "${_operator}" STREQUAL ">" AND
+            ( "${_operator}" STREQUAL ".ge." AND
               NOT "${DEAL_II_${_feature}_VERSION}" VERSION_GREATER "${_version}" ) OR
-            ( "${_operator}" STREQUAL "<" AND
+            ( "${_operator}" STREQUAL ".le." AND
               NOT "${DEAL_II_${_feature}_VERSION}" VERSION_LESS "${_version}" ) OR
-            ( "${_operator}" STREQUAL ">=" AND
+            ( "${_operator}" STREQUAL ".geq." AND
               "${DEAL_II_${_feature}_VERSION}" VERSION_LESS "${_version}" ) OR
-            ( "${_operator}" STREQUAL "<=" AND
+            ( "${_operator}" STREQUAL ".leq." AND
               "${DEAL_II_${_feature}_VERSION}" VERSION_GREATER "${_version}" ) )
           SET(_define_test FALSE)
         ENDIF()


update package.make centreon-engine

update package.make centreon-engine

--- centreon-engine-1.4.11/build/package.cmake
+++ centreon-engine-1.4.11/build/package.cmake
@@ -68,7 +68,8 @@
     set(CPACK_DEBIAN_PACKAGE_SECTION "net")
     set (CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
     set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
-    set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "centreon-connector (>= 1.1.1), centreon-plugins")
+    set (CPACK_DEBIAN_PACKAGE_SUGGESTS "centreon-broker (>= 2.8.1), centreon-connector-perl (>= 1.1.1), centreon-connector-ssh (>= 1.1.1), centreon-plugins")
+    set (CPACK_DEBIAN_PACKAGE_CONFLICTS "nagios3, icinga")
     set (CPACK_DEBIAN_PACKAGE_DEPENDS "centreon-clib (>= 1.4.2), openssl, nagios-plugins-basic")
     configure_file("${SCRIPT_DIR}/deb/postinst.in" "${SCRIPT_DIR}/deb/postinst")
     set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA


Always skip update command for git based external projects

I noticed that some external projects were being reconfigured/built
with every make, even though no files in the external project had been
updated.

With some debugging I noticed that git based external projects were
re-running their "update" step every time, and that in turn caused the
configure/build/install steps to re-run as well. (Generally the build
step is a no-op as the Makefile/etc. in the external project is well
formed and doesn't do anything, but the configure/install steps still
run).

It seems related to this cmake bug:
https://gitlab.kitware.com/cmake/cmake/-/issues/19703. In short, the
git update step for an external project does not create any "done"
file that denotes that the files are still up-to-date. Without that
"done" file, the update step is always run, and that in turn causes
the other steps for the external project to re-run as well.

The best way to fix this seems to be to skip the update step by
defining an empty UPDATE_COMMAND. As long as the downloaded code for a
given hash/tag/etc does not change, the update step is unnecessary.

And if we *really* wanted to ensure unchanged dependencies, we would
download our own copies anyway.

Making this change significantly cleans up the falco build to avoid
rebuilding git based external dependencies.

Signed-off-by: Mark Stemm <1b6cbc2e568a933a16c6fa30b73e50cd507debf7@gmail.com>

--- cmake/modules/DownloadStringViewLite.cmake
+++ cmake/modules/DownloadStringViewLite.cmake
@@ -24,6 +24,7 @@
   GIT_TAG "v1.4.0"
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ""
+  UPDATE_COMMAND ""
   INSTALL_COMMAND
     ${CMAKE_COMMAND} -E copy ${STRING_VIEW_LITE_PREFIX}/src/string-view-lite/include/nonstd/string_view.hpp
     ${STRING_VIEW_LITE_INCLUDE}/nonstd/string_view.hpp)


Terminate macro.

Terminate macro.

--- CPM.cmake
+++ CPM.cmake
@@ -747,7 +747,7 @@
   # Now propogate the version map upwards (we don't really *need* to do this).
   # But makes it clear what we are trying to do.
   #_cpm_propogate_version_map_up()
-endfunction()
+endmacro()

 function(CPM_AddExternal name)
   # Attempt to find common directory for external project build recipes?


CMake: Skip MIC builds with non-Makefile generators

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- cmake/FindMIC.cmake
+++ cmake/FindMIC.cmake
@@ -56,7 +56,12 @@
 set(MIC_NATIVE_FOUND false)
 set(MIC_OFFLOAD_FOUND false)

-option(ENABLE_MIC "Enable native builds for the MIC architecture (Intel Knights Corner)" ON)
+if(CMAKE_GENERATOR MATCHES "Makefile")
+   option(ENABLE_MIC "Enable native builds for the MIC architecture (Intel Knights Corner)" ON)
+else()
+   message(STATUS "MIC builds are only supported with a Makefile generator")
+   set(ENABLE_MIC false)
+endif()
 if(ENABLE_MIC)
    file(GLOB _intel_dirs "/opt/intel/compilers_and_libraries_*/linux")
    if ("${_intel_dirs}" STREQUAL "")


remove unnecessary output

remove unnecessary output

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -1,10 +1,7 @@
 FIND_PACKAGE(Git)

-message("hop")
-message(${CMAKE_SOURCE_DIR}/..)
-
 IF(GIT_EXECUTABLE)
-  execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --dirty OUTPUT_VARIABLE RMPCDMD_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
+  execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --tags --dirty OUTPUT_VARIABLE RMPCDMD_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
   configure_file(${CMAKE_SOURCE_DIR}/../src/rmpcdmd_module.f90.in ${CMAKE_BINARY_DIR}/rmpcdmd_module.f90 @ONLY)
 else()
   message(FATAL_ERROR "git not found")


Squashed 'cmake/yacma/' changes from 0448405..dfd29ed

dfd29ed Some extra debug flags for GCC 6 and 7.

git-subtree-dir: cmake/yacma
git-subtree-split: dfd29ed5d07a90b10c298cc9a1c487501867ab26

--- YACMACompilerLinkerSettings.cmake
+++ YACMACompilerLinkerSettings.cmake
@@ -127,6 +127,14 @@
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wodr)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsuggest-final-types)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsuggest-final-methods)
+        # From GCC 6.
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wshift-negative-value)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wshift-overflow=2)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wduplicated-cond)
+        # From GCC 7.
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wduplicated-branches)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wrestrict)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Waligned-new)
     endif()

     # MSVC setup.


Fixed Windows Android paths

Fixed Windows Android paths

--- cmake-toolchains/android.toolchain.cmake
+++ cmake-toolchains/android.toolchain.cmake
@@ -91,8 +91,8 @@
     set(ANDROID_SDK_TOOL_EXT "")
 elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
     set(ANDROID_NDK_HOST "windows")
-    get_filename_component(ANDROID_NDK_ROOT "../fips-sdks/windows/${ANDROID_NDK_NAME}" ABSOLUTE)
-    get_filename_component(ANDROID_SDK_ROOT "../fips-sdks/windows/android-sdk-windows" ABSOLUTE)
+    get_filename_component(ANDROID_NDK_ROOT "../fips-sdks/win/${ANDROID_NDK_NAME}" ABSOLUTE)
+    get_filename_component(ANDROID_SDK_ROOT "../fips-sdks/win/android-sdk-windows" ABSOLUTE)
     set(ANDROID_NDK_EXE_EXT ".exe")
     set(ANDROID_SDK_TOOL_EXT ".bat")
 endif()


Supports CUDA Volta architecture.

Supports CUDA Volta architecture.

--- cmake/TbagFindPackage/FindTbagCUDA.cmake
+++ cmake/TbagFindPackage/FindTbagCUDA.cmake
@@ -40,10 +40,63 @@
 #///  - ${CUDA_npps_LIBRARY}       NVIDIA Performance Primitives library (signal processing). Only available for CUDA version 5.5+.
 #///  - ${CUDA_nvcuvenc_LIBRARY}   CUDA Video Encoder library. Only available for CUDA version 3.2+. Windows only.
 #///  - ${CUDA_nvcuvid_LIBRARY}    CUDA Video Decoder library. Only available for CUDA version 3.2+. Windows only.
+#///
+#/// Deprecated Fermi(2.x) version.
+
+set (TBAG_CUDA_ARCH2_NAME   Fermi)
+set (TBAG_CUDA_ARCH3_NAME  Kepler)
+set (TBAG_CUDA_ARCH5_NAME Maxwell)
+set (TBAG_CUDA_ARCH6_NAME  Pascal)
+set (TBAG_CUDA_ARCH7_NAME   Volta)
+
+set (TBAG_CUDA_ARCH2_VERS 20 "21(20)")
+set (TBAG_CUDA_ARCH3_VERS 30 35)
+set (TBAG_CUDA_ARCH5_VERS 50 52)
+set (TBAG_CUDA_ARCH6_VERS 60 61)
+set (TBAG_CUDA_ARCH7_VERS 70)
+
+set (TBAG_CUDA_FERMI    ${TBAG_CUDA_ARCH2_NAME})
+set (TBAG_CUDA_KEPLER   ${TBAG_CUDA_ARCH3_NAME})
+set (TBAG_CUDA_MAXWELL  ${TBAG_CUDA_ARCH5_NAME})
+set (TBAG_CUDA_PASCAL   ${TBAG_CUDA_ARCH6_NAME})
+set (TBAG_CUDA_VOLTA    ${TBAG_CUDA_ARCH7_NAME})
+
+set (TBAG_CUDA_FERMI_VERS   ${TBAG_CUDA_ARCH2_VERS})
+set (TBAG_CUDA_KEPLER_VERS  ${TBAG_CUDA_ARCH3_VERS})
+set (TBAG_CUDA_MAXWELL_VERS ${TBAG_CUDA_ARCH5_VERS})
+set (TBAG_CUDA_PASCAL_VERS  ${TBAG_CUDA_ARCH6_VERS})
+set (TBAG_CUDA_VOLTA_VERS   ${TBAG_CUDA_ARCH7_VERS})

 # Known NVIDIA GPU achitectures.
 # This list will be used for 'CUDA_ARCH_NAME = All' option.
-set (TBAG_CUDA_KNOWN_GPU_ARCHS "20 21(20) 30 35 50 52 61")
+set (TBAG_CUDA_KNOWN_GPU_ARCHS
+        ${TBAG_CUDA_KEPLER}
+        ${TBAG_CUDA_MAXWELL}
+        ${TBAG_CUDA_PASCAL}
+        ${TBAG_CUDA_VOLTA})
+set (TBAG_CUDA_KNOWN_GPU_ARCHS_NAMES
+        ${TBAG_CUDA_KEPLER_VERS}
+        ${TBAG_CUDA_MAXWELL_VERS}
+        ${TBAG_CUDA_PASCAL_VERS}
+        ${TBAG_CUDA_VOLTA_VERS}
+        All Manual Local)
+
+if (NOT CMAKE_CROSSCOMPILING)
+    list (APPEND TBAG_CUDA_KNOWN_GPU_ARCHS_NAMES Auto)
+    set (TBAG_CUDA_KNOWN_GPU_ARCHS_DEFAULT Auto)
+else ()
+    set (TBAG_CUDA_KNOWN_GPU_ARCHS_DEFAULT All)
+endif ()
+
+set (CUDA_ARCH_NAME ${TBAG_CUDA_KNOWN_GPU_ARCHS_DEFAULT} CACHE STRING "Select target NVIDIA GPU achitecture.")
+set_property (CACHE CUDA_ARCH_NAME PROPERTY STRINGS "" ${TBAG_CUDA_KNOWN_GPU_ARCHS_NAMES})
+mark_as_advanced (CUDA_ARCH_NAME)
+
+# verify CUDA_ARCH_NAME value
+if (NOT ";${TBAG_CUDA_KNOWN_GPU_ARCHS_NAMES};" MATCHES ";${CUDA_ARCH_NAME};")
+    string (REPLACE ";" ", " TBAG_CUDA_KNOWN_GPU_ARCHS_NAMES "${TBAG_CUDA_KNOWN_GPU_ARCHS_NAMES}")
+    message (FATAL_ERROR "Only ${TBAG_CUDA_KNOWN_GPU_ARCHS_NAMES} architeture names are supported.")
+endif ()

 #/// A function for automatic detection of GPUs installed  (if autodetection is enabled)
 #///
@@ -53,7 +106,7 @@
         message (FATAL_ERROR "Not found nvcc executable: ${CUDA_NVCC_EXECUTABLE}")
     endif ()

-    if (NOT __gpu_detect_output)
+    if (NOT CUDA_GPU_DETECT_OUTPUT)
         set (__cuda_source_file "${PROJECT_BINARY_DIR}/tabg_cuda__find_detect_arch.cu")

         file (WRITE ${__cuda_source_file} ""
@@ -77,23 +130,30 @@
                 "    return 0;"
                 "}")

-        execute_process (COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${__cuda_source_file}" "-ccbin" "${CMAKE_CXX_COMPILER}" -Xcompiler /w
+        if (MSVC)
+            set (CUDA_GPU_DETECT_EXT_FLAGS -ccbin "${CMAKE_CXX_COMPILER}" -Xcompiler /w)
+        else ()
+            set (CUDA_GPU_DETECT_EXT_FLAGS -ccbin "${CMAKE_CXX_COMPILER}" -Xcompiler -w)
+        endif ()
+
+        execute_process (COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${__cuda_source_file}" ${CUDA_GPU_DETECT_EXT_FLAGS}
                 WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                 RESULT_VARIABLE __nvcc_exit_code
                 OUTPUT_VARIABLE __nvcc_output
                 ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

         if (__nvcc_exit_code EQUAL 0)
-            string (REPLACE "2.1" "2.1(2.0)" __nvcc_output "${__nvcc_output}")
-            set (__gpu_detect_output ${__nvcc_output} CACHE INTERNAL "Returned GPU architetures" FORCE)
-        endif ()
-    endif ()
-
-    if (NOT __gpu_detect_output)
+            ## Deprecated version: 2.x
+            ## string (REPLACE "2.1" "2.1(2.0)" __nvcc_output "${__nvcc_output}")
+            set (CUDA_GPU_DETECT_OUTPUT ${__nvcc_output} CACHE INTERNAL "Returned GPU architetures" FORCE)
+        endif ()
+    endif ()
+
+    if (NOT CUDA_GPU_DETECT_OUTPUT)
         message (STATUS "Automatic GPU detection failed. Building for all known architectures.")
         set (${__result} ${TBAG_CUDA_KNOWN_GPU_ARCHS})
     else ()
-        set (${__result} ${__gpu_detect_output})
+        set (${__result} ${CUDA_GPU_DETECT_OUTPUT})
     endif ()

     # Update result.
@@ -104,42 +164,25 @@
 #///
 #/// @param __result [out] Output result variable.
 function (tabg_cuda__select_nvcc_arch_flags __result)
-    # List of arch names
-    set (__archs_names "Fermi" "Kepler" "Maxwell" "Pascal" "All" "Manual" "Local")
-    set (__archs_name_default "All")
-    if (NOT CMAKE_CROSSCOMPILING)
-        list (APPEND __archs_names "Auto")
-        set (__archs_name_default "Auto")
-    endif ()
-
-    # set CUDA_ARCH_NAME strings (so it will be seen as dropbox in CMake-Gui)
-    set (CUDA_ARCH_NAME ${__archs_name_default} CACHE STRING "Select target NVIDIA GPU achitecture.")
-    set_property (CACHE CUDA_ARCH_NAME PROPERTY STRINGS "" ${__archs_names} )
-    mark_as_advanced (CUDA_ARCH_NAME)
-
-    # verify CUDA_ARCH_NAME value
-    if (NOT ";${__archs_names};" MATCHES ";${CUDA_ARCH_NAME};")
-        string (REPLACE ";" ", " __archs_names "${__archs_names}")
-        message (FATAL_ERROR "Only ${__archs_names} architeture names are supported.")
-    endif ()
-
     if (${CUDA_ARCH_NAME} STREQUAL "Manual")
         set (CUDA_ARCH_BIN ${TBAG_CUDA_KNOWN_GPU_ARCHS} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
-        set (CUDA_ARCH_PTX "50"                         CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")
+        set (CUDA_ARCH_PTX "61"                         CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")
         mark_as_advanced (CUDA_ARCH_BIN CUDA_ARCH_PTX)
     else ()
         unset (CUDA_ARCH_BIN CACHE)
         unset (CUDA_ARCH_PTX CACHE)
     endif ()

-    if (${CUDA_ARCH_NAME} STREQUAL "Fermi")
-        set (__cuda_arch_bin "20 21(20)")
-    elseif (${CUDA_ARCH_NAME} STREQUAL "Kepler")
-        set (__cuda_arch_bin "30 35")
-    elseif (${CUDA_ARCH_NAME} STREQUAL "Maxwell")
-        set (__cuda_arch_bin "50")
-    elseif (${CUDA_ARCH_NAME} STREQUAL "Pascal")
-        set (__cuda_arch_bin "61")
+    if (${CUDA_ARCH_NAME} STREQUAL "${TBAG_CUDA_FERMI}")
+        set (__cuda_arch_bin ${TBAG_CUDA_FERMI_VERS})
+    elseif (${CUDA_ARCH_NAME} STREQUAL "${TBAG_CUDA_KEPLER}")
+        set (__cuda_arch_bin ${TBAG_CUDA_KEPLER_VERS})
+    elseif (${CUDA_ARCH_NAME} STREQUAL "${TBAG_CUDA_MAXWELL}")
+        set (__cuda_arch_bin ${TBAG_CUDA_MAXWELL_VERS})
+    elseif (${CUDA_ARCH_NAME} STREQUAL "${TBAG_CUDA_PASCAL}")
+        set (__cuda_arch_bin ${TBAG_CUDA_PASCAL_VERS})
+    elseif (${CUDA_ARCH_NAME} STREQUAL "${TBAG_CUDA_VOLTA})")
+        set (__cuda_arch_bin ${TBAG_CUDA_VOLTA_VERS})
     elseif (${CUDA_ARCH_NAME} STREQUAL "All")
         set (__cuda_arch_bin ${TBAG_CUDA_KNOWN_GPU_ARCHS})
     elseif (${CUDA_ARCH_NAME} STREQUAL "Auto")


Fix dotnet exe portability between FreeBSD versions. (#5072)

Link pthread in resulting binary.

--- src/corehost/cli/exe.cmake
+++ src/corehost/cli/exe.cmake
@@ -56,8 +56,13 @@
     target_link_libraries(${DOTNET_HOST_EXE_NAME} shell32.lib)
 endif()

+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+    target_link_libraries (${DOTNET_HOST_EXE_NAME} "pthread")
+endif()
+
 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-    target_link_libraries (${DOTNET_HOST_EXE_NAME} "dl" "pthread")
+    target_link_libraries (${DOTNET_HOST_EXE_NAME} "dl")
 endif()

+


STYLE: indent file

STYLE: indent file

--- CMake/OTBManageLargeInputPaths.cmake
+++ CMake/OTBManageLargeInputPaths.cmake
@@ -1,77 +1,77 @@
 # --------------------------------------------------------------------------------
 # Manage PHR data input
 if(OTB_DATA_USE_LARGEINPUT)
-   set(GenericTestPHR_DATA_INPUTS
-      ${GenericTestPHR_DATA_INPUTS}
-      ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES-PRE/TLSE_JP2_ORTHO_DIMAPv2_PMS-N_lossy_12bits/IMG_PHR1Z_PMS_N_001/IMG_PHR1A_PMS-N_201006181052297_ORT_IPU_20111011_0619-001_R1C1.JP2
-      ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES-PRE/TLSE_TIFF_ORTHO_DIMAPv2_MS_lossless_8bits/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_ORT_IPU_20111109_7807-004_R1C1.TIF
-      ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES-PRE/TLSE_TIFF_PRIMARY_DIMAPv2_MS_lossly_12bits/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_SEN_IPU_20111025_3077-004_R1C1.TIF
-      ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES/TLSE_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R2C1.JP2
-      ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES/LASVEGAS_JP2_DIMAPv1_PRIMARY_PMS_lossless_12bits/IMGPHR_PHR1A_SENSOR_20120217_IPU_20120217_5374-001_V1/IMG_R1C1.JP2
-      ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES/PARIS_JP2_DIMAPv1_ORTHO_PMS_lossless_12bits/IMGPHR_PHR1A_ORTHO_20120502_IPU_20120430_6347-003_V1/IMG_R1C1.JP2
-   )
+  set(GenericTestPHR_DATA_INPUTS
+    ${GenericTestPHR_DATA_INPUTS}
+    ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES-PRE/TLSE_JP2_ORTHO_DIMAPv2_PMS-N_lossy_12bits/IMG_PHR1Z_PMS_N_001/IMG_PHR1A_PMS-N_201006181052297_ORT_IPU_20111011_0619-001_R1C1.JP2
+    ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES-PRE/TLSE_TIFF_ORTHO_DIMAPv2_MS_lossless_8bits/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_ORT_IPU_20111109_7807-004_R1C1.TIF
+    ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES-PRE/TLSE_TIFF_PRIMARY_DIMAPv2_MS_lossly_12bits/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_SEN_IPU_20111025_3077-004_R1C1.TIF
+    ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES/TLSE_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R2C1.JP2
+    ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES/LASVEGAS_JP2_DIMAPv1_PRIMARY_PMS_lossless_12bits/IMGPHR_PHR1A_SENSOR_20120217_IPU_20120217_5374-001_V1/IMG_R1C1.JP2
+    ${OTB_DATA_LARGEINPUT_ROOT}/PLEIADES/PARIS_JP2_DIMAPv1_ORTHO_PMS_lossless_12bits/IMGPHR_PHR1A_ORTHO_20120502_IPU_20120430_6347-003_V1/IMG_R1C1.JP2
+    )

-   set(GenericTestPHR_DATA_TYPES
-      ${GenericTestPHR_DATA_TYPES}
-      SIMUL_PHR_JP2_ORTHO_DIMAPv2_PMS-N_lossy_12bits
-      SIMUL_PHR_TIFF_ORTHO_DIMAPv2_MS_lossless_8bits
-      SIMUL_PHR_TIFF_PRIMARY_DIMAPv2_MS_lossy_12bits
-      PHR_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits
-      PHR_JP2_DIMAPv1_PRIMARY_PMS_lossless_12bits
-      PHR_JP2_DIMAPv1_ORTHO_PMS_lossless_12bits
-   )
+  set(GenericTestPHR_DATA_TYPES
+    ${GenericTestPHR_DATA_TYPES}
+    SIMUL_PHR_JP2_ORTHO_DIMAPv2_PMS-N_lossy_12bits
+    SIMUL_PHR_TIFF_ORTHO_DIMAPv2_MS_lossless_8bits
+    SIMUL_PHR_TIFF_PRIMARY_DIMAPv2_MS_lossy_12bits
+    PHR_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits
+    PHR_JP2_DIMAPv1_PRIMARY_PMS_lossless_12bits
+    PHR_JP2_DIMAPv1_ORTHO_PMS_lossless_12bits
+    )

-   set(GenericTestSPOT6_DATA_INPUTS
-      ${GenericTestSPOT6_DATA_INPUTS}
-      ${OTB_DATA_LARGEINPUT_ROOT}/SPOT6/SPOT6_Ortho_Bundle_12_bits/PROD_SPOT6_001/VOL_SPOT6_001_A/IMG_SPOT6_MS_001_A/IMG_SPOT6_MS_201306031242000_ORT_816005101_R1C1.JP2
-      ${OTB_DATA_LARGEINPUT_ROOT}/SPOT6/SPOT6_Ortho_Pan-sharpened_12_bits/PROD_SPOT6_001/VOL_SPOT6_001_A/IMG_SPOT6_PMS_001_A/IMG_SPOT6_PMS_201305251604372_ORT_816009101_R1C1.JP2
-      ${OTB_DATA_LARGEINPUT_ROOT}/SPOT6/SPOT6_Primary_Bundle_12_bits/PROD_SPOT6_001/VOL_SPOT6_001_A/IMG_SPOT6_MS_001_A/IMG_SPOT6_MS_201211100138085_SEN_816007101_R1C1.JP2
-   )
+  set(GenericTestSPOT6_DATA_INPUTS
+    ${GenericTestSPOT6_DATA_INPUTS}
+    ${OTB_DATA_LARGEINPUT_ROOT}/SPOT6/SPOT6_Ortho_Bundle_12_bits/PROD_SPOT6_001/VOL_SPOT6_001_A/IMG_SPOT6_MS_001_A/IMG_SPOT6_MS_201306031242000_ORT_816005101_R1C1.JP2
+    ${OTB_DATA_LARGEINPUT_ROOT}/SPOT6/SPOT6_Ortho_Pan-sharpened_12_bits/PROD_SPOT6_001/VOL_SPOT6_001_A/IMG_SPOT6_PMS_001_A/IMG_SPOT6_PMS_201305251604372_ORT_816009101_R1C1.JP2
+    ${OTB_DATA_LARGEINPUT_ROOT}/SPOT6/SPOT6_Primary_Bundle_12_bits/PROD_SPOT6_001/VOL_SPOT6_001_A/IMG_SPOT6_MS_001_A/IMG_SPOT6_MS_201211100138085_SEN_816007101_R1C1.JP2
+    )

-   set(GenericTestSPOT6_DATA_TYPES
-      ${GenericTestSPOT6_DATA_TYPES}
-      SPOT6_Ortho_Bundle_12_bits
-      SPOT6_Ortho_Pan-sharpened_12_bits
-      SPOT6_Primary_Bundle_12_bits
-   )
+  set(GenericTestSPOT6_DATA_TYPES
+    ${GenericTestSPOT6_DATA_TYPES}
+    SPOT6_Ortho_Bundle_12_bits
+    SPOT6_Ortho_Pan-sharpened_12_bits
+    SPOT6_Primary_Bundle_12_bits
+    )

 endif()

 if(OTB_DATA_USE_SPOTPHRINPUT)
   set(GenericTestPHR_SPOT_DATA_INPUTS
-      ${SPOTPHRINPUT}/ORTHO_UTM_BUNDLE/IMG_PHR1A_P_001/IMG_PHR1A_P_201006181052297_ORT_IPU_20120221_8798-001_R1C1.JP2
-      ${SPOTPHRINPUT}/ORTHO_UTM_BUNDLE/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_ORT_IPU_20120221_8798-002_R1C1.JP2
-      ${SPOTPHRINPUT}/PRIMARY_BUNDLE/IMG_PHR1A_P_001/IMG_PHR1A_P_201006181052297_SEN_IPU_20120221_8686-001_R1C1.JP2
-      ${SPOTPHRINPUT}/PRIMARY_BUNDLE/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_SEN_IPU_20120221_8686-002_R1C1.JP2
-      ${SPOTPHRINPUT}/ORTHO_GEOGRAPHIC_BUNDLE/IMG_PHR1A_P_001/IMG_PHR1A_P_201006181052297_ORT_IPU_20120221_8718-001_R1C1.JP2
-      ${SPOTPHRINPUT}/ORTHO_GEOGRAPHIC_BUNDLE/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_ORT_IPU_20120221_8718-002_R1C1.JP2
-      )
+    ${SPOTPHRINPUT}/ORTHO_UTM_BUNDLE/IMG_PHR1A_P_001/IMG_PHR1A_P_201006181052297_ORT_IPU_20120221_8798-001_R1C1.JP2
+    ${SPOTPHRINPUT}/ORTHO_UTM_BUNDLE/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_ORT_IPU_20120221_8798-002_R1C1.JP2
+    ${SPOTPHRINPUT}/PRIMARY_BUNDLE/IMG_PHR1A_P_001/IMG_PHR1A_P_201006181052297_SEN_IPU_20120221_8686-001_R1C1.JP2
+    ${SPOTPHRINPUT}/PRIMARY_BUNDLE/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_SEN_IPU_20120221_8686-002_R1C1.JP2
+    ${SPOTPHRINPUT}/ORTHO_GEOGRAPHIC_BUNDLE/IMG_PHR1A_P_001/IMG_PHR1A_P_201006181052297_ORT_IPU_20120221_8718-001_R1C1.JP2
+    ${SPOTPHRINPUT}/ORTHO_GEOGRAPHIC_BUNDLE/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_ORT_IPU_20120221_8718-002_R1C1.JP2
+    )

   set(GenericTestPHR_SPOT_DATA_TYPES
-	  SPOT_PHR_ORTHO_UTM_P
-	  SPOT_PHR_ORTHO_UTM_MS
-	  SPOT_PHR_ORTHO_GEO_P
-      	  SPOT_PHR_ORTHO_GEO_MS
-	  SPOT_PHR_PRIMARY_MS
-	  SPOT_PHR_PRIMARY_P
-	 )
+    SPOT_PHR_ORTHO_UTM_P
+    SPOT_PHR_ORTHO_UTM_MS
+    SPOT_PHR_ORTHO_GEO_P
+    SPOT_PHR_ORTHO_GEO_MS
+    SPOT_PHR_PRIMARY_MS
+    SPOT_PHR_PRIMARY_P
+    )

-   set(GenericTestPHR_DATA_INPUTS ${GenericTestPHR_DATA_INPUTS} ${GenericTestPHR_SPOT_DATA_INPUTS})
-   set(GenericTestPHR_DATA_TYPES ${GenericTestPHR_DATA_TYPES} ${GenericTestPHR_SPOT_DATA_TYPES})
+  set(GenericTestPHR_DATA_INPUTS ${GenericTestPHR_DATA_INPUTS} ${GenericTestPHR_SPOT_DATA_INPUTS})
+  set(GenericTestPHR_DATA_TYPES ${GenericTestPHR_DATA_TYPES} ${GenericTestPHR_SPOT_DATA_TYPES})
 endif()

 if(OTB_DATA_USE_CNESPHRINPUT)
   set(GenericTestPHR_CNES_DATA_INPUTS
-      ${CNESPHRINPUT}/PRIMARY_PMS/IMGPHR_201212716417737721/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120127_5579-001_R1C1.JP2
-      ${CNESPHRINPUT}/PRIMARY_PMS/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R1C1.JP2
-      ${CNESPHRINPUT}/PRIMARY_PMS/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R3C1.JP2
-      )
+    ${CNESPHRINPUT}/PRIMARY_PMS/IMGPHR_201212716417737721/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120127_5579-001_R1C1.JP2
+    ${CNESPHRINPUT}/PRIMARY_PMS/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R1C1.JP2
+    ${CNESPHRINPUT}/PRIMARY_PMS/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R3C1.JP2
+    )

   set(GenericTestPHR_CNES_DATA_TYPES
-	  CNES_PHR_PRIMARY_PMS_R1C1_2012-01-27
-	  CNES_PHR_PRIMARY_PMS_R1C1_2012-02-22
-	  CNES_PHR_PRIMARY_PMS_R3C1_2012-02-22
-	 )
+    CNES_PHR_PRIMARY_PMS_R1C1_2012-01-27
+    CNES_PHR_PRIMARY_PMS_R1C1_2012-02-22
+    CNES_PHR_PRIMARY_PMS_R3C1_2012-02-22
+    )

   set(GenericTestPHR_DATA_INPUTS ${GenericTestPHR_DATA_INPUTS} ${GenericTestPHR_CNES_DATA_INPUTS})
   set(GenericTestPHR_DATA_TYPES ${GenericTestPHR_DATA_TYPES} ${GenericTestPHR_CNES_DATA_TYPES})


FIX: ChestConventions change fix. TG-55 #in-progress

--- SuperBuild/External_CIP.cmake
+++ SuperBuild/External_CIP.cmake
@@ -30,10 +30,13 @@
     set(git_protocol "git")
   endif()
   message(STATUS ${VTK_DIR})
-ExternalProject_Add(${proj}
+
+  get_filename_component(Slicer_PYTHON_DIR ${SlicerExecutionModel_DIR} PATH)
+
+  ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${git_protocol}://github.com/acil-bwh/ChestImagingPlatform.git"
-    GIT_TAG develop # Develop
+    GIT_TAG develop
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     #DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Remove this line and uncomment GIT_REPOSITORY and GIT_TAG"
     #SOURCE_DIR ../CIP
@@ -69,9 +72,7 @@
       -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
       -DBUILD_TESTING:BOOL=OFF
       -DCMAKE_CXX_FLAGS:STRING=${CIP_CMAKE_CXX_FLAGS}
-      -DUSE_CYTHON:BOOL=OFF
-      # Temporal to FIX bug. Remove when the name is shorter
-      -DBUILD_GENERATEREGIONHISTOGRAMANDPARENCHYMAPHENOTYPES:BOOL=OFF
+      -DCIP_PYTHON_DIR:PATH=${Slicer_PYTHON_DIR}/python-install

     #CONFIGURE_COMMAND ${CMAKE_COMMAND}
     #-E echo


Update ITK along 5.1 development

Update ITK along 5.1 development

This update include improvements to the MeanImageFilter to directly
support VectorImages.

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

 # post v5.1rc01
-set(_DEFAULT_ITK_GIT_TAG "e8aba69589860916dd4ca165145ca7471c749227")
+set(_DEFAULT_ITK_GIT_TAG "c342c6aedcebb2252e07a8e37892da965d6acff5")
 set(ITK_GIT_TAG "${_DEFAULT_ITK_GIT_TAG}" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


dead file cleanup

dead file cleanup

--- src/xzero/http/cortex-http.pc.cmake
+++ src/xzero/http/cortex-http.pc.cmake
@@ -1,9 +0,0 @@
-# cortex-http.pc.cmake
-
-Name: cortex-http
-Description: Xzero HTTP framework
-Version: @XZERO_BASE_HTTP_VERSION@
-Requires: cortex-base >= 0.10.0
-# Conflicts:
-Libs: -lcortex-http
-# Cflags:


Update jenkins_mercury.cmake

Update jenkins_mercury.cmake

--- Testing/jenkins_mercury.cmake
+++ Testing/jenkins_mercury.cmake
@@ -73,7 +73,7 @@
 BMI_INCLUDE_DIR:PATH=$ENV{WORKSPACE}/.install/include
 BMI_LIBRARY:FILEPATH=$ENV{WORKSPACE}/.install/lib/libbmi.so
 NA_USE_MPI:BOOL=ON
-OPA_INCLUDE_DIR:PATH=/usr/include
+OPA_INCLUDE_DIR:PATH=/usr/include/mpich2
 OPA_LIBRARY:FILEPATH=/usr/lib/libopa.so
 MPIEXEC_MAX_NUMPROCS:STRING=4
 ")


优化依赖链Patch脚本

优化依赖链Patch脚本

--- project/cmake/modules/ProjectBuildTools.cmake
+++ project/cmake/modules/ProjectBuildTools.cmake
@@ -364,7 +364,13 @@
     endif ()
 endfunction()

-function(project_build_tools_patch_remove_imported_link_interface_libraries TARGET_NAME)
+function(project_build_tools_patch_imported_link_interface_libraries TARGET_NAME)
+    if (CMAKE_VERSION VERSION_LESS_EQUAL "3.4")
+        include(CMakeParseArguments)
+    endif ()
+    set(multiValueArgs ADD_LIBRARIES REMOVE_LIBRARIES)
+    cmake_parse_arguments(PATCH_OPTIONS "" "" "${multiValueArgs}" ${ARGN})
+
     get_target_property(OLD_LINK_LIBRARIES ${TARGET_NAME} INTERFACE_LINK_LIBRARIES)
     set(PROPERTY_NAME "")
     if (OLD_LINK_LIBRARIES)
@@ -383,15 +389,20 @@
             set(PROPERTY_NAME "IMPORTED_LINK_INTERFACE_LIBRARIES_${OLD_IMPORTED_CONFIGURATIONS}")
         endif ()
     endif ()
-    if (PROPERTY_NAME)
-        unset(PATCH_INNER_LIBS)
-        set(PATCH_INNER_ACTIVE FALSE)
+    if (NOT PROPERTY_NAME)
+        set(PROPERTY_NAME "INTERFACE_LINK_LIBRARIES")
+    endif ()
+
+    if(NOT OLD_LINK_LIBRARIES)
+        set(OLD_LINK_LIBRARIES "") # Reset NOTFOUND
+    endif()
+    unset(PATCH_INNER_LIBS)
+    if (OLD_LINK_LIBRARIES AND PATCH_OPTIONS_REMOVE_LIBRARIES)
         foreach(DEP_PATH IN LISTS OLD_LINK_LIBRARIES)
             set(MATCH_ANY_RULES FALSE)
-            foreach(MATCH_RULE ${ARGN})
+            foreach(MATCH_RULE IN LISTS PATCH_OPTIONS_REMOVE_LIBRARIES)
                 if(DEP_PATH MATCHES ${MATCH_RULE})
                     set(MATCH_ANY_RULES TRUE)
-                    set(PATCH_INNER_ACTIVE TRUE)
                     break()
                 endif()
             endforeach()
@@ -400,47 +411,26 @@
                 list(APPEND PATCH_INNER_LIBS ${DEP_PATH})
             endif ()
         endforeach()
-
-        if (PATCH_INNER_ACTIVE)
-            set_target_properties(${TARGET_NAME} PROPERTIES ${PROPERTY_NAME} "${PATCH_INNER_LIBS}")
-            message(STATUS "Patch Remove: ${PROPERTY_NAME} of ${TARGET_NAME} from ${OLD_LINK_LIBRARIES} to ${PATCH_INNER_LIBS}")
-        endif ()
-    endif ()
-endfunction()
-
-function(project_build_tools_patch_add_imported_link_interface_libraries TARGET_NAME)
-    get_target_property(OLD_LINK_LIBRARIES ${TARGET_NAME} INTERFACE_LINK_LIBRARIES)
-    set(PROPERTY_NAME "")
-    if (OLD_LINK_LIBRARIES)
-        set(PROPERTY_NAME "INTERFACE_LINK_LIBRARIES")
-    endif ()
-    if (NOT PROPERTY_NAME)
-        get_target_property(OLD_LINK_LIBRARIES ${TARGET_NAME} IMPORTED_LINK_INTERFACE_LIBRARIES)
-        if (OLD_LINK_LIBRARIES)
-            set(PROPERTY_NAME "IMPORTED_LINK_INTERFACE_LIBRARIES")
-        endif ()
-    endif ()
-    if (NOT PROPERTY_NAME)
-        get_target_property(OLD_IMPORTED_CONFIGURATIONS ${TARGET_NAME} IMPORTED_CONFIGURATIONS)
-        get_target_property(OLD_LINK_LIBRARIES ${TARGET_NAME} "IMPORTED_LINK_INTERFACE_LIBRARIES_${OLD_IMPORTED_CONFIGURATIONS}")
-        if (OLD_LINK_LIBRARIES)
-            set(PROPERTY_NAME "IMPORTED_LINK_INTERFACE_LIBRARIES_${OLD_IMPORTED_CONFIGURATIONS}")
-        endif ()
-    endif ()
-    if (NOT PROPERTY_NAME)
-        set(PROPERTY_NAME "INTERFACE_LINK_LIBRARIES")
-    endif ()
-
-    if (OLD_LINK_LIBRARIES)
+        if (PATCH_OPTIONS_ADD_LIBRARIES)
+            list(APPEND PATCH_INNER_LIBS ${PATCH_OPTIONS_ADD_LIBRARIES})
+        endif()
+    elseif (OLD_LINK_LIBRARIES)
         set(PATCH_INNER_LIBS ${OLD_LINK_LIBRARIES})
-        list(APPEND PATCH_INNER_LIBS ${ARGN})
-    else ()
-        set(PATCH_INNER_LIBS ${ARGN})
-    endif ()
-    list(REMOVE_DUPLICATES PATCH_INNER_LIBS)
-
-    if (NOT OLD_LINK_LIBRARIES EQUAL PATCH_INNER_LIBS)
+        if (PATCH_OPTIONS_ADD_LIBRARIES)
+            list(APPEND PATCH_INNER_LIBS ${PATCH_OPTIONS_ADD_LIBRARIES})
+        endif()
+    elseif (PATCH_OPTIONS_ADD_LIBRARIES)
+        set(PATCH_INNER_LIBS ${PATCH_OPTIONS_ADD_LIBRARIES})
+    else()
+        set(PATCH_INNER_LIBS "")
+    endif ()
+
+    if (PATCH_INNER_LIBS)
+        list(REMOVE_DUPLICATES PATCH_INNER_LIBS)
+    endif()
+
+    if (NOT OLD_LINK_LIBRARIES STREQUAL PATCH_INNER_LIBS)
         set_target_properties(${TARGET_NAME} PROPERTIES ${PROPERTY_NAME} "${PATCH_INNER_LIBS}")
-        message(STATUS "Patch Add: ${PROPERTY_NAME} of ${TARGET_NAME} from ${OLD_LINK_LIBRARIES} to ${PATCH_INNER_LIBS}")
-    endif ()
-endfunction()
+        message(STATUS "Patch: ${PROPERTY_NAME} of ${TARGET_NAME} from ${OLD_LINK_LIBRARIES} to ${PATCH_INNER_LIBS}")
+    endif ()
+endfunction()


CMake: don't recheck compile flags every time

Doesn't cause a problem when embedded within a larger project, but is
annoying.

--- build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
+++ build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
@@ -2,20 +2,21 @@
 include(CheckCCompilerFlag)

 function(EnableCompilerFlag _flag _C _CXX)
-    message("Checking flag ${_flag}")
+    string(REGEX REPLACE "\\+" "PLUS" varname "${_flag}")
+    string(REGEX REPLACE "[^A-Za-z0-9]+" "_" varname "${varname}")
+    string(REGEX REPLACE "^_+" "" varname "${varname}")
+    string(TOUPPER "${varname}" varname)
     if (_C)
-        CHECK_C_COMPILER_FLAG(${_flag} C_FLAG)
-        if (C_FLAG)
+        CHECK_C_COMPILER_FLAG(${_flag} C_FLAG_${varname})
+        if (C_FLAG_${varname})
             set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}" CACHE INTERNAL "C Flags")
         endif ()
-        unset(C_FLAG CACHE)
     endif ()
     if (_CXX)
-        CHECK_CXX_COMPILER_FLAG(${_flag} CXX_FLAG)
-        if (CXX_FLAG)
+        CHECK_CXX_COMPILER_FLAG(${_flag} CXX_FLAG_${varname})
+        if (CXX_FLAG_${varname})
             set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}" CACHE INTERNAL "CXX Flags")
         endif ()
-        unset(CXX_FLAG CACHE)
     endif ()
 endfunction()


[OGRE-273] Correct the case of the Ogre framework name to match what we build.

--HG--
branch : v1-9

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -162,7 +162,7 @@
 	use_pkgconfig(OGRE_PKGC "OGRE${OGRE_LIB_SUFFIX}")

 	# try to find framework on OSX
-	findpkg_framework(OGRE)
+	findpkg_framework(Ogre)
 else()
 	set(OGRE_LIBRARY_FWK "")
 endif()


updated MitkData revision tag and testdata repository

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -12,7 +12,7 @@
 set(MITK-Data_DEPENDS ${proj})

 if(BUILD_TESTING)
-  set(revision_tag 403cc83b)
+  set(revision_tag 0bcd9d70)
 #                 ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


Use major.minor version for ABI (#143)

Use major.minor version for ABI (#143)

--- CMakeModules/FCLVersion.cmake
+++ CMakeModules/FCLVersion.cmake
@@ -5,4 +5,4 @@
 set(FCL_VERSION "${FCL_MAJOR_VERSION}.${FCL_MINOR_VERSION}.${FCL_PATCH_VERSION}")

 # increment this when we have ABI changes
-set(FCL_ABI_VERSION 7)
+set(FCL_ABI_VERSION ${FCL_MAJOR_VERSION}.${FCL_MINOR_VERSION})


Cleaned up FindFFmpeg.cmake

Cleaned up FindFFmpeg.cmake

--- CMakeModules/FindFFmpeg.cmake
+++ CMakeModules/FindFFmpeg.cmake
@@ -93,9 +93,9 @@
         /usr/freeware/lib64
     )

-    IF   (FFMPEG_${varname}_LIBRARIES)
+    IF   (FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
         SET(FFMPEG_${varname}_FOUND 1)
-    ENDIF(FFMPEG_${varname}_LIBRARIES)
+    ENDIF(FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)

 ENDMACRO(FFMPEG_FIND)

@@ -126,6 +126,6 @@

 ELSE (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND)

-    MESSAGE(STATUS "Could not find FFMPEG")
+#    MESSAGE(STATUS "Could not find FFMPEG")

 ENDIF(FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND)


update: coverage processing

update: coverage processing

--- cmake/HUGH_FIELDS_SetupVariables.cmake
+++ cmake/HUGH_FIELDS_SetupVariables.cmake
@@ -11,3 +11,5 @@
 endif()

 include(CMakeAddons_SetupVariables)
+
+set(${PROJECT_NAME}_COVERAGE_EXCLUDE "${${PROJECT_NAME}_COVERAGE_EXCLUDE} 'install/*'")


[CMake][Exp PyROOT] Change PYTHON_VERSION to PYTHON_VERSION_STRING for old CMake

--- cmake/modules/SearchRootCoreDeps.cmake
+++ cmake/modules/SearchRootCoreDeps.cmake
@@ -222,7 +222,7 @@
   find_package(NumPy)

   set(PYTHON_EXECUTABLE_Development_Main "${PYTHON_EXECUTABLE}")
-  set(PYTHON_VERSION_STRING_Development_Main "${PYTHON_VERSION}")
+  set(PYTHON_VERSION_STRING_Development_Main "${PYTHON_VERSION_STRING}")
   set(PYTHON_UNDER_VERSION_STRING_Development_Main "${PYTHON_VERSION_MAJOR}_${PYTHON_VERSION_MINOR}")
   set(PYTHON_INCLUDE_DIRS_Development_Main "${PYTHON_INCLUDE_DIRS}")
   set(PYTHON_LIBRARIES_Development_Main "${PYTHON_LIBRARIES}")


cmake: add terminal detection to mac os

cmake: add terminal detection to mac os

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1474,14 +1474,22 @@
 #
 #=============================================================================#
 function(setup_serial_target TARGET_NAME CMD SERIAL_PORT)
-    file(GLOB TERMINALS "/usr/bin/gnome-terminal" "/usr/bin/konsole" "/usr/bin/xterm")
-    list(GET TERMINALS 0 TERMINAL)
-
     set(ARGUMENTS "-e" "'${CMD} ${SERIAL_PORT}'")
     separate_arguments(ARGUMENTS)

+    # Detect terminal
+    if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+        file(GLOB TERMINALS "/usr/bin/gnome-terminal" "/usr/bin/konsole" "/usr/bin/xterm")
+        list(GET TERMINALS 0 TERMINAL)
+    elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
+        set(TERMINAL "open -b com.apple.terminal")
+    else()
+        message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} not supported yet." )
+    endif()
+
     add_custom_target(${TARGET_NAME}-serial
-                      COMMAND ${TERMINAL} ${ARGUMENTS})
+            COMMAND ${TERMINAL} ${ARGUMENTS})
+
 endfunction()


build: obsolete options which have long been deprecated

This is simply dropping the error that would be presented for any
existing usage.  These have been rooted out for some time now.  Remove
the obsoleted checks.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1542,15 +1542,10 @@
 #   Sources to add into this library.
 function(add_swift_host_library name)
   set(options
-        FORCE_BUILD_OPTIMIZED
         SHARED
         STATIC)
   set(single_parameter_options)
   set(multiple_parameter_options
-        C_COMPILE_FLAGS
-        DEPENDS
-        FILE_DEPENDS
-        LINK_LIBRARIES
         LLVM_LINK_COMPONENTS)

   cmake_parse_arguments(ASHL
@@ -1559,22 +1554,6 @@
                         "${multiple_parameter_options}"
                         ${ARGN})
   set(ASHL_SOURCES ${ASHL_UNPARSED_ARGUMENTS})
-
-  if(ASHL_FORCE_BUILD_OPTIMIZED)
-    message(SEND_ERROR "library ${name} is using FORCE_BUILD_OPTIMIZED flag which is deprecated.  Please use target_compile_options instead")
-  endif()
-  if(ASHL_C_COMPILE_FLAGS)
-    message(SEND_ERROR "library ${name} is using C_COMPILE_FLAGS parameter which is deprecated.  Please use target_compile_definitions, target_compile_options, or target_include_directories instead")
-  endif()
-  if(ASHL_DEPENDS)
-    message(SEND_ERROR "library ${name} is using DEPENDS parameter which is deprecated.  Please use add_dependencies instead")
-  endif()
-  if(ASHL_FILE_DEPENDS)
-    message(SEND_ERROR "library ${name} is using FILE_DEPENDS parameter which is deprecated.")
-  endif()
-  if(ASHL_LINK_LIBRARIES)
-    message(SEND_ERROR "library ${name} is using LINK_LIBRARIES parameter which is deprecated.  Please use target_link_libraries instead")
-  endif()

   translate_flags(ASHL "${options}")

@@ -2524,21 +2503,21 @@
 #   [ARCHITECTURE architecture]
 #     Architecture to build for.
 function(_add_swift_executable_single name)
-  # Parse the arguments we were given.
+  set(options)
+  set(single_parameter_options
+    ARCHITECTURE
+    SDK)
+  set(multiple_parameter_options
+    COMPILE_FLAGS
+    DEPENDS
+    LLVM_LINK_COMPONENTS)
   cmake_parse_arguments(SWIFTEXE_SINGLE
-    "EXCLUDE_FROM_ALL"
-    "SDK;ARCHITECTURE"
-    "DEPENDS;LLVM_LINK_COMPONENTS;LINK_LIBRARIES;COMPILE_FLAGS"
+    "${options}"
+    "${single_parameter_options}"
+    "${multiple_parameter_options}"
     ${ARGN})

   set(SWIFTEXE_SINGLE_SOURCES ${SWIFTEXE_SINGLE_UNPARSED_ARGUMENTS})
-
-  if(SWIFTEXE_SINGLE_EXCLUDE_FROM_ALL)
-    message(SEND_ERROR "${name} is using EXCLUDE_FROM_ALL option which is deprecated.")
-  endif()
-  if(SWIFTEXE_SINGLE_LINK_LIBRARIES)
-    message(SEND_ERROR "${name} is using LINK_LIBRARIES parameter which is deprecated.  Please use target_link_libraries instead")
-  endif()

   # Check arguments.
   precondition(SWIFTEXE_SINGLE_SDK MESSAGE "Should specify an SDK")
@@ -2663,17 +2642,13 @@
 function(add_swift_host_tool executable)
   set(options)
   set(single_parameter_options SWIFT_COMPONENT)
-  set(multiple_parameter_options LINK_LIBRARIES)
+  set(multiple_parameter_options)

   cmake_parse_arguments(ASHT
     "${options}"
     "${single_parameter_options}"
     "${multiple_parameter_options}"
     ${ARGN})
-
-  if(ASHT_LINK_LIBRARIES)
-    message(SEND_ERROR "${executable} is using LINK_LIBRARIES parameter which is deprecated.  Please use target_link_libraries instead")
-  endif()

   precondition(ASHT_SWIFT_COMPONENT
                MESSAGE "Swift Component is required to add a host tool")


CMake: Don't use copy_if_different for TableGen output, because it does not work with IDE targets

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -6,18 +6,12 @@
   file(GLOB local_tds "*.td")
   file(GLOB_RECURSE global_tds "${LLVM_MAIN_SRC_DIR}/include/llvm/*.td")

-  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
+  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
     COMMAND ${LLVM_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
     -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
     ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS}
-    -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
+    -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
     DEPENDS tblgen ${local_tds} ${global_tds}
-    COMMENT "Building ${ofn}.tmp..."
-    )
-  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
-    COMMAND ${CMAKE_COMMAND} -E copy_if_different
-    ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
-    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     COMMENT "Building ${ofn}..."
     )
   set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn})


CMake: set develop optimizations

CMake: set develop optimizations

--- cmake/profiles/develop.cmake
+++ cmake/profiles/develop.cmake
@@ -7,6 +7,7 @@
     list(APPEND c_compile_options
         "-c"
         "-std=gnu11"
+        "-Os"
     )
     target_compile_options(mbed-os
         PUBLIC
@@ -17,6 +18,7 @@
         "-std=gnu++14"
         "-fno-rtti"
         "-Wvla"
+        "-Os"
     )
     target_compile_options(mbed-os
         PUBLIC
@@ -46,6 +48,7 @@
 elseif(MBED_TOOLCHAIN STREQUAL "ARM")
     list(APPEND c_compile_options
         "-std=gnu11"
+        "-Os"
     )
     target_compile_options(mbed-os
         PUBLIC
@@ -56,6 +59,7 @@
         "-std=gnu++14"
         "-fno-rtti"
         "-fno-c++-static-destructors"
+        "-Os"
     )
     target_compile_options(mbed-os
         PUBLIC


SuperBuild: also package GeoTIFF data and OSSIM data

--- SuperBuild/CMake/Package_Macro.cmake
+++ SuperBuild/CMake/Package_Macro.cmake
@@ -202,6 +202,12 @@
     find_path(GDAL_DATA epsg.wkt ${PACKAGE_INSTALLDIR}/share/gdal)
     install(DIRECTORY ${GDAL_DATA} DESTINATION ${DATA_DIR})

+    ####################### install GeoTIFF data ###########################
+    install(DIRECTORY ${PACKAGE_INSTALLDIR}/share/epsg_csv DESTINATION ${DATA_DIR})
+
+    ####################### install OSSIM data ###########################
+    install(DIRECTORY ${PACKAGE_INSTALLDIR}/share/ossim DESTINATION ${DATA_DIR})
+
     ####################### install otbcli scripts ######################
     file(GLOB CLI_SCRIPTS ${PACKAGE_INSTALLDIR}/bin/otbcli*)
     foreach(CLI_SCRIPT ${CLI_SCRIPTS})


update run-from-directory test now that we get args via -D

--- contrib/cmake/build_from_scratch.cmake
+++ contrib/cmake/build_from_scratch.cmake
@@ -24,7 +24,7 @@
 get_filename_component(_prog_name ${CMAKE_ARGV2} NAME)
 set(_script_cwd ${CMAKE_CURRENT_SOURCE_DIR})

-if(NOT EXISTS "${_script_cwd}/${_prog_name}")
+if(NOT EXISTS "${_script_cwd}/build_from_scratch.cmake")
     usage_exit("Script was not run from its containing directory")
 endif()


SuperBuild: raise fatal error only on unix

--- SuperBuild/CMake/patch.cmake
+++ SuperBuild/CMake/patch.cmake
@@ -1,22 +1,24 @@
 file(GLOB all_dot_diff_files "${PATCH_DIR}/*diff")

 find_program(PATCH_PROGRAM NAMES patch)
-if(NOT PATCH_PROGRAM)
-  message(FATAL_ERROR "patch program not found. PATCH_PROGRAM. search names :' patch'")
-endif()
-
-foreach(dot_diff_file ${all_dot_diff_files})
- # message("dot_diff_file=${dot_diff_file}")
-#  message(FATAL_ERROR "${PATCH_PROGRAM} ${SOURCE_DIR} -p1 < ${dot_diff_file}")
-execute_process(
-  COMMAND
-  ${CMAKE_COMMAND} -E chdir ${SOURCE_DIR}  ${PATCH_PROGRAM} "-p1" INPUT_FILE "${dot_diff_file}"
-  RESULT_VARIABLE patch_rv
-  OUTPUT_VARIABLE patch_ov
-  OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
-if(NOT "${patch_rv}" STREQUAL "0")
-  message(FATAL_ERROR "${PATCH_PROGRAM} returned non-zero exit status '${patch_rv}'")
+if(PATCH_PROGRAM)
+  foreach(dot_diff_file ${all_dot_diff_files})
+    # message("dot_diff_file=${dot_diff_file}")
+    execute_process(
+      COMMAND
+      ${CMAKE_COMMAND} -E chdir ${SOURCE_DIR}  ${PATCH_PROGRAM} "-p1" INPUT_FILE "${dot_diff_file}"
+      RESULT_VARIABLE patch_rv
+      OUTPUT_VARIABLE patch_ov
+      OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
+    if(NOT "${patch_rv}" STREQUAL "0")
+      message(FATAL_ERROR "${PATCH_PROGRAM} returned non-zero exit status '${patch_rv}'")
+    else()
+      message(STATUS "${patch_ov}")
+    endif()
+  endforeach()
 else()
-  message(STATUS "${patch_ov}")
-endif()
-endforeach()+  if(NOT WIN32)
+    #Raise a fatal error if not on windows
+    message(FATAL_ERROR "patch program not found. PATCH_PROGRAM. search names :' patch'")
+  endif()
+endif()


COMP: Update KWStyle to fix its additional warning messages

- Update KWStyle to fix unused-local-typedef, unknown-pragmas and shadow
  warning message of boost.

Change-Id: I8faec4280e01585a2aff33088f91d2d11a7d529b

--- Utilities/KWStyle/BuildKWStyle.cmake
+++ Utilities/KWStyle/BuildKWStyle.cmake
@@ -15,7 +15,7 @@

 ExternalProject_add(KWStyle
   GIT_REPOSITORY "https://github.com/Kitware/KWStyle.git"
-  GIT_TAG df69db211e42fe6b5554a421b3824556060eff40
+  GIT_TAG 5ab06656c49630709fad69d6970f1afd9986f63a
   UPDATE_COMMAND ""
   DOWNLOAD_DIR ${KWStyle_SOURCE_DIR}
   SOURCE_DIR ${KWStyle_SOURCE_DIR}


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2011)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 02)
+SET(KWSYS_DATE_STAMP_MONTH 03)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


Use Mat_meat.hpp, which has not changed over Armadillo versions, but arma_ostream_proto.hpp has changed names.

--- fastlib/branches/fastlib-stl/CMake/FindArmadillo.cmake
+++ fastlib/branches/fastlib-stl/CMake/FindArmadillo.cmake
@@ -49,7 +49,7 @@
 ## -----------------------------------------------------------------------------
 ## Check for the header files

-find_path (ARMADILLO_INCLUDES arma_ostream_proto.hpp
+find_path (ARMADILLO_INCLUDES Mat_meat.hpp
   PATHS
   /usr/include
   /usr/local/include


Make FindBoost handle CMakes multi-part compiler commands.

--- build/modules/FindBoost.cmake
+++ build/modules/FindBoost.cmake
@@ -372,7 +372,7 @@
     SET (_boost_COMPILER "-vc71")
   ELSEIF(MINGW)
     EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
-      ARGS -dumpversion
+      ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
       OUTPUT_VARIABLE _boost_COMPILER_VERSION
       )
     STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.[0-9]" "\\1\\2"
@@ -387,7 +387,7 @@
     ELSE ()
       # Determine which version of GCC we have.
       EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
-        ARGS -dumpversion
+        ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
         OUTPUT_VARIABLE _boost_COMPILER_VERSION
         )
       STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.[0-9]" "\\1\\2"


Revert "Remove the "flexisip" systemd script because it has no meaning. There is flexisip-proxy, flexisip-conference, and flexisip-presence."

This reverts commit 1138d4a4ba5c30109c12b2bbc542d72eecc975e3.

We still need this script for our fs-test.linphone.org test server.

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -130,6 +130,8 @@
 %endif

 mkdir -p $RPM_BUILD_ROOT/lib/systemd/system
+install -p -m 0644 scripts/flexisip.service $RPM_BUILD_ROOT/lib/systemd/system
+install -p -m 0644 scripts/flexisip\@.service $RPM_BUILD_ROOT/lib/systemd/system
 install -p -m 0644 scripts/flexisip-proxy.service $RPM_BUILD_ROOT/lib/systemd/system
 install -p -m 0644 scripts/flexisip-proxy\@.service $RPM_BUILD_ROOT/lib/systemd/system
 %if @ENABLE_PRESENCE@


Updated FindMagnum.cmake from Magnum repository.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -14,13 +14,13 @@
 # components. The base library depends on Corrade, OpenGL and GLEW
 # libraries. Additional dependencies are specified by the components. The
 # optional components are:
-#  DebugTools       - DebugTools library (depends on MeshTools, Physics,
-#                     Primitives, SceneGraph and Shaders components)
+#  DebugTools       - DebugTools library (depends on MeshTools, Primitives,
+#                     SceneGraph, Shaders and Shapes components)
 #  MeshTools        - MeshTools library
-#  Physics          - Physics library (depends on SceneGraph component)
 #  Primitives       - Primitives library
 #  SceneGraph       - SceneGraph library
 #  Shaders          - Shaders library
+#  Shapes           - Shapes library (depends on SceneGraph component)
 #  Text             - Text library (depends on TextureTools component)
 #  TextureTools     - TextureTools library
 #  GlutApplication  - GLUT application (depends on GLUT library)
@@ -224,7 +224,7 @@

     # DebugTools library
     if(${component} STREQUAL DebugTools)
-        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Profiler.h)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES DebugTools.h)
     endif()

     # Mesh tools library
@@ -232,11 +232,6 @@
         set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h)
     endif()

-    # Physics library
-    if(${component} STREQUAL Physics)
-        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES AbstractShape.h)
-    endif()
-
     # Primitives library
     if(${component} STREQUAL Primitives)
         set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Cube.h)
@@ -244,17 +239,22 @@

     # Scene graph library
     if(${component} STREQUAL SceneGraph)
-        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Scene.h)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES SceneGraph.h)
     endif()

     # Shaders library
     if(${component} STREQUAL Shaders)
-        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES PhongShader.h)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Shaders.h)
+    endif()
+
+    # Shapes library
+    if(${component} STREQUAL Shapes)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Shapes.h)
     endif()

     # Text library
     if(${component} STREQUAL Text)
-        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES AbstractFont.h)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Text.h)
     endif()

     # TextureTools library


ENH: Do not build the Python wrapping in the Superbuild

Following commits will use the packages to reduce build time.

Change-Id: Ifd069e2b6c1a24f759dced1f9db39e9296465bfd

--- Superbuild/External-ITK.cmake
+++ Superbuild/External-ITK.cmake
@@ -36,30 +36,9 @@
   if(NOT EXISTS PYTHON_EXECUTABLE)
     set(_python_depends Python)
   endif()
-  list(APPEND _wrap_python_args "-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/Python-install")
-  list(APPEND _wrap_python_args -DITK_WRAP_PYTHON:BOOL=ON)
-  list(APPEND _wrap_python_args
+  set(_wrap_python_args
     "-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
-    "-DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}"
-    "-DPYTHON_LIBRARY:PATH=${PYTHON_LIBRARY}"
     )
-  if(UNIX)
-    list(APPEND _wrap_python_args "-DPY_SITE_PACKAGES_PATH:PATH=${PY_SITE_PACKAGES_PATH}")
-  endif()
-  find_package(NumPy)
-  if(NUMPY_FOUND)
-    list(APPEND _wrap_python_args -DModule_BridgeNumPy:BOOL=ON)
-  else()
-    list(APPEND _wrap_python_args -DModule_BridgeNumPy:BOOL=OFF)
-  endif()
-  list(APPEND _wrap_python_args INSTALL_COMMAND ${CMAKE_COMMAND} -E copy
-    "${CMAKE_BINARY_DIR}/ITK-build/Wrapping/Generators/Python/${CMAKE_CFG_INTDIR}/WrapITK.pth"
-    "${PY_SITE_PACKAGES_PATH}"
-    )
-else()
-  set(_wrap_python_args -DITK_WRAP_PYTHON:BOOL=OFF
-    -DModule_BridgeNumPy:BOOL=OFF
-    INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "ITK install skipped")
 endif()

 ExternalProject_Add(ITK
@@ -84,6 +63,7 @@
     ${_vtk_args}
     ${_opencv_args}
     ${_wrap_python_args}
+  INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "ITK install skipped"
   DEPENDS ${ITK_DEPENDENCIES} ${_python_depends} zlib
   LOG_BUILD 0
 )


Fix DPUT HOST.

Fix DPUT HOST.

--- cmake/Modules/UploadPPA.cmake
+++ cmake/Modules/UploadPPA.cmake
@@ -315,7 +315,7 @@
 # ##############################################################################
 # # dput ppa:your-lp-id/ppa <source.changes>

-set(UPLOAD_PPA "ppa:mathieu-leonardon/aff3ct")
+set(DPUT_HOST "ppa:mathieu-leonardon/aff3ct")

 add_custom_target(dput_${DISTRI} ALL
         COMMAND ${DPUT_EXECUTABLE} ${DPUT_HOST} ${DEB_SOURCE_CHANGES}


cmake: fix Linux system OpenEXR detection

--- cmake/OpenCVFindOpenEXR.cmake
+++ cmake/OpenCVFindOpenEXR.cmake
@@ -20,6 +20,8 @@
     elseif(MSVC)
         SET(OPENEXR_LIBSEARCH_SUFFIXES Win32/Release Win32 Win32/Debug)
     endif()
+elseif(UNIX)
+    SET(OPENEXR_LIBSEARCH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE})
 endif()

 SET(SEARCH_PATHS
@@ -37,6 +39,25 @@
         PATH_SUFFIXES ${OPENEXR_LIBSEARCH_SUFFIXES}
         NO_DEFAULT_PATH
         PATHS "${SEARCH_PATH}/lib" "${SEARCH_PATH}/lib/static")
+ENDMACRO()
+
+MACRO(ocv_find_openexr LIBRARY_SUFFIX)
+    IF(NOT OPENEXR_FOUND)
+        FIND_OPENEXR_LIBRARY("Half" "${LIBRARY_SUFFIX}")
+        FIND_OPENEXR_LIBRARY("Iex" "${LIBRARY_SUFFIX}")
+        FIND_OPENEXR_LIBRARY("Imath" "${LIBRARY_SUFFIX}")
+        FIND_OPENEXR_LIBRARY("IlmImf" "${LIBRARY_SUFFIX}")
+        FIND_OPENEXR_LIBRARY("IlmThread" "${LIBRARY_SUFFIX}")
+        IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY AND OPENEXR_ILMTHREAD_LIBRARY)
+            SET(OPENEXR_FOUND TRUE)
+        ELSE()
+            UNSET(OPENEXR_IMATH_LIBRARY)
+            UNSET(OPENEXR_ILMIMF_LIBRARY)
+            UNSET(OPENEXR_IEX_LIBRARY)
+            UNSET(OPENEXR_ILMTHREAD_LIBRARY)
+            UNSET(OPENEXR_HALF_LIBRARY)
+        ENDIF()
+    ENDIF()
 ENDMACRO()

 FOREACH(SEARCH_PATH ${SEARCH_PATHS})
@@ -64,32 +85,14 @@
         set(OPENEXR_VERSION "${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}")
     ENDIF ()

-    SET(LIBRARY_SUFFIXES
-        "-${OPENEXR_VERSION}"
-        "-${OPENEXR_VERSION}_s"
-        "-${OPENEXR_VERSION}_d"
-        "-${OPEXEXR_VERSION}_s_d"
-        ""
-        "_s"
-        "_d"
-        "_s_d")
-
-    FOREACH(LIBRARY_SUFFIX ${LIBRARY_SUFFIXES})
-        FIND_OPENEXR_LIBRARY("Half" ${LIBRARY_SUFFIX})
-        FIND_OPENEXR_LIBRARY("Iex" ${LIBRARY_SUFFIX})
-        FIND_OPENEXR_LIBRARY("Imath" ${LIBRARY_SUFFIX})
-        FIND_OPENEXR_LIBRARY("IlmImf" ${LIBRARY_SUFFIX})
-        FIND_OPENEXR_LIBRARY("IlmThread" ${LIBRARY_SUFFIX})
-        IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
-            SET(OPENEXR_FOUND TRUE)
-            BREAK()
-        ENDIF()
-        UNSET(OPENEXR_IMATH_LIBRARY)
-        UNSET(OPENEXR_ILMIMF_LIBRARY)
-        UNSET(OPENEXR_IEX_LIBRARY)
-        UNSET(OPENEXR_ILMTHREAD_LIBRARY)
-        UNSET(OPENEXR_HALF_LIBRARY)
-    ENDFOREACH()
+    ocv_find_openexr("-${OPENEXR_VERSION}")
+    ocv_find_openexr("-${OPENEXR_VERSION}_s")
+    ocv_find_openexr("-${OPENEXR_VERSION}_d")
+    ocv_find_openexr("-${OPEXEXR_VERSION}_s_d")
+    ocv_find_openexr("")
+    ocv_find_openexr("_s")
+    ocv_find_openexr("_d")
+    ocv_find_openexr("_s_d")

     IF (OPENEXR_FOUND)
         BREAK()


Hide the mess of cache variables before finding libXml2.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -40,6 +40,20 @@
 check_cxx_compiler_flag("-fprofile-arcs -ftest-coverage" GCC_COVERAGE_COMPILER_FLAGS_OK)

 set(CMAKE_REQUIRED_FLAGS ${_ORIGINAL_CMAKE_REQUIRED_FLAGS})
+
+mark_as_advanced(
+  CLANG_TIDY_EXE
+  CLANG_FORMAT_EXE
+  FIND_EXE
+  GCC_COVERAGE_COMPILER_FLAGS_OK
+  GCOV_EXE
+  GIT_EXE
+  LLVM_COV_EXE
+  LLVM_COVERAGE_COMPILER_FLAGS_OK
+  LLVM_PROFDATA_EXE
+  SWIG_EXECUTABLE
+  VALGRIND_EXE
+)

 # Find libxml2
 set(HAVE_LIBXML2_CONFIG FALSE)
@@ -92,17 +106,3 @@
 if(LLVM_PROFDATA_EXE AND LLVM_COV_EXE AND FIND_EXE AND LLVM_COVERAGE_COMPILER_FLAGS_OK)
   set(LLVM_COVERAGE_TESTING_AVAILABLE TRUE INTERNAL BOOL "Executables required to run the llvm coverage testing are available.")
 endif()
-
-mark_as_advanced(
-  CLANG_TIDY_EXE
-  CLANG_FORMAT_EXE
-  FIND_EXE
-  GCC_COVERAGE_COMPILER_FLAGS_OK
-  GCOV_EXE
-  GIT_EXE
-  LLVM_COV_EXE
-  LLVM_COVERAGE_COMPILER_FLAGS_OK
-  LLVM_PROFDATA_EXE
-  SWIG_EXECUTABLE
-  VALGRIND_EXE
-)


VS2010 path for google mock cmake module adapted

--- cmake/modules/FindGMock.cmake
+++ cmake/modules/FindGMock.cmake
@@ -86,14 +86,14 @@

 set(_gmock_libpath_suffixes lib)
 if(MSVC)
-  if(GMOCK_MSVC_SEARCH STREQUAL "MD")
+  if(MSVC_VERSION GREATER 1400)
     list(APPEND _gmock_libpath_suffixes
-      msvc/gmock-md/Debug
-      msvc/gmock-md/Release)
-  elseif(GMOCK_MSVC_SEARCH STREQUAL "MT")
+      msvc/2010/Debug
+      msvc/2010/Release)
+  else()
     list(APPEND _gmock_libpath_suffixes
-      msvc/gmock/Debug
-      msvc/gmock/Release)
+      msvc/2005/Debug
+      msvc/2005/Release)
   endif()
 endif()


Build system: implement wxwidgets version check for 2.8.12 or higher

This could easily be modified to 3.0.0 or higher if necessary.

--- cmake/modules/wxwidgets.cmake
+++ cmake/modules/wxwidgets.cmake
@@ -66,6 +66,36 @@
     # Check if stdint.h can be used from c++ (PL_HAVE_CXX_STDINT_H)
     include(TestForStdintCXX)
   endif(NOT wxWidgets_FOUND OR NOT wxwidgets_LINK_FLAGS)
+endif(PLD_wxwidgets OR PLD_wxpng)
+
+if(PLD_wxwidgets OR PLD_wxpng)
+  # Determine wxwidgets version in cross-platform way.
+  set(check_wxwidgets_version_source "
+#include <wx/version.h>
+int main(void)
+{
+// True if version is 2.8.12 or later....
+#if  wxCHECK_VERSION(2, 8, 12)
+// Return success
+  return 0;
+#else
+// Return failure
+  return 1;
+#endif
+}
+")
+  include(CheckCSourceRuns)
+  set(CMAKE_REQUIRED_INCLUDES ${wxWidgets_INCLUDE_DIRS})
+  check_c_source_runs("${check_wxwidgets_version_source}" WX_VERSION_LARGE_ENOUGH)
+  unset(CMAKE_REQUIRED_INCLUDES)
+  if(NOT WX_VERSION_LARGE_ENOUGH)
+    message(STATUS
+      "WARNING: wxWidgets version is less than 2.8.12 so "
+      "setting all wxwidgets devices to OFF."
+      )
+    set(PLD_wxwidgets OFF CACHE BOOL "Enable wxwidgets device" FORCE)
+    set(PLD_wxpng OFF CACHE BOOL "Enable wxwidgets png device" FORCE)
+  endif(NOT WX_VERSION_LARGE_ENOUGH)
 endif(PLD_wxwidgets OR PLD_wxpng)

 if(PLD_wxwidgets OR PLD_wxpng)


[cmake] Explicitly set VS 2017 compatibility

When cross-compiling using clang-cl 5.0 (which is currently the latest
stable release of the compiler), the default MS compatibility level is
set to VS 2013, which is too low to build LLVM. Explicitly set the
compatibility level to VS 2017 to support cross-compiling LLVM for
Windows using clang-cl 5.0. This will be a no-op when using clang-cl 6.0
and above, where the default MS compatibility level is already VS 2017.

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

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

--- cmake/platforms/WinMsvc.cmake
+++ cmake/platforms/WinMsvc.cmake
@@ -164,6 +164,7 @@

 set(COMPILE_FLAGS
     -D_CRT_SECURE_NO_WARNINGS
+    -fms-compatibility-version=19.11
     -imsvc "${MSVC_INCLUDE}"
     -imsvc "${WINSDK_INCLUDE}/ucrt"
     -imsvc "${WINSDK_INCLUDE}/shared"


bug 1632 - fix lcm-gen rules in lcmtypes.cmake

This is a partial fix related to bug 1632.

Running make reconfigure caused the next make to fail because the
lcm-gen command line that is run during configuration was missing the
c-path and cpp-hpath args.

This fix should go upstream and be applied to all the lcmtypes.cmake
files that are duplicated throughout the DRC repo and externals.  For
now, apply it just to drc_lcmtypes which is the most active lcmtypes
directory.

The lcmtypes.cmake file still has some incorrect generation rules that
need to be fixed in the future:

- it always regenerates files when cmake runs, triggering a full
  recompile of the lcmtypes library and all downstream client
  libraries using the headers, which is made much worse due to the
  "convenience" aggregate header

- it doesn't correctly handle lcm type files that are added/deleted

git-svn-id: 3bdc50f1ba932488e36d0c1d1e7fc079467b8f9b@7034 c7283977-0100-402a-a91a-fa70b306dbfe

--- software/drc_lcmtypes/cmake/lcmtypes.cmake
+++ software/drc_lcmtypes/cmake/lcmtypes.cmake
@@ -168,7 +168,7 @@
     # run lcm-gen at compile time
     add_custom_target(lcmgen_c ALL
         COMMAND sh -c '[ -d ${_lcmtypes_c_dir} ] || mkdir -p ${_lcmtypes_c_dir}'
-        COMMAND sh -c '${LCM_GEN_EXECUTABLE} --lazy -c ${_lcmtypes} --c-cpath ${_lcmtypes_c_dir} --c-hpath ${_lcmtypes_c_dir}')
+        COMMAND sh -c '${LCM_GEN_EXECUTABLE} --lazy -c --c-cpath ${_lcmtypes_c_dir} --c-hpath ${_lcmtypes_c_dir} --cinclude lcmtypes  ${_lcmtypes}')

     # get a list of all generated .c and .h files
     file(GLOB _lcmtypes_c_files ${_lcmtypes_c_dir}/*.c)
@@ -274,7 +274,7 @@
     # run lcm-gen at compile time
     add_custom_target(lcmgen_cpp ALL
         COMMAND sh -c '[ -d ${_lcmtypes_cpp_dir} ] || mkdir -p ${_lcmtypes_cpp_dir}'
-        COMMAND sh -c '${LCM_GEN_EXECUTABLE} --lazy --cpp ${_lcmtypes} --cpp-hpath ${_lcmtypes_cpp_dir}')
+        COMMAND sh -c '${LCM_GEN_EXECUTABLE} --lazy --cpp  --cpp-hpath ${_lcmtypes_cpp_dir} --cpp-include lcmtypes ${_lcmtypes}')

     # get a list of all generated .hpp files
     file(GLOB_RECURSE _lcmtypes_hpp_files  ${_lcmtypes_cpp_dir}/*.hpp)


Use MITK_ACCESSBYITK_PIXEL_TYPES in MITK_MULTIPLEX_PICTYPE

--- CMake/mitkMacroMultiplexPicType.cmake
+++ CMake/mitkMacroMultiplexPicType.cmake
@@ -9,7 +9,7 @@
 # is generated and added to CPP_FILES_GENERATED.
 #
 MACRO(MITK_MULTIPLEX_PICTYPE file)
-  SET(TYPES "double;float;int;unsigned int;short;unsigned short;char;unsigned char")
+  STRING(REPLACE "," ";" TYPES "${MITK_ACCESSBYITK_PIXEL_TYPES}")
   FOREACH(TYPE ${TYPES})
     # create filename for destination
     STRING(REPLACE " " "_" quoted_type "${TYPE}")


Removed a few characters that CMake complained about and I do not why was there.

--- cmake/Modules/WrapResources.cmake
+++ cmake/Modules/WrapResources.cmake
@@ -83,7 +83,7 @@
 "\n"
 "    return 0\;\n"
 "}\n"
-""\; )
+"" )

 FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/buildtools" )
 FILE(WRITE "${CMAKE_BINARY_DIR}/buildtools/txt2cpp.cpp" ${txt2cpp_source})


Added warnings-as-errors support for MSVC.

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -239,6 +239,10 @@
       set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /fp:fast") # !! important - be on the same wave with x64 compilers
     endif()
   endif()
+
+  if(OPENCV_WARNINGS_ARE_ERRORS)
+    set(OPENCV_EXTRA_FLAGS "${OPENCV_EXTRA_FLAGS} /WX")
+  endif()
 endif()

 # Extra link libs if the user selects building static libs:


Fix for ROOT-8510 - CMake: default config on MacOS fails due to fortran

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -2,15 +2,16 @@
 #  CheckCompiler.cmake
 #---------------------------------------------------------------------------------------------------

+include(CheckLanguage)
 #---Enable FORTRAN (unfortunatelly is not not possible in all cases)-------------------------------
 if(fortran)
   #--Work-around for CMake issue 0009220
   if(DEFINED CMAKE_Fortran_COMPILER AND CMAKE_Fortran_COMPILER MATCHES "^$")
     set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)
   endif()
-  enable_language(Fortran OPTIONAL)
-  if(NOT CMAKE_Fortran_COMPILER)
-    set(CMAKE_Fortran_COMPILER_LOADED)   # FindBLAS/LAPACK tests CMAKE_Fortran_COMPILER_LOADED
+  check_language(Fortran)
+  if(CMAKE_Fortran_COMPILER)
+    enable_language(Fortran)
   endif()
 else()
   set(CMAKE_Fortran_COMPILER CMAKE_Fortran_COMPILER-NOTFOUND)


Added new line at EOF

Added new line at EOF

--- cmake/modules/FindUsdCycles.cmake
+++ cmake/modules/FindUsdCycles.cmake
@@ -64,4 +64,4 @@
         USD_CYCLES_INCLUDE_DIRS
         USD_CYCLES_LIBRARY_DIR
         USD_CYCLES_LIBRARIES
-    )+    )


[cxxmodules] Set ROOT_MODULES=DEBUG for rootcling invocations

We need to set ROOT_MODULES to DEBUG when we want rootcling to
create C++ modules. For this we wrap all rootcling invocations
in cmake wrappers that set this environment variable.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -362,18 +362,24 @@
     endforeach()
   endif()

+  if(runtime_cxxmodules AND ARG_MODULE)
+    # FIXME: Once modules work better, we should use some other value like "1"
+    # to disable the module-build remarks from clang.
+    set(runtime_cxxmodules_env "ROOT_MODULES=DEBUG")
+  endif()
   #---what rootcling command to use--------------------------
   if(ARG_STAGE1)
-    set(command rootcling_stage1)
+    set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" "${runtime_cxxmodules_env}" $<TARGET_FILE:rootcling_stage1>)
     set(pcm_name)
   else()
     if(CMAKE_PROJECT_NAME STREQUAL ROOT)
-      set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" "ROOTIGNOREPREFIX=1" $<TARGET_FILE:rootcling> -rootbuild)
+      set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}"
+                  "ROOTIGNOREPREFIX=1" "${runtime_cxxmodules_env}" $<TARGET_FILE:rootcling> -rootbuild)
       set(ROOTCINTDEP rootcling)
     elseif(TARGET ROOT::rootcling)
-      set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:$ENV{LD_LIBRARY_PATH}" $<TARGET_FILE:ROOT::rootcling>)
-    else()
-      set(command rootcling)
+      set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}:$ENV{LD_LIBRARY_PATH}" "${runtime_cxxmodules_env}" $<TARGET_FILE:ROOT::rootcling>)
+    else()
+      set(command ${CMAKE_COMMAND} -E env "${runtime_cxxmodules_env}" rootcling)
     endif()
   endif()


ORC-873: Fix FindCyrusSASL to use the package name CyrusSASL (#783)

### What changes were proposed in this pull request?

This PR aims to use the package name `CyprusSASL` at `find_package_handle_standard_args`.
```cmake
-find_package_handle_standard_args(CYRUS_SASL DEFAULT_MSG
+find_package_handle_standard_args(CyrusSASL DEFAULT_MSG
```

### Why are the changes needed?

Currently, it shows a warning like the following.
```
CMake Warning (dev) at /opt/homebrew/Cellar/cmake/3.21.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (CYRUS_SASL)
  does not match the name of the calling package (CyrusSASL).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake_modules/FindCyrusSASL.cmake:46 (find_package_handle_standard_args)
  cmake_modules/ThirdpartyToolchain.cmake:432 (find_package)
  CMakeLists.txt:130 (INCLUDE)
This warning is for project developers.  Use -Wno-dev to suppress it.
```

### How was this patch tested?

After passing the CIs, manually check the C++ build.

--- cmake_modules/FindCyrusSASL.cmake
+++ cmake_modules/FindCyrusSASL.cmake
@@ -43,7 +43,7 @@
 find_library(CYRUS_SASL_SHARED_LIB sasl2)

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(CYRUS_SASL DEFAULT_MSG
+find_package_handle_standard_args(CyrusSASL DEFAULT_MSG
   CYRUS_SASL_SHARED_LIB CYRUS_SASL_INCLUDE_DIR)

 MARK_AS_ADVANCED(CYRUS_SASL_INCLUDE_DIR CYRUS_SASL_SHARED_LIB)


chore(build): do not set CMAKE_INSTALL_LIBDIR and never with _libdir!

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -102,7 +102,7 @@
 %setup -n %{name}-%{version}-%build_number

 %build
-%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} @RPM_ALL_CMAKE_OPTIONS@
+%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} @RPM_ALL_CMAKE_OPTIONS@

 make %{?_smp_mflags}
@@ -233,25 +233,39 @@
 %endif

 %changelog
+
+* Tue Nov 27 2018 ronan.abhamon <ronan.abhamon@belledonne-communications.com>
+- Do not set CMAKE_INSTALL_LIBDIR and never with _libdir!
+
 * Mon Nov 05 2018 Nicolas Michon <nicolas.michon@belledonne-communications.com>
 - Add share directory
+
 * Wed Oct 31 2018 ronan.abhamon <ronan.abhamon@belledonne-communications.com>
 - Use epoch in JweAuth plugin requires
+
 * Wed Jun 13 2018 ronan.abhamon <ronan.abhamon@belledonne-communications.com>
 - Add JweAuth plugin
+
 * Tue Aug 29  2017 Jehan Monnier <jehan.monnier@linphone.org>
 - cmake port
+
 * Fri Dec 02 2016 Simon Morlat <simon.morlat@linphone.org>
 - Add init scripts for flexisip-presence
+
 * Thu Jul 28 2016 François Grisez <francois.grisez@belledonne-communications.com>
 - Add systemd unit files
+
 * Mon Feb 08 2016 Guillaume Bienkowski <gbi@linphone.org>
 - Add soci option
+
 * Wed Nov 04 2015 Sylvain Berfini <sylvain.berfini@linphone.org>
 - Add option to disable odb
+
 * Tue Oct 14 2014 Guillaume Bienkowski <gbi@linphone.org>
 - Add /opt packaging possibility
+
 * Wed Feb 15 2012 Guillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
 - Force use of redhat init script
+
 * Tue Oct 19 2010 Simon Morlat <simon.morlat@belledonne-communications.com>
 - Initial specfile for first prototype release


assimp not required anymore

assimp not required anymore

--- cmake/Dependencies_core.cmake
+++ cmake/Dependencies_core.cmake
@@ -109,7 +109,7 @@

 #assimp
-find_package(ASSIMP REQUIRED)
+find_package(ASSIMP QUIET)
 PackageHelper(ASSIMP ${ASSIMP_FOUND} "${ASSIMP_INCLUDE_DIRS}" "${ASSIMP_LIBRARIES}")

 #set(CMAKE_FIND_DEBUG_MODE TRUE)


suppress windows cuda warning :D

suppress windows cuda warning :D

--- cmake/Dependencies_cuda.cmake
+++ cmake/Dependencies_cuda.cmake
@@ -80,6 +80,12 @@
   list(APPEND SAIGA_CUDA_FLAGS "--expt-relaxed-constexpr")
   list(APPEND SAIGA_CUDA_FLAGS "-Xcudafe=--diag_suppress=esa_on_defaulted_function_ignored")

+  # suppress some warnings in windows
+  list(APPEND SAIGA_CUDA_FLAGS "-Xcudafe=--diag_suppress=field_without_dll_interface")
+  list(APPEND SAIGA_CUDA_FLAGS "-Xcudafe=--diag_suppress=base_class_has_different_dll_interface")
+  list(APPEND SAIGA_CUDA_FLAGS "-Xcudafe=--diag_suppress=dll_interface_conflict_none_assumed")
+  list(APPEND SAIGA_CUDA_FLAGS "-Xcudafe=--diag_suppress=dll_interface_conflict_dllexport_assumed")
+
   if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ${SAIGA_LIBSTDCPP})
     list(APPEND SAIGA_CUDA_FLAGS "-Xcompiler=-stdlib=libstdc++")
   endif()


we need to depend on flann_cpp not on flann, as we're using FLANN's C++ interface

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@356 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindFlann.cmake
+++ cmake/Modules/FindFlann.cmake
@@ -14,7 +14,7 @@
 find_path(FLANN_INCLUDE_DIR flann/flann.hpp
     HINTS ${PC_FLANN_INCLUDEDIR} ${PC_FLANN_INCLUDE_DIRS})

-find_library(FLANN_LIBRARY flann
+find_library(FLANN_LIBRARY flann_cpp
     HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS})

 set(FLANN_INCLUDE_DIRS ${FLANN_INCLUDE_DIR})


improve FindLibRt.cmake

improve FindLibRt.cmake

test if system has built-in LibRT functions

--- cmake/Modules/FindLibRt.cmake
+++ cmake/Modules/FindLibRt.cmake
@@ -12,4 +12,20 @@
 find_package_handle_standard_args (LibRt DEFAULT_MSG LIBRT_LIBRARIES)

 # hide variables from the CMake GUI
-mark_as_advanced (LIBRT_LIBRARIES)+mark_as_advanced (LIBRT_LIBRARIES)
+
+# Most systems (except Linux) have librt features built into their libc.
+# If no librt has been found, there is still a chance that the system supports our desired features.
+if (NOT LIBRT_FOUND)
+	try_compile (HAS_LIBRT_4SURE
+		"${CMAKE_BINARY_DIR}"
+		"${PROJECT_SOURCE_DIR}/tests/librt_test.c"
+	)
+
+	if (HAS_LIBRT_4SURE)
+		set (LIBRT_FOUND on)
+		set (LIBRT_LIBRARIES "")
+		message (STATUS "using system's built-in librt functions")
+	endif ()
+	unset (HAS_LIBRT_4SURE)
+endif ()


Remove unsetting of compiler test variables.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -34,11 +34,9 @@
 set(_ORIGINAL_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})

 set(CMAKE_REQUIRED_FLAGS -fprofile-instr-generate)
-unset(COMPILER_FLAG_PROFILE_INSTR CACHE)
 check_cxx_compiler_flag("-fprofile-instr-generate -fcoverage-mapping" LLVM_COVERAGE_COMPILER_FLAGS)

 set(CMAKE_REQUIRED_FLAGS "-fprofile-arcs -ftest-coverage")
-unset(COMPILER_FLAG_PROFILE_INSTR CACHE)
 check_cxx_compiler_flag("-fprofile-arcs -ftest-coverage" GCC_COVERAGE_COMPILER_FLAGS)

 set(CMAKE_REQUIRED_FLAGS ${_ORIGINAL_CMAKE_REQUIRED_FLAGS})


Update the version of OpenBLAS and set the sysroot to fix compiling error using clang on Mac.

--- cmake/external/openblas.cmake
+++ cmake/external/openblas.cmake
@@ -25,7 +25,12 @@
         "${CBLAS_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}openblas${CMAKE_STATIC_LIBRARY_SUFFIX}"
         CACHE FILEPATH "openblas library." FORCE)

-    SET(COMMON_ARGS CC=${CMAKE_C_COMPILER} NO_SHARED=1 NO_LAPACK=1 libs)
+    IF(APPLE)
+        SET(OPENBLAS_CC "${CMAKE_C_COMPILER} -isysroot ${CMAKE_OSX_SYSROOT}")
+        SET(COMMON_ARGS CC=${OPENBLAS_CC} NO_SHARED=1 NO_LAPACK=1 libs)
+    ELSE()
+        SET(COMMON_ARGS CC=${CMAKE_C_COMPILER} NO_SHARED=1 NO_LAPACK=1 libs)
+    ENDIF()

     IF(CMAKE_CROSSCOMPILING)
         IF(ANDROID)
@@ -40,11 +45,11 @@
             SET(OPTIONAL_ARGS HOSTCC=${HOST_C_COMPILER} TARGET=${TARGET} ARM_SOFTFP_ABI=1 USE_THREAD=0)
         ELSEIF(RPI)
             # use hardfp
-            SET(OPENBLAS_COMMIT "v0.2.19")
+            SET(OPENBLAS_COMMIT "v0.2.20")
             SET(OPTIONAL_ARGS HOSTCC=${HOST_C_COMPILER} TARGET=ARMV7 USE_THREAD=0)
         ENDIF()
     ELSE()
-        SET(OPENBLAS_COMMIT "v0.2.19")
+        SET(OPENBLAS_COMMIT "v0.2.20")
         SET(OPTIONAL_ARGS "")
         IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^x86(_64)?$")
             SET(OPTIONAL_ARGS DYNAMIC_ARCH=1 NUM_THREADS=64)


Before, it said:  -- Boost Version required: .. Found: 1.34.1
Now it says:      -- Boost Version found: 1.34.1. Component PROGRAM_OPTIONS not found.
(given akonadi's use: find_package(Boost REQUIRED COMPONENTS program_options))

I see that CMake's FindBoost is much better about this already, it has _Boost_MISSING_COMPONENTS and Boost_ERROR_REASON.
Should this copy be removed? I think the initial reason isn't right anymore, if we depend on cmake-2.6.2.
CCMAIL: adam@kde.org

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

--- cmake/modules/FindBoost.cmake
+++ cmake/modules/FindBoost.cmake
@@ -496,6 +496,7 @@
       STRING(TOUPPER ${COMPONENT} COMPONENT)
       set(_boost_CHECKED_COMPONENT TRUE)
       IF(NOT Boost_${COMPONENT}_FOUND)
+	SET( Boost_ERROR_MESSAGE "${Boost_ERROR_MESSAGE}Component ${COMPONENT} not found. " )
         SET( Boost_FOUND FALSE)
       ENDIF(NOT Boost_${COMPONENT}_FOUND)
     ENDFOREACH(COMPONENT)
@@ -553,7 +554,11 @@
       ENDFOREACH(COMPONENT)
   ELSE (Boost_FOUND)
       IF (Boost_FIND_REQUIRED)
-        MESSAGE(STATUS "Boost Version required: ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH} Found: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
+	IF (Boost_FIND_VERSION_MAJOR)
+          MESSAGE(STATUS "Boost Version required: ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH} Found: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
+	ELSE (Boost_FIND_VERSION_MAJOR)
+          MESSAGE(STATUS "Boost Version found: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}. ${Boost_ERROR_MESSAGE}")
+	ENDIF (Boost_FIND_VERSION_MAJOR)
         MESSAGE(FATAL_ERROR "Couldn't find the Boost libraries and/or include directory, or the version found is too old. Please install the Boost libraries AND development packages. You can set BOOST_ROOT, BOOST_INCLUDEDIR and BOOST_LIBRARYDIR to help find Boost.")
       ENDIF(Boost_FIND_REQUIRED)
   ENDIF(Boost_FOUND)


eds-I#281 - GLibTools.cmake: Use basename in glib-mkenums templates

This change helps to create reproducible builds.

Related to https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/281

--- cmake/modules/GLibTools.cmake
+++ cmake/modules/GLibTools.cmake
@@ -65,7 +65,7 @@

 G_BEGIN_DECLS

-/* Enumerations from \"@filename@\" */
+/* Enumerations from \"@basename@\" */

 /*** END file-production ***/

@@ -95,8 +95,8 @@
 /*** END file-header ***/

 /*** BEGIN file-production ***/
-/* enumerations from \"@filename@\" */
-#include \"@filename@\"
+/* enumerations from \"@basename@\" */
+#include \"@basename@\"

 /*** END file-production ***/


code size reduction flags added

code size reduction flags added

--- cmake/toolchain.ESP8266.cmake
+++ cmake/toolchain.ESP8266.cmake
@@ -40,8 +40,8 @@
 endif()
 set(ESP8266_LINKER_SCRIPT_PATH ${ESP8266_SDK_BASE}/ld/${ESP8266_LINKER_SCRIPT})

-set(CMAKE_C_FLAGS "-Os -g -O2 -std=c99 -Wpointer-arith -pipe -Wundef -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals  -D__ets__ -DICACHE_FLASH")
-set(CMAKE_EXE_LINKER_FLAGS "-T${ESP8266_LINKER_SCRIPT_PATH} -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static")
+set(CMAKE_C_FLAGS "-Os -g -O2 -std=c99 -Wpointer-arith -pipe -Wundef -Wl,-EL -fno-inline-functions -ffunction-sections -nostdlib -mlongcalls -mtext-section-literals  -D__ets__ -DICACHE_FLASH")
+set(CMAKE_EXE_LINKER_FLAGS "-T${ESP8266_LINKER_SCRIPT_PATH} -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--gc-sections")

 set(BUILD_LINK_PREFIX "-Wl,--start-group")
 set(BUILD_LINK_SUFFIX "-Wl,--end-group")


Fix SOFA build on mac

Fix SOFA build on mac

CMake can find more than 1 OpenGL library which was not correctly handled.

--- CMake/Superbuild/External_SOFA.cmake
+++ CMake/Superbuild/External_SOFA.cmake
@@ -49,7 +49,7 @@
     -DSOFA-PLUGIN_SOFACUDA:BOOL=ON
     -DCUDA_TOOLKIT_ROOT_DIR:PATH=${CUDA_TOOLKIT_ROOT_DIR}
   )
-endif(CUDA_FOUND)
+endif()

 # Restore the proj variable
 get_filename_component(proj_filename ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
@@ -85,7 +85,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "git://public.kitware.com/Bender/SOFA.git"
-    GIT_TAG "d7967a8d58adf96db4d311fb937e91b6c69b7249"
+    GIT_TAG "3704279d21342969216a621b8c9b96a5cab33796"
     INSTALL_COMMAND ""
     CMAKE_GENERATOR ${gen}
     LIST_SEPARATOR &&


COMP: Always default RPATH ON on mac.

COMP: Always default RPATH ON on mac.

CPack FixUpBundle will correct any RPATH issues at CPack time
if the binaries will be redistributed.

--- CMake/vtkSelectSharedLibraries.cmake
+++ CMake/vtkSelectSharedLibraries.cmake
@@ -39,6 +39,12 @@
           # This is a development version.  Default to use rpath.
           SET(VTK_USE_RPATH_DEFAULT ON)
         ENDIF(VTK_MINOR_VERSION MATCHES "[02468]$")
+
+        # On APPLE we will always default ON as the RPATHs will be stripped/modified by
+        # FixUpBundle at CPack time if the binaries need to be redistributed.
+        IF(APPLE)
+           SET(VTK_USE_RPATH_DEFAULT ON)
+        ENDIF(APPLE)
       ENDIF("VTK_USE_RPATH_DEFAULT" MATCHES "^VTK_USE_RPATH_DEFAULT$")
       VTK_DEPENDENT_OPTION(VTK_USE_RPATH "Build shared libraries with rpath.  This makes it easy to run executables from the build tree when using shared libraries, but removes install support."
         ${VTK_USE_RPATH_DEFAULT}


Fixed Protobuf header dependency.

Fixed Protobuf header dependency.

While the header files were being created correctly, the explicit
dependency in the `CUSTOM_COMMAND` did not exist. Though we depended on
`${H}`, the variable was empty as we forgot to set it.

Review: https://reviews.apache.org/r/63455/

--- src/cmake/MesosProtobuf.cmake
+++ src/cmake/MesosProtobuf.cmake
@@ -73,6 +73,7 @@
   endif ()

   set(CC ${CPP_OUT}/${PROTOC_TARGET}.pb.cc)
+  set(H ${CPP_OUT}/${PROTOC_TARGET}.pb.h)

   # Fully qualified path for the Java file.
   if (PROTOC_JAVA AND HAS_JAVA)


fix python target

fix python target

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -557,14 +557,13 @@
 			else()
 				message(FATAL_ERROR "no valgrind detected")
 			endif()
-		else()
-			add_test(
-				NAME ${_TEST_NAME}_test
-				COMMAND $<TARGET_FILE:${_TEST_NAME}_exe> --gmock_verbose=info
-				WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
-				CONFIGURATIONS ${BUILD_TYPE}
-				)
 		endif()
+		add_test(
+			NAME ${_TEST_NAME}_test
+			COMMAND $<TARGET_FILE:${_TEST_NAME}_exe> --gmock_verbose=info
+			WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
+			CONFIGURATIONS ${BUILD_TYPE}
+			)
 	endforeach()
 	generate_vcxproj_user(${_TEST_NAME})

@@ -593,7 +592,7 @@
 	cmaki_find_package(boost-python)
 	cmaki2_gtest(${ARGV} PTHREADS)
 	cmaki_parse_parameters(${ARGV})
-	set_tests_properties(${_MAIN_NAME}_exe PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE}")
+	set_tests_properties(${_MAIN_NAME}_test PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE}")
 endmacro()

 macro(cmaki_python_test)


remove unneeded add_subdirectory statement

It was useless for quite a while now, and causes a warning
in CMake 2.8. Fix.

--- lib/orogen/templates/config/Base.cmake
+++ lib/orogen/templates/config/Base.cmake
@@ -65,7 +65,6 @@

 # Take care of the task library
 <% if !component.self_tasks.empty? %>
-ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/tasks)
 ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/tasks)
 <% end %>


Add cmake 2.6 compatible FindCheck module.

--- cmake/Modules/FindCheck.cmake
+++ cmake/Modules/FindCheck.cmake
@@ -1,46 +1,86 @@
-# - Try to find the CHECK libraries
-#  Once done this will define
+# - Try to find Check
+# Once done this will define
 #
-#  CHECK_FOUND - system has check
-#  CHECK_INCLUDE_DIR - the check include directory
-#  CHECK_LIBRARIES - check library
-#
-#  Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
-#  Copyright (c) 2007 Bjoern Ricks  <b.ricks@fh-osnabrueck.de>
+#  CHECK_FOUND - system has Check
+#  CHECK_INCLUDE_DIRS - the Check include directory
+#  CHECK_LIBRARIES - Link these to use Check
+#  CHECK_DEFINITIONS - Compiler switches required for using Check
+#
+#  Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
 #
 #  Redistribution and use is allowed according to the terms of the New
 #  BSD license.
 #  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#

-INCLUDE( FindPkgConfig )
+if (CHECK_LIBRARIES AND CHECK_INCLUDE_DIRS)
+  # in cache already
+  set(CHECK_FOUND TRUE)
+else (CHECK_LIBRARIES AND CHECK_INCLUDE_DIRS)
+  # use pkg-config to get the directories and then use these values
+  # in the FIND_PATH() and FIND_LIBRARY() calls
+  if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+    include(UsePkgConfig)
+    pkgconfig(check _CHECK_INCLUDEDIR _CHECK_LIBDIR _CHECK_LDFLAGS _CHECK_CFLAGS)
+  else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+    find_package(PkgConfig)
+    if (PKG_CONFIG_FOUND)
+      pkg_check_modules(_CHECK check)
+    endif (PKG_CONFIG_FOUND)
+  endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+  find_path(CHECK_INCLUDE_DIR
+    NAMES
+      check.h
+    PATHS
+      ${_CHECK_INCLUDEDIR}
+      /usr/include
+      /usr/local/include
+      /opt/local/include
+      /sw/include
+  )

-# Take care about check.pc settings
-PKG_SEARCH_MODULE( CHECK check )
+  find_library(CHECK_LIBRARY
+    NAMES
+      check
+    PATHS
+      ${_Check_LIBDIR}
+      /usr/lib
+      /usr/local/lib
+      /opt/local/lib
+      /sw/lib
+  )

-# Look for CHECK include dir and libraries
-IF( NOT CHECK_FOUND )
+  if (CHECK_LIBRARY)
+    set(CHECK_FOUND TRUE)
+  endif (CHECK_LIBRARY)

-	FIND_PATH( CHECK_INCLUDE_DIR check.h )
+  set(CHECK_INCLUDE_DIRS
+    ${CHECK_INCLUDE_DIR}
+  )

-	FIND_LIBRARY( CHECK_LIBRARIES NAMES check )
+  if (CHECK_FOUND)
+    set(CHECK_LIBRARIES
+      ${CHECK_LIBRARY}
+    )
+  endif (CHECK_FOUND)

-	IF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES )
-		SET( CHECK_FOUND 1 )
-		IF ( NOT Check_FIND_QUIETLY )
-			MESSAGE ( STATUS "Found CHECK: ${CHECK_LIBRARIES}" )
-		ENDIF ( NOT Check_FIND_QUIETLY )
-	ELSE ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES )
-		IF ( Check_FIND_REQUIRED )
-			MESSAGE( FATAL_ERROR "Could NOT find CHECK" )
-		ELSE ( Check_FIND_REQUIRED )
-			IF ( NOT Check_FIND_QUIETLY )
-				MESSAGE( STATUS "Could NOT find CHECK" )
-			ENDIF ( NOT Check_FIND_QUIETLY )
-		ENDIF ( Check_FIND_REQUIRED )
-	ENDIF ( CHECK_INCLUDE_DIR AND CHECK_LIBRARIES )
-ENDIF( NOT CHECK_FOUND )
+  if (CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES)
+     set(CHECK_FOUND TRUE)
+  endif (CHECK_INCLUDE_DIRS AND CHECK_LIBRARIES)

-# Hide advanced variables from CMake GUIs
-MARK_AS_ADVANCED( CHECK_INCLUDE_DIR CHECK_LIBRARIES )
+  if (CHECK_FOUND)
+    if (NOT Check_FIND_QUIETLY)
+      message(STATUS "Found Check: ${CHECK_LIBRARIES}")
+    endif (NOT Check_FIND_QUIETLY)
+  else (CHECK_FOUND)
+    if (Check_FIND_REQUIRED)
+      message(FATAL_ERROR "Could not find Check")
+    endif (Check_FIND_REQUIRED)
+  endif (CHECK_FOUND)

+  # show the CHECK_INCLUDE_DIRS and CHECK_LIBRARIES variables only in the advanced view
+  mark_as_advanced(CHECK_INCLUDE_DIRS CHECK_LIBRARIES)
+
+endif (CHECK_LIBRARIES AND CHECK_INCLUDE_DIRS)
+