added: preliminary support for clang 3.3+

--- cmake/SetupCompilerPre.cmake
+++ cmake/SetupCompilerPre.cmake
@@ -5,6 +5,9 @@
 # Copyright (C) 2014 University of Hull                                                            #
 #                                                                                #
 ####################################################################################################
+
+MESSAGE(STATUS "Applying Compiler Defaults for: "
+               "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")

 INCLUDE(ProcessorCount)
 PROCESSORCOUNT(NUM_CPUS)
@@ -14,9 +17,66 @@

 SET(CMAKE_LIBRARY_TYPE "LIBRARY_TYPE_UNDEFINED")

-IF(CMAKE_COMPILER_IS_GNUCC)
-  MESSAGE(STATUS "Applying Compiler Defaults for: GCC (v. ${CMAKE_CXX_COMPILER_VERSION})")
+IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+  SET(CMAKE_LIBRARY_TYPE "SHARED")

+  SET(GLOBAL_COMPILER_FLAGS)
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -pipe")
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wall -Wextra")
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wpointer-arith")
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-ignored-qualifiers")
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -fmessage-length=0")
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -fdiagnostics-show-option")
+
+  IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "3.0")
+    SET(GLOBAL_COMPILER_FLAGS "-std=c++11 ${GLOBAL_COMPILER_FLAGS}")
+  ELSE()
+    SET(GLOBAL_COMPILER_FLAGS "-std=c++0x ${GLOBAL_COMPILER_FLAGS}")
+  ENDIF()
+
+  IF("Release" STREQUAL "${CMAKE_BUILD_TYPE}")
+  ELSE()
+  ENDIF()
+
+  IF(FALSE)
+    IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "3.0")
+      MESSAGE(STATUS "Enabling runtime address-sanitation support")
+      SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -fsanitize=address")
+      SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -fno-omit-frame-pointer")
+    ENDIF()
+  ENDIF()
+
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GLOBAL_COMPILER_FLAGS}")
+
+  # linker flags
+  IF("Release" STREQUAL "${CMAKE_BUILD_TYPE}")
+    SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-O1")
+  ENDIF()
+
+  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--demangle")
+  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--fatal-warnings")
+
+  # BOOST
+  SET(Boost_DEBUG               FALSE)
+  # SET(Boost_USE_STATIC_LIBS     ON)
+  SET(Boost_USE_MULTITHREAD     ON)
+  ADD_DEFINITIONS(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
+  ADD_DEFINITIONS("-DBOOST_ALL_DYN_LINK")
+
+  # GLM
+  ADD_DEFINITIONS("-DGLM_FORCE_CXX11")
+  # doesn't work if '__attribute__((always_inline))' is used without 'inline'
+  # ADD_DEFINITIONS("-DGLM_FORCE_INLINE")
+  # ADD_DEFINITIONS("-DGLM_FORCE_ONLY_XYZW")
+  ADD_DEFINITIONS("-DGLM_FORCE_RADIANS")
+  # ADD_DEFINITIONS("-DGLM_MESSAGES")
+  ADD_DEFINITIONS("-DGLM_PRECISION_MEDIUMP_INT")
+  ADD_DEFINITIONS("-DGLM_PRECISION_MEDIUMP_FLOAT")
+  ADD_DEFINITIONS("-DGLM_SWIZZLE")
+
+ENDIF()
+
+IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
   SET(CMAKE_LIBRARY_TYPE "SHARED")

   SET(GLOBAL_COMPILER_FLAGS)
@@ -78,11 +138,10 @@
   ADD_DEFINITIONS("-DGLM_PRECISION_MEDIUMP_INT")
   ADD_DEFINITIONS("-DGLM_PRECISION_MEDIUMP_FLOAT")
   ADD_DEFINITIONS("-DGLM_SWIZZLE")
+
 ENDIF()

-IF(MSVC)
-  MESSAGE(STATUS "Applying Compiler Defaults for: MSVC (v. ${CMAKE_CXX_COMPILER_VERSION})")
-
+IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
   SET(CMAKE_LIBRARY_TYPE "STATIC")

   SET(DISABLED_WARNINGS)


[android] Escape include paths in Android.

Before the result of `_add_variant_c_compile_flags` was a string, so appending several "-isystem" was not a problem. With #29451 the rules have changed since the list is now handled by CMake, and it deduplicates the repeated members in the list. Thanks, CMake.

Should fix the Android CI builds that were failing since the merging of #29451.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -363,7 +363,7 @@
     swift_android_libcxx_include_paths(CFLAGS_CXX_INCLUDES)
     swift_android_include_for_arch("${CFLAGS_ARCH}" "${CFLAGS_ARCH}_INCLUDE")
     foreach(path IN LISTS CFLAGS_CXX_INCLUDES ${CFLAGS_ARCH}_INCLUDE)
-      list(APPEND result -isystem;${path})
+      list(APPEND result "SHELL:${CMAKE_INCLUDE_SYSTEM_FLAG_C}${path}")
     endforeach()
     list(APPEND result "-D__ANDROID_API__=${SWIFT_ANDROID_API_LEVEL}")
   elseif(CFLAGS_SDK STREQUAL WINDOWS)


build: remove `IS_SDK_OVERLAY` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -691,7 +691,6 @@
 #     [DONT_EMBED_BITCODE]
 #     [IS_STDLIB]
 #     [IS_STDLIB_CORE]
-#     [IS_SDK_OVERLAY]
 #     INSTALL_IN_COMPONENT comp
 #     source1 [source2 source3 ...])
 #
@@ -751,9 +750,6 @@
 #
 # IS_STDLIB_CORE
 #   Compile as the standard library core.
-#
-# IS_SDK_OVERLAY
-#   Treat the library as a part of the Swift SDK overlay.
 #
 # INSTALL_IN_COMPONENT comp
 #   The Swift installation component that this library belongs to.
@@ -763,7 +759,6 @@
 function(_add_swift_host_library_single target name)
   set(SWIFTLIB_SINGLE_options
         DONT_EMBED_BITCODE
-        IS_SDK_OVERLAY
         IS_STDLIB
         IS_STDLIB_CORE
         NOSWIFTRT
@@ -920,7 +915,6 @@
       COMPILE_FLAGS ${SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS}
       ${SWIFTLIB_SINGLE_IS_STDLIB_keyword}
       ${SWIFTLIB_SINGLE_IS_STDLIB_CORE_keyword}
-      ${SWIFTLIB_SINGLE_IS_SDK_OVERLAY_keyword}
       ${embed_bitcode_arg}
       INSTALL_IN_COMPONENT "${SWIFTLIB_SINGLE_INSTALL_IN_COMPONENT}")
   add_swift_source_group("${SWIFTLIB_SINGLE_EXTERNAL_SOURCES}")


Fix some problems in Finduuid.cmake

Fix some problems in Finduuid.cmake

There is some weird CMake behavior where CMake is unable to check for
the existence of directories in some cases

--- cmake/modules/Finduuid.cmake
+++ cmake/modules/Finduuid.cmake
@@ -34,7 +34,7 @@
   find_path(UUID_INCLUDE_DIR uuid/uuid.h)
 endif()

-if(EXISTS UUID_INCLUDE_DIR)
+if(EXISTS "${UUID_INCLUDE_DIR}")
   set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
   set(CMAKE_REQUIRED_INCLUDES ${UUID_INCLUDE_DIRS})
   check_cxx_symbol_exists("uuid_generate_random" "uuid/uuid.h" _uuid_header_only)


Set rpath to executable path in MacOS builds

--- cmake/resolve_platform.cmake
+++ cmake/resolve_platform.cmake
@@ -21,6 +21,8 @@
         set(PLATFORM_APPLE 1)
         set(TARGET_ARCH "APPLE")
         set(__UPPER_TARGET_ARCH "APPLE")
+        set(CMAKE_MACOSX_RPATH TRUE)
+        set(CMAKE_INSTALL_RPATH "@executable_path")
     elseif(CMAKE_HOST_UNIX)
         set(PLATFORM_LINUX 1)
         set(TARGET_ARCH "LINUX")


cmake: drop obsolete code creating OpenMP target, unneeded with now required cmake-3.10

--- cmake/src-dependencies.cmake
+++ cmake/src-dependencies.cmake
@@ -41,17 +41,6 @@
                        "or pass -DWITH_OPENMP=OFF to disable OpenMP support.")
   else()
     message(STATUS "Looking for OpenMP - found (system)")
-  endif()
-
-  # FIXME: OpenMP::OpenMP_CXX target, and ${OpenMP_CXX_LIBRARIES} were both
-  # added in cmake-3.9. Until then, this is correct:
-  if(NOT TARGET OpenMP::OpenMP_CXX)
-    add_library(OpenMP::OpenMP_CXX INTERFACE IMPORTED)
-    if(OpenMP_CXX_FLAGS)
-      set_property(TARGET OpenMP::OpenMP_CXX PROPERTY INTERFACE_COMPILE_OPTIONS ${OpenMP_CXX_FLAGS})
-      set_property(TARGET OpenMP::OpenMP_CXX PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS})
-      # Yes, both of them to the same value.
-    endif()
   endif()

   # The wrapper library that *actually* should be linked to.


cmake: fix todo target

cmake: fix todo target

--- lib/cmake/targets.cmake
+++ lib/cmake/targets.cmake
@@ -1,2 +1,2 @@
 add_custom_target(run ./run working_diretory ${CMAKE_SOURCE_DIR})
-add_custom_target(todo which ack && ack --type=nomake TODO || grep -Hrn TODO *)
+add_custom_target(todo which ack && ack --type=cpp TODO || grep -Hrn TODO *)


Changed debian install prefix from /usr to /

--- linux/cmake/DpkgDeb.cmake
+++ linux/cmake/DpkgDeb.cmake
@@ -208,13 +208,13 @@

   # Calling "make install DESTDIR=${DEBIAN_DIR}"
   ADD_CUSTOM_TARGET(deb_destdir_install
-    COMMAND ${CMAKE_MAKE_PROGRAM} install CMAKE_INSTALL_PREFIX=/usr DESTDIR=${DEBIAN_DIR}
+    COMMAND ${CMAKE_MAKE_PROGRAM} install CMAKE_INSTALL_PREFIX=/ DESTDIR=${DEBIAN_DIR}
     DEPENDS ${CMAKE_BINARY_DIR}/cmake_install.cmake
     COMMENT "Installing with DESTDIR = ${DEBIAN_DIR}"
   )
   ADD_DEPENDENCIES(deb_destdir_install deb_destdir_preinstall)
   ADD_CUSTOM_TARGET(deb_destdir_preinstall
-    COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=/usr -DDESTDIR=${DEBIAN_DIR} .
+    COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=/ -DDESTDIR=${DEBIAN_DIR} .
     DEPENDS ${CMAKE_BINARY_DIR}/cmake_install.cmake
     COMMENT "Configuring with DESTDIR = ${DEBIAN_DIR}"
   )


ENH: bundle executables in the packaging.

--- cmake/sara_installation_settings.cmake
+++ cmake/sara_installation_settings.cmake
@@ -47,6 +47,13 @@
           FILES_MATCHING PATTERN "*.hpp")

   set(CPACK_COMPONENT_Sources_REQUIRED 1)
+
+  # Programs
+  sara_message("Installing binary")
+  install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+          DESTINATION .
+          COMPONENT Programs)
+  set(CPACK_COMPONENT_Programs_REQUIRED 1)
 endif ()

 # DO-Sara component libraries
