cmake: Drop FindICU.cmake

cmake: Drop FindICU.cmake

--- cmake/FindICU.cmake
+++ cmake/FindICU.cmake
@@ -1,394 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-#.rst:
-# FindICU
-# -------
-#
-# Find the International Components for Unicode (ICU) libraries and
-# programs.
-#
-# This module supports multiple components.
-# Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
-# ``lx``, ``test``, ``tu`` and ``uc``.
-#
-# Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
-# ``in``; any of the names may be used, and the appropriate
-# platform-specific library name will be automatically selected.
-#
-# This module reports information about the ICU installation in
-# several variables.  General variables::
-#
-#   ICU_VERSION - ICU release version
-#   ICU_FOUND - true if the main programs and libraries were found
-#   ICU_LIBRARIES - component libraries to be linked
-#   ICU_INCLUDE_DIRS - the directories containing the ICU headers
-#
-# Imported targets::
-#
-#   ICU::<C>
-#
-# Where ``<C>`` is the name of an ICU component, for example
-# ``ICU::i18n``.
-#
-# ICU programs are reported in::
-#
-#   ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
-#   ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
-#   ICU_GENBRK_EXECUTABLE - path to genbrk executable
-#   ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
-#   ICU_GENRB_EXECUTABLE - path to genrb executable
-#   ICU_GENDICT_EXECUTABLE - path to gendict executable
-#   ICU_DERB_EXECUTABLE - path to derb executable
-#   ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
-#   ICU_UCONV_EXECUTABLE - path to uconv executable
-#   ICU_GENCFU_EXECUTABLE - path to gencfu executable
-#   ICU_MAKECONV_EXECUTABLE - path to makeconv executable
-#   ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
-#   ICU_GENCCODE_EXECUTABLE - path to genccode executable
-#   ICU_GENSPREP_EXECUTABLE - path to gensprep executable
-#   ICU_ICUPKG_EXECUTABLE - path to icupkg executable
-#   ICU_GENCMN_EXECUTABLE - path to gencmn executable
-#
-# ICU component libraries are reported in::
-#
-#   ICU_<C>_FOUND - ON if component was found
-#   ICU_<C>_LIBRARIES - libraries for component
-#
-# ICU datafiles are reported in::
-#
-#   ICU_MAKEFILE_INC - Makefile.inc
-#   ICU_PKGDATA_INC - pkgdata.inc
-#
-# Note that ``<C>`` is the uppercased name of the component.
-#
-# This module reads hints about search results from::
-#
-#   ICU_ROOT - the root of the ICU installation
-#
-# The environment variable ``ICU_ROOT`` may also be used; the
-# ICU_ROOT variable takes precedence.
-#
-# The following cache variables may also be set::
-#
-#   ICU_<P>_EXECUTABLE - the path to executable <P>
-#   ICU_INCLUDE_DIR - the directory containing the ICU headers
-#   ICU_<C>_LIBRARY - the library for component <C>
-#
-# .. note::
-#
-#   In most cases none of the above variables will require setting,
-#   unless multiple ICU versions are available and a specific version
-#   is required.
-#
-# Other variables one may set to control this module are::
-#
-#   ICU_DEBUG - Set to ON to enable debug output from FindICU.
-
-# Written by Roger Leigh <rleigh@codelibre.net>
-
-set(icu_programs
-  gencnval
-  icuinfo
-  genbrk
-  icu-config
-  genrb
-  gendict
-  derb
-  pkgdata
-  uconv
-  gencfu
-  makeconv
-  gennorm2
-  genccode
-  gensprep
-  icupkg
-  gencmn)
-
-set(icu_data
-  Makefile.inc
-  pkgdata.inc)
-
-# The ICU checks are contained in a function due to the large number
-# of temporary variables needed.
-function(_ICU_FIND)
-  # Set up search paths, taking compiler into account.  Search ICU_ROOT,
-  # with ICU_ROOT in the environment as a fallback if unset.
-  if(ICU_ROOT)
-    list(APPEND icu_roots "${ICU_ROOT}")
-  else()
-    if(NOT "$ENV{ICU_ROOT}" STREQUAL "")
-      file(TO_CMAKE_PATH "$ENV{ICU_ROOT}" NATIVE_PATH)
-      list(APPEND icu_roots "${NATIVE_PATH}")
-      set(ICU_ROOT "${NATIVE_PATH}"
-          CACHE PATH "Location of the ICU installation" FORCE)
-    endif()
-  endif()
-
-  # Find include directory
-  list(APPEND icu_include_suffixes "include")
-  find_path(ICU_INCLUDE_DIR
-            NAMES "unicode/utypes.h"
-            HINTS ${icu_roots}
-            PATH_SUFFIXES ${icu_include_suffixes}
-            DOC "ICU include directory")
-  set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
-
-  # Get version
-  if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
-    file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
-      REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
-
-    string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
-      "\\1" icu_version_string "${icu_header_str}")
-    set(ICU_VERSION "${icu_version_string}")
-    set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
-    unset(icu_header_str)
-    unset(icu_version_string)
-  endif()
-
-  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    # 64-bit binary directory
-    set(_bin64 "bin64")
-    # 64-bit library directory
-    set(_lib64 "lib64")
-  endif()
-
-
-  # Find all ICU programs
-  list(APPEND icu_binary_suffixes "${_bin64}" "bin")
-  foreach(program ${icu_programs})
-    string(TOUPPER "${program}" program_upcase)
-    set(cache_var "ICU_${program_upcase}_EXECUTABLE")
-    set(program_var "ICU_${program_upcase}_EXECUTABLE")
-    find_program("${cache_var}" "${program}"
-      HINTS ${icu_roots}
-      PATH_SUFFIXES ${icu_binary_suffixes}
-      DOC "ICU ${program} executable")
-    mark_as_advanced(cache_var)
-    set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
-  endforeach()
-
-  # Find all ICU libraries
-  list(APPEND icu_library_suffixes "${_lib64}" "lib")
-  set(ICU_REQUIRED_LIBS_FOUND ON)
-  foreach(component ${ICU_FIND_COMPONENTS})
-    string(TOUPPER "${component}" component_upcase)
-    set(component_cache "ICU_${component_upcase}_LIBRARY")
-    set(component_cache_release "${component_cache}_RELEASE")
-    set(component_cache_debug "${component_cache}_DEBUG")
-    set(component_found "${component_upcase}_FOUND")
-    set(component_libnames "icu${component}")
-    set(component_debug_libnames "icu${component}d")
-
-    # Special case deliberate library naming mismatches between Unix
-    # and Windows builds
-    unset(component_libnames)
-    unset(component_debug_libnames)
-    list(APPEND component_libnames "icu${component}")
-    list(APPEND component_debug_libnames "icu${component}d")
-    if(component STREQUAL "data")
-      list(APPEND component_libnames "icudt")
-      # Note there is no debug variant at present
-      list(APPEND component_debug_libnames "icudtd")
-    endif()
-    if(component STREQUAL "dt")
-      list(APPEND component_libnames "icudata")
-      # Note there is no debug variant at present
-      list(APPEND component_debug_libnames "icudatad")
-    endif()
-    if(component STREQUAL "i18n")
-      list(APPEND component_libnames "icuin")
-      list(APPEND component_debug_libnames "icuind")
-    endif()
-    if(component STREQUAL "in")
-      list(APPEND component_libnames "icui18n")
-      list(APPEND component_debug_libnames "icui18nd")
-    endif()
-
-    find_library("${component_cache_release}" ${component_libnames}
-      HINTS ${icu_roots}
-      PATH_SUFFIXES ${icu_library_suffixes}
-      DOC "ICU ${component} library (release)")
-    find_library("${component_cache_debug}" ${component_debug_libnames}
-      HINTS ${icu_roots}
-      PATH_SUFFIXES ${icu_library_suffixes}
-      DOC "ICU ${component} library (debug)")
-    include(SelectLibraryConfigurations)
-    select_library_configurations(ICU_${component_upcase})
-    mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
-    if(${component_cache})
-      set("${component_found}" ON)
-      list(APPEND ICU_LIBRARY "${${component_cache}}")
-    endif()
-    mark_as_advanced("${component_found}")
-    set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
-    set("${component_found}" "${${component_found}}" PARENT_SCOPE)
-    if(${component_found})
-      if (ICU_FIND_REQUIRED_${component})
-        list(APPEND ICU_LIBS_FOUND "${component} (required)")
-      else()
-        list(APPEND ICU_LIBS_FOUND "${component} (optional)")
-      endif()
-    else()
-      if (ICU_FIND_REQUIRED_${component})
-        set(ICU_REQUIRED_LIBS_FOUND OFF)
-        list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
-      else()
-        list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
-      endif()
-    endif()
-  endforeach()
-  set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
-  set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
-
-  # Find all ICU data files
-  if(CMAKE_LIBRARY_ARCHITECTURE)
-    list(APPEND icu_data_suffixes
-      "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
-      "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu/${ICU_VERSION}"
-      "${_lib64}/${CMAKE_LIBRARY_ARCHITECTURE}/icu"
-      "lib/${CMAKE_LIBRARY_ARCHITECTURE}/icu")
-  endif()
-  list(APPEND icu_data_suffixes
-    "${_lib64}/icu/${ICU_VERSION}"
-    "lib/icu/${ICU_VERSION}"
-    "${_lib64}/icu"
-    "lib/icu")
-  foreach(data ${icu_data})
-    string(TOUPPER "${data}" data_upcase)
-    string(REPLACE "." "_" data_upcase "${data_upcase}")
-    set(cache_var "ICU_${data_upcase}")
-    set(data_var "ICU_${data_upcase}")
-    find_file("${cache_var}" "${data}"
-      HINTS ${icu_roots}
-      PATH_SUFFIXES ${icu_data_suffixes}
-      DOC "ICU ${data} data file")
-    mark_as_advanced(cache_var)
-    set("${data_var}" "${${cache_var}}" PARENT_SCOPE)
-  endforeach()
-
-  if(NOT ICU_FIND_QUIETLY)
-    if(ICU_LIBS_FOUND)
-      message(STATUS "Found the following ICU libraries:")
-      foreach(found ${ICU_LIBS_FOUND})
-        message(STATUS "  ${found}")
-      endforeach()
-    endif()
-    if(ICU_LIBS_NOTFOUND)
-      message(STATUS "The following ICU libraries were not found:")
-      foreach(notfound ${ICU_LIBS_NOTFOUND})
-        message(STATUS "  ${notfound}")
-      endforeach()
-    endif()
-  endif()
-
-  if(ICU_DEBUG)
-    message(STATUS "--------FindICU.cmake search debug--------")
-    message(STATUS "ICU binary path search order: ${icu_roots}")
-    message(STATUS "ICU include path search order: ${icu_roots}")
-    message(STATUS "ICU library path search order: ${icu_roots}")
-    message(STATUS "----------------")
-  endif()
-endfunction()
-
-_ICU_FIND()
-
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICU
-                                  FOUND_VAR ICU_FOUND
-                                  REQUIRED_VARS ICU_INCLUDE_DIR
-                                                ICU_LIBRARY
-                                                _ICU_REQUIRED_LIBS_FOUND
-                                  VERSION_VAR ICU_VERSION
-                                  FAIL_MESSAGE "Failed to find all ICU components")
-
-unset(_ICU_REQUIRED_LIBS_FOUND)
-
-if(ICU_FOUND)
-  set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
-  set(ICU_LIBRARIES "${ICU_LIBRARY}")
-  foreach(_ICU_component ${ICU_FIND_COMPONENTS})
-    string(TOUPPER "${_ICU_component}" _ICU_component_upcase)
-    set(_ICU_component_cache "ICU_${_ICU_component_upcase}_LIBRARY")
-    set(_ICU_component_cache_release "ICU_${_ICU_component_upcase}_LIBRARY_RELEASE")
-    set(_ICU_component_cache_debug "ICU_${_ICU_component_upcase}_LIBRARY_DEBUG")
-    set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES")
-    set(_ICU_component_found "${_ICU_component_upcase}_FOUND")
-    set(_ICU_imported_target "ICU::${_ICU_component}")
-    if(${_ICU_component_found})
-      set("${_ICU_component_lib}" "${${_ICU_component_cache}}")
-      if(NOT TARGET ${_ICU_imported_target})
-        add_library(${_ICU_imported_target} UNKNOWN IMPORTED)
-        if(ICU_INCLUDE_DIR)
-          set_target_properties(${_ICU_imported_target} PROPERTIES
-            INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIR}")
-        endif()
-        if(EXISTS "${${_ICU_component_cache}}")
-          set_target_properties(${_ICU_imported_target} PROPERTIES
-            IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
-            IMPORTED_LOCATION "${${_ICU_component_cache}}")
-        endif()
-        if(EXISTS "${${_ICU_component_cache_release}}")
-          set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
-            IMPORTED_CONFIGURATIONS RELEASE)
-          set_target_properties(${_ICU_imported_target} PROPERTIES
-            IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
-            IMPORTED_LOCATION_RELEASE "${${_ICU_component_cache_release}}")
-        endif()
-        if(EXISTS "${${_ICU_component_cache_debug}}")
-          set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
-            IMPORTED_CONFIGURATIONS DEBUG)
-          set_target_properties(${_ICU_imported_target} PROPERTIES
-            IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
-            IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
-        endif()
-      endif()
-    endif()
-    unset(_ICU_component_upcase)
-    unset(_ICU_component_cache)
-    unset(_ICU_component_lib)
-    unset(_ICU_component_found)
-    unset(_ICU_imported_target)
-  endforeach()
-endif()
-
-if(ICU_DEBUG)
-  message(STATUS "--------FindICU.cmake results debug--------")
-  message(STATUS "ICU found: ${ICU_FOUND}")
-  message(STATUS "ICU_VERSION number: ${ICU_VERSION}")
-  message(STATUS "ICU_ROOT directory: ${ICU_ROOT}")
-  message(STATUS "ICU_INCLUDE_DIR directory: ${ICU_INCLUDE_DIR}")
-  message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
-
-  foreach(program IN LISTS icu_programs)
-    string(TOUPPER "${program}" program_upcase)
-    set(program_lib "ICU_${program_upcase}_EXECUTABLE")
-    message(STATUS "${program} program: ${${program_lib}}")
-    unset(program_upcase)
-    unset(program_lib)
-  endforeach()
-
-  foreach(data IN LISTS icu_data)
-    string(TOUPPER "${data}" data_upcase)
-    string(REPLACE "." "_" data_upcase "${data_upcase}")
-    set(data_lib "ICU_${data_upcase}")
-    message(STATUS "${data} data: ${${data_lib}}")
-    unset(data_upcase)
-    unset(data_lib)
-  endforeach()
-
-  foreach(component IN LISTS ICU_FIND_COMPONENTS)
-    string(TOUPPER "${component}" component_upcase)
-    set(component_lib "ICU_${component_upcase}_LIBRARIES")
-    set(component_found "${component_upcase}_FOUND")
-    message(STATUS "${component} library found: ${${component_found}}")
-    message(STATUS "${component} library: ${${component_lib}}")
-    unset(component_upcase)
-    unset(component_lib)
-    unset(component_found)
-  endforeach()
-  message(STATUS "----------------")
-endif()
-
-unset(icu_programs)


Add support for lua5.4 in FindLua.cmake

Add support for lua5.4 in FindLua.cmake

--- cmake/FindLua.cmake
+++ cmake/FindLua.cmake
@@ -44,7 +44,7 @@

 # this is a function only to have all the variables inside go away automatically
 function(_lua_set_version_vars)
-    set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
+    set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0)

     if (Lua_FIND_VERSION_EXACT)
         if (Lua_FIND_VERSION_COUNT GREATER 1)


Macro made a function and identifier corrected.

--- cmake/Options.cmake
+++ cmake/Options.cmake
@@ -6,29 +6,29 @@
 endif()

-macro(_print_option _option _name)
-    message(STATUS "${_name} : ${${_option}}")
-endmacro()
+function(print_option opt name)
+    message(STATUS "${name} : ${${opt}}")
+endfunction()

 option(UNIT_TESTS "Build Unit Tests" ON)
-_print_option(UNIT_TESTS "Unit Tests")
+print_option(UNIT_TESTS "Unit Tests")

 option(COVERAGE "Enable Coverage" OFF)
-_print_option(COVERAGE "Coverage")
+print_option(COVERAGE "Coverage")

 option(BUILD_TOOLS "Build the tools" ON)
-_print_option(BUILD_TOOLS "Build Tools")
+print_option(BUILD_TOOLS "Build Tools")

 option(BUILD_SCHEMA_TESTS "Build the Schema Tests" OFF)
-_print_option(BUILD_SCHEMA_TESTS "Build Schema Tests")
+print_option(BUILD_SCHEMA_TESTS "Build Schema Tests")

 option(BUILD_DEMOS "Build the Demos" OFF)
-_print_option(BUILD_DEMOS "Build Demos")
+print_option(BUILD_DEMOS "Build Demos")

 option(BUILD_SHARED_LIBS "Build Shared Library" OFF)