@@ -57,7 +64,7 @@

 # List all available components for installation.
-set(CPACK_COMPONENTS_ALL ThirdParty Sources Libraries)
+set(CPACK_COMPONENTS_ALL ThirdParty Sources Libraries Programs)

 if (WIN32)


 - изменена логика работы cmake скрипта запуска бизона

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@12668 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/split-bison.cmake
+++ rdo/packages/cmake/trunk/split-bison.cmake
@@ -33,7 +33,8 @@
 	SET(BISON_${INPUT_FILE}_OUTPUT_HEADER)
 	IF(${ARGC} GREATER 4 OR ${ARGC} EQUAL 4)
 		SET(BISON_${INPUT_FILE}_OUTPUT_HEADER ${GRAMMA_H})
-		SET(BISON_DEFINE -defines\ ${BISON_${INPUT_FILE}_OUTPUT_HEADER})
+		SET(BISON_DEFINES -defines)
+		SET(BISON_DEFINE ${BISON_${INPUT_FILE}_OUTPUT_HEADER})
 		LIST(APPEND OUTPUT_FILE ${BISON_${INPUT_FILE}_OUTPUT_HEADER})
 	ENDIF()

@@ -43,7 +44,7 @@
 			COMMAND set CYGWIN=nodosfilewarning
 			COMMAND set BISON_PKGDATADIR=${BISON_FLEX_DIRECTORY}/share/bison
 			COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/python/split-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2}
-			COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/python/run-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2} -o1 ${CPP_OUTPUT_FILE_1} -o2 ${CPP_OUTPUT_FILE_2} -n1 ${Y_1} -n2 ${Y_2} -bison ${BISON_EXECUTABLE}\ -g\ -v ${BISON_DEFINE}
+			COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/python/run-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2} -o1 ${CPP_OUTPUT_FILE_1} -o2 ${CPP_OUTPUT_FILE_2} -n1 ${Y_1} -n2 ${Y_2} -bison ${BISON_EXECUTABLE}\ -g\ -v ${BISON_DEFINES} ${BISON_DEFINE}
 			DEPENDS ${${INPUT_FILE}_INPUT}
 			COMMENT "[BISON][rdo${INPUT_FILE}] Building parser with bison ${BISON_VERSION}"
 			WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@@ -52,7 +53,7 @@
 		ADD_CUSTOM_COMMAND(
 			OUTPUT ${OUTPUT_FILE}
 			COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/python/split-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2}
-			COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/python/run-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2} -o1 ${CPP_OUTPUT_FILE_1} -o2 ${CPP_OUTPUT_FILE_2} -n1 ${Y_1} -n2 ${Y_2} -bison ${BISON_EXECUTABLE}\ -g\ -v ${BISON_DEFINE}
+			COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/python/run-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2} -o1 ${CPP_OUTPUT_FILE_1} -o2 ${CPP_OUTPUT_FILE_2} -n1 ${Y_1} -n2 ${Y_2} -bison ${BISON_EXECUTABLE}\ -g\ -v ${BISON_DEFINES} ${BISON_DEFINE}
 			DEPENDS ${${INPUT_FILE}_INPUT}
 			COMMENT "[BISON][rdo${INPUT_FILE}] Building parser with bison ${BISON_VERSION}"
 			WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}


ARROW-15027: [C++] Fix OpenTelemetry CMake definitions

Closes #11903 from lidavidm/arrow-15027

Authored-by: David Li <dc24f9cfc84fb1675ce65c8444a2c3e2f0e5f297@gmail.com>
Signed-off-by: David Li <dc24f9cfc84fb1675ce65c8444a2c3e2f0e5f297@gmail.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -3918,6 +3918,7 @@
       common
       http_client_curl
       ostream_span_exporter
+      otlp_http_client
       otlp_http_exporter
       otlp_recordable
       proto
@@ -3934,6 +3935,7 @@
                                      "${OPENTELEMETRY_INCLUDE_DIR}")
   endforeach()
   foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_LIBS})
+    # N.B. OTel targets and libraries don't follow any consistent naming scheme
     if(_OPENTELEMETRY_LIB STREQUAL "http_client_curl")
       set(_OPENTELEMETRY_STATIC_LIBRARY
           "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
@@ -3941,6 +3943,10 @@
     elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_span_exporter")
       set(_OPENTELEMETRY_STATIC_LIBRARY
           "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_span${CMAKE_STATIC_LIBRARY_SUFFIX}"
+      )
+    elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_client")
+      set(_OPENTELEMETRY_STATIC_LIBRARY
+          "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_client${CMAKE_STATIC_LIBRARY_SUFFIX}"
       )
     elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_exporter")
       set(_OPENTELEMETRY_STATIC_LIBRARY
@@ -4082,9 +4088,13 @@
                         PROPERTIES INTERFACE_LINK_LIBRARIES
                                    "opentelemetry-cpp::trace;opentelemetry-cpp::resources;opentelemetry-cpp::proto"
   )
+  set_target_properties(opentelemetry-cpp::otlp_http_client
+                        PROPERTIES INTERFACE_LINK_LIBRARIES
+                                   "opentelemetry-cpp::sdk;opentelemetry-cpp::proto;opentelemetry-cpp::http_client_curl;nlohmann_json::nlohmann_json"
+  )
   set_target_properties(opentelemetry-cpp::otlp_http_exporter
                         PROPERTIES INTERFACE_LINK_LIBRARIES
-                                   "opentelemetry-cpp::otlp_recordable;opentelemetry-cpp::http_client_curl;nlohmann_json::nlohmann_json"
+                                   "opentelemetry-cpp::otlp_recordable;opentelemetry-cpp::otlp_http_client"
   )

   foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_LIBS})


modules: updated FindCorrade.cmake.

modules: updated FindCorrade.cmake.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -4,7 +4,7 @@
 #  find_package(Corrade [REQUIRED])
 # This module tries to find Corrade library and then defines:
 #  CORRADE_FOUND                    - True if Corrade is found
-#  CORRADE_INCLUDE_DIR              - Root include dir
+#  CORRADE_INCLUDE_DIRS             - Corrade include directories
 #  CORRADE_INTERCONNECT_LIBRARIES   - Interconnect library and dependent
 #   libraries
 #  CORRADE_UTILITY_LIBRARIES        - Utility library and dependent
@@ -101,7 +101,14 @@
 # release plugins installed alongside each other.
 #
 #
+# Find corresponding DLLs for library files.
+#  corrade_find_dlls_for_libs(<VAR> libs...)
+# Available only on Windows, for all *.lib files tries to find corresponding
+# DLL file. Useful for bundling dependencies for e.g. WinRT packages.
+#
+#
 # Additionally these variables are defined for internal usage:
+#  CORRADE_INCLUDE_DIR              - Root include dir
 #  CORRADE_INTERCONNECT_LIBRARY     - Interconnect library (w/o
 #   dependencies)
 #  CORRADE_UTILITY_LIBRARY          - Utility library (w/o dependencies)
@@ -176,6 +183,10 @@
     NAMES UseCorrade.cmake CorradeLibSuffix.cmake
     PATH_SUFFIXES share/cmake/Corrade)

+# Configuration file
+find_file(_CORRADE_CONFIGURE_FILE configure.h
+    HINTS ${CORRADE_INCLUDE_DIR}/Corrade/)
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Corrade DEFAULT_MSG
     CORRADE_UTILITY_LIBRARY
@@ -184,14 +195,15 @@
     CORRADE_TESTSUITE_LIBRARY
     CORRADE_INCLUDE_DIR
     CORRADE_RC_EXECUTABLE
-    _CORRADE_MODULE_DIR)
+    _CORRADE_MODULE_DIR
+    _CORRADE_CONFIGURE_FILE)

 if(NOT CORRADE_FOUND)
     return()
 endif()

 # Read flags from fonfiguration
-file(READ ${CORRADE_INCLUDE_DIR}/Corrade/configure.h _corradeConfigure)
+file(READ ${_CORRADE_CONFIGURE_FILE} _corradeConfigure)
 set(_corradeFlags
     GCC47_COMPATIBILITY
     MSVC2015_COMPATIBILITY
@@ -213,6 +225,7 @@
     endif()
 endforeach()

+set(CORRADE_INCLUDE_DIRS ${CORRADE_INCLUDE_DIR})
 set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARY})
 set(CORRADE_INTERCONNECT_LIBRARIES ${CORRADE_INTERCONNECT_LIBRARY} ${CORRADE_UTILITY_LIBRARIES})
 set(CORRADE_PLUGINMANAGER_LIBRARIES ${CORRADE_PLUGINMANAGER_LIBRARY} ${CORRADE_UTILITY_LIBRARIES})
@@ -220,6 +233,15 @@
 set(CORRADE_USE_MODULE ${_CORRADE_MODULE_DIR}/UseCorrade.cmake)
 set(CORRADE_LIB_SUFFIX_MODULE ${_CORRADE_MODULE_DIR}/CorradeLibSuffix.cmake)

+# If the configure file is somewhere else than in root include dir (e.g. when
+# using CMake subproject), we need to include that dir too
+if(NOT ${CORRADE_INCLUDE_DIR}/Corrade/configure.h STREQUAL ${_CORRADE_CONFIGURE_FILE})
+    # Go two levels up
+    get_filename_component(_CORRADE_CONFIGURE_FILE_INCLUDE_DIR ${_CORRADE_CONFIGURE_FILE} DIRECTORY)
+    get_filename_component(_CORRADE_CONFIGURE_FILE_INCLUDE_DIR ${_CORRADE_CONFIGURE_FILE_INCLUDE_DIR} DIRECTORY)
+    list(APPEND CORRADE_INCLUDE_DIRS ${_CORRADE_CONFIGURE_FILE_INCLUDE_DIR})
+endif()
+
 # At least static build needs this
 if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_NACL_GLIBC)
     set(CORRADE_PLUGINMANAGER_LIBRARIES ${CORRADE_PLUGINMANAGER_LIBRARIES} ${CMAKE_DL_LIBS})
@@ -230,7 +252,7 @@
     set(CORRADE_UTILITY_LIBRARIES ${CORRADE_UTILITY_LIBRARIES} log)
 endif()

-mark_as_advanced(_CORRADE_MODULE_DIR)
+mark_as_advanced(_CORRADE_CONFIGURE_FILE _CORRADE_MODULE_DIR)

 # Finalize the finding process
 include(${CORRADE_USE_MODULE})


Update FW - [ImageManip] Adding support for input/output GRAY8 format

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "391ede37d1b55aa3dac727f58ff99aac7d2865dc")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "53c09072ddcc23361a37026486e668196695a790")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


toolchain: arcmwdt: add compile options: -Wno-typedef-redefinition

Without the -Wno-typedef-redefinition option, arcmwdt (clang based)
complains if a typedef gets redefined in gnu99  mode (since this is
officially a C11 feature). While new versions of GCC do not seem to
issue this warning in gnu99 mode anymore. So some existing code
with typedef redefined which works well with GCC will issue this
warning. As this warning is not fatal, so simply shut it off for good.

Signed-off-by: Watson Zeng <bb6a45ebfbb8932a11537002b062f5218879c562@synopsys.com>

--- cmake/compiler/arcmwdt/compiler_flags.cmake
+++ cmake/compiler/arcmwdt/compiler_flags.cmake
@@ -31,6 +31,7 @@
                       -Wno-main-return-type
                       -Wno-unaligned-pointer-conversion
                       -Wno-incompatible-pointer-types-discards-qualifiers
+                      -Wno-typedef-redefinition
 )

 check_set_compiler_property(APPEND PROPERTY warning_base -Wno-pointer-sign)


Force LF: args.cmake

Force LF: args.cmake

--- cmake/modules/hunter_create_args_file.cmake
+++ cmake/modules/hunter_create_args_file.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ruslan Baratov
+# Copyright (c) 2015, 2018 Ruslan Baratov
 # All rights reserved.

 include(hunter_status_debug)
@@ -26,8 +26,9 @@
   #       "A", "B", "C"
   #   'var_value' will have values:
   #       "value1", "value2", "value3", "value4"
-  file(REMOVE "${filename}")
-  file(WRITE "${filename}" "") # create empty file if no option
+  set(filename_nolf "${filename}.NOLF")
+  file(REMOVE "${filename_nolf}")
+  file(WRITE "${filename_nolf}" "") # create empty file if no option
   set(var_name "")
   foreach(entry ${args})
     string(FIND "${entry}" "=" update_var)
@@ -53,13 +54,13 @@
         )
       endif()
       ### -- end
-      file(APPEND "${filename}" "set(")
+      file(APPEND "${filename_nolf}" "set(")
       file(
           APPEND
-          "${filename}"
+          "${filename_nolf}"
           "\"${var_name}\" \"\${${var_name}}\" \"${var_value}\""
       )
-      file(APPEND "${filename}" " CACHE INTERNAL \"\")\n")
+      file(APPEND "${filename_nolf}" " CACHE INTERNAL \"\")\n")
       hunter_status_debug(
           "Add extra CMake args: '${var_name}' += '${var_value}'"
       )
@@ -97,12 +98,21 @@
       endif()
       ### -- end

-      file(APPEND "${filename}" "set(")
-      file(APPEND "${filename}" "\"${var_name}\" \"${var_value}\"")
-      file(APPEND "${filename}" " CACHE INTERNAL \"\")\n")
+      file(APPEND "${filename_nolf}" "set(")
+      file(APPEND "${filename_nolf}" "\"${var_name}\" \"${var_value}\"")
+      file(APPEND "${filename_nolf}" " CACHE INTERNAL \"\")\n")
       hunter_status_debug(
           "Add extra CMake args: '${var_name}' = '${var_value}'"
       )
     endif()
   endforeach()
+
+  # About '@ONLY': no substitutions expected but COPYONLY can't be
+  # used with NEWLINE_STYLE
+  configure_file(
+      "${filename_nolf}"
+      "${filename}"
+      @ONLY
+      NEWLINE_STYLE LF
+  )
 endfunction()


ARROW-1302: C++: Set MAKE to make if not defined

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #1010 from xhochy/ARROW-1302 and squashes the following commits:

72fe9e5f [Uwe L. Korn] Only search for make on unix systems
95d3a310 [Uwe L. Korn] Use find_program to find make
b7b169e5 [Uwe L. Korn] ARROW-1302: C++: Set MAKE to make if not defined

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -103,6 +103,13 @@

 if (DEFINED ENV{ZSTD_HOME})
   set(ZSTD_HOME "$ENV{ZSTD_HOME}")
+endif()
+
+# Ensure that a default make is set
+if ("${MAKE}" STREQUAL "")
+    if (NOT MSVC)
+        find_program(MAKE make)
+    endif()
 endif()

 # ----------------------------------------------------------------------


[Config] (hopefully) better detection of Boost.Python across platforms

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -504,7 +504,7 @@
 	  set (PY_MINOR_VERSION "${CMAKE_MATCH_2}")
 	  set (PY_PATCH_VERSION "${CMAKE_MATCH_3}")
 	endif (${PYTHONLIBS_VERSION_STRING} MATCHES "([0-9]).([0-9]).([0-9])")
-
+
 	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION} (${PYTHONLIBS_VERSION_STRING} / ${PY_MAJOR_VERSION}.${PY_MINOR_VERSION}.${PY_PATCH_VERSION})")

 	# Set the Python installation directory
@@ -585,15 +585,15 @@
 macro (register_boost_lib _boost_lib_list_name _boost_lib_list)
   # Update the list of library dependencies for the project
   foreach (_lib_cpt ${_boost_lib_list})
-	string (TOUPPER ${_lib_cpt} _lib_cpt_up)
-
-	if (Boost_${_lib_cpt_up}_LIBRARY)
-	  # Update the list of dependencies for the project
-	  list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
-
-	  # Update the list of libraries to be displayed
-	  list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
-	endif (Boost_${_lib_cpt_up}_LIBRARY)
+    string (TOUPPER ${_lib_cpt} _lib_cpt_up)
+
+    if (Boost_${_lib_cpt_up}_LIBRARY)
+      # Update the list of dependencies for the project
+      list (APPEND ${_boost_lib_list_name} ${Boost_${_lib_cpt_up}_LIBRARY})
+
+      # Update the list of libraries to be displayed
+      list (APPEND BOOST_REQUIRED_LIBS ${Boost_${_lib_cpt_up}_LIBRARY})
+    endif (Boost_${_lib_cpt_up}_LIBRARY)
   endforeach (_lib_cpt ${_boost_lib_list})
 endmacro (register_boost_lib _boost_lib_list_name _boost_lib_list)

@@ -606,18 +606,26 @@
   else (${ARGC} GREATER 0)
     message (STATUS "Requires Boost without specifying any version")
   endif (${ARGC} GREATER 0)
-
+
   #
-  # Note: ${Boost_DATE_TIME_LIBRARY} and ${Boost_PROGRAM_OPTIONS_LIBRARY}
-  # are already set by ${SOCIMYSQL_LIBRARIES} and/or ${SOCI_LIBRARIES}.
-  #
-  set (python_component_name "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
+  # Note 1: ${Boost_DATE_TIME_LIBRARY} and ${Boost_PROGRAM_OPTIONS_LIBRARY}
+  #         are already set by ${SOCIMYSQL_LIBRARIES} and/or ${SOCI_LIBRARIES}.
+  # Note 2: Boost libraries are not installed in a consistent way across the
+  #         the different platforms and versions of Boost.
+  #         For a while, the Boost.Python library component was just called
+  #         'python'. It is now suffixed with the version of Python, and
+  #         on some Linux distributions, there is even a '-py' suffix.
+  #         On some platform/Boost version combinations, the Python version
+  #         may be just the major version (2 or 3 as of 2019) or the major
+  #         and minor versions (e.g., 27, 28, 34, 36, 37 as of 2019)
+  set (python_cpt_name1 "python${PY_MAJOR_VERSION}")
+  set (python_cpt_name2 "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
     date_time random iostreams serialization filesystem system
-	locale ${python_component_name} regex)
+    locale ${python_cpt_name1} ${python_cpt_name2} regex)
   set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
   set (BOOST_REQUIRED_COMPONENTS_FOR_TST unit_test_framework)
   set (BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS_FOR_LIB}
@@ -637,23 +645,28 @@
   find_package (BoostWrapper ${_required_version} REQUIRED)

   if (Boost_FOUND)
+    # Boost.Python library
+    message (STATUS "  + Boost_PYTHON_LIBRARY: ${Boost_PYTHON_LIBRARY}")
+    message (STATUS "  + Boost_PYTHON3_LIBRARY: ${Boost_PYTHON3_LIBRARY}")
+    message (STATUS "  + Boost_PYTHON37_LIBRARY: ${Boost_PYTHON37_LIBRARY}")
+
     # Update the list of include directories for the project
     include_directories (${Boost_INCLUDE_DIRS})

-	# For display purposes
+    # For display purposes
     set (BOOST_REQUIRED_LIBS "")

     # Update the list of library dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_LIB"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")

     # Update the list of binary dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_BIN}")

     # Update the list of test dependencies for the project
-	register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
-	  "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")
+    register_boost_lib ("PROJ_DEP_LIBS_FOR_TST"
+      "${BOOST_REQUIRED_COMPONENTS_FOR_TST}")

   endif (Boost_FOUND)


[Build] Added support for RMOL and AirInv in the CMake framework.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -120,7 +120,11 @@
   if (NOT EXISTS ${DOC_INSTALL_FILE})
     unset (DOC_INSTALL_FILE)
   endif (NOT EXISTS ${DOC_INSTALL_FILE})
-  set (BASICDOC_FILES AUTHORS NEWS README ${DOC_INSTALL_FILE})
+  set (DOC_NEWS_FILE NEWS)
+  if (NOT EXISTS ${DOC_NEWS_FILE})
+    unset (DOC_NEWS_FILE)
+  endif (NOT EXISTS ${DOC_NEWS_FILE})
+  set (BASICDOC_FILES AUTHORS ${DOC_NEWS_FILE} README ${DOC_INSTALL_FILE})
   set (BASICDOC_PATH "share/doc/${PACKAGE}-${PACKAGE_VERSION}")

 endmacro (set_project_options)
@@ -291,9 +295,49 @@
       get_stdair (${_arg_version})
     endif (${_arg_lower} STREQUAL "stdair")

+    if (${_arg_lower} STREQUAL "sevmgr")
+      get_sevmgr (${_arg_version})
+    endif (${_arg_lower} STREQUAL "sevmgr")
+
+    if (${_arg_lower} STREQUAL "trademgen")
+      get_trademgen (${_arg_version})
+    endif (${_arg_lower} STREQUAL "trademgen")
+
+    if (${_arg_lower} STREQUAL "travelccm")
+      get_travelccm (${_arg_version})
+    endif (${_arg_lower} STREQUAL "travelccm")
+
+    if (${_arg_lower} STREQUAL "airsched")
+      get_airsched (${_arg_version})
+    endif (${_arg_lower} STREQUAL "airsched")
+
     if (${_arg_lower} STREQUAL "airrac")
       get_airrac (${_arg_version})
     endif (${_arg_lower} STREQUAL "airrac")