-_print_option(BUILD_SHARED_LIBS "Build shared library")
+print_option(BUILD_SHARED_LIBS "Build shared library")

 option(ENABLE_CPPCHECK "Enables CppCheck (Requires Compile Commands)" OFF)
-_print_option(ENABLE_CPPCHECK "Enable CppCheck")
+print_option(ENABLE_CPPCHECK "Enable CppCheck")


Changed windows package file name

Changed windows package file name

--- cmake/Package.cmake
+++ cmake/Package.cmake
@@ -15,7 +15,7 @@
 if(WIN32 AND NOT UNIX)
     ## Windows
     set(CPACK_GENERATOR "NSIS")
-    set(CPACK_PACKAGE_FILE_NAME "fast-windows-${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
+    set(CPACK_PACKAGE_FILE_NAME "fast_windows_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
     set(CPACK_PACKAGE_INSTALL_DIRECTORY "FAST")
     set(CPACK_NSIS_MUI_ICON ${PROJECT_SOURCE_DIR}/doc/images/fast_icon.ico)
     set(CPACK_NSIS_MUI_UNICON ${PROJECT_SOURCE_DIR}/doc/images/fast_icon.ico)


iox-#163 combine cmake

iox-#163 combine cmake

Signed-off-by: Dietrich Krönke <ea45bc0219d3b6c3a6b9cf3abdfa172e6bfa16ff@apex.ai>

--- iceoryx_utils/cmake/IceoryxPlatform.cmake
+++ iceoryx_utils/cmake/IceoryxPlatform.cmake
@@ -34,9 +34,7 @@
 if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
     set(ICEORYX_WARNINGS PRIVATE ${ICEORYX_WARNINGS} /W1)
     # todo: '/O2' and '/RTC1' (set by default) options are incompatible,
-elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-    set(ICEORYX_WARNINGS PRIVATE ${ICEORYX_WARNINGS} -W -Wall -Wextra -Wuninitialized -Wpedantic -Wstrict-aliasing -Wcast-align -Wno-noexcept-type -Wconversion)
-elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     set(ICEORYX_WARNINGS PRIVATE ${ICEORYX_WARNINGS} -W -Wall -Wextra -Wuninitialized -Wpedantic -Wstrict-aliasing -Wcast-align -Wno-noexcept-type -Wconversion)
 endif()


FindHIP: Fix formatting issues

FindHIP: Fix formatting issues

Change-Id: I169266fe34fec1d0619b299733e9997eddc16d90

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -235,9 +235,9 @@
 function(HIP_COMPUTE_BUILD_PATH path build_path)
     # Convert to cmake style paths
     file(TO_CMAKE_PATH "${path}" bpath)
-    if (IS_ABSOLUTE "${bpath}")
+    if(IS_ABSOLUTE "${bpath}")
         string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos)
-        if (_binary_dir_pos EQUAL 0)
+        if(_binary_dir_pos EQUAL 0)
             file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}")
         else()
             file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}")
@@ -391,72 +391,72 @@
             set(host_flag TRUE)
         endif()

-        if (NOT host_flag)
-        # Determine output directory
-        HIP_COMPUTE_BUILD_PATH("${file}" hip_build_path)
-        set(hip_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_target}.dir/${hip_build_path}")
-
-        get_filename_component(basename ${file} NAME)
-        set(generated_file_path "${hip_compile_output_dir}/${CMAKE_CFG_INTDIR}")
-        set(generated_file_basename "${_target}_generated_${basename}${generated_extension}")
-
-        # Set file names
-        set(generated_file "${generated_file_path}/${generated_file_basename}")
-        set(cmake_dependency_file "${hip_compile_output_dir}/${generated_file_basename}.depend")
-        set(custom_target_script_pregen "${hip_compile_output_dir}/${generated_file_basename}.cmake.pre-gen")
-        set(custom_target_script "${hip_compile_output_dir}/${generated_file_basename}.cmake")
-
-        # Set properties for object files
-        set_source_files_properties("${generated_file}"
-            PROPERTIES
-            EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked
-            )
-
-        # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path
-        get_filename_component(file_path "${file}" PATH)
-        if(IS_ABSOLUTE "${file_path}")
-            set(source_file "${file}")
-        else()
-            set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
-        endif()
-
-        # Bring in the dependencies
-        HIP_INCLUDE_HIPCC_DEPENDENCIES(${cmake_dependency_file})
-
-        # Configure the build script
-        configure_file("${HIP_run_hipcc}" "${custom_target_script_pregen}" @ONLY)
-        file(GENERATE
-            OUTPUT "${custom_target_script}"
-            INPUT "${custom_target_script_pregen}"
-            )
-        set(main_dep DEPENDS ${source_file})
-        set(verbose_output "$(VERBOSE)")
-
-        # Create up the comment string
-        file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}")
-        set(hip_build_comment_string "Building HIPCC object ${generated_file_relative_path}")
-
-        # Build the generated file and dependency file
-        add_custom_command(
-            OUTPUT ${generated_file}
-            # These output files depend on the source_file and the contents of cmake_dependency_file
-            ${main_dep}
-            DEPENDS ${HIP_HIPCC_DEPEND}
-            DEPENDS ${custom_target_script}
-            # Make sure the output directory exists before trying to write to it.
-            COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}"
-            COMMAND ${CMAKE_COMMAND} ARGS
-            -D verbose:BOOL=${verbose_output}
-            -D build_configuration:STRING=${_hip_build_configuration}
-            -D "generated_file:STRING=${generated_file}"
-            -P "${custom_target_script}"
-            WORKING_DIRECTORY "${hip_compile_output_dir}"
-            COMMENT "${hip_build_comment_string}"
-            )
-
-        # Make sure the build system knows the file is generated
-        set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE)
-        list(APPEND _hip_generated_files ${generated_file})
+        if(NOT host_flag)
+            # Determine output directory
+            HIP_COMPUTE_BUILD_PATH("${file}" hip_build_path)
+            set(hip_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_target}.dir/${hip_build_path}")
+
+            get_filename_component(basename ${file} NAME)
+            set(generated_file_path "${hip_compile_output_dir}/${CMAKE_CFG_INTDIR}")
+            set(generated_file_basename "${_target}_generated_${basename}${generated_extension}")
+
+            # Set file names
+            set(generated_file "${generated_file_path}/${generated_file_basename}")
+            set(cmake_dependency_file "${hip_compile_output_dir}/${generated_file_basename}.depend")
+            set(custom_target_script_pregen "${hip_compile_output_dir}/${generated_file_basename}.cmake.pre-gen")
+            set(custom_target_script "${hip_compile_output_dir}/${generated_file_basename}.cmake")
+
+            # Set properties for object files
+            set_source_files_properties("${generated_file}"
+                PROPERTIES
+                EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked
+                )
+
+            # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path
+            get_filename_component(file_path "${file}" PATH)
+            if(IS_ABSOLUTE "${file_path}")
+                set(source_file "${file}")
+            else()
+                set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
+            endif()
+
+            # Bring in the dependencies
+            HIP_INCLUDE_HIPCC_DEPENDENCIES(${cmake_dependency_file})
+
+            # Configure the build script
+            configure_file("${HIP_run_hipcc}" "${custom_target_script_pregen}" @ONLY)
+            file(GENERATE
+                OUTPUT "${custom_target_script}"
+                INPUT "${custom_target_script_pregen}"
+                )
+            set(main_dep DEPENDS ${source_file})
+            set(verbose_output "$(VERBOSE)")
+
+            # Create up the comment string
+            file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}")
+            set(hip_build_comment_string "Building HIPCC object ${generated_file_relative_path}")
+
+            # Build the generated file and dependency file
+            add_custom_command(
+                OUTPUT ${generated_file}
+                # These output files depend on the source_file and the contents of cmake_dependency_file
+                ${main_dep}
+                DEPENDS ${HIP_HIPCC_DEPEND}
+                DEPENDS ${custom_target_script}
+                # Make sure the output directory exists before trying to write to it.
+                COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}"
+                COMMAND ${CMAKE_COMMAND} ARGS
+                -D verbose:BOOL=${verbose_output}
+                -D build_configuration:STRING=${_hip_build_configuration}
+                -D "generated_file:STRING=${generated_file}"
+                -P "${custom_target_script}"
+                WORKING_DIRECTORY "${hip_compile_output_dir}"
+                COMMENT "${hip_build_comment_string}"
+                )
+
+            # Make sure the build system knows the file is generated
+            set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE)
+            list(APPEND _hip_generated_files ${generated_file})
         endif()
     endforeach()


Fix FindXDG.cmake too

Fix FindXDG.cmake too

--- cmake/FindXDG.cmake
+++ cmake/FindXDG.cmake
@@ -25,6 +25,8 @@

 # handle the QUIETLY and REQUIRED arguments and set XDG_FOUND to TRUE if all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(XDG DEFAULT_MSG XDG_INCLUDE_DIR XDG_LIBRARY)
+find_package_handle_standard_args(
+	XDG
+	REQUIRED_VARS XDG_LIBRARY XDG_INCLUDE_DIR)

 mark_as_advanced(XDG_INCLUDE_DIR XDG_LIBRARY)


setting *.i file is main dependency for swig generation command

--- cmake/LuaSWIG.cmake
+++ cmake/LuaSWIG.cmake
@@ -17,7 +17,7 @@
   add_custom_command (
     OUTPUT "${SWIG_GENERATED_SOURCE_DIR}/${SWIG_GENERERATED_FILENAME}"
     COMMAND "${SWIG_EXECUTABLE}" -o "${SWIG_GENERATED_SOURCE_DIR}/${SWIG_GENERERATED_FILENAME}" -lua -c++ "${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_MODULE}"
-    DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_MODULE}"
+    MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_MODULE}"
   )
   set(${SWIG_GENERATED_FILEPATH} ${${SWIG_GENERATED_FILEPATH}} "${SWIG_GENERATED_SOURCE_DIR}/${SWIG_GENERERATED_FILENAME}")
 endmacro(generate_lua_wrap)


cmake/Version.cmake: Fix version detection when building from zipfile (non-git tree). Fixes #523

--- cmake/Version.cmake
+++ cmake/Version.cmake
@@ -20,15 +20,15 @@
 	if (res EQUAL 1)
 		set (PROJECT_VERSION "${PROJECT_VERSION}-dirty")
 	endif()
-endif()

-string(REGEX REPLACE "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)(-[.0-9A-Za-z-]+)?([+][.0-9A-Za-z-]+)?$"
-                     "\\1;\\2;\\3" PROJECT_VERSION_LIST ${PROJECT_VERSION})
-list(LENGTH PROJECT_VERSION_LIST len)
-if(len EQUAL 3)
-	list(GET PROJECT_VERSION_LIST 0 PROJECT_VERSION_MAJOR)
-	list(GET PROJECT_VERSION_LIST 1 PROJECT_VERSION_MINOR)
-	list(GET PROJECT_VERSION_LIST 2 PROJECT_VERSION_PATCH)
+	string(REGEX REPLACE "^(0|[1-9][0-9]*)[.](0|[1-9][0-9]*)[.](0|[1-9][0-9]*)(-[.0-9A-Za-z-]+)?([+][.0-9A-Za-z-]+)?$"
+		"\\1;\\2;\\3" PROJECT_VERSION_LIST ${PROJECT_VERSION})
+	list(LENGTH PROJECT_VERSION_LIST len)
+	if(len EQUAL 3)
+		list(GET PROJECT_VERSION_LIST 0 PROJECT_VERSION_MAJOR)
+		list(GET PROJECT_VERSION_LIST 1 PROJECT_VERSION_MINOR)
+		list(GET PROJECT_VERSION_LIST 2 PROJECT_VERSION_PATCH)
+	endif()
 elseif(EXISTS ${PROJECT_SOURCE_DIR}/.version)
 	#  If git is not available (e.g. when building from source package)
 	#  we can extract the package version from .version file.
@@ -44,7 +44,5 @@
 	message(FATAL_ERROR "Unable to determine project version")
 endif()

-if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
-	message(STATUS "stlink version: ${PROJECT_VERSION}")
-	message(STATUS "          Major ${PROJECT_VERSION_MAJOR} Minor ${PROJECT_VERSION_MINOR} Patch ${PROJECT_VERSION_PATCH}")
-endif()
+message(STATUS "stlink version: ${PROJECT_VERSION}")
+message(STATUS "          Major ${PROJECT_VERSION_MAJOR} Minor ${PROJECT_VERSION_MINOR} Patch ${PROJECT_VERSION_PATCH}")


fptu: add '-Wno-error' for GoogleTest.

fptu: add '-Wno-error' for GoogleTest.

--- cmake/testing.cmake
+++ cmake/testing.cmake
@@ -79,6 +79,11 @@
     # the gtest and gtest_main targets.
     add_subdirectory(${gtest_root}
       ${CMAKE_BINARY_DIR}/googletest-build)
+
+    if (CC_HAS_WERROR)
+      target_compile_options(gtest PRIVATE "-Wno-error")
+      target_compile_options(gtest_main PRIVATE "-Wno-error")
+    endif()

     # The gtest/gtest_main targets carry header search path
     # dependencies automatically when using CMake 2.8.11 or