+
+    if (${_arg_lower} STREQUAL "rmol")
+      get_rmol (${_arg_version})
+    endif (${_arg_lower} STREQUAL "rmol")
+
+    if (${_arg_lower} STREQUAL "airinv")
+      get_airinv (${_arg_version})
+    endif (${_arg_lower} STREQUAL "airinv")
+
+    if (${_arg_lower} STREQUAL "avlcal")
+      get_avlcal (${_arg_version})
+    endif (${_arg_lower} STREQUAL "avlcal")
+
+    if (${_arg_lower} STREQUAL "simfqt")
+      get_simfqt (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simfqt")
+
+    if (${_arg_lower} STREQUAL "simlfs")
+      get_simlfs (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simlfs")
+
+    if (${_arg_lower} STREQUAL "simcrs")
+      get_simcrs (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simcrs")

     if (${_arg_lower} STREQUAL "doxygen")
       get_doxygen (${_arg_version})
@@ -577,6 +621,70 @@
   endif (AirRAC_FOUND)

 endmacro (get_airrac)
+
+# ~~~~~~~~~~ RMOL ~~~~~~~~~
+macro (get_rmol)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires RMOL-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires RMOL without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (RMOL ${_required_version} REQUIRED
+	HINTS ${WITH_RMOL_PREFIX})
+  if (RMOL_FOUND)
+    #
+    message (STATUS "Found RMOL version: ${RMOL_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${RMOL_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${RMOL_LIBRARIES})
+
+  else (RMOL_FOUND)
+    set (ERROR_MSG "The RMOL library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_RMOL_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<RMOL install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (RMOL_FOUND)
+
+endmacro (get_rmol)
+
+# ~~~~~~~~~~ Airinv ~~~~~~~~~
+macro (get_airinv)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires Airinv-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires Airinv without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (Airinv ${_required_version} REQUIRED
+	HINTS ${WITH_AIRINV_PREFIX})
+  if (Airinv_FOUND)
+    #
+    message (STATUS "Found Airinv version: ${AIRINV_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${AIRINV_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${AIRINV_LIBRARIES})
+
+  else (Airinv_FOUND)
+    set (ERROR_MSG "The Airinv library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_AIRINV_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<Airinv install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (Airinv_FOUND)
+
+endmacro (get_airinv)

 ##############################################
@@ -1572,6 +1680,34 @@
     message (STATUS "  - AIRRAC_INCLUDE_DIRS ........ : ${AIRRAC_INCLUDE_DIRS}")
   endif (AirRAC_FOUND)
 endmacro (display_airrac)
+
+# RMOL
+macro (display_rmol)
+  if (RMOL_FOUND)
+    message (STATUS)
+    message (STATUS "* RMOL:")
+    message (STATUS "  - RMOL_VERSION ............... : ${RMOL_VERSION}")
+    message (STATUS "  - RMOL_BINARY_DIRS ........... : ${RMOL_BINARY_DIRS}")
+    message (STATUS "  - RMOL_EXECUTABLES ........... : ${RMOL_EXECUTABLES}")
+    message (STATUS "  - RMOL_LIBRARY_DIRS .......... : ${RMOL_LIBRARY_DIRS}")
+    message (STATUS "  - RMOL_LIBRARIES ............. : ${RMOL_LIBRARIES}")
+    message (STATUS "  - RMOL_INCLUDE_DIRS .......... : ${RMOL_INCLUDE_DIRS}")
+  endif (RMOL_FOUND)
+endmacro (display_rmol)
+
+# Airinv
+macro (display_airinv)
+  if (Airinv_FOUND)
+    message (STATUS)
+    message (STATUS "* Airinv:")
+    message (STATUS "  - AIRINV_VERSION ............. : ${AIRINV_VERSION}")
+    message (STATUS "  - AIRINV_BINARY_DIRS ......... : ${AIRINV_BINARY_DIRS}")
+    message (STATUS "  - AIRINV_EXECUTABLES ......... : ${AIRINV_EXECUTABLES}")
+    message (STATUS "  - AIRINV_LIBRARY_DIRS ........ : ${AIRINV_LIBRARY_DIRS}")
+    message (STATUS "  - AIRINV_LIBRARIES ........... : ${AIRINV_LIBRARIES}")
+    message (STATUS "  - AIRINV_INCLUDE_DIRS ........ : ${AIRINV_INCLUDE_DIRS}")
+  endif (Airinv_FOUND)
+endmacro (display_airinv)

 ##
 macro (display_status_all_modules)
@@ -1658,6 +1794,8 @@
   display_soci ()
   display_stdair ()
   display_airrac ()
+  display_rmol ()
+  display_airinv ()
   #
   message (STATUS)
   message (STATUS "Change a value with: cmake -D<Variable>=<Value>" )


[Conf] Fixed a typo in status reporting

[Conf] Fixed a typo in status reporting

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -939,7 +939,7 @@
     #message (FATAL_ERROR "${ERROR_MSG}")
   else (OPTD_POR_DIR-NOTFOUND)
     #
-    message (STATUS "Found OPTD POR data dir: ${OOPTD_POR_DIR}")
+    message (STATUS "Found OPTD POR data dir: ${OPTD_POR_DIR}")
   endif (OPTD_POR_DIR-NOTFOUND)

 endmacro (get_optd)


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

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

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

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

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

 endmacro (get_python)

@@ -618,8 +606,8 @@
   #         On some platform/Boost version combinations, the Python version
   #         may be just the major version (2 or 3 as of 2019) or the major
   #         and minor versions (e.g., 27, 28, 34, 36, 37 as of 2019)
-  set (python_cpt_name1 "python${PY_MAJOR_VERSION}")
-  set (python_cpt_name2 "python${PY_MAJOR_VERSION}${PY_MINOR_VERSION}")
+  set (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
+  set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
@@ -1473,7 +1461,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/site-packages/py${PACKAGE})
+  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)
@@ -2555,27 +2543,26 @@

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

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


Add missing diagnostic sources to CoreCLR (#2029)

***NO_CI***

--- CMake/Modules/FindNF_CoreCLR.cmake
+++ CMake/Modules/FindNF_CoreCLR.cmake
@@ -279,7 +279,8 @@

     add_library(
         ${LIB_NAME} STATIC
-            ${NF_CoreCLR_SOURCES})
+            ${NF_CoreCLR_SOURCES}
+            ${NF_Diagnostics_SOURCES})

     target_include_directories(
         ${LIB_NAME}


Add Win10 SDKs to DX11 search script

Add Win10 SDKs to DX11 search script

--- CMake/Packages/FindDirectX11.cmake
+++ CMake/Packages/FindDirectX11.cmake
@@ -18,38 +18,57 @@
 	include(FindPkgMacros)
 	findpkg_begin(DirectX11)

-	# Windows 10 Universal SDK
-	if(MSVC14)
-		if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
-			set(W10SDK_VER ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION})
-		else()
-			set(W10SDK_VER 10.0.10240.0)
+	# Windows Phone
+	if(WINDOWS_PHONE)
+		# Windows Phone 8.1 SDK
+		if(WINDOWS_PHONE AND MSVC12)
+			find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Phone Kits/8.1/include" "C:/Program Files/Windows Phone Kits/8.1/include")
+			set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.1/lib/${MSVC_CXX_ARCHITECTURE_ID}/"
+
+		# Windows Phone 8.0 SDK
+		elseif(WINDOWS_PHONE AND MSVC11)
+			find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Phone Kits/8.0/include" "C:/Program Files/Windows Phone Kits/8.0/include")
+			set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.0/lib/${MSVC_CXX_ARCHITECTURE_ID}/"
+
 		endif()
-		find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Kits/10/include/${W10SDK_VER}/um" "C:/Program Files/Windows Kits/10/include/${W10SDK_VER}/um")
-		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Kits/10/lib/${W10SDK_VER}/um/${MSVC_CXX_ARCHITECTURE_ID}/"
-
-	# Windows Phone 8.1 SDK
-	elseif(WINDOWS_PHONE AND MSVC12)
-		find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Phone Kits/8.1/include" "C:/Program Files/Windows Phone Kits/8.1/include")
-		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.1/lib/${MSVC_CXX_ARCHITECTURE_ID}/"
-
-	# Windows Phone 8.0 SDK
-	elseif(WINDOWS_PHONE AND MSVC11)
-		find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Phone Kits/8.0/include" "C:/Program Files/Windows Phone Kits/8.0/include")
-		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.0/lib/${MSVC_CXX_ARCHITECTURE_ID}/"
-
-	# Windows 8.1 SDK
-	elseif(MSVC12)
-		find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Kits/8.1/include/um" "C:/Program Files/Windows Kits/8.1/include/um")
-		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Kits/8.1/lib/winv6.3/um/${MSVC_CXX_ARCHITECTURE_ID}/"
-
-	# Windows 8.0 SDK
-	elseif(MSVC11)
-		find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Kits/8.0/include/um" "C:/Program Files/Windows Kits/8.0/include/um")
-		set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Kits/8.0/lib/win8/um/${MSVC_CXX_ARCHITECTURE_ID}/"
+	else(WINDOWS_PHONE)
+		# Windows 10.x SDK
+		if(CMAKE_CL_64)
+			set(DirectX11_LIBPATH_SUFFIX "x64")
+		else(CMAKE_CL_64)
+			set(DirectX11_LIBPATH_SUFFIX "x86")
+		endif(CMAKE_CL_64)
+		get_filename_component(kit10_dir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" REALPATH)
+		file(GLOB kit10_list ${kit10_dir}/Include/10.*)
+		foreach(tmp_elem ${kit10_list})
+			if(IS_DIRECTORY ${tmp_elem})
+				get_filename_component(kit10_ver ${tmp_elem} NAME)
+				set(DirectX11_LIB_SEARCH_PATH "${kit10_dir}/Lib/${kit10_ver}/um")
+				find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "${tmp_elem}/um")
+				find_library(DirectX11_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
+				find_library(DirectX11_DXGI_LIBRARY NAMES dxgi HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
+				find_library(DirectX11_D3D11_LIBRARY NAMES d3d11 HINTS ${DirectX11_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX11_LIBPATH_SUFFIX})
+				set(DirectX11_LIBRARY
+					${DirectX11_D3D11_LIBRARY}
+					${DirectX11_DXGI_LIBRARY}
+					${DirectX11_DXGUID_LIBRARY}
+				)
+			endif()
+		endforeach()
+		# Windows 8.1 SDK
+		if(NOT DirectX11_INCLUDE_DIR)
+			find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Kits/8.1/include/um" "C:/Program Files/Windows Kits/8.1/include/um")
+			set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Kits/8.1/lib/winv6.3/um/${MSVC_CXX_ARCHITECTURE_ID}/"
+		endif()
+		# Windows 8.0 SDK
+		if(NOT DirectX11_INCLUDE_DIR)
+			find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "C:/Program Files (x86)/Windows Kits/8.0/include/um" "C:/Program Files/Windows Kits/8.0/include/um")
+			set(DirectX11_LIBRARY d3d11.lib dxgi.lib dxguid.lib) # in "C:/Program Files (x86)/Windows Kits/8.0/lib/win8/um/${MSVC_CXX_ARCHITECTURE_ID}/"
+		endif()
+	endif(WINDOWS_PHONE)

 	# Legacy Direct X SDK
-	else()
+	if(NOT DirectX11_INCLUDE_DIR)

 	# Get path, convert backslashes as ${ENV_DXSDK_DIR}
 	getenv_path(DXSDK_DIR)


make sure we find update imagemagick on ccsr before we look for the local system library

--- CMakeModules/FindImageMagick.cmake
+++ CMakeModules/FindImageMagick.cmake
@@ -214,7 +214,7 @@
     list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickWand_LIBRARY)
   elseif(component STREQUAL "MagickCore")
     FIND_IMAGEMAGICK_API(MagickCore magick/MagickCore.h
-      MagickCore CORE_RL_magick_ MagickCore-6.Q16 MagickCore-Q16 MagickCore-6.Q8 MagickCore-Q8 MagickCore-6.Q16HDRI MagickCore-Q16HDRI MagickCore-6.Q8HDRI MagickCore-Q8HDRI Magick
+      CORE_RL_magick_ MagickCore-6.Q16 MagickCore-Q16 MagickCore-6.Q8 MagickCore-Q8 MagickCore-6.Q16HDRI MagickCore-Q16HDRI MagickCore-6.Q8HDRI MagickCore-Q8HDRI MagickCore Magick
       )
     list(APPEND ImageMagick_REQUIRED_VARS ImageMagick_MagickCore_LIBRARY)
   else()


fix build type check in glbinding cmake build script

--- CMakeModules/build_glbinding.cmake
+++ CMakeModules/build_glbinding.cmake
@@ -3,7 +3,7 @@
 SET(prefix ${PROJECT_BINARY_DIR}/third_party/glb)

 SET(LIB_POSTFIX "")
-IF (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+IF (CMAKE_BUILD_TYPE MATCHES Debug)
     SET(LIB_POSTFIX "d")
 ENDIF()


- remove the debug_test_* targets from "all"   (otherwise they are compiled when you simply run    make in test/ or when enforcing "test" to be part of "all") - add linking libraries to the debug_test_* targets

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -45,7 +45,7 @@
   set(filename ${testname}.cpp)
   add_executable(${targetname} ${filename})
   add_dependencies(btest ${targetname})
-  add_executable(${debug_targetname} ${filename})
+  add_executable(${debug_targetname} EXCLUDE_FROM_ALL ${filename})

   if(NOT EIGEN_NO_ASSERTION_CHECKING)

@@ -92,6 +92,7 @@
     string(LENGTH "${ARGV2_stripped}" ARGV2_stripped_length)
     if(${ARGV2_stripped_length} GREATER 0)
       target_link_libraries(${targetname} ${ARGV2})
+      target_link_libraries(${debug_targetname} ${ARGV2})
     endif(${ARGV2_stripped_length} GREATER 0)
   endif(${ARGC} GREATER 2)


Avoid a warning about semicolons after macros from clang 8.0.0

--- cmake/add_warnings.cmake
+++ cmake/add_warnings.cmake
@@ -2,6 +2,7 @@
     if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     set(extra_warn
         -Weverything
+        -Wno-extra-semi-stmt
         -Wno-weak-vtables
         -Wno-exit-time-destructors
         -Wno-gnu-zero-variadic-macro-arguments


Re-enable HAVE_PTHREAD=ON by default on most platforms now tk segmentation fault has been cured.

svn path=/trunk/; revision=9867

--- cmake/modules/xwin.cmake
+++ cmake/modules/xwin.cmake
@@ -40,10 +40,9 @@
       # get a clear report that official X works for 10.5.
       option(HAVE_PTHREAD "Use pthreads with the xwin driver" OFF)
     else(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      # Turn HAVE_PTHREAD OFF by default everywhere else as well since it
-      # has been discovered it interacts so poorly with the Tk components
-      # of PLplot on Linux that it causes segfaults for those components.
-      option(HAVE_PTHREAD "Use pthreads with the xwin driver" OFF)
+      # Turn HAVE_PTHREAD ON by default for other platforms now that
+      # the tk segmentation fault has been cured.
+      option(HAVE_PTHREAD "Use pthreads with the xwin driver" ON)
     endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
     if(HAVE_PTHREAD)
       find_package(Threads)


cmake: Support for extra defines supplied in command line call to cmake when building services

--- cmake/post.service.cmake
+++ cmake/post.service.cmake
@@ -64,6 +64,17 @@
 #
 # DRIVERS / PLUGINS - support for parent cmake list specification
 #
+
+# Add extra drivers defined from command line
+set(DRIVERS ${DRIVERS} ${EXTRA_DRIVERS})
+if(DRIVERS)
+  list(REMOVE_DUPLICATES DRIVERS) # Remove duplicate drivers
+endif()
+# Add extra plugins defined from command line
+set(PLUGINS ${PLUGINS} ${EXTRA_PLUGINS})
+if(PLUGINS)
+  list(REMOVE_DUPLICATES PLUGINS) # Remove duplicate plugins
+endif()

 # Function:
 # Add plugin / driver as library, set link options
@@ -133,6 +144,12 @@
   add_subdirectory(${DIR_PATH})
   add_dependencies(service ${DEP_NAME})
 endforeach()
+
+# Add extra libraries defined from command line
+set(LIBRARIES ${LIBRARIES} ${EXTRA_LIBRARIES})
+if(LIBRARIES)
+  list(REMOVE_DUPLICATES LIBRARIES) # Remove duplicate libraries
+endif()

 # add all extra libs
 foreach(LIBR ${LIBRARIES})
@@ -267,8 +284,9 @@
 endfunction()

 # automatically build memdisk from folder
-function(diskbuilder FOLD)
+function(build_memdisk FOLD)
   get_filename_component(REL_PATH "${FOLD}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
+  message(STATUS ${REL_PATH})
   add_custom_command(
       OUTPUT  memdisk.fat
       COMMAND ${INSTALL_LOC}/bin/diskbuilder -o memdisk.fat ${REL_PATH}
@@ -277,6 +295,18 @@
     add_custom_target(diskbuilder ALL DEPENDS memdisk.fat)
   add_dependencies(service diskbuilder)
   add_memdisk("${CMAKE_BINARY_DIR}/memdisk.fat")
+endfunction()
+
+# build memdisk if defined
+if(MEMDISK)
+  build_memdisk(${MEMDISK})
+endif()
+
+# call build_memdisk only if MEMDISK is not defined from command line
+function(diskbuilder FOLD)
+  if(NOT MEMDISK)
+    build_memdisk(${FOLD})
+  endif()
 endfunction()

 if(TARFILE)


doc: improve flib documentation

doc: improve flib documentation

Change-Id: Ic8e7e4e6df17896dc526fafffb9dd5a057543f41

--- cmake/qibuild/find.cmake
+++ cmake/qibuild/find.cmake
@@ -157,11 +157,23 @@
 #!
 # Search for a library
 #
-# Note: if the library has a different name in debug and in release,
+# If the library has a different name in debug and in release,
 # you should use::
 #
 #   flib(foo DEBUG     foo_d)
 #   flib(foo OPTIMIZED foo)
+#
+# If the library has different names, you should call flib() just once ::
+#
+#  flib(foo foo foo3 foo3.4)
+#
+# If you want to link with several libraries in one step (for instance
+# foo-bar depends on foo-core but you just want to do
+# ``qi_use_lib(.. FOO)``, you must call flib() several times::
+#
+#  flib(foo foo-bar)
+#  flib(foo foo-core)
+#
 #
 # \arg:prefix  The prefix of the exported variables.
 #              Must match the argument of ``clean()`` and ``export()``


Update cmake/stm32/common.cmake

Update cmake/stm32/common.cmake

Co-authored-by: Julien Staub <0e44a740070fae557fd5ae1ae9f383381457fcd0@yahoo.fr>

--- cmake/stm32/common.cmake
+++ cmake/stm32/common.cmake
@@ -10,13 +10,12 @@
 endforeach()
 list(REMOVE_DUPLICATES STM32_SUPPORTED_FAMILIES_SHORT_NAME)

-if(DEFINED ENV{STM32_TOOLCHAIN_PATH})
-    message(STATUS "Detected toolchain path STM32_TOOLCHAIN_PATH in environmental variables: ")
-    message(STATUS "$ENV{STM32_TOOLCHAIN_PATH}")
-    set(STM32_TOOLCHAIN_PATH $ENV{STM32_TOOLCHAIN_PATH})
-endif()
-
 if(NOT STM32_TOOLCHAIN_PATH)
+    if(DEFINED ENV{STM32_TOOLCHAIN_PATH})
+        message(STATUS "Detected toolchain path STM32_TOOLCHAIN_PATH in environmental variables: ")
+        message(STATUS "$ENV{STM32_TOOLCHAIN_PATH}")
+        set(STM32_TOOLCHAIN_PATH $ENV{STM32_TOOLCHAIN_PATH})
+    endif()
     if(NOT CMAKE_C_COMPILER)
         set(STM32_TOOLCHAIN_PATH "/usr")
         message(STATUS "No STM32_TOOLCHAIN_PATH specified, using default: " ${STM32_TOOLCHAIN_PATH})
@@ -319,4 +318,3 @@
 include(stm32/l1)
 include(stm32/l4)
 include(stm32/l5)
-


Bug 880: automatically preserves buildtool flags when modifying DartConfiguration.tcl file.

--- cmake/EigenConfigureTesting.cmake
+++ cmake/EigenConfigureTesting.cmake
@@ -23,7 +23,12 @@
 # Recall that our unit tests are not in the "all" target, so we have to explicitely ask ctest to build our custom 'buildtests' target.
 # At this stage, we can also add custom flags to the build tool through the user defined EIGEN_TEST_BUILD_FLAGS variable.
 file(READ  "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" EIGEN_DART_CONFIG_FILE)
-string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config '' -- -i ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType"
+# try to grab the default flags
+string(REGEX MATCH "MakeCommand:.*-- (.*)DefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
+if(NOT CMAKE_MATCH_1)
+string(REGEX MATCH "MakeCommand:.*gmake (.*)DefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
+endif()
+string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config \"\${CTEST_CONFIGURATION_TYPE}\" -- ${CMAKE_MATCH_1} ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType"
        EIGEN_DART_CONFIG_FILE2 ${EIGEN_DART_CONFIG_FILE})
 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" ${EIGEN_DART_CONFIG_FILE2})


cmake: eliminate GCC4.x warnings

cmake: eliminate GCC4.x warnings

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -132,6 +132,9 @@
     if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
       add_extra_compiler_option(-Wno-strict-overflow) # Issue appears when compiling surf.cpp from opencv_contrib/modules/xfeatures2d
     endif()
+    if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+      add_extra_compiler_option(-Wno-missing-field-initializers)  # GCC 4.x emits warnings about {}, fixed in GCC 5+
+    endif()
   endif()
   add_extra_compiler_option(-fdiagnostics-show-option)


Make framework-header-fix process copied headers

Summary:
Previously the framework-header-fix script would change the sources
before they were copied, leading to unnecessary rebuilds on repeat
`ninja lldb` invocations. This runs the script on the headers after
they're copied into the produced LLDB.framework, meaning it doesn't
affect any files being built.

Patch by Keith Smiley <keithbsmiley@gmail.com>!

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

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

--- cmake/modules/LLDBFramework.cmake
+++ cmake/modules/LLDBFramework.cmake
@@ -12,23 +12,20 @@
                      COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
   list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
 endforeach()
-add_custom_target(lldb-framework-headers
-  DEPENDS ${framework_headers}
-  COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR} ${LLDB_VERSION})
+
+add_custom_command(TARGET lldb-framework POST_BUILD
+  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
+  COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh $<TARGET_FILE_DIR:liblldb>/Headers ${LLDB_VERSION}
+)

 if (NOT IOS)
   if (NOT LLDB_BUILT_STANDALONE)
     add_dependencies(lldb-framework clang-headers)
   endif()
   add_custom_command(TARGET lldb-framework POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
     COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Headers
     COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Versions/Current
     COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang
-  )
-else()
-  add_custom_command(TARGET lldb-framework POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
   )
 endif()

@@ -41,5 +38,4 @@
   PUBLIC_HEADER "${framework_headers}")

 add_dependencies(lldb-framework
-  lldb-framework-headers
   lldb-suite)


Do not complain about empty dirs in modulemap macro

ROOT_FIND_DIRS_WITH_HEADERS() can return an empty list
of directories with headers since it can be called via
ROOT_GENERATE_DICTIONARY() from a directory where no
headers are present in either inc/ or v7/inc/. For
example, from core/CMakeLists.txt to generate G__Core.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -474,11 +474,6 @@
 #---------------------------------------------------------------------------------------------------
 function (ROOT_CXXMODULES_APPEND_TO_MODULEMAP library library_headers)
   ROOT_FIND_DIRS_WITH_HEADERS(dirs)
-
-  # Variable 'dirs' is the return result of ROOT_FIND_DIRS_WITH_HEADERS.
-  if(NOT DEFINED dirs)
-    message(SEND_ERROR "Error, the variable ${dirs} is not defined!")
-  endif()

   set(found_headers "")
   set(dir_headers "")


Ensure target is only used if one exists.

--- CPM.cmake
+++ CPM.cmake
@@ -994,7 +994,9 @@
   endif()

   # Append target to pre-existing libraries.
-  set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
+  if (TARGET ${CPM_TARGET_NAME})
+    set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
+  endif()

   set(CPM_DEFINITIONS ${CPM_DEFINITIONS} PARENT_SCOPE)
   set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} PARENT_SCOPE)


:hash: :gun:  - as they are in :octocat:

:hash: :gun:  - as they are in :octocat:

--- modules/FindFFTW3.cmake
+++ modules/FindFFTW3.cmake
@@ -66,17 +66,6 @@
           INTERFACE_INCLUDE_DIRECTORIES "${FFTW3_INCLUDE_DIR_PARALLEL}"
           IMPORTED_LINK_INTERFACE_LIBRARIES ${MPI_C_LIBRARIES})
       endif()
-        # Below seems to be the same path than include_dir_parallel but it fails
-        # if(MPI_C_INCLUDE_PATH)
-        #   message(STATUS "MPI PATH: ${MPI_C_INCLUDE_PATH} VS ${FFTW3_INCLUDE_DIR_PARALLEL}")
-        #   target_include_directories(fftw3::${kind}::mpi SYSTEM INTERFACE ${MPI_C_INCLUDE_PATH})
-        # endif()
-        # It seems the flags are not anywhere to be found
-        # if(MPI_C_COMPILE_FLAGS)
-        #   message(STATUS "mpi flags: ${MPI_C_COMPILE_FLAGS}")
-        #   target_compile_options(fftw3::${kind}::mpi INTERFACE ${MPI_C_COMPILE_FLAGS})
-        # endif()
-      #endif()
     endif()
     ##   OpenMP
     if(PARALLEL STREQUAL "OPENMP")


Clean and light configure of BOOST

Clean and light configure of BOOST

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -22,9 +22,37 @@

 SETUP_SUPERBUILD(BOOST)

-set(_SB_BOOST_LIBRARYDIR ${SB_INSTALL_PREFIX}/lib)
+# set(_SB_BOOST_LIBRARYDIR ${SB_INSTALL_PREFIX}/lib)
+# Libraries we need from boost
+set( boost_libraries_to_build "system;serialization;filesystem;test;date_time;program_options;thread")
+
+# add libraries to bootstrap option
+set(BOOST_BOOTSTRAP_OPTIONS "--with-libraries=")
+foreach(lib ${boost_libraries_to_build})
+  set(BOOST_BOOTSTRAP_OPTIONS "${BOOST_BOOTSTRAP_OPTIONS}${lib},")
+endforeach(lib)
+
+if(UNIX)
+  set(BOOST_BOOTSTRAP_FILE "./bootstrap.sh")
+  set(BOOST_B2_EXE "./b2")
+  if(NOT APPLE AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    set(BOOST_BOOTSTRAP_OPTIONS "${BOOST_BOOTSTRAP_OPTIONS} --with-toolset=clang")
+  endif()
+else()
+  set(BOOST_BOOTSTRAP_FILE "bootstrap.bat")
+  set(BOOST_B2_EXE "b2.exe")
+endif()
+
+set( BOOST_BOOTSTRAP_OPTIONS "${BOOST_BOOTSTRAP_OPTIONS} --prefix=${SB_INSTALL_PREFIX}")
+
+set(BOOST_CONFIGURE_COMMAND ${CMAKE_COMMAND}
+  -E chdir ${BOOST_SB_SRC}
+  ${BOOST_BOOTSTRAP_FILE} ${BOOST_BOOTSTRAP_OPTIONS}
+  )

 set(BOOST_SB_CONFIG)
+
+# I think that this is already handled by boost.
 if(OTB_TARGET_SYSTEM_ARCH_IS_X64)
   set(BOOST_SB_CONFIG address-model=64)
 endif()
@@ -36,38 +64,10 @@
   threading=multi
   runtime-link=shared
   --prefix=${SB_INSTALL_PREFIX}
-  --includedir=${SB_INSTALL_PREFIX}/include
-  --libdir=${_SB_BOOST_LIBRARYDIR}
-  --with-system
-  --with-serialization
-  --with-filesystem
-  --with-test
-  --with-date_time
-  --with-program_options
-  --with-thread
   )
+  # --includedir=${SB_INSTALL_PREFIX}/include #This is the default in boost
+  # --libdir=${_SB_BOOST_LIBRARYDIR} # same here

-set(BOOST_BOOTSTRAP_OPTIONS "")
-
-if(UNIX)
-  set(BOOST_BOOTSTRAP_FILE "./bootstrap.sh")
-  set(BOOST_B2_EXE "./b2")
-  if(NOT APPLE AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-    set(BOOST_SB_CONFIG
-        ${BOOST_SB_CONFIG}
-        toolset=clang)
-    set(BOOST_BOOTSTRAP_OPTIONS "--with-toolset=clang")
-  endif()
-else()
-  set(BOOST_BOOTSTRAP_FILE "bootstrap.bat")
-  set(BOOST_B2_EXE "b2.exe")
-endif()
-
-set(BOOST_CONFIGURE_COMMAND ${CMAKE_COMMAND}
-  -E chdir ${BOOST_SB_SRC}
-  ${BOOST_BOOTSTRAP_FILE} ${BOOST_BOOTSTRAP_OPTIONS}
-  --prefix=${SB_INSTALL_PREFIX}
-  )

 set(BOOST_BUILD_COMMAND ${CMAKE_COMMAND}
   -E chdir ${BOOST_SB_SRC}


update PCL_SUFFIX in trunk's FindPCL.cmake

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@1920 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- doc/tutorials/content/sources/FindPCL.cmake
+++ doc/tutorials/content/sources/FindPCL.cmake
@@ -37,7 +37,7 @@

 include(FindPackageHandleStandardArgs)
 #set a suffix based on project name and version
-set(PCL_SUFFIX pcl-1.0)
+set(PCL_SUFFIX pcl-1.2)
 #set a suffix for debug libraries
 set(PCL_DEBUG_SUFFIX "-gd")


cmake: Put a variable to the cache to have access one in other cmake files

--- tools/cmake/idf_functions.cmake
+++ tools/cmake/idf_functions.cmake
@@ -76,10 +76,11 @@
 function(idf_set_global_compile_options)
     # Temporary trick to support both gcc5 and gcc8 builds
     if(CMAKE_C_COMPILER_VERSION VERSION_EQUAL 5.2.0)
-        set(GCC_NOT_5_2_0 0)
+        set(GCC_NOT_5_2_0 0 CACHE STRING "GCC is 5.2.0 version")
     else()
-        set(GCC_NOT_5_2_0 1)
-    endif()
+        set(GCC_NOT_5_2_0 1 CACHE STRING "GCC is not 5.2.0 version")
+    endif()
+    list(APPEND compile_definitions "GCC_NOT_5_2_0=${GCC_NOT_5_2_0}")

     list(APPEND compile_definitions "ESP_PLATFORM" "HAVE_CONFIG_H")

@@ -178,9 +179,6 @@
     list(APPEND cxx_compile_options ${EXTRA_CXXFLAGS})
     list(APPEND compile_options ${EXTRA_CPPFLAGS})

-    # Temporary trick to support both gcc5 and gcc8 builds
-    list(APPEND compile_definitions "GCC_NOT_5_2_0=${GCC_NOT_5_2_0}")
-
     set_default(IDF_COMPILE_DEFINITIONS "${compile_definitions}")
     set_default(IDF_COMPILE_OPTIONS "${compile_options}")
     set_default(IDF_C_COMPILE_OPTIONS "${c_compile_options}")


Add a warning header to the temporary generated file

--- stm32/generic_code/stm32f1/cmake/stm32f10x.cmake
+++ stm32/generic_code/stm32f1/cmake/stm32f10x.cmake
@@ -38,19 +38,24 @@

 		set(hal_filename ${hal_type}.hpp)

-		file (TO_NATIVE_PATH ${${hal_implemented}}					HAL_IMPLEMENTED_NATIVE_PATH)
+		file (TO_NATIVE_PATH ${${hal_implemented}}				HAL_IMPLEMENTED_NATIVE_PATH)
 		file (TO_NATIVE_PATH ${BASE_HAL_DIR}/${hal_filename}	HAL_NATIVE_PATH)

-		#file (READ ${HAL_IMPLEMENTED_NATIVE_PATH} FILE_CONTENT)
-		#file (WRITE ${CMAKE_BINARY_DIR}/hal/${hal_filename} "// WARNING : DO NOT EDIT THIS FILE !!!!!!!!!!!\n")
-		#file (APPEND ${CMAKE_BINARY_DIR}/hal/${hal_filename} "// it was genereated by CMAKE\n")
-		#file (APPEND ${CMAKE_BINARY_DIR}/hal/${hal_filename} "// if you want to modify the content, edit the file : ${HAL_IMPLEMENTED_NATIVE_PATH}\n\n")
-		#file (WRITE ${CMAKE_BINARY_DIR}/hal/${hal_filename} ${FILE_CONTENT})
-
-		configure_file(${HAL_IMPLEMENTED_NATIVE_PATH} ${CMAKE_BINARY_DIR}/hal/${hal_filename} COPYONLY)
-
-		#message ("copy : ${HAL_IMPLEMENTED_NATIVE_PATH} to ./hal/${hal_filename}")
-		#message ("append : ${HAL_NATIVE_PATH}")
+		file (READ ${HAL_IMPLEMENTED_NATIVE_PATH} FILE_CONTENT)
+		file (WRITE ${CMAKE_BINARY_DIR}/hal/${hal_filename} "
+/****************************************************************************
+** Hal file for ${hal_type}
+**
+** This file was genereted by the toolchain
+**
+** The original file is located here : \"${HAL_IMPLEMENTED_NATIVE_PATH}\"
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+")
+		file (APPEND ${CMAKE_BINARY_DIR}/hal/${hal_filename} "${FILE_CONTENT}")
+
+
 		list(APPEND STM32F1_NEEDED_SYSTEM_FILES ${HAL_NATIVE_PATH})
 		if (NOT (${HAL_IMPLEMENTED_NATIVE_PATH} STREQUAL ${HAL_NATIVE_PATH}))
 			#message ("append : ${HAL_IMPLEMENTED_NATIVE_PATH}")


Add default build settings for Ubuntu 20.04 LTS.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -86,6 +86,13 @@
   set(DEFAULT_EXTRA_LINK_DIRECTORY "${VESPA_DEPS}/lib" "/usr/lib/llvm-9/lib" PARENT_SCOPE)
   set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include" "/usr/lib/llvm-9/include" PARENT_SCOPE)
   set(DEFAULT_VESPA_LLVM_VERSION "9" PARENT_SCOPE)
+endfunction()
+
+function(setup_vespa_default_build_settings_ubuntu_20_04)
+  message("-- Setting up default build settings for ubuntu 20.04")
+  set(DEFAULT_EXTRA_LINK_DIRECTORY "${VESPA_DEPS}/lib" "/usr/lib/llvm-10/lib" PARENT_SCOPE)
+  set(DEFAULT_EXTRA_INCLUDE_DIRECTORY "${VESPA_DEPS}/include" "/usr/lib/llvm-10/include" PARENT_SCOPE)
+  set(DEFAULT_VESPA_LLVM_VERSION "10" PARENT_SCOPE)
 endfunction()

 function(vespa_use_default_vespa_unprivileged)
@@ -171,6 +178,8 @@
     setup_vespa_default_build_settings_fedora_33()
   elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "ubuntu 19.10")
     setup_vespa_default_build_settings_ubuntu_19_10()
+  elseif(VESPA_OS_DISTRO_COMBINED STREQUAL "ubuntu 20.04")
+    setup_vespa_default_build_settings_ubuntu_20_04()
   else()
     message(FATAL_ERROR "-- Unkonwn vespa build platform ${VESPA_OS_DISTRO_COMBINED}")
   endif()


Fix typos in comments

Fix typos in comments

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -1,6 +1,6 @@
 include(CMakeParseArguments)

-# Use ${cmake_2_8_12_KEYWORD} intead of KEYWORD in target_link_libraries().
+# Use ${cmake_2_8_12_KEYWORD} instead of KEYWORD in target_link_libraries().
 # These variables are used by LLVM's CMake code.
 set(cmake_2_8_12_INTERFACE INTERFACE)
 set(cmake_2_8_12_PRIVATE PRIVATE)
@@ -29,7 +29,7 @@
 #     Path to llvm include directory.
 #
 #   [OBJ_ROOT_DIR objRootDir]
-#     Path tp llvm build tree.
+#     Path to llvm build tree.
 #
 #   [SOURCE_DIR srcDir]
 #     Path to llvm source tree.


avoid errors in timestamp if git is not installed

--- cmakemodules/script_create_version_h.cmake
+++ cmakemodules/script_create_version_h.cmake
@@ -8,7 +8,7 @@
 SET(CMAKE_MRPT_VERSION_CODE "0x${CMAKE_MRPT_VERSION_NUMBER_MAJOR}${CMAKE_MRPT_VERSION_NUMBER_MINOR}${CMAKE_MRPT_VERSION_NUMBER_PATCH}")

 # SOURCE_DATE_EPOCH: See Specs in https://reproducible-builds.org/specs/source-date-epoch/
-# Take its value from:
+# Take its value from:
 # 1) The file SRC/SOURCE_DATE_EPOCH  (generated by scripts creating Windows/Debian packages)
 # 2) The env var "SOURCE_DATE_EPOCH"
 # 3) The output from "git log -1 --pretty=%ct"
@@ -20,7 +20,7 @@
   FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/SOURCE_DATE_EPOCH" CMAKE_SOURCE_DATE_EPOCH LIMIT_COUNT 1) # Read only the first line
 endif()
 if ("" STREQUAL "${CMAKE_SOURCE_DATE_EPOCH}")
-  # If empty:
+  # If empty:
   # 2) The env var "SOURCE_DATE_EPOCH"
   if (DEFINED ENV{SOURCE_DATE_EPOCH})
     set(CMAKE_SOURCE_DATE_EPOCH "$ENV{SOURCE_DATE_EPOCH}")
@@ -36,6 +36,11 @@
         IF ($ENV{VERBOSE})
          MESSAGE(STATUS "SOURCE_DATE_EPOCH from git log: ${CMAKE_SOURCE_DATE_EPOCH}")
         ENDIF()
+    else() # fallback if no git is found: use "%s" from CMake, if available
+			  string(TIMESTAMP CMAKE_SOURCE_DATE_EPOCH "%s")
+				if ("${CMAKE_SOURCE_DATE_EPOCH}" STREQUAL "%s")
+					set(CMAKE_SOURCE_DATE_EPOCH "0") # worst case
+				endif()
     endif()
   endif()
 endif()
@@ -44,7 +49,7 @@
 CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/parse-files/version.h.in" "${MRPT_CONFIG_FILE_INCLUDE_DIR}/mrpt/version.h")

-# Prepare version.rc for Windows apps:
+# Prepare version.rc for Windows apps:
 IF (WIN32)
 	configure_file(
 		${MRPT_SOURCE_DIR}/parse-files/version.rc.in


Added INTERFACE_LINK_DIRECTORIES to the RdKafka::rdkafka properties

--- cmake/FindRdKafka.cmake
+++ cmake/FindRdKafka.cmake
@@ -68,6 +68,7 @@
             IMPORTED_NAME RdKafka
             IMPORTED_LOCATION "${RdKafka_LIBRARY_PATH}"
             INTERFACE_INCLUDE_DIRECTORIES "${RdKafka_INCLUDE_DIR}"
+            INTERFACE_LINK_DIRECTORIES "${RdKafka_LIBRARY_DIR}"
             INTERFACE_LINK_LIBRARIES "${RDKAFKA_DEPENDENCIES}")
     message(STATUS "Found valid rdkafka version")
     mark_as_advanced(


CMake: Added function to check if a lib is 32 or 64 bits.

--- cmake/globalutils.cmake
+++ cmake/globalutils.cmake
@@ -482,4 +482,45 @@
        endif()
      endforeach()
      set(${retval} NOTFOUND PARENT_SCOPE)
-endfunction()+endfunction()
+
+
+#--------------------------------------------------------------------
+# Get the module name from a CMakeLists.txt
+function(ivw_library_bits lib retval)
+    if(WIN32)
+        get_filename_component(vcpath ${CMAKE_CXX_COMPILER} DIRECTORY)
+        execute_process(COMMAND CMD /c dumpbin.exe "C:/Python/Python34-64bit/libs/python3.lib" /headers | findstr machine
+                        WORKING_DIRECTORY ${vcpath}
+                        OUTPUT_VARIABLE result)
+
+        string(REGEX MATCH "(x64)" found_64bit ${result})
+        if(CMAKE_MATCH_1)
+            set(${retval} 64 PARENT_SCOPE)
+            return()
+        endif()
+        string(REGEX MATCH "(x86)" found_32bit ${result})
+        if(CMAKE_MATCH_1)
+            set(${retval} 32 PARENT_SCOPE)
+            return()
+        endif()
+    else()
+        execute_process(COMMAND file -b ${lib} OUTPUT_VARIABLE result)
+        string(REGEX MATCH "(x86_64)" found_64bit ${result})
+        if(CMAKE_MATCH_1)
+            set(${retval} 64 PARENT_SCOPE)
+            return()
+       endif()
+       string(REGEX MATCH "(i386)" found_32bit ${result})
+       if(CMAKE_MATCH_1)
+            set(${retval} 32 PARENT_SCOPE)
+            return()
+       endif()
+    endif()
+
+    set(${retval} 0 PARENT_SCOPE)
+endfunction()
+
+
+
+


Fix: some MacOS don't like --as-needed linker flag
While there lowercase some maco calls

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

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -82,9 +82,11 @@
     #
     # Only link if needed
     if(WIN32 AND MSVC)
-      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
+    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
     else()
-      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     endif()
     #
     set_target_properties(${_name} PROPERTIES
@@ -111,9 +113,11 @@
     #
     # Only link if needed
     if(WIN32 AND MSVC)
-      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
+    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
     else()
-      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     endif()
     #
     set(PCL_EXECUTABLES ${PCL_EXECUTABLES} ${_name})
@@ -139,12 +143,15 @@
     target_link_libraries(${_exename} ${GTEST_BOTH_LIBRARIES} ${PCL_ADD_TEST_LINK_WITH})
     #
     # Only link if needed
-    if(UNIX)
-      SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS -Wl,--as-needed)
+    if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
+      target_link_libraries(${_exename} pthread)
+    elseif(UNIX)
+      set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl,--as-needed)
       # GTest >= 1.5 requires pthread and CMake's 2.8.4 FindGTest is broken
       target_link_libraries(${_exename} pthread)
     elseif(WIN32)
-      SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
+      set_target_properties(${_exename} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
     endif()
     #
     PCL_LINK_OPENMP(${_exename})


fix FindMPI

fix FindMPI

--- cmake/vSMCFindMPI.cmake
+++ cmake/vSMCFindMPI.cmake
@@ -1,3 +1,4 @@
+UNSET (VSMC_MPI_FOUND CACHE)
 IF (NOT VSMC_MPI_FOUND)
     UNSET (VSMC_MPI_FOUND CACHE)
     INCLUDE (FindMPI)
@@ -11,21 +12,24 @@
     IF (MPI_CXX_FOUND AND Boost_FOUND)
         SET (VSMC_MPI_FOUND TRUE CACHE BOOL "Found MPI")
         IF (NOT VSMC_MPIEXEC)
-            SET (VSMC_MPIEXEC ${MPIEXEC})
+            SET (VSMC_MPIEXEC ${MPIEXEC} CACHE STRING "MPIEXEC")
             MESSAGE (STATUS "Set VSMC_MPIEXEC: ${VSMC_MPIEXEC}")
         ENDIF (NOT VSMC_MPIEXEC)
         IF (NOT VSMC_MPIEXEC_NUMPROC_FLAG)
-            SET (VSMC_MPIEXEC_NUMPROC_FLAG ${MPIEXEC_NUMPROC_FLAG})
+            SET (VSMC_MPIEXEC_NUMPROC_FLAG ${MPIEXEC_NUMPROC_FLAG}
+                CACHE STRING "MPIEXEC")
             MESSAGE (STATUS
                 "Set VSMC_MPIEXEC_NUMPROC_FLAG: ${VSMC_MPIEXEC_NUMPROC_FLAG}")
         ENDIF (NOT VSMC_MPIEXEC_NUMPROC_FLAG)
         IF (NOT VSMC_MPIEXEC_PREFLAGS)
-            SET (VSMC_MPIEXEC_PREFLAGS ${MPIEXEC_PREFLAGS})
+            SET (VSMC_MPIEXEC_PREFLAGS ${MPIEXEC_PREFLAGS}
+                CACHE STRING "MPIEXEC")
             MESSAGE (STATUS
                 "Set VSMC_MPIEXEC_PREFLAGS: ${VSMC_MPIEXEC_PREFLAGS}")
         ENDIF (NOT VSMC_MPIEXEC_PREFLAGS)
         IF (NOT VSMC_MPIEXEC_POSTFLAGS)
-            SET (VSMC_MPIEXEC_POSTFLAGS ${MPIEXEC_POSTFLAGS})
+            SET (VSMC_MPIEXEC_POSTFLAGS ${MPIEXEC_POSTFLAGS}
+                CACHE STRING "MPIEXEC")
             MESSAGE (STATUS
                 "Set VSMC_MPIEXEC_POST_FLAGS: ${VSMC_MPIEXEC_POST_FLAGS}")
         ENDIF (NOT VSMC_MPIEXEC_POSTFLAGS)


BUG: Teem repository has been moved. We updated the teem's location to its new location

--- SuperBuild/FindExternalTools.cmake
+++ SuperBuild/FindExternalTools.cmake
@@ -564,7 +564,7 @@

 # ===== teem (unu) =====================================================================
 set( SourceCodeArgs
-  SVN_REPOSITORY "http://teem.svn.sourceforge.net/svnroot/teem/teem/trunk"
+  SVN_REPOSITORY "http://svn.code.sf.net/p/teem/code/teem/trunk"
   SVN_USERNAME slicerbot
   SVN_PASSWORD slicer
   SVN_REVISION -r 5888 # 12/13/2012


bump version to 0.3.1

bump version to 0.3.1

--- src/CPackConfig.cmake
+++ src/CPackConfig.cmake
@@ -4,7 +4,7 @@

 set(CPACK_PACKAGE_VERSION_MAJOR "0")
 set(CPACK_PACKAGE_VERSION_MINOR "3")
-set(CPACK_PACKAGE_VERSION_PATCH "0")
+set(CPACK_PACKAGE_VERSION_PATCH "1")
 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "libes")


added new directory to the list

added new directory to the list

--- src/cmake/sources.cmake
+++ src/cmake/sources.cmake
@@ -7,6 +7,7 @@

 set(SRC_DIRS
     But
+    But/Container
     But/Log
     But/Log/detail
     But/System


Add some documentation.

Add some documentation.

git-svn-id: 25ef932062c7d454eca13bcaa0e2d6c96abd0655@29717 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_cached_variables.cmake
+++ deal.II/cmake/setup_cached_variables.cmake
@@ -237,11 +237,15 @@
   MARK_AS_ADVANCED(${_flag})
 ENDFOREACH()

+
+#
+# Define the variable that defines whether we should use 32- or 64-bit
+# global DoF indices.
+#
 SET(DEAL_II_WITH_64BIT_INDICES "${DEAL_II_WITH_64BIT_INDICES}" CACHE BOOL
     "If set to ON, then use 64-bit data types to represent global degree of freedom indices. The default is to OFF. You only want to set this to ON if you will solve problems with more than 2^31 (approximately 2 billion) unknowns. If set to ON, you also need to ensure that both Trilinos and/or PETSc support 64-bit indices."
    )

-SET(DEAL_II_WITH_64BIT_INDICES_SAVED "${DEAL_II_WITH_64BIT_INDICES}")
 MARK_AS_ADVANCED(DEAL_II_WITH_64BIT_INDICES)


Allow git version description to use lightweight tags and dirty repos.

Add '--tags' and '--dirty' to args of git describe command in
GetGitRevisionDescription.cmake.

--- cmake/GetGitRevisionDescription.cmake
+++ cmake/GetGitRevisionDescription.cmake
@@ -112,7 +112,7 @@

     execute_process(COMMAND
             "${GIT_EXECUTABLE}"
-            describe
+            describe --tags --dirty
             ${ARGN}
             WORKING_DIRECTORY
             "${CMAKE_CURRENT_SOURCE_DIR}"


Necessary to use C language otherwise regeexp doesn't work
(we search on english string)

svn path=/trunk/KDE/kdepim/; revision=758807

--- cmake/modules/FindKdeSubversion.cmake
+++ cmake/modules/FindKdeSubversion.cmake
@@ -66,12 +66,12 @@
   SET(KdeSubversion_FOUND TRUE)

   MACRO(KdeSubversion_WC_INFO dir prefix)
-    EXECUTE_PROCESS(COMMAND ${KdeSubversion_SVN_EXECUTABLE} --version
+    EXECUTE_PROCESS(COMMAND "LC_ALL=C ${KdeSubversion_SVN_EXECUTABLE}" --version
       WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
       OUTPUT_VARIABLE KdeSubversion_VERSION_SVN
       OUTPUT_STRIP_TRAILING_WHITESPACE)

-    EXECUTE_PROCESS(COMMAND ${KdeSubversion_SVN_EXECUTABLE} info ${dir}
+    EXECUTE_PROCESS(COMMAND "${KdeSubversion_SVN_EXECUTABLE}" info ${dir}
       OUTPUT_VARIABLE ${prefix}_WC_INFO
       ERROR_VARIABLE KdeSubversion_svn_info_error
       RESULT_VARIABLE KdeSubversion_svn_info_result


removed debug prints

removed debug prints

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -47,12 +47,9 @@
 ENDIF()

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

 IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
   MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")


moved samples from test to test/samples

moved samples from test to test/samples

--- test/test_data.h.cmake
+++ test/test_data.h.cmake
@@ -22,7 +22,7 @@
 extern "C" {
 #endif

-#define SAMPLES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/test"
+#define SAMPLES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/test/samples"

 char addr_string1[] = "Foo Bar <foobar@example.com>";
 char addr_string1_name_part[] = "Foo Bar";


Added a coment to the cmake test config file

--- test/test_driver.cmake
+++ test/test_driver.cmake
@@ -16,6 +16,7 @@
     )
     target_link_libraries(${test_target}
         libgtest
+        # boost and glog are both needed by the testrunner
         glog
         boost
         ${ARGN}


Added missing project source group filters.

--- build/cmake/Project.cmake
+++ build/cmake/Project.cmake
@@ -21,8 +21,8 @@
 	source_group("Source Files\\Graphics" FILES ${RAINBOW_SRC})
 	file(GLOB RAINBOW_SRC src/Graphics/Decoders/*)
 	source_group("Source Files\\Graphics\\Decoders" FILES ${RAINBOW_SRC})
-	file(GLOB RAINBOW_SRC src/Graphics/impl/*)
-	source_group("Source Files\\Graphics\\impl" FILES ${RAINBOW_SRC})
+	file(GLOB RAINBOW_SRC src/Graphics/Shaders/*)
+	source_group("Source Files\\Graphics\\Shaders" FILES ${RAINBOW_SRC})

 	file(GLOB RAINBOW_SRC src/Heimdall/*)
 	source_group("Source Files\\Heimdall" FILES ${RAINBOW_SRC})
@@ -48,6 +48,9 @@
 	file(GLOB RAINBOW_SRC src/ThirdParty/Box2D/*)
 	source_group("Source Files\\ThirdParty\\Box2D" FILES ${RAINBOW_SRC})

+	file(GLOB RAINBOW_SRC src/ThirdParty/Spine/*)
+	source_group("Source Files\\ThirdParty\\Spine" FILES ${RAINBOW_SRC})
+
 	file(GLOB RAINBOW_SRC src/ThirdParty/TestFlight/*)
 	source_group("Source Files\\ThirdParty\\TestFlight" FILES ${RAINBOW_SRC})


Fix hadoop-analytics package version.

Fix hadoop-analytics package version.

--- build/cmake/package.cmake
+++ build/cmake/package.cmake
@@ -227,8 +227,8 @@
 list(APPEND FPM_ARGS --name api-umbrella-hadoop-analytics)
 list(APPEND FPM_ARGS --license MIT)
 list(APPEND FPM_ARGS --url https://apiumbrella.io)
-list(APPEND FPM_ARGS --version ${VERSION})
-list(APPEND FPM_ARGS --iteration ${ITERATION})
+list(APPEND FPM_ARGS --version ${PACKAGE_VERSION})
+list(APPEND FPM_ARGS --iteration ${PACKAGE_VERSION_ITERATION})
 list(APPEND FPM_ARGS --directories /opt/api-umbrella)
 list(APPEND FPM_ARGS --depends api-umbrella)
 foreach(DEP IN LISTS HADOOP_ANALYTICS_PACKAGE_DEPENDENCIES)


chainging default value of ispc debug flag

--- components/ospcommon/cmake/ispc.cmake
+++ components/ospcommon/cmake/ispc.cmake
@@ -110,7 +110,7 @@
   ENDIF()

   #CAUTION: -O0/1 -g with ispc seg faults
-  SET(ISPC_FLAGS_DEBUG -O2 -g CACHE STRING "ISPC Debug flags")
+  SET(ISPC_FLAGS_DEBUG -g CACHE STRING "ISPC Debug flags")
   MARK_AS_ADVANCED(ISPC_FLAGS_DEBUG)
   SET(ISPC_FLAGS_RELEASE -O3 CACHE STRING "ISPC Release flags")
   MARK_AS_ADVANCED(ISPC_FLAGS_RELEASE)


include OpenCL directory if found (cmake)

--- cmake/UbiTrackFindCoreLibraries.cmake
+++ cmake/UbiTrackFindCoreLibraries.cmake
@@ -180,6 +180,7 @@
 find_package(OpenCL)
 IF(OpenCL_FOUND)
   add_definitions(-DHAVE_OPENCL)
+  include_directories(${OpenCL_INCLUDE_DIR})
   SET(HAVE_OPENCL 1)
   MESSAGE(STATUS "Found OpenCL: ${OpenCL_INCLUDE_DIR} - ${OpenCL_LIBRARY}")
 ENDIF(OpenCL_FOUND)


Pass -Wl,-z,defs when building shared libraries, but not with the sanitizers.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -104,6 +104,14 @@
   set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
 endif()

+# Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO
+# build might work on ELF but fail on MachO/COFF.
+if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32) AND
+  NOT LLVM_USE_SANITIZER)
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
+endif()
+
+
 function(append value)
   foreach(variable ${ARGN})
     set(${variable} "${${variable}} ${value}" PARENT_SCOPE)


Add sugar target properties to echo target command [skip ci]

--- cmake/utility/sugar_echo_target.cmake
+++ cmake/utility/sugar_echo_target.cmake
@@ -186,6 +186,11 @@
       WIN32_EXECUTABLE
       XCODE_ATTRIBUTE_SDKROOT
       XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY
+
+      # Sugar properties:
+      SUGAR_IOS
+      SUGAR_IOS_PATH_DEBUG
+      SUGAR_IOS_PATH_RELEASE
   )

   message("======================== ${target} ========================")


PS-7507: Fix cmake build with gcc-10 and WITH_ASAN=ON

Problem:
Cmake fails in TokuSetupCompiler.cmake in case gcc-10 is used and
WITH_ASAN=ON with the following error:
    /usr/bin/c++ doesn't support -std=c++11 or -std=c++0x, you need one that does.

The reason is that cmake fails to determine if compiler supports
-std=c++11 or -std=c++0x. This cmake check fails with the following error:
    cc1plus: error: command-line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++ [-Werror]
    cc1plus: error: command-line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ [-Werror]
    cc1plus: error: command-line option '-Wbad-function-cast' is valid for C/ObjC but not for C++ [-Werror]

All those flags are added earlier in same cmake file with prepend_cflags_if_supported.
It does check if corresponding flag is supported with the help of
check_c_compiler_flag and check_cxx_compiler_flag cmake commands.
These commands try to build small program to find out if
corresponding flag is supported. All checks are passing with only
the following warning:
    cc1plus: warning: command-line option '-Wbad-function-cast' is valid for C/ObjC but not for C++

Fix:
Pass "-Werror" along with the flag being checked to check_c_compiler_flag
and check_cxx_compiler_flag. This leads to test compilation failure in case
the flag isn't supported by the compiler.

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -50,11 +50,11 @@
 MACRO (prepend_cflags_if_supported)
   FOREACH (flag ${ARGN})
     STRING (REGEX REPLACE "-" "_" temp_flag ${flag})
-    check_c_compiler_flag (${flag} HAVE_C_${temp_flag})
+    check_c_compiler_flag ("-Werror ${flag}" HAVE_C_${temp_flag})
     IF (HAVE_C_${temp_flag})
       SET (CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
     ENDIF ()
-    check_cxx_compiler_flag (${flag} HAVE_CXX_${temp_flag})
+    check_cxx_compiler_flag ("-Werror ${flag}" HAVE_CXX_${temp_flag})
     IF (HAVE_CXX_${temp_flag})
       SET (CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
     ENDIF ()


- add missing zipper find module

- add missing zipper find module