cucumber-testing: Cleaned up logging.

cucumber-testing: Cleaned up logging.

--- cmake/testing.cmake
+++ cmake/testing.cmake
@@ -47,11 +47,7 @@
         OPTIONAL
     )

-    message("- Test '${arg_TEST_NAME}' setup for target '${arg_TEST_TARGET}'.\n
-    \tTarget found at: \"${OUT_DIR}\"\n \
-    \tReport found at: \"${OUT_DIR}/${arg_REPORT_FILE}\n \
-    \tTags: \"${arg_TAGS}\"\n"
-    )
+    message("TESTING - Test '${arg_TEST_NAME}' setup for target '${arg_TEST_TARGET}'. Tags: ${arg_TAGS}")

 endfunction()


Clone MITK-Data head

Clone MITK-Data head

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,13 +13,13 @@

 if(BUILD_TESTING)

-  set(revision_tag 5ad3bb57) # first 8 characters of hash-tag
+# set(revision_tag 5ad3bb57) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}
     SOURCE_DIR ${proj}
     GIT_REPOSITORY https://phabricator.mitk.org/source/mitkdata.git
-    GIT_TAG ${revision_tag}
+#   GIT_TAG ${revision_tag}
 #   URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/mitk-data_${revision_tag}.tar.gz
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ""


re-fixed clang version check

re-fixed clang version check

--- cmake/ClangFormat.cmake
+++ cmake/ClangFormat.cmake
@@ -21,13 +21,9 @@
       OUTPUT_VARIABLE CLANG_FORMAT_VERSION
       OUTPUT_STRIP_TRAILING_WHITESPACE)
     string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" CLANG_FORMAT_VERSION ${CLANG_FORMAT_VERSION})
-    string(REPLACE "." ";" CLANG_SPLIT_VERSION ${CLANG_FORMAT_VERSION})
-    list(GET CLANG_SPLIT_VERSION 0 CLANG_FORMAT_MAJOR)
-    list(GET CLANG_SPLIT_VERSION 1 CLANG_FORMAT_MINOR)
-    list(GET CLANG_SPLIT_VERSION 2 CLANG_FORMAT_PATCH)
   endif()

-  if(CLANG_FORMAT AND ${CLANG_FORMAT_MAJOR} VERSION_GREATER_EQUAL 6)
+  if(CLANG_FORMAT AND ${CLANG_FORMAT_VERSION} VERSION_GREATER_EQUAL "6.0.0")
     add_custom_target("${TARGET}_clangformat"
       COMMAND ${CLANG_FORMAT}
         "-i"
@@ -39,7 +35,7 @@
       VERBATIM)
     add_dependencies(${TARGET} "${TARGET}_clangformat")
   elseif(CLANG_FORMAT)
-    message(WARNING "clang-format version ${CLANG_FORMAT_VERSION} (major version ${CLANG_FORMAT_MAJOR}) is too old.\n"
+    message(WARNING "clang-format version ${CLANG_FORMAT_VERSION} is too old.\n"
       "Please download and install a version matching ${CLANG_FORMAT_VERSION_PATTERN}"
       " from http://releases.llvm.org/download.html\n"
 	  "Also adjust Visual Studio options and PATH variable as necessary!")


Test boost 1.78

Test boost 1.78

--- cmake/FindPython3.cmake
+++ cmake/FindPython3.cmake
@@ -51,7 +51,8 @@
                                         libboost_python37.so.1.76.0
                                         libboost_python38.so.1.76.0
                                         libboost_python39.so.1.76.0
-                                        libboost_python39.so.1.77.0)
+                                        libboost_python39.so.1.77.0
+                                        libboost_python39.so.1.78.0)

     execute_process(COMMAND bash -c "cat /etc/os-release | grep ID_LIKE" OUTPUT_VARIABLE OS_ID_LIKE)
     if($ENV{CONDA_BUILD})


Recent UMFPACK library requires to link to libSuiteSparse

--- cmake/FindUmfpack.cmake
+++ cmake/FindUmfpack.cmake
@@ -39,9 +39,12 @@
   find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
   if (COLAMD_LIBRARY)
     set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
-  #else (COLAMD_LIBRARY)
-  #  set(UMFPACK_LIBRARIES FALSE)
   endif (COLAMD_LIBRARY)
+
+  find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
+  if (SUITESPARSE_LIBRARY)
+    set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SUITESPARSE_LIBRARY})
+  endif (SUITESPARSE_LIBRARY)

 endif(UMFPACK_LIBRARIES)


CMake: more module info in CMakeUI

CMake: more module info in CMakeUI

--- cmake/globalutils.cmake
+++ cmake/globalutils.cmake
@@ -212,6 +212,14 @@
     first_case_upper(dir_name_cap ${the_module})

     set(desc "Build ${dir_name_cap} Module\nPath: ${${mod_dep}_path}")
+
+    if(${mod}_version)
+        set(desc "${desc}\nVersion: ${${mod}_version}")
+    endif()
+    if(${mod}_dependencies)
+        join(";" ", " res ${${mod}_dependencies})
+        set(desc "${desc}\nDependencies: ${res}")
+    endif()
     if(${mod_dep}_description)
         decodeLineBreaks(decodedDesc ${${mod_dep}_description})
         set(desc "${desc}\n\n${decodedDesc}")


If ENABLE_DYNDRIVERS is OFF we need to set cgm_COMPILE_FLAGS to include the nistcd headers.

svn path=/trunk/; revision=9697

--- cmake/modules/cgm.cmake
+++ cmake/modules/cgm.cmake
@@ -23,10 +23,14 @@
 #
 # cgm_TARGETS	     - list of targets which the cgm dynamic device
 # 		       depends on.
+# cgm_COMPILE_FLAGS	  - individual COMPILE_FLAGS required to compile cgm
+# 			    device.
 # DRIVERS_LINK_FLAGS - list of targets which the cgm static device
 # 		       depends on.

 if(PLD_cgm)
   set(cgm_TARGETS nistcd)
+  set(cgm_COMPILE_FLAGS "-I${CMAKE_SOURCE_DIR}/lib/nistcd")
+
   set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} nistcd)
 endif(PLD_cgm)


Adding .${PCL_MINOR_VERSION} to SOVERSION

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

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -87,7 +87,7 @@
     #
     set_target_properties(${_name} PROPERTIES
         VERSION ${PCL_VERSION}
-        SOVERSION ${PCL_MAJOR_VERSION}
+        SOVERSION ${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}
         DEFINE_SYMBOL "PCLAPI_EXPORTS")
     if(USE_PROJECT_FOLDERS)
       set_target_properties(${_name} PROPERTIES FOLDER "Libraries")


build: default to consider warnings as error

--- tools/cmake/compiler_warnings.cmake
+++ tools/cmake/compiler_warnings.cmake
@@ -3,7 +3,7 @@
 # https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Available.md

 function(set_project_warnings project_name)
-    option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" FALSE)
+    option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE)

     set(MSVC_WARNINGS
         /W4 # Baseline reasonable warnings


explicitly run python.
look for cookie file: if not there ask user to run upload.py manually,
and use a new CR_ISSUE arg to update later.

git-svn-id: ed337ca7cdb08c0ba29d8fe58632bb7686892c2d@492 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6

--- make/codereview.cmake
+++ make/codereview.cmake
@@ -64,6 +64,9 @@
 #   DR_ISSUE:BOOL   = Set to ON to create a DynamoRIO Issue to cover the review
 #                     task.  This is no longer recommended as we use Rietveld
 #                     and don't want to pollute the DR issue tracker.
+#   CR_ISSUE:STRING = Gives the codereview.appspot.com issue number to use, if
+#                     the diff was uploaded manually and thus the number is not
+#                     stored at the top of the diff itself.
 #
 # Examples:
 #
@@ -135,6 +138,11 @@
 if (NOT EXISTS "make/upload.py")
   message(FATAL_ERROR "cannot find make/upload.py")
 endif ()
+
+find_program(PYTHON python DOC "subversion client")
+if (NOT PYTHON)
+  message(FATAL_ERROR "python not found")
+endif (NOT PYTHON)

 find_program(SVN svn DOC "subversion client")
 if (NOT SVN)
@@ -234,19 +242,28 @@
   # If someone manually created these files then this script
   # will fail: we assume not already there if haven't been
   # added to svn yet.
-  set(cur_issue )
+  if (CR_ISSUE)
+    set(cur_issue -i ${CR_ISSUE})
+  else (CR_ISSUE)
+    set(cur_issue )
+  endif (CR_ISSUE)
   if (NOT EXISTS "${DIFF_FILE}")
     file(WRITE "${DIFF_FILE}" "")
     run_svn("add;${DIFF_LOCAL}")
   else (NOT EXISTS "${DIFF_FILE}")
-    # Get Rietveld issue #
-    file(READ "${DIFF_FILE}" curdiff)
-    string(REGEX MATCHALL "http://codereview.appspot.com/[0-9]*" issue "${curdiff}")
-    string(REGEX REPLACE "http://codereview.appspot.com/" "" inum "${issue}")
-    if (NOT "${inum}" STREQUAL "")
-      set(cur_issue -i ${inum})
-    endif ()
+    if (NOT CR_ISSUE)
+      # Get Rietveld issue #
+      file(READ "${DIFF_FILE}" curdiff)
+      string(REGEX MATCH "http://codereview.appspot.com/[0-9]*" issue "${curdiff}")
+      string(REGEX REPLACE "http://codereview.appspot.com/" "" inum "${issue}")
+      if (NOT "${inum}" STREQUAL "")
+        set(cur_issue -i ${inum})
+      endif (NOT "${inum}" STREQUAL "")
+    endif (NOT CR_ISSUE)
   endif (NOT EXISTS "${DIFF_FILE}")
+  if ("${inum}" STREQUAL "")
+    set(issue "Not auto-uploaded to codereview.appspot.com")
+  endif ("${inum}" STREQUAL "")

   file(READ "${NOTES}" string)
   string(REGEX REPLACE "^.*\ntoreview:\r?\n" "" pubnotes "${string}")
@@ -455,18 +472,40 @@

  if (COMMIT)
     # Upload to Rietveld with notes as description
-    execute_process(COMMAND "make/upload.py" -y
+    # Unfortunately there's no way in CMake to execute upload.py when it
+    # asks for a password (it needs control over the terminal to do that)
+    # so we only automate when cookies are in place.
+    set(home "$ENV{HOME}")
+    if (WIN32 AND "${home}" STREQUAL "")
+      set(home "$ENV{USERPROFILE}")
+    endif ()
+    set(cookie_file "${home}/.codereview_upload_cookies")
+    set(upload_cmd "${PYTHON}" "make/upload.py" -y
       -e "${AUTHOR}" -r "${REVIEWER}" -m "${first_line}" -f "${DIFF_FILE}"
       --send_mail --cc=dynamorio-devs@googlegroups.com
-      ${cur_issue} ${DIFFARGS}
-      RESULT_VARIABLE cmd_result
-      ERROR_VARIABLE cmd_err
-      OUTPUT_VARIABLE cmd_out)
-    if (cmd_result OR cmd_err)
-      message(FATAL_ERROR "*** upload.py failed: ***\n${cmd_out}\n${cmd_err}")
-    endif (cmd_result OR cmd_err)
-    string(REGEX MATCHALL "http://codereview.appspot.com/[0-9]*" issue "${cmd_out}")
-    message(STATUS "Issue is uploaded to: ${issue}")
+      ${cur_issue} ${DIFFARGS})
+    # list to string
+    foreach(arg ${upload_cmd})
+      if (arg MATCHES " ")
+        set(upload_cmd_str "${upload_cmd_str} \"${arg}\"")
+      else (arg MATCHES " ")
+        set(upload_cmd_str "${upload_cmd_str} ${arg}")
+      endif (arg MATCHES " ")
+    endforeach(arg ${upload_cmd})
+    if (NOT EXISTS "${cookie_file}")
+      message(STATUS "It looks like upload.py does not have cookies in place and will prompt you for a password.  To do so you must run it separately (and then use -DCR_ISSUE=<issue#> arg with future invocations of this script in order to update the same issue).\nPlease run:\n\t${upload_cmd_str}")
+    else (NOT EXISTS "${cookie_file}")
+      message(STATUS "running ${upload_cmd_str}")
+      execute_process(COMMAND ${upload_cmd}
+        RESULT_VARIABLE cmd_result
+        OUTPUT_VARIABLE cmd_out
+        ERROR_VARIABLE cmd_err)
+      if (cmd_result OR cmd_err)
+        message(FATAL_ERROR "*** upload.py failed: ***\n${cmd_out}\n${cmd_err}.")
+      endif (cmd_result OR cmd_err)
+      string(REGEX MATCHALL "http://codereview.appspot.com/[0-9]*" issue "${cmd_out}")
+      message(STATUS "Issue is uploaded to: ${issue}")
+    endif (NOT EXISTS "${cookie_file}")
   endif (COMMIT)
   # Save issue for next time
   file(APPEND "${DIFF_FILE}" "\n${issue}\n")


simlify boost use script, use BoostConfig.cmake from boost build

https://github.com/smanders/externpro/issues/308#issuecomment-902959955

--- projects/use/usexp-boost-config.cmake
+++ projects/use/usexp-boost-config.cmake
@@ -14,13 +14,15 @@
 endif()
 set(BOOST_VERSION "${BOOST_VER} [@PROJECT_NAME@]")
 if(NOT DEFINED Boost_LIBS)
-  # dependencies determined by examining cmake's Modules/FindBoost.cmake
+  # dependencies determined by 'grep _DEPS boost_*/*-static.cmake'
   set(Boost_LIBS   # dependency order
+    log_setup      # dep:log
+    ######
     log            # dep:thread
     ######
-    iostreams      # dep:regex
+    graph          # dep:regex
     json           # dep:container
-    thread         # dep:atomic,chrono,date_time
+    thread         # dep:atomic
     timer          # dep:chrono
     wserialization # dep:serialization
     ######
@@ -28,10 +30,8 @@
     chrono
     container
     date_time
-    exception
     filesystem
-    graph
-    log_setup
+    iostreams
     nowide
     program_options
     random
@@ -47,83 +47,19 @@
   # iostreams depends on zlib bzip2
   xpFindPkg(PKGS bzip2 zlib) # dependencies
 endif()
-unset(Boost_INCLUDE_DIR CACHE)
-unset(Boost_LIBRARY_DIR CACHE)
-foreach(lib ${Boost_LIBS})
-  string(TOUPPER ${lib} UPPERLIB)
-  unset(Boost_${UPPERLIB}_LIBRARY_DEBUG CACHE)
-  unset(Boost_${UPPERLIB}_LIBRARY_RELEASE CACHE)
-endforeach()
-string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1.\\2" BOOST_VER2 ${BOOST_VER})
-# see FindBoost.cmake for details on the following variables
-set(Boost_ADDITIONAL_VERSIONS ${BOOST_VER} ${BOOST_VER2})
+# see BoostConfig.cmake for details on the following variables
 set(Boost_FIND_QUIETLY TRUE)
-set(Boost_NO_SYSTEM_PATHS TRUE)
 set(Boost_USE_STATIC_LIBS ON)
 set(Boost_USE_MULTITHREADED ON)
 set(Boost_USE_STATIC_RUNTIME ON)
-#set(Boost_DEBUG TRUE) # enable debugging output of FindBoost.cmake
-#set(Boost_DETAILED_FAILURE_MSG) # output detailed information
-set(BOOST_ROOT ${XP_ROOTDIR})
-# TODO: remove the following once CMAKE_CXX_COMPILER_ARCHITECTURE_ID is defined for all supported compilers
-#   https://gitlab.kitware.com/cmake/cmake/issues/17702
-# boost versions >= 1.66.0 add an additional modifier to the library name and some compilers don't set the
-# cmake variable used in FindBoost.cmake that's used to set _boost_ARCHITECTURE_TAG
-#   https://gitlab.kitware.com/cmake/cmake/issues/17701
-if(BOOST_VER VERSION_GREATER_EQUAL "1.66.0" AND "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x")
-  execute_process(COMMAND uname --machine
-    OUTPUT_VARIABLE unameMachine
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-    ERROR_VARIABLE unameErr
-    )
-  if(DEFINED unameMachine AND NOT unameErr)
-    if(unameMachine STREQUAL x86_64)
-      set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID x64)
-    elseif(unameMachine MATCHES "^armv" OR unameMachine MATCHES "^aarch")
-      set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "ARM")
-    endif()
-  endif()
-endif()
-find_package(Boost ${BOOST_VER} REQUIRED COMPONENTS ${Boost_LIBS})
-set(${PRJ}_FOUND ${Boost_FOUND})
-set(${PRJ}_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
-function(listPrependToAll var prefix)
-  set(listVar)
-  foreach(f ${ARGN})
-    list(APPEND listVar "${prefix}${f}")
-  endforeach()
-  set(${var} "${listVar}" PARENT_SCOPE)
-endfunction()
-listPrependToAll(boostLibs "Boost::" ${Boost_LIBS})
-# TRICKY: Boost_LIBRARIES returned from find_package() introduces hard-coded absolute
-# paths and wrecks havoc on cmake-generated targets files, hence boostLibs
-set(${PRJ}_LIBRARIES ${boostLibs})
-set(reqVars ${PRJ}_VERSION ${PRJ}_INCLUDE_DIR ${PRJ}_LIBRARIES)
-if(UNIX)
-  include(CheckLibraryExists)
-  function(checkLibraryConcat lib symbol liblist)
-    string(TOUPPER ${lib} LIB)
-    check_library_exists("${lib}" "${symbol}" "" XP_BOOST_HAS_${LIB})
-    if(XP_BOOST_HAS_${LIB})
-      list(APPEND ${liblist} ${lib})
-      set(${liblist} ${${liblist}} PARENT_SCOPE)
-    endif()
-  endfunction()
-  checkLibraryConcat(m pow syslibs)
-  checkLibraryConcat(pthread pthread_create syslibs)
-  checkLibraryConcat(rt shm_open syslibs)
-  list(APPEND ${PRJ}_LIBRARIES ${syslibs})
-  checkLibraryConcat(rt clock_gettime additionalThreadLibs)
-  if(DEFINED additionalThreadLibs AND TARGET Boost::thread)
-    get_target_property(libs Boost::thread INTERFACE_LINK_LIBRARIES)
-    if(libs)
-      list(APPEND libs ${additionalThreadLibs})
-    else()
-      set(libs ${additionalThreadLibs})
-    endif()
-    set_target_properties(Boost::thread PROPERTIES INTERFACE_LINK_LIBRARIES "${libs}")
-  endif()
-endif()
+#set(Boost_VERBOSE TRUE) # enable verbose output of BoostConfig.cmake
+#set(Boost_DEBUG TRUE) # enable debug (even more verbose) output of BoostConfig.cmake
+find_package(Boost ${BOOST_VER} REQUIRED COMPONENTS ${Boost_LIBS}
+  PATHS ${XP_ROOTDIR}/lib/cmake/Boost-${BOOST_VER} NO_DEFAULT_PATH
+  )
+mark_as_advanced(Boost_DIR)
+set(${PRJ}_LIBRARIES ${Boost_LIBRARIES})
+set(reqVars ${PRJ}_VERSION ${PRJ}_LIBRARIES)
 include(FindPackageHandleStandardArgs)
 set(FPHSA_NAME_MISMATCHED TRUE) # find_package_handle_standard_args NAME_MISMATCHED (prefix usexp-)
 find_package_handle_standard_args(${prj} REQUIRED_VARS ${reqVars})


fix boost DEFINITIONS in use script

fix boost DEFINITIONS in use script

* wxInclude, which only uses part of boost, failed becase BOOST_DEFINITIONS wasn't defined

see issue https://github.com/smanders/externpro/issues/182

--- projects/use/usexp-boost-config.cmake
+++ projects/use/usexp-boost-config.cmake
@@ -114,6 +114,7 @@
     set(${PRJ}_FOUND FALSE)
   endif()
   link_directories(${XP_ROOTDIR}/lib)
+  set(reqVars ${PRJ}_INCLUDE_DIR)
   if(DEFINED ZLIB_LIBRARIES AND DEFINED BZIP2_LIBRARIES)
     add_definitions(
       -DBOOST_ZLIB_BINARY=$<TARGET_FILE:${ZLIB_LIBRARIES}>
@@ -123,8 +124,8 @@
       -DBOOST_ZLIB_BINARY=$<TARGET_FILE:${ZLIB_LIBRARIES}>
       -DBOOST_BZIP2_BINARY=$<TARGET_FILE:${BZIP2_LIBRARIES}>
       )
+    list(APPEND reqVars ${PRJ}_DEFINITIONS)
   endif()
-  set(reqVars ${PRJ}_INCLUDE_DIR ${PRJ}_DEFINITIONS)
 endif()
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(${prj} REQUIRED_VARS ${reqVars})


CI: enable diapotb

CI: enable diapotb

--- CI/configure_options.cmake
+++ CI/configure_options.cmake
@@ -70,7 +70,7 @@
 set(cmake_configure_option
 "${cmake_configure_option}
 CMAKE_PREFIX_PATH=${XDK_PATH}")
-foreach(remote_module OTBTemporalGapFilling SertitObject otbGRM)# DiapOTBModule
+foreach(remote_module OTBTemporalGapFilling SertitObject otbGRM DiapOTBModule)
   set(cmake_configure_option
 "${cmake_configure_option}
 Module_${remote_module}:BOOL=ON")


CMake: fix Emscripten build. Instead of setting things in CMake itself, the toolchain file should be provided via `-DCMAKE_TOOLCHAIN_FILE`.

--- CMake/ChooseCompiler.cmake
+++ CMake/ChooseCompiler.cmake
@@ -2,12 +2,15 @@
 MESSAGE( STATUS ">> --------------------- ChooseCompiler.cmake ------------------------- <<" )
 ######## UI Web - this means we need emcc ###########################
 if (SPIRIT_BUILD_FOR_JS)
-    ###
+    ###
     MESSAGE( STATUS ">> Choosing compiler:             emcc" )
     ### Set the path to emscripten
-    SET(EMSCRIPTEN_ROOT_PATH "/usr/local/emsdk/emscripten/1.38.29/")
+    # SET(EMSCRIPTEN_ROOT_PATH "/usr/local/emsdk/emscripten/1.38.29/")
     ### Use the Emscripten toolchain file
-    SET(CMAKE_TOOLCHAIN_FILE Emscripten)
+    # SET(CMAKE_TOOLCHAIN_FILE /usr/local/emsdk/emscripten/1.38.13/cmake/Modules/Platform/Emscripten)
+    ###
+    MESSAGE( STATUS ">> EMSCRIPTEN_ROOT_PATH: \"${EMSCRIPTEN_ROOT_PATH}\"")
+    MESSAGE( STATUS ">> CMAKE_TOOLCHAIN_FILE: \"${CMAKE_TOOLCHAIN_FILE}\"")
 ######################################################################


Add ELASTIX_VERSION CMake variable

Add ELASTIX_VERSION CMake variable

--- CMake/elastixVersion.cmake
+++ CMake/elastixVersion.cmake
@@ -2,3 +2,5 @@
 set(ELASTIX_VERSION_MAJOR "5")
 set(ELASTIX_VERSION_MINOR "0")
 set(ELASTIX_VERSION_PATCH "1")
+
+set(ELASTIX_VERSION "${ELASTIX_VERSION_MAJOR}.${ELASTIX_VERSION_MINOR}.${ELASTIX_VERSION_PATCH}")


Disabled 3rd party libs for dcmtk configuration. Now mbi superbuild should work for macs

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -34,6 +34,12 @@
          "-DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS} ${DCMTK_CXX_FLAGS}"
          "-DCMAKE_C_FLAGS:STRING=${ep_common_C_FLAGS} ${DCMTK_C_FLAGS}"
          -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/${proj}-install
+         -DDCMTK_WITH_ZLIB:BOOL=OFF # see bug #9894
+         -DDCMTK_WITH_OPENSSL:BOOL=OFF # see bug #9894
+         -DDCMTK_WITH_PNG:BOOL=OFF # see bug #9894
+         -DDCMTK_WITH_TIFF:BOOL=OFF  # see bug #9894
+         -DDCMTK_WITH_XML:BOOL=OFF  # see bug #9894
+         -DDCMTK_FORCE_FPIC_ON_UNIX:BOOL=ON
       DEPENDS ${proj_DEPENDENCIES}
       )
     SET(DCMTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-install)


Change download method of Vigra to Git clone


Fixed gcc compiler command line warning about ill formed define.

--- CMakeModules/FindSBW.cmake
+++ CMakeModules/FindSBW.cmake
@@ -78,10 +78,17 @@

 if (SBW_LIBRARY AND SBW_LIBRARY MATCHES "static")
   get_target_property(current_defs SBW::SBW INTERFACE_COMPILE_DEFINITIONS)
-  set_target_properties(SBW::SBW PROPERTIES
-    INTERFACE_COMPILE_DEFINITIONS "SBW_STATIC=1;${current_defs}"
-  )
-endif()
+
+  if (NOT current_defs)
+    set_target_properties(SBW::SBW PROPERTIES
+      INTERFACE_COMPILE_DEFINITIONS "SBW_STATIC=1"
+    )
+  else ()
+    set_target_properties(SBW::SBW PROPERTIES
+      INTERFACE_COMPILE_DEFINITIONS ${current_defs}
+    )
+  endif ()
+endif ()

 if (SBW_INCLUDE_DIR AND SBW_LIBRARY)
     set(TEST_FILE ${CMAKE_BINARY_DIR}/test_sbw_version.cpp)


Help anaconda on windows a bit more to find the libs needed for linking

--- modules/FindCoherentPython.cmake
+++ modules/FindCoherentPython.cmake
@@ -47,9 +47,19 @@
             endif()
         endif()
     endmacro()
-    # Figures out paths from distutils' sysconfig module
+    # Figures out paths from distutils' sysconfig module and sys.prefix
     # Started off for canopy and virtualenv
     macro(paths_from_distutils_sysconfig)
+        call_python(PYTHON_INTERP_PREFIX "import sys; print(sys.prefix)")
+        if(DEFINED PYTHON_INTERP_PREFIX)
+            FILE(TO_CMAKE_PATH ${PYTHON_INTERP_PREFIX} PYTHON_INTERP_PREFIX)
+            if(EXISTS "${PYTHON_INTERP_PREFIX}/libs")
+                # Conda stores its .lib files in ${PYTHON_INTERP_PREFIX/libs
+                # on windows. (Python35.lib etc needed for linking)
+                # The dlls should be on path.
+                list(INSERT CMAKE_LIBRARY_PATH 0 "${PYTHON_INTERP_PREFIX}/libs")
+            endif()
+        endif()
         call_python(python_include
         "from distutils.sysconfig import get_python_inc"
             "print(get_python_inc())"


Fix  ROOT_${_opt}_FOUND in FindROOT.cmake

--- etc/cmake/FindROOT.cmake
+++ etc/cmake/FindROOT.cmake
@@ -59,6 +59,7 @@
   COMMAND ${ROOT_CONFIG_EXECUTABLE} --features
   OUTPUT_VARIABLE _root_options
   OUTPUT_STRIP_TRAILING_WHITESPACE)
+separate_arguments(_root_options)
 foreach(_opt ${_root_options})
   set(ROOT_${_opt}_FOUND TRUE)
 endforeach()


CMake: refactor MAP_ANON checks

CMake: refactor MAP_ANON checks

http://blog.foxkit.us/2015/09/the-joys-of-unix-programming.html

--- cmake/Modules/platform.cmake
+++ cmake/Modules/platform.cmake
@@ -53,13 +53,19 @@
 endmacro()

 macro(mmap_check)
-	if(HAVE_POSIX)
-		check_symbol_exists(mmap sys/mman.h HAVE_MMAP)
-		if(HAVE_MMAP)
-			check_symbol_exists(mremap sys/mman.h HAVE_MREMAP)
-			check_symbol_exists(MAP_ANONYMOUS sys/mman.h HAVE_MAP_ANONYMOUS)
-			if(NOT HAVE_MAP_ANONYMOUS)
+	check_symbol_exists(mmap sys/mman.h HAVE_MMAP)
+	if(HAVE_MMAP)
+		check_symbol_exists(mremap sys/mman.h HAVE_MREMAP)
+		check_symbol_exists(MAP_ANON sys/mman.h HAVE_MAP_ANONYMOUS)
+		if(NOT HAVE_MAP_ANONYMOUS)
+			if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+				add_definitions(-D_DARWIN_C_SOURCE)
 				check_symbol_exists(MAP_ANON sys/mman.h HAVE_MAP_ANONYMOUS)
+			elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+				add_definitions(-D__BSD_VISIBLE)
+				check_symbol_exists(MAP_ANON sys/mman.h HAVE_MAP_ANONYMOUS)
+			elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+				check_symbol_exists(MAP_ANONYMOUS sys/mman.h HAVE_MAP_ANONYMOUS)
 			endif()
 		endif()
 	endif()
@@ -83,5 +89,7 @@
 	stdc_check()
 	swap_check()
 	clock_check()
-	mmap_check()
+	if(HAVE_POSIX)
+		mmap_check()
+	endif()
 endmacro()


Make sure that toplevel bin/ directory is there...  some python stuff might want to make links at cmake time.

--- cmake/catkin_workspace.cmake
+++ cmake/catkin_workspace.cmake
@@ -1,4 +1,8 @@
 function(catkin_workspace)
+  if (NOT IS_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+    file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+  endif()
+
   assert(catkin_EXTRAS_DIR)
   assert_file_exists(${catkin_EXTRAS_DIR}/templates/topologically_traverse.py.in "${catkin_EXTRAS_DIR}")
   assert_file_exists(${catkin_EXTRAS_DIR}/em/topologically_traverse.cmake.em "file not found")