CELIX-63: Using cmake's PROJECT_NAME (lower case) install location for bundles.

--- cmake/cmake_celix/Packaging.cmake
+++ cmake/cmake_celix/Packaging.cmake
@@ -290,15 +290,18 @@
         GROUP bundles
     )
     add_dependencies( install-${INT_BUNDLE_NAME} ${INT_BUNDLE_NAME} )
+
+
+    string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

     if (BUNDLE_HEADERS)
-	    install (FILES ${BUNDLE_HEADERS} DESTINATION include/celix/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
+        install (FILES ${BUNDLE_HEADERS} DESTINATION include/${PROJECT_NAME_LOWER}/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
     endif(BUNDLE_HEADERS)
     if (BUNDLE_RESOURCES)
-	    install (FILES ${BUNDLE_RESOURCES} DESTINATION share/celix/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
+        install (FILES ${BUNDLE_RESOURCES} DESTINATION share/${PROJECT_NAME_LOWER}/${INT_BUNDLE_NAME} COMPONENT ${INT_BUNDLE_NAME})
     endif(BUNDLE_RESOURCES)

-    INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip DESTINATION share/celix/bundles COMPONENT ${INT_BUNDLE_NAME})
+    INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${INT_BUNDLE_NAME}.zip DESTINATION share/${PROJECT_NAME_LOWER}/bundles COMPONENT ${INT_BUNDLE_NAME})
 ENDMACRO(install_bundle)

 MACRO(package)


From Pere:
fixes the installation problem on Windows.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@48180 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -325,7 +325,7 @@
                                COMPONENT libraries)
     #install(EXPORT ${CMAKE_PROJECT_NAME}Exports DESTINATION cmake/modules)
   endif()
-  if(WIN32)
+  if(WIN32 AND ARG_TYPE STREQUAL SHARED)
     if(CMAKE_GENERATOR MATCHES "Visual Studio")
       install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/lib${library}.pdb
               CONFIGURATIONS Debug


Set 'suggests' field in DEB package to "indi-bin (>= 0.9.7)"

--- cmake_modules/PHD2Packaging.cmake
+++ cmake_modules/PHD2Packaging.cmake
@@ -104,6 +104,7 @@
   set(CPACK_PACKAGE_FILE_NAME "phd2_${CPACK_DEBIAN_PACKAGE_VERSION}_${debarch}")
   # Ubuntu 14.04 compatible minimal dependency
   set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.17), libgcc1 (>= 1:4.1.1), libnova-0.14-0 | libnova-0.16-0, libstdc++6 (>= 4.2.1), libusb-1.0-0 (>= 2:1.0.8), libwxbase3.0-0 | libwxbase3.0-0v5 (>= 3.0.0), libwxgtk3.0-0 | libwxgtk3.0-0v5 (>=3.0.0), libx11-6, zlib1g (>= 1:1.1.4)")
+  set(CPACK_DEBIAN_PACKAGE_SUGGESTS "indi-bin (>= 0.9.7)")
   set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "PHD2 auto-guiding software")
   # same section as many astronomy packages
   set(CPACK_DEBIAN_PACKAGE_SECTION "education")


Fix MinGW Direct3D build. Related to commit 58332565eafa1a948a7673a48e9fcebc27bb8eb6. [ci only: master]

--- CMake/Modules/FindDirect3D.cmake
+++ CMake/Modules/FindDirect3D.cmake
@@ -98,6 +98,13 @@
             endif ()
         endif ()
     endif ()
+else ()
+    # MinGW compiler toolchain is assumed to come with its own necessary headers and libraries for Direct3D
+    if (NOT URHO3D_D3D11)
+        set (DIRECT3D_LIBRARIES d3d9 d3dcompiler)
+    else ()
+        set (DIRECT3D_LIBRARIES d3d11 d3dcompiler dxgi dxguid)
+    endif ()
 endif ()

 if (DIRECT3D_FOUND)


- Fix include dir for CoffeeCore

- Fix include dir for CoffeeCore

--- cmake/Find/FindStandardLibs.cmake
+++ cmake/Find/FindStandardLibs.cmake
@@ -61,6 +61,9 @@

         ${SDL2_LIBRARY}
         )
+    list ( APPEND CORE_INCLUDE_DIR
+        ${CMAKE_SOURCE_DIR}/bindings/android/include
+        )
 #    if("${ANDROID_NATIVE_API_LEVEL}" GREATER 17)
 #        message ( "-- Building with GLES 3.0+ support" )
 #        list ( APPEND CORE_EXTRA_LIBRARIES


restored -Wno-unnamed-type-template-args

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -79,7 +79,7 @@
   else()
     add_extra_compiler_option(-Wno-narrowing)
     add_extra_compiler_option(-Wno-delete-non-virtual-dtor)
-    #add_extra_compiler_option(-Wno-unnamed-type-template-args)
+    add_extra_compiler_option(-Wno-unnamed-type-template-args)
   endif()

   # The -Wno-long-long is required in 64bit systems when including sytem headers.


cmake: armlink: fix handling of argument in configure_linker_script

The PR #40174 changed `configure_linker_script()` macro from handling a
single string to handle a list of strings for the
linker_pass_define argument.

This changed the armlink/target.cmake from STREQUAL to IN_LIST, however
as `configure_linker_script()` is a macro, then arguments are not
variables in the CMake sense but string replacements, and therefore
IN_LIST doesn't work directly on the argument.

Fix this by creating a true CMake list from the content of the argument
and use this list for IN_LIST checking.

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

--- cmake/linker/armlink/target.cmake
+++ cmake/linker/armlink/target.cmake
@@ -30,8 +30,9 @@
   set(STEERING_C)
   set(STEERING_FILE_ARG)
   set(STEERING_C_ARG)
+  set(linker_pass_define_list ${linker_pass_define})

-  if("LINKER_ZEPHYR_FINAL" IN_LIST "${linker_pass_define}")
+  if("LINKER_ZEPHYR_FINAL" IN_LIST linker_pass_define_list)
     set(STEERING_FILE ${CMAKE_CURRENT_BINARY_DIR}/armlink_symbol_steering.steer)
     set(STEERING_C ${CMAKE_CURRENT_BINARY_DIR}/armlink_symbol_steering.c)
     set(STEERING_FILE_ARG "-DSTEERING_FILE=${STEERING_FILE}")
@@ -55,7 +56,7 @@
       -P ${ZEPHYR_BASE}/cmake/linker/armlink/scatter_script.cmake
   )

-  if("LINKER_ZEPHYR_FINAL" IN_LIST "${linker_pass_define}")
+  if("LINKER_ZEPHYR_FINAL" IN_LIST linker_pass_define_list)
     add_library(armlink_steering OBJECT ${STEERING_C})
     target_link_libraries(armlink_steering PRIVATE zephyr_interface)
   endif()


add install targets for ep shared libs (#5286)


boards: arm: adafruit_feather_m0_basic_proto: Set flash offset

On this board, it is required to flash beyond the locked bootloader.

Signed-off-by: Adam Serbinski <4837cd3f3b2acac2173c9549510081be7f9ffbee@gmail.com>

--- boards/arm/adafruit_feather_m0_basic_proto/board.cmake
+++ boards/arm/adafruit_feather_m0_basic_proto/board.cmake
@@ -2,4 +2,6 @@
 #
 # SPDX-License-Identifier: Apache-2.0

+board_runner_args(bossac "--offset=0x2000")
+
 include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)


Fix typo.

Fix typo.

--- core/command_definitions.cmake
+++ core/command_definitions.cmake
@@ -22,8 +22,6 @@

 f1(a b c) # 3, a, a;b;c, a;b;c
 f2(a b c) # 3, a, a;b;c, b;c
-
-f1() #

 ## The arguments of macro() are not variable ##


change import/export define for C type support

--- rosidl_typesupport_opensplice_c/cmake/rosidl_typesupport_opensplice_c_generate_interfaces.cmake
+++ rosidl_typesupport_opensplice_c/cmake/rosidl_typesupport_opensplice_c_generate_interfaces.cmake
@@ -220,8 +220,9 @@
   target_compile_definitions(${rosidl_generate_interfaces_TARGET}${_target_suffix}
     PRIVATE "ROSIDL_TYPESUPPORT_OPENSPLICE_C_BUILDING_DLL")
 endif()
+# The following still uses CPP because the OpenSplice code which uses it was generated for CPP.
 target_compile_definitions(${rosidl_generate_interfaces_TARGET}${_target_suffix}
-  PRIVATE "ROSIDL_TYPESUPPORT_OPENSPLICE_C_BUILDING_DLL_${PROJECT_NAME}")
+  PRIVATE "ROSIDL_TYPESUPPORT_OPENSPLICE_CPP_BUILDING_DLL_${PROJECT_NAME}")
 target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
   PUBLIC
   ${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_c


got rid of libsigc++ cmake module - we use boost::signals2

--- cmake/Modules/FindLibSigCXX2.cmake
+++ cmake/Modules/FindLibSigCXX2.cmake
@@ -1,55 +0,0 @@
-# - Try to find libsigc++-2.0
-# Once done this will define
-#
-#  LIBSIGCXX2_FOUND - System has libsigc++2
-#  LIBSIGCXX2_INCLUDE_DIRS - The libsigc++2 include directories
-#  LIBSIGCXX2_LIBRARIES - The libraries needed to use libsigc++2
-
-# Copyright (c) 2008, Michael Wild <themiwi at users.sf.net>
-#
-# Redistribution and use is allowed according to the terms of the BSD
-# license.
-
-if (NOT WIN32)
-   # use pkg-config to get the directories and then use these values
-   # in the FIND_PATH() and FIND_LIBRARY() calls
-   find_package( PkgConfig REQUIRED )
-   pkg_check_modules( _sigcxx2  REQUIRED sigc++-2.0 )
-endif (NOT WIN32)
-
-# find sigc++/sigc++.h
-find_path( LIBSIGCXX2_sigcxx_h_DIR sigc++/sigc++.h
-   PATHS ${_sigcxx2_INCLUDE_DIRS}
-   PATH_SUFFIXES sigc++-2.0
-   DOC "Include directory for sigc++.h"
-   )
-
-# find sigc++config.h
-find_path( LIBSIGCXX2_sigcxxconfig_h_DIR sigc++config.h
-   /usr/include/libsigc++-2.0/include
-   PATHS ${_sigcxx2_INCLUDE_DIRS}
-   DOC "Include directory for sigc++config.h"
-   )
-
-# combine the two paths
-set( LIBSIGCXX2_INCLUDE_DIRS ${LIBSIGCXX2_sigcxx_h_DIR} ${LIBSIGCXX2_sigcxxconfig_h_DIR} )
-
-# find the sigc-2.0 library
-find_library( LIBSIGCXX2_LIBRARIES
-   NAMES sigc-2.0 ${_sigcxx2_LIBRARIES}
-   PATHS ${_sigcxx2_LIBRARY_DIRS}
-   DOC "Libraries for libsigc++2"
-   )
-
-# let find_package_handle_standard_args handle all the boilerplate stuff
-include( FindPackageHandleStandardArgs )
-find_package_handle_standard_args(
-   LibSigCXX2 LIBSIGCXX2_LIBRARIES LIBSIGCXX2_sigcxx_h_DIR
-   LIBSIGCXX2_sigcxxconfig_h_DIR
-   )
-
-# mark these cache entries as advanced
-mark_as_advanced( LIBSIGCXX2_LIBRARIES LIBSIGCXX2_sigcxx_h_DIR
-   LIBSIGCXX2_sigcxxconfig_h_DIR LIBSIGCXX2_INCLUDE_DIR
-   )
-


Fixed again error with CMAKE_PREFIX_PATH

--- cmake/dev/eprosima_libraries.cmake
+++ cmake/dev/eprosima_libraries.cmake
@@ -1,9 +1,9 @@
 macro(find_eprosima_package package)
     if(THIRDPARTY)
-        set(_USE_BOOST "")
+        set(USE_BOOST_ "")
         foreach(arg ${ARGN})
             if("${arg}" STREQUAL "USE_BOOST")
-                set(_USE_BOOST "-DEPROSIMA_BOOST=${EPROSIMA_BOOST}\n")
+                set(USE_BOOST_ "-DEPROSIMA_BOOST=${EPROSIMA_BOOST}\n")
             endif()
         endforeach()

@@ -13,10 +13,16 @@
         endif()

         # Separate CMAKE_PREFIX_PATH
-        set(CMAKE_PREFIX_PATH_ "")
-        foreach(cmake_prefix_path_element ${CMAKE_PREFIX_PATH})
-            set(CMAKE_PREFIX_PATH_ "${CMAKE_PREFIX_PATH_} -DCMAKE_PREFIX_PATH=${cmake_prefix_path_element}")
-        endforeach()
+        string(REPLACE ";" "|" CMAKE_PREFIX_PATH_ "${CMAKE_PREFIX_PATH}")
+        set(${package}_CMAKE_ARGS
+             "${PROJECT_SOURCE_DIR}/thirdparty/${package}"
+             "-G \"${CMAKE_GENERATOR}\""
+             ${BUILD_OPTION}
+             ${USE_BOOST_}
+             "-DCMAKE_INSTALL_PREFIX=${${package}ExternalDir}/install"
+             "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH_}"
+             )
+        list(APPEND ${package}_CMAKE_ARGS LIST_SEPARATOR "|")

         file(MAKE_DIRECTORY ${${package}ExternalDir})
         file(WRITE ${${package}ExternalDir}/CMakeLists.txt
@@ -24,12 +30,7 @@
             "include(ExternalProject)\n"
             "ExternalProject_Add(${package}\n"
              "CONFIGURE_COMMAND \"${CMAKE_COMMAND}\"\n"
-             "${PROJECT_SOURCE_DIR}/thirdparty/${package}\n"
-             "-G \"${CMAKE_GENERATOR}\"\n"
-             ${BUILD_OPTION}
-             ${_USE_BOOST}
-             "-DCMAKE_INSTALL_PREFIX=${${package}ExternalDir}/install\n"
-             "${CMAKE_PREFIX_PATH_}\n"
+             "${${package}_CMAKE_ARGS}\n"
              "DOWNLOAD_COMMAND echo\n"
              "UPDATE_COMMAND cd ${PROJECT_SOURCE_DIR} && git submodule update --recursive --init thirdparty/${package}\n"
              "SOURCE_DIR ${PROJECT_SOURCE_DIR}/thirdparty/${package}\n"


Allow developers to override the client test module

--- tests/JavascriptTests.cmake
+++ tests/JavascriptTests.cmake
@@ -157,6 +157,8 @@
   #     needs exclusive access to.  Defaults to mongo and cherrypy.
   # TIMEOUT (seconds): An overall test timeout.
   # BASEURL (url): The base url to load for the test.
+  # TEST_MODULE (python module path): Run this module rather than the default
+  #     "tests.web_client_test"
   if (NOT BUILD_JAVASCRIPT_TESTS)
     return()
   endif()
@@ -164,7 +166,7 @@
   set(testname "web_client_${case}")

   set(_options NOCOVERAGE)
-  set(_args PLUGIN ASSETSTORE WEBSECURITY BASEURL PLUGIN_DIRS TIMEOUT)
+  set(_args PLUGIN ASSETSTORE WEBSECURITY BASEURL PLUGIN_DIRS TIMEOUT TEST_MODULE)
   set(_multival_args RESOURCE_LOCKS ENABLEDPLUGINS)
   cmake_parse_arguments(fn "${_options}" "${_args}" "${_multival_args}" ${ARGN})

@@ -197,10 +199,16 @@
     list(APPEND plugins ${fn_ENABLEDPLUGINS})
   endif()

+  if(fn_TEST_MODULE)
+    set(test_module ${fn_TEST_MODULE})
+  else()
+    set(test_module "tests.web_client_test")
+  endif()
+
   add_test(
       NAME ${testname}
       WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
-      COMMAND "${PYTHON_EXECUTABLE}" -m unittest -v tests.web_client_test
+      COMMAND "${PYTHON_EXECUTABLE}" -m unittest -v "${test_module}"
   )

   # Catch view leaks and report them as test failures.


Improve documentation for some macros SALOME_JUSTIFY_STRING() and SALOME_PACKAGE_REPORT() macros

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -254,6 +254,14 @@
 # adding required number of spaces to the end. Does noting if input
 # string is longer as required length.
 # Puts the result to the output variable.
+#
+# USAGE: SALOME_JUSTIFY_STRING(input length result)
+#
+# ARGUMENTS:
+#   input  [in] input string
+#   length [in] required length of resulting string
+#   result [out] name of variable where the result string is put to
+#
 MACRO(SALOME_JUSTIFY_STRING input length result)
   SET(${result} ${input})
   STRING(LENGTH ${input} _input_length)
@@ -269,11 +277,16 @@
 # SALOME_PACKAGE_REPORT()
 #
 # Print a quick summary of the detection of optional prerequisites.
+#
+# If optional JUSTIFY argument is specified, names of packages
+# are left-justified to the given length; default value is 10.
+#
+# USAGE: SALOME_PACKAGE_REPORT([JUSTIFY length])
 #
 MACRO(SALOME_PACKAGE_REPORT)
-  PARSE_ARGUMENTS(SALOME_PACKAGE_REPORT "LENGTH" "" ${ARGN})
-  IF(SALOME_PACKAGE_REPORT_LENGTH)
-    SET(_length ${SALOME_PACKAGE_REPORT_LENGTH})
+  PARSE_ARGUMENTS(SALOME_PACKAGE_REPORT "JUSTIFY" "" ${ARGN})
+  IF(SALOME_PACKAGE_REPORT_JUSTIFY)
+    SET(_length ${SALOME_PACKAGE_REPORT_JUSTIFY})
   ELSE()
     SET(_length 10)
   ENDIF()


[cmake] Add 'WintermuteFunctionDependencies'.

--- cmake/Modules/WintermuteFunctionDependencies.cmake
+++ cmake/Modules/WintermuteFunctionDependencies.cmake
@@ -26,3 +26,6 @@
 endif()

 include(CheckFunctionExists)
+
+# TODO: Scan code for system-specific functions and check here for their
+# existence.


added create save folder in femus build app macro

--- cmake-modules/femusMacroBuildApplication.cmake
+++ cmake-modules/femusMacroBuildApplication.cmake
@@ -32,6 +32,7 @@

 FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/output/)
 FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/input/)
+FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/save/)
 FILE(COPY           ${PROJECT_SOURCE_DIR}/input/ DESTINATION ${PROJECT_BINARY_DIR}/input/)
 # TODO this file copy does not generate a dependency rule in the makefiles, maybe we should think of how to obtain that,
 # to avoid re-running cmake when new input files are added in the applications


22778: [CEA 1298] Python file compilation should be done at build time, not install time

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -120,10 +120,25 @@
     INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS})
     GET_FILENAME_COMPONENT(ext ${file} EXT)
     IF(ext STREQUAL .py)
-      INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file_name}\")")
-      INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file_name}')\")")
-      INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\")")
-      INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\")")
+      # FILE TIMESTAMP command appears in cmake-2.8.11
+      IF(${CMAKE_VERSION} VERSION_LESS "2.8.11")
+        INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file_name}\")")
+        INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file_name}')\")")
+        INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\")")
+        INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\")")
+      ELSE(${CMAKE_VERSION} VERSION_LESS "2.8.11")
+        GET_FILENAME_COMPONENT(file_we ${file_name} NAME_WE)
+        INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file_name}')\")")
+        INSTALL(CODE "FILE(TIMESTAMP \"${CMAKE_CURRENT_SOURCE_DIR}/${file}\"            py_time)")
+        INSTALL(CODE "FILE(TIMESTAMP \"${CMAKE_INSTALL_PREFIX}/${path}/${file_we}.pyc\" pyc_time)")
+        INSTALL(CODE "FILE(TIMESTAMP \"${CMAKE_INSTALL_PREFIX}/${path}/${file_we}.pyo\" pyo_time)")
+        #INSTALL(CODE "MESSAGE(STATUS \"\${py_time} \${pyc_time} \")")
+        INSTALL(CODE "STRING(COMPARE LESS \${pyc_time} \${py_time} to_install_pyc)")
+        INSTALL(CODE "STRING(COMPARE LESS \${pyo_time} \${py_time} to_install_pyo)")
+        INSTALL(CODE "IF (\${to_install_pyc} OR \${to_install_pyo}) \n MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file_name}\") \n ENDIF()")
+        INSTALL(CODE "IF (\${to_install_pyc}) \n EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\") \n ENDIF()")
+        INSTALL(CODE "IF (\${to_install_pyo}) \n EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\") \n ENDIF()")
+      ENDIF(${CMAKE_VERSION} VERSION_LESS "2.8.11")
     ENDIF(ext STREQUAL .py)
   ENDFOREACH(file ${file_list})
 ENDMACRO(SALOME_INSTALL_SCRIPTS)


Update FOTS tests location

Update FOTS tests location

--- test/fots/ImportFOTS.cmake
+++ test/fots/ImportFOTS.cmake
@@ -36,7 +36,7 @@
   MESSAGE (STATUS "FOTS archive '${FOTS_ARCHIVE}' already downloaded.")
 ELSE(EXISTS "${_outdir}/${FOTS_ARCHIVE}")
   MESSAGE (STATUS "Downloading FOTS archive '${FOTS_ARCHIVE}'...")
-  FILE (DOWNLOAD http://zorbatest.28.io:8080/~spungi/${FOTS_ARCHIVE}
+  FILE (DOWNLOAD http://w3c-tests.s3.amazonaws.com/${FOTS_ARCHIVE}
     "${_outdir}/${FOTS_ARCHIVE}" STATUS _dlstat SHOW_PROGRESS)
   LIST (GET _dlstat 0 _dlcode)
   IF (NOT _dlcode EQUAL 0)


SVN_SILENT made messages (.desktop file)


v5x target: Fix wrong FD for TELEM3

v5x target: Fix wrong FD for TELEM3

Signed-off-by: Claudio Micheli <c3923186c4c9da9c766af46f22a325cd4677020a@auterion.com>

--- boards/px4/fmu-v5x/default.cmake
+++ boards/px4/fmu-v5x/default.cmake
@@ -14,7 +14,7 @@
 		GPS1:/dev/ttyS0
 		TEL1:/dev/ttyS6
 		TEL2:/dev/ttyS4
-		TEL3:/dev/ttyS2
+		TEL3:/dev/ttyS1
 		GPS2:/dev/ttyS7
 	DRIVERS
 		adc


switching back to gcc

switching back to gcc

--- build/toolchains/rasperypi.cmake
+++ build/toolchains/rasperypi.cmake
@@ -1,6 +1,3 @@
-# target clang++
-set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
-
 # options
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -stdlib=libc++ -std=c++11")
 set(CXX_FLAGS_DEBUG "-g -O0")


Update coveralls script some

Update coveralls script some

--- cmake/Coveralls.cmake
+++ cmake/Coveralls.cmake
@@ -19,7 +19,7 @@
 #
 # Copyright (C) 2014 Joakim Söderberg <joakim.soderberg@gmail.com>
 #
-
+include(CheckCCompilerFlag)

 #
 # Param _COVERAGE_SRCS	A list of source files that coverage should be collected for.
@@ -109,19 +109,32 @@

 endfunction()

-macro(coveralls_turn_on_coverage)
-	if(NOT (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-		AND (NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
-		message(FATAL_ERROR "Coveralls: Compiler ${CMAKE_C_COMPILER_ID} is not GNU gcc! Aborting... You can set this on the command line using CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake <options> ..")
+#
+# Verifies that the compiler supports compiling coverage data.
+#
+macro(coveralls_test_support)
+	check_c_compiler_flag(-ftest-coverage COMPILER_HAS_TEST_COVERAGE)
+	check_c_compiler_flag(-fprofile-arcs COMPILER_HAS_PROFILE_ARCS)
+
+	if (NOT (COMPILER_HAS_PROFILE_ARCS OR COMPILER_HAS_TEST_COVERAGE))
+		message(FATAL_ERROR "\n\nCoveralls: Compiler does not support the necessary compile flags! Aborting... You can set compiler explicitly like this: CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake <options> ..\n\n")
 	endif()

 	if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
-		message(FATAL_ERROR "Coveralls: Code coverage results with an optimised (non-Debug) build may be misleading! Add -DCMAKE_BUILD_TYPE=Debug")
+		message(FATAL_ERROR "\n\nCoveralls: Code coverage results with an optimised (non-Debug) build may be misleading! Add -DCMAKE_BUILD_TYPE=Debug\n\n")
 	endif()
+endmacro()

+#
+# This turns on Coverage support for all targets globally.
+#
+macro(coveralls_turn_on_coverage)
+	coveralls_test_support()
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
 endmacro()

-
-
+macro(coveralls_turn_on_coverage_for_target _TARGET)
+	coveralls_test_support()
+	set_target_properties(${_TARGET} PROPERTIES COMPILE_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+endmacro()


core module lib location change

core module lib location change

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -68,7 +68,7 @@
 MACRO( ADD_DUNE_MODULES )
 	FOREACH( MODULE ${ARGN} )
 		INCLUDE_SYS_DIR( ${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE} )
-		LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/${MODULE}/.libs )
+		LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/lib/.libs )
 		FILE( GLOB_RECURSE tmp_header "${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/${MODULE}/*.hh" )
 		LIST( APPEND DUNE_HEADERS ${tmp_header} )
 	ENDFOREACH(MODULE)
@@ -133,7 +133,7 @@
 INCLUDE_DIR(${Boost_INCLUDE_DIR})
 FIND_PACKAGE( PkgConfig )
 pkg_check_modules( CCGNU REQUIRED libccgnu2 )
-ADD_CXX_FLAGS( "${CCGNU_CFLAGS}" "-DHAVE_GRIDTYPE" )
+ADD_CXX_FLAGS( "${CCGNU_CFLAGS}")
 INCLUDE_SYS_DIR(${Boost_INCLUDE_DIR})

 #try to enable link-time-optimisation


Fixed FindBlosc.cmake on Windows with vcpkg changes to zstd

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/FindBlosc.cmake
+++ cmake/FindBlosc.cmake
@@ -377,18 +377,8 @@
       INTERFACE_LINK_DIRECTORIES
          "\$<\$<CONFIG:Release>:${Blosc_RELEASE_LIBRARY_DIRS}>;\$<\$<CONFIG:Debug>:${Blosc_DEBUG_LIBRARY_DIRS}>")
     target_link_libraries(Blosc::blosc INTERFACE
-      $<$<CONFIG:Release>:lz4;snappy;zlib>
-      $<$<CONFIG:Debug>:lz4d;snappyd;zlibd>)
-
-    if(BLOSC_USE_STATIC_LIBS)
-      target_link_libraries(Blosc::blosc INTERFACE
-        $<$<CONFIG:Release>:zstd_static>
-        $<$<CONFIG:Debug>:zstd_staticd>)
-    else()
-      target_link_libraries(Blosc::blosc INTERFACE
-        $<$<CONFIG:Release>:zstd>
-        $<$<CONFIG:Debug>:zstdd>)
-    endif()
-  endif()
-endif()
-
+      $<$<CONFIG:Release>:lz4;snappy;zlib;zstd>
+      $<$<CONFIG:Debug>:lz4d;snappyd;zlibd;zstd>)
+  endif()
+endif()
+


fix glib cmake check, so we don't use KDEisms

--- cmake/FindGLIB2.cmake
+++ cmake/FindGLIB2.cmake
@@ -17,7 +17,7 @@
 endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)

 find_package(PkgConfig)
-pkg_check_modules(PC_LibGLIB2 QUIET glib-2.0)
+pkg_check_modules(PC_LibGLIB2 glib-2.0)

 find_path(GLIB2_MAIN_INCLUDE_DIR
           NAMES glib.h


Updated Findphypp.cmake file to new header organization.

--- cmake/Findphypp.cmake
+++ cmake/Findphypp.cmake
@@ -2,8 +2,6 @@
     # fine phy++ headers
     find_path(PHYPP_INCLUDE_DIR phypp.hpp
         HINTS ${PHYPP_ROOT_DIR} PATH_SUFFIXES include)
-
-    file(GLOB PHYPP_HEADERS ${PHYPP_INCLUDE_DIR}/phypp/*.hpp)

     find_path(PHYPP_COMPILER_DIR cphy++
         HINTS ${PHYPP_ROOT_DIR} PATH_SUFFIXES bin)
@@ -14,11 +12,10 @@
     set(PHYPP_COMPILER ${PHYPP_COMPILER_DIR}/cphy++)
     set(PHYPP_REFGEN ${PHYPP_REFGEN_DIR}/phy++-refgen)

-    mark_as_advanced(PHYPP_INCLUDE_DIR PHYPP_HEADERS PHYPP_REFGEN PHYPP_COMPILER)
+    mark_as_advanced(PHYPP_INCLUDE_DIR PHYPP_REFGEN PHYPP_COMPILER)

     include(FindPackageHandleStandardArgs)
-    find_package_handle_standard_args(PHYPP DEFAULT_MSG
-        PHYPP_INCLUDE_DIR PHYPP_HEADERS PHYPP_REFGEN PHYPP_COMPILER)
+    find_package_handle_standard_args(PHYPP DEFAULT_MSG PHYPP_INCLUDE_DIR)

     set(PHYPP_INCLUDE_DIRS ${PHYPP_INCLUDE_DIR})

@@ -181,18 +178,17 @@
     if(CMAKE_BUILD_TYPE MATCHES Debug)
         add_custom_command(OUTPUT "${FILE_BASE}-make" VERBATIM COMMAND
             ${PHYPP_COMPILER} debug "${PROJECT_SOURCE_DIR}/${CPP_FILE_NAME}" -o "${CMAKE_CURRENT_BINARY_DIR}/${FILE_BASE}-make"
-            DEPENDS ${PROJECT_SOURCE_DIR}/${CPP_FILE_NAME} ${PHYPP_HEADERS})
+            DEPENDS ${PROJECT_SOURCE_DIR}/${CPP_FILE_NAME})
     else()
         add_custom_command(OUTPUT "${FILE_BASE}-make" VERBATIM COMMAND
             ${PHYPP_COMPILER} optimize "${PROJECT_SOURCE_DIR}/${CPP_FILE_NAME}" -o "${CMAKE_CURRENT_BINARY_DIR}/${FILE_BASE}-make"
-            DEPENDS ${PROJECT_SOURCE_DIR}/${CPP_FILE_NAME} ${PHYPP_HEADERS})
+            DEPENDS ${PROJECT_SOURCE_DIR}/${CPP_FILE_NAME})
     endif()

     # Create a target that will call this command
     add_custom_target(${FILE_BASE} ALL DEPENDS
         ${PROJECT_SOURCE_DIR}/${CPP_FILE_NAME}
-        ${CMAKE_CURRENT_BINARY_DIR}/${FILE_BASE}-make
-        ${PHYPP_HEADERS})
+        ${CMAKE_CURRENT_BINARY_DIR}/${FILE_BASE}-make)

     # Specify installation of the binary
     install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${FILE_BASE}-make


Fix a "CMAKE_BUILD_TYPE" issue in CMake 3.1

--- cmake/Utilities.cmake
+++ cmake/Utilities.cmake
@@ -32,8 +32,11 @@
     message(FATAL_ERROR "${COMPILER_STRING} version need to be at leaset ${VERSION_STRING}")
   endif()

-  if(NOT MSVC AND NOT (${CMAKE_BUILD_TYPE} STREQUAL "Debug"))
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG" PARENT_SCOPE)
+#  if(NOT MSVC AND NOT (${CMAKE_BUILD_TYPE} STREQUAL "Debug"))
+  if(CMAKE_BUILD_TYPE)
+    if(NOT (${CMAKE_BUILD_TYPE} STREQUAL "Debug"))
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG" PARENT_SCOPE)
+    endif()
   endif()
 endfunction()


CMake: cxxabi.h is only available to C++ compilers, use the right check macro.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -4,6 +4,7 @@
 endif()

 include(CheckIncludeFile)
+include(CheckIncludeFileCXX)
 include(CheckLibraryExists)
 include(CheckSymbolExists)
 include(CheckFunctionExists)
@@ -37,7 +38,7 @@
 check_include_file(argz.h HAVE_ARGZ_H)
 check_include_file(assert.h HAVE_ASSERT_H)
 check_include_file(ctype.h HAVE_CTYPE_H)
-check_include_file(cxxabi.h HAVE_CXXABI_H)
+check_include_file_cxx(cxxabi.h HAVE_CXXABI_H)
 check_include_file(dirent.h HAVE_DIRENT_H)
 check_include_file(dl.h HAVE_DL_H)
 check_include_file(dld.h HAVE_DLD_H)


Updated check_gtest

Updated check_gtest

--- cmake/dev/gtest.cmake
+++ cmake/dev/gtest.cmake
@@ -20,6 +20,12 @@
         endif()
     endif()
     find_package(GTest)
+
+    if(GTEST_FOUND)
+        find_package(Threads REQUIRED)
+        set(GTEST_LIBRARIES ${GTEST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+        set(GTEST_BOTH_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+    endif()
 endmacro()

 macro(add_gtest test)


Fix handling of ALGLIB dependency

Fix handling of ALGLIB dependency

The minimum version needs to be specified in idyntree_handle_dependency via the MINIMUM_VERSION option

--- cmake/iDynTreeDependencies.cmake
+++ cmake/iDynTreeDependencies.cmake
@@ -64,7 +64,7 @@
 idyntree_handle_dependency(Irrlicht)
 idyntree_handle_dependency(Qt5 COMPONENTS Qml Quick Widgets)
 idyntree_handle_dependency(OsqpEigen)
-idyntree_handle_dependency(ALGLIB 3.14.0)
+idyntree_handle_dependency(ALGLIB MINIMUM_VERSION 3.14.0)
 idyntree_handle_dependency(WORHP)
 # Workaround for https://github.com/robotology/idyntree/issues/599
 idyntree_handle_dependency(ASSIMP DO_NOT_SILENTLY_SEARCH)


minor changes (unneeded macdeploy, formatting) to jkqtplotter_deployqt.cmake

--- cmake/jkqtplotter_deployqt.cmake
+++ cmake/jkqtplotter_deployqt.cmake
@@ -4,7 +4,6 @@
         get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
         get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
         find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
-        find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")

         set(WINDEPLOYQTOPTION "--release")
         if (CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -22,8 +21,8 @@
             COMMAND "${CMAKE_COMMAND}" -E
                 env PATH="${CMAKE_CXX_COMPILER_BINPATH}\;${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
                     --compiler-runtime
-					-xml
-					-printsupport
+                       -xml
+                       -printsupport
                     ${WINDEPLOYQTOPTION}
                     \"$<TARGET_FILE:${TARGET_NAME}>\"
             COMMENT "Running windeployqt ... "


if APPLE is defined, undefine it

if APPLE is defined, undefine it

This is to prevent some confusions in CMake scripts while cross-compiling
to Android from Apple platform.

--- toolchains/android-studio.toolchain.cmake
+++ toolchains/android-studio.toolchain.cmake
@@ -11,6 +11,10 @@
 set( CPACK_SYSTEM_NAME "Android" )

 set( ANDROID true )
+
+if( APPLE )
+    unset( APPLE )
+endif()

 add_definitions( -D__ANDROID__ )


Rework code coverage script

Rework code coverage script

--- cmake/modules/CodeCoverage.cmake
+++ cmake/modules/CodeCoverage.cmake
@@ -26,11 +26,17 @@
   option(CodeCov_BUILD_COVERAGE "Build coverage targets" On)
 endif()

+if(NOT DEFINED CodeCov_TOOLSET)
+  set(CodeCov_TOOLSET "lcov" CACHE STRING
+    "The tool to generate code coverage report.")
+endif()
+
+
 function(_codecov_failure_message msg)
   message(FATAL_ERROR "${msg}")
 endfunction()

-macro(_codecov_gnu_lcov_branch_workaround)
+macro(_codecov_lcov_branch_workaround)
   execute_process(COMMAND ${CodeCov_GNU_LCOV} "--version"
                   OUTPUT_VARIABLE _codecov_gnu_lcov_version_dump)
   string(REGEX MATCH "[0-9.]+" _codecov_gnu_lcov_version_string
@@ -43,7 +49,7 @@
   endif()
 endmacro()

-function(_codecov_gnu_setup)
+function(_codecov_lcov_setup)
   find_program(CodeCov_GNU_LCOV lcov)
   find_program(CodeCov_GNU_GENHTML genhtml)

@@ -65,7 +71,7 @@

   mark_as_advanced(CodeCov_GNU_LCOV CodeCov_GNU_GENHTML)

-  _codecov_gnu_lcov_branch_workaround()
+  _codecov_lcov_branch_workaround()

   add_custom_target(codecov_prerun
     ${CodeCov_GNU_LCOV} --quiet --directory . --zerocounters ${_CodeCov_GNU_LCOV_BRANCH_COVERAGE_OPTION}
@@ -101,6 +107,9 @@
       set(CodeCov_${lang}_FLAGS_INTERNAL "-g" "-O0" "--coverage")
       set(CodeCov_${lang}_LINK_FLAGS_INTERNAL "--coverage")
     endif()
+  elseif(CMAKE_${lang}_COMPILER_ID STREQUAL "AppleClang")
+    set(CodeCov_${lang}_FLAGS_INTERNAL "-g" "-O0" "-fprofile-arcs" "-ftest-coverage")
+    set(CodeCov_${lang}_LINK_FLAGS_INTERNAL "-fprofile-arcs -ftest-coverage")
   elseif(CMAKE_${lang}_COMPILER_ID STREQUAL "Clang")
     include(Check${lang}CompilerFlag)
     if(${lang} STREQUAL "C")
@@ -137,10 +146,10 @@
       "These flags will be used when a target with coverage is linked.")
   mark_as_advanced(CodeCov_${lang}_FLAGS CodeCov_${lang}_LINK_FLAGS)

-  if(CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
-    _codecov_gnu_setup()
+  if(CodeCov_TOOLSET STREQUAL "lcov")
+    _codecov_lcov_setup()
   else()
-    message(FATAL_ERROR "code coverage is not implemented for ${CMAKE_${lang}_COMPILER_ID}")
+    message(FATAL_ERROR "unknown code coverage toolset")
   endif()

   if(CodeCov_${lang}_FLAGS AND CodeCov_${lang}_LINK_FLAGS)


nuttx only show stderr

nuttx only show stderr

-failures will still be displayed, but we don't need to see normal
successful compile output

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -229,7 +229,7 @@
 		COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_src}/nuttx/configs
 		COMMAND cd ${nuttx_src}/nuttx/tools && ./configure.sh ${CONFIG}/nsh
 		COMMAND ${ECHO} Exporting NuttX for ${CONFIG}
-		COMMAND ${MAKE} --no-print-directory --quiet -C ${nuttx_src}/nuttx -j${THREADS} -r CONFIG_ARCH_BOARD=${CONFIG} export
+		COMMAND ${MAKE} --no-print-directory --quiet -C ${nuttx_src}/nuttx -j${THREADS} -r CONFIG_ARCH_BOARD=${CONFIG} export > /dev/null
 		COMMAND ${CP} -r ${nuttx_src}/nuttx/nuttx-export.zip ${CMAKE_BINARY_DIR}/${CONFIG}.export
 		DEPENDS ${config_files} ${DEPENDS} __nuttx_copy_${CONFIG})


--- gstreamer/gstreamer.desktop.cmake
+++ gstreamer/gstreamer.desktop.cmake
@@ -32,6 +32,7 @@
 Name[is]=GStreamer
 Name[it]=GStreamer
 Name[ja]=GStreamer
+Name[kk]=GStreamer
 Name[ko]=GStreamer
 Name[ku]=GStreamer
 Name[lt]=GStreamer
@@ -86,6 +87,7 @@
 Comment[is]=Phonon GStreamer bakendi
 Comment[it]=Motore Gstreamer di Phonon
 Comment[ja]=Phonon GStreamer バックエンド
+Comment[kk]=Phonon GStreamer тетігі
 Comment[ko]=Phonon GStreamer 백엔드
 Comment[ku]=Binesaza Phonon GStreamer
 Comment[lt]=Phonon GStreamer galinė sąsaja


Autotools defaults for PATH, PKG_CONFIG_PATH, CPPFLAGS, LDFLAGS

--- cmake/modules/hunter_autotools_project.cmake
+++ cmake/modules/hunter_autotools_project.cmake
@@ -6,6 +6,14 @@
 # It forwards to ExternalProject_Add the following parameters:
 #   URL, URL_HASH, DOWNLOAD_DIR, SOURCE_DIR and INSTALL_DIR
 #
+# Adds to the environment variables:
+#   PATH=<root-id>/bin
+#   PKG_CONFIG_PATH=<root-id>/{lib,share}/pkgconfig
+#
+# Adds to autotools flags:
+#   CPPFLAGS=-I<root-id>/include
+#   LDFLAGS=-L<root-id>/lib
+
 # Usage example:
 # hunter_autotools_project("@HUNTER_EP_NAME@" # target name
 #     HUNTER_SELF                             # hunter home
@@ -40,11 +48,6 @@
 #       --enable-feature
 #       --disable-other
 #       --with-library
-#     MODIFY_PATH                             # add <root-id>/bin folder to the
-#                                             # PATH environment variable
-#     MODIFY_PKG_CONFIG                       # add <root-id>/{lib,share}/pkgconfig
-#                                             # folders to the PKG_CONFIG_PATH
-#                                             # environment variable
 #     BOOTSTRAP                               # add a bootstrap command to be run
 #       "./autogen.sh"                        # before ./configure such as
 #                                             # ./autogen.sh or ./bootstrap
@@ -59,7 +62,7 @@

 function(hunter_autotools_project target_name)

-  set(optional_params MODIFY_PATH MODIFY_PKG_CONFIG)
+  set(optional_params)
   set(one_value_params
       HUNTER_SELF
       URL
@@ -90,8 +93,6 @@
   # -> PARAM_BUILD_DIR
   # -> PARAM_GLOBAL_INSTALL_DIR
   # -> PARAM_INSTALL_DIR
-  # -> PARAM_MODIFY_PATH
-  # -> PARAM_MODIFY_PKG_CONFIG

   if(PARAM_UNPARSED_ARGUMENTS)
     hunter_internal_error(
@@ -177,7 +178,7 @@
   #          [-I${INCLUDE_DIRECTORIES}]
   #
   # C Preprocessor flags
-  set(cppflags)
+  set(cppflags "-I${PARAM_GLOBAL_INSTALL_DIR}/include")
   # build config type definitions
   get_directory_property(defs
       COMPILE_DEFINITIONS_${config_type}
@@ -219,7 +220,12 @@
   # LDFLAGS=${ldflags}
   #
   # Linker flags
-  set(ldflags "${CMAKE_EXE_LINKER_FLAGS_${config_type}} ${CMAKE_EXE_LINKER_FLAGS} ${PARAM_LDFLAGS}")
+  set(ldflags "-L${PARAM_GLOBAL_INSTALL_DIR}/lib")
+  set(ldflags "${ldflags} ${CMAKE_EXE_LINKER_FLAGS_${config_type}}")
+  string(STRIP "${ldflags}" ldflags)
+  set(ldflags "${ldflags} ${CMAKE_EXE_LINKER_FLAGS}")
+  string(STRIP "${ldflags}" ldflags)
+  set(ldflags "${ldflags} ${PARAM_LDFLAGS}")
   string(STRIP "${ldflags}" ldflags)
   hunter_status_debug("LDFLAGS=${ldflags}")

@@ -279,20 +285,20 @@

   set(configure_command . "${PARAM_HUNTER_SELF}/scripts/clear-all.sh" &&)
   list(APPEND configure_command AR=${CMAKE_AR})
-  if(PARAM_MODIFY_PATH)
-    # see clear-all.sh
-    set(default_path "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin")
-    list(
-        APPEND
-        configure_command
-        "PATH=${PARAM_GLOBAL_INSTALL_DIR}/bin:${default_path}"
-    )
-  endif()
-  if(PARAM_MODIFY_PKG_CONFIG)
-    set(d1 "${PARAM_GLOBAL_INSTALL_DIR}/lib/pkgconfig")
-    set(d2 "${PARAM_GLOBAL_INSTALL_DIR}/share/pkgconfig")
-    list(APPEND configure_command "PKG_CONFIG_PATH=${d1}:${d2}")
-  endif()
+
+  # see clear-all.sh
+  # PATH environment variable
+  set(default_path "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin")
+  list(
+      APPEND
+      configure_command
+      "PATH=${PARAM_GLOBAL_INSTALL_DIR}/bin:${default_path}"
+  )
+
+  # PKG_CONFIG_PATH environment variable
+  set(d1 "${PARAM_GLOBAL_INSTALL_DIR}/lib/pkgconfig")
+  set(d2 "${PARAM_GLOBAL_INSTALL_DIR}/share/pkgconfig")
+  list(APPEND configure_command "PKG_CONFIG_PATH=${d1}:${d2}")

   string(COMPARE NOTEQUAL "${PARAM_BOOTSTRAP}" "" have_bootstrap)
   if(have_bootstrap)


MAINT-1636: Turning off tcmalloc for the build now that davep's changes are in to fix our major crasher.

--- indra/cmake/GooglePerfTools.cmake
+++ indra/cmake/GooglePerfTools.cmake
@@ -3,7 +3,7 @@

 # If you want to enable or disable TCMALLOC in viewer builds, this is the place.
 # set ON or OFF as desired.
-set (USE_TCMALLOC ON)
+set (USE_TCMALLOC OFF)

 if (STANDALONE)
   include(FindGooglePerfTools)


BUG: Fix MGHIO to fix write failures

BUG: Fix MGHIO to fix write failures

MGHIO was not always writing valid images to disk. This problem was
identified as part of the BRAINSTools use of MGHIO, and resulted
in incorrect data results when using .mgz extension instead of
.nii.gz.  The problem was identified as incorrect direction cosine
manipulation between MGH coordinate space and ITK coordinate space.

In order to facilitate future maintenance, the code was modified
to use itk::Vector and itk::Matrix mathematical operations rather
than c-arrays with manual computations.  This change makes the
code easier to debug (using external matrix calculators) and easier
to validate to the documentation.

More extensive tests created to stress test reading and writing.

Test images converted to/from nifti format for reading and writing
and loaded into slicer to visually confirm that all information is
preserved.

Change-Id: I7a850e2aa6a1938c94326769c415380cf6ee68e8

--- Modules/Remote/MGHIO.remote.cmake
+++ Modules/Remote/MGHIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(MGHIO
   "MGHIO ImageIO plugin for ITK"
   GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
-  GIT_TAG dc1f16c73d497ca2d1d7e1c77096817f8a82eb21
+  GIT_TAG 7d0386335dd90199fa7f1e79db7ceab22d8e957f
   )


build: repair cross-compilation for Windows after #33908

`CMAKE_SYSTEM_NAME` specifies the host, not the build.  Use the correct
executable extension for the host.

--- stdlib/cmake/modules/SwiftSource.cmake
+++ stdlib/cmake/modules/SwiftSource.cmake
@@ -610,12 +610,12 @@
   endif()

   set(line_directive_tool "${SWIFT_SOURCE_DIR}/utils/line-directive")
-  # line-directive needs full path on Windows.
-  if (CMAKE_SYSTEM_NAME STREQUAL Windows)
-    set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc.exe")
-  else()
-    set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc")
-  endif()
+
+  if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
+    set(HOST_EXECUTABLE_SUFFIX .exe)
+  endif()
+  set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc${HOST_EXECUTABLE_SUFFIX}")
+
   set(swift_compiler_tool_dep)
   if(SWIFT_INCLUDE_TOOLS)
     # Depend on the binary itself, in addition to the symlink.


missing commit for need porttime off

missing commit for need porttime off

--- mingw64/Custom-mingw64.cmake
+++ mingw64/Custom-mingw64.cmake
@@ -7,6 +7,9 @@
 set(BUILD_STATIC_LIBRARY ON)
 set(USE_OPEN_MP OFF)
 set(TCL_VERSION 8.5)
+
+set(NEED_PORTTIME OFF)
+
 #set(PYTHON_INCLUDE_DIRS "/usr/include/python2.7")
 ##set(BUILD_CSOUND_AC OFF)
 ##set(BUILD_CSOUND_AC_PYTHON_INTERFACE OFF)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

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


BUG: Pass CMAKE_BUILD_TYPE in Superbuild.

Change-Id: I8579eab8b401437b8de2de07e2e5c2791d1df550

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -12,6 +12,10 @@
 endif()

 include( ExternalProject )
+
+set(ep_common_args
+  -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+  )

 # Compute -G arg for configuring external projects with the same CMake generator:
 if(CMAKE_EXTRA_GENERATOR)


Drop bindings/octave/demos from list of octave directories since that
directory no longer exists.

svn path=/trunk/; revision=10750

--- plplot_test/plplot-test.sh.cmake
+++ plplot_test/plplot-test.sh.cmake
@@ -237,7 +237,6 @@
 "$EXAMPLES_DIR"/../bindings/octave:\
 "$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot:\
 "$SRC_EXAMPLES_DIR"/../bindings/octave/PLplot/support:\
-"$SRC_EXAMPLES_DIR"/../bindings/octave/demos:\
 "$SRC_EXAMPLES_DIR"/../bindings/octave/misc:\
 "$SRC_EXAMPLES_DIR"/octave:\
 "@PLPLOT_OCTAVE_DIR@":\


disable ICF on Android x86, as it triggers internal linker error

--- toolchains/android-studio.toolchain.cmake
+++ toolchains/android-studio.toolchain.cmake
@@ -97,7 +97,15 @@
         set( gold_suffix ".exe" )
     endif()
     link_libraries( -fuse-ld=gold${gold_suffix} )
-    link_libraries( $<$<CONFIG:RELEASE>:-Wl,--icf=all> ) # http://research.google.com/pubs/pub36912.html Safe ICF: Pointer Safe and Unwinding Aware Identical Code Folding in Gold
+    # Implementation note:
+    # NDK r17 (and r18 as well) on x86 with ICF and LTO combined causes internal linker error.
+    #
+    #                              Nenad Miksa (19.09.2018.)
+    if( ANDROID_ABI STREQUAL "x86" )
+        link_libraries( $<$<CONFIG:RELEASE>:-Wl,--icf=none> )
+    else()
+        link_libraries( $<$<CONFIG:RELEASE>:-Wl,--icf=all> ) # http://research.google.com/pubs/pub36912.html Safe ICF: Pointer Safe and Unwinding Aware Identical Code Folding in Gold
+    endif()
 endif()

 link_libraries( $<$<CONFIG:RELEASE>:-Wl,--gc-sections> )


Fix linking for rhel 8.2.

Fix linking for rhel 8.2.

--- build_settings.cmake
+++ build_settings.cmake
@@ -55,7 +55,9 @@
 else()
   set(CXX_SPECIFIC_WARN_OPTS "-Wsuggest-override -Wnon-virtual-dtor -Wformat-security")
   if(VESPA_OS_DISTRO_COMBINED STREQUAL "centos 8" OR
-      VESPA_OS_DISTRO_COMBINED STREQUAL "rhel 8.1")
+      (VESPA_OS_DISTRO STREQUAL "rhel" AND
+	VESPA_OS_DISTRO_VERSION VERSION_GREATER_EQUAL "8" AND
+	VESPA_OS_DISTRO_VERSION VERSION_LESS "9"))
     set(VESPA_ATOMIC_LIB "")
   else()
     set(VESPA_ATOMIC_LIB "atomic")


[modules] Centralize our internal LLVM's module cache.

--- interpreter/llvm/src/cmake/modules/HandleLLVMOptions.cmake
+++ interpreter/llvm/src/cmake/modules/HandleLLVMOptions.cmake
@@ -465,7 +465,7 @@
   endif()
   if (LLVM_ENABLE_MODULES)
     set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
-    set(module_flags "-fmodules -fmodules-cache-path=module.cache")
+    set(module_flags "-fmodules -fmodules-cache-path=${PROJECT_BINARY_DIR}/module.cache")
     if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
       # On Darwin -fmodules does not imply -fcxx-modules.
       set(module_flags "${module_flags} -fcxx-modules")


cmake: set CMAKE_CXX_FLAGS in FBCompilerSettingsUnix.cmake

Summary:
It looks like the various CMAKE_CXX_FLAGS_* are simply ineffective, and I'm not
sure why, setting CMAKE_CXX_FLAGS does work though, and CMake appears to add
some release/debug flags to it when generating Ninja files.

Reviewed By: fanzeyi

Differential Revision: D27862117

fbshipit-source-id: a89f6182b5bae9a087f8fcfd4c5f9526f91e2adf

--- build/fbcode_builder/CMake/FBCompilerSettingsUnix.cmake
+++ build/fbcode_builder/CMake/FBCompilerSettingsUnix.cmake
@@ -6,6 +6,4 @@
 # to these shared compiler settings in order to avoid accidentally
 # breaking a build in another project!

-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations")
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations")


Allow custom config file for ament_uncrustify (#200)

* parse arguements for CONFIG_FILE and append to cmd

Signed-off-by: Yadunund Vijay <e078cbf42ed35152eaab8f31a3b12a474b23daef@gmail.com>

* removed newline

Signed-off-by: Yadunund <e078cbf42ed35152eaab8f31a3b12a474b23daef@openrobotics.org>

* fixed description

Signed-off-by: Yadunund <e078cbf42ed35152eaab8f31a3b12a474b23daef@openrobotics.org>
Signed-off-by: Yadunund Vijay <e078cbf42ed35152eaab8f31a3b12a474b23daef@gmail.com>

* corrected location of default configuration file in docblock

Signed-off-by: Yadunund <e078cbf42ed35152eaab8f31a3b12a474b23daef@openrobotics.org>

* fixed alignment in docblock

Signed-off-by: Yadunund <e078cbf42ed35152eaab8f31a3b12a474b23daef@openrobotics.org>

* reverted deletion of empty line after copyright header

Signed-off-by: Yadunund <e078cbf42ed35152eaab8f31a3b12a474b23daef@openrobotics.org>

--- ament_cmake_uncrustify/cmake/ament_uncrustify.cmake
+++ ament_cmake_uncrustify/cmake/ament_uncrustify.cmake
@@ -15,8 +15,16 @@
 #
 # Add a test to check the code for compliance with uncrustify.
 #
+# The default configuration file used for uncrustify is located at
+# configuration/ament_code_style.cfg within the ament_uncrustify directory.
+# The default configuration file can be overridden by the
+# argument 'CONFIG_FILE'.
+#
 # :param TESTNAME: the name of the test, default: "uncrustify"
 # :type TESTNAME: string
+# :param CONFIG_FILE: the path of the configuration file for
+#   uncrustify to consider
+# :type CONFIG_FILE: string
 # :param MAX_LINE_LENGTH: override the maximum line length,
 #   the default is defined in ament_uncrustify
 # :type MAX_LINE_LENGTH: integer
@@ -26,7 +34,7 @@
 # @public
 #
 function(ament_uncrustify)
-  cmake_parse_arguments(ARG "" "MAX_LINE_LENGTH;TESTNAME" "" ${ARGN})
+  cmake_parse_arguments(ARG "" "MAX_LINE_LENGTH;TESTNAME;CONFIG_FILE" "" ${ARGN})
   if(NOT ARG_TESTNAME)
     set(ARG_TESTNAME "uncrustify")
   endif()
@@ -40,6 +48,9 @@
   set(cmd "${ament_uncrustify_BIN}" "--xunit-file" "${result_file}")
   if(DEFINED ARG_MAX_LINE_LENGTH)
     list(APPEND cmd "--linelength" "${ARG_MAX_LINE_LENGTH}")
+  endif()
+  if(ARG_CONFIG_FILE)
+    list(APPEND cmd "-c" "${ARG_CONFIG_FILE}")
   endif()
   list(APPEND cmd ${ARG_UNPARSED_ARGUMENTS})


Add Homebrew LLVM path hint

Add Homebrew LLVM path hint

--- atdna/FindLLVM.cmake
+++ atdna/FindLLVM.cmake
@@ -44,7 +44,7 @@
                       llvm-config-3.1 llvm-config31 llvm-config)
 find_program(LLVM_CONFIG
     NAMES ${llvm_config_names}
-    PATHS ${LLVM_ROOT_DIR}/bin NO_DEFAULT_PATH
+    PATHS ${LLVM_ROOT_DIR}/bin /usr/local/opt/llvm/bin NO_DEFAULT_PATH
     DOC "Path to llvm-config tool.")
 find_program(LLVM_CONFIG NAMES ${llvm_config_names})

@@ -207,4 +207,3 @@
 find_package_handle_standard_args(LLVM
     REQUIRED_VARS LLVM_ROOT_DIR LLVM_HOST_TARGET
     VERSION_VAR LLVM_VERSION_STRING)
-


Fixed coverage

Fixed coverage

--- cmake/Coverage.cmake
+++ cmake/Coverage.cmake
@@ -1,17 +1,21 @@
-file(GLOB_RECURSE HDR_FILES_LIBRARY "src/library/*.h")
+file(GLOB_RECURSE HDR_FILES_BASE "src/base/*.h")
+file(GLOB_RECURSE HDR_FILES_CORE "src/core/*.h")
+file(GLOB_RECURSE HDR_FILES_LOADER "src/loader/*.h")
 file(GLOB_RECURSE HDR_FILES_PYTHON "src/python/*.h")
-file(GLOB_RECURSE HDR_FILES_UTILS "src/utils/*.h")
+set(HDR_FILES ${HDR_FILES_BASE} ${HDR_FILES_CORE} ${HDR_FILES_LOADER} ${HDR_FILES_PYTHON})

-file(GLOB_RECURSE HDR_IN_FILES_LIBRARY "src/library/*.inl")
+file(GLOB_RECURSE HDR_IN_FILES_BASE "src/base/*.inl")
+file(GLOB_RECURSE HDR_IN_FILES_CORE "src/core/*.inl")
+file(GLOB_RECURSE HDR_IN_FILES_LOADER "src/loader/*.inl")
 file(GLOB_RECURSE HDR_IN_FILES_PYTHON "src/python/*.inl")
-file(GLOB_RECURSE HDR_IN_FILES_UTILS "src/utils/*.inl")
+set(HDR_IN_FILES ${HDR_IN_FILES_BASE} ${HDR_IN_FILES_CORE} ${HDR_IN_FILES_LOADER} ${HDR_IN_FILES_PYTHON})

-file(GLOB_RECURSE SRC_FILES_LIBRARY "src/library/*.cpp")
+file(GLOB_RECURSE SRC_FILES_BASE "src/base/*.cpp")
+file(GLOB_RECURSE SRC_FILES_CORE "src/core/*.cpp")
+file(GLOB_RECURSE SRC_FILES_LOADER "src/loader/*.cpp")
 file(GLOB_RECURSE SRC_FILES_PYTHON "src/python/*.cpp")
-file(GLOB_RECURSE SRC_FILES_UTILS "src/utils/*.cpp")
+set(SRC_FILES ${SRC_FILES_BASE} ${SRC_FILES_CORE} ${SRC_FILES_LOADER} ${SRC_FILES_PYTHON})

-SET(CV_FILES ${HDR_FILES_LIBRARY} ${HDR_FILES_PYTHON} ${HDR_FILES_UTILS}
-		${HDR_IN_FILES_LIBRARY} ${HDR_IN_FILES_PYTHON} ${HDR_IN_FILES_UTILS}
-		${SRC_FILES_LIBRARY} ${SRC_FILES_PYTHON} ${SRC_FILES_UTILS})
+SET(CV_FILES ${HDR_FILES} ${HDR_IN_FILES} ${SRC_FILES})

 coveralls_setup("${CV_FILES}" ON)


Changed FindGLFW.cmake so that setting the %GLFW_LOCATION% environment variable in Windows behaves like the CMake option, "-DGLFW_LOCATION=%GLFW_LOCATION%".

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -81,6 +81,8 @@
                 "${GLFW_LOCATION}/lib/x64"
                 "${GLFW_LOCATION}/lib-msvc110"
                 "$ENV{GLFW_LOCATION}/lib"
+                "$ENV{GLFW_LOCATION}/lib/x64"
+                "$ENV{GLFW_LOCATION}/lib-msvc110"
                 "${PROJECT_SOURCE_DIR}/extern/glfw/bin"
                 "${PROJECT_SOURCE_DIR}/extern/glfw/lib"
                 "$ENV{PROGRAMFILES}/GLFW/lib"


Fixed bug in FindGcov.cmake.

Fixed bug in FindGcov.cmake.

Generated files cannot be found, so the if must be changed to an other check
mechanism.

--- cmake/FindGcov.cmake
+++ cmake/FindGcov.cmake
@@ -79,8 +79,8 @@

 		if ("${_file}" STREQUAL "" AND ${IS_SOURCE} EQUAL 1)
 			string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" FILE "${FILE}")
-			if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}" AND
-			NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${FILE}")
+
+			if(IS_ABSOLUTE ${FILE})
 				file(RELATIVE_PATH FILE ${CMAKE_CURRENT_SOURCE_DIR} ${FILE})
 			endif()


Don't cache SDL2_LIBRARY_TEMP with CMake

Otherwise it keeps prepending and appending the same extra libs and flags with
each invocation.

--- cmake/FindSDL2.cmake
+++ cmake/FindSDL2.cmake
@@ -18,10 +18,10 @@
 # module will automatically add the -framework Cocoa on your behalf.
 #
 #
-# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
+# Additional Note: If you see an empty SDL2_CORE_LIBRARY in your configuration
 # and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
 # (SDL2.dll, libsdl2.so, SDL2.framework, etc).
-# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
+# Set SDL2_CORE_LIBRARY to point to your SDL2 library, and configure again.
 # Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
 # as appropriate. These values are used to generate the final SDL2_LIBRARY
 # variable, but when these values are unset, SDL2_LIBRARY does not get created.
@@ -87,7 +87,7 @@
 )
 #MESSAGE("SDL2_INCLUDE_DIR is ${SDL2_INCLUDE_DIR}")

-FIND_LIBRARY(SDL2_LIBRARY_TEMP
+FIND_LIBRARY(SDL2_CORE_LIBRARY
   NAMES SDL2
   HINTS
   $ENV{SDL2DIR}
@@ -98,8 +98,7 @@
   /opt/csw
   /opt
 )
-
-#MESSAGE("SDL2_LIBRARY_TEMP is ${SDL2_LIBRARY_TEMP}")
+#MESSAGE("SDL2_CORE_LIBRARY is ${SDL2_CORE_LIBRARY}")

 IF(NOT SDL2_BUILDING_LIBRARY)
   IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
@@ -137,7 +136,9 @@
 ENDIF(MINGW)

 SET(SDL2_FOUND "NO")
-IF(SDL2_LIBRARY_TEMP)
+IF(SDL2_CORE_LIBRARY)
+  SET(SDL2_LIBRARY_TEMP ${SDL2_CORE_LIBRARY})
+
   # For SDL2main
   IF(NOT SDL2_BUILDING_LIBRARY)
     IF(SDL2MAIN_LIBRARY)
@@ -172,15 +173,12 @@
   ENDIF(WIN32)

   # Set the final string here so the GUI reflects the final state.
-  SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
-  # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
-  SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
+  SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP})

   SET(SDL2_FOUND "YES")
-ENDIF(SDL2_LIBRARY_TEMP)
+ENDIF(SDL2_CORE_LIBRARY)

 INCLUDE(FindPackageHandleStandardArgs)
-
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
                                   REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)


GCC 4.8 produces lots of noise about unsused local typedefs - I couldn't care less

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -202,6 +202,7 @@
             # GCC gives bogus "array subscript is above array bounds" warnings in math.cpp
             AddCompilerFlag("-Wno-array-bounds")
          endif()
+         AddCompilerFlag("-Wno-unused-local-typedefs")
       endif()
       vc_add_compiler_flag(Vc_DEFINITIONS "-Wabi")
       vc_add_compiler_flag(Vc_DEFINITIONS "-fabi-version=0") # ABI version 4 is required to make __m128 and __m256 appear as different types. 0 should give us the latest version.


Temporarily disabled gdb checker to avoid hanging buildbots

--- cmake/checkgdb.cmake
+++ cmake/checkgdb.cmake
@@ -1,9 +1,9 @@
 execute_process(COMMAND ${EXECUTABLE} ${FILE} ${ARGS} RESULT_VARIABLE RESULT)
 if (RESULT)
-	if (GDB_COMMAND AND GDB_SCRIPT)
-		execute_process(COMMAND ${GDB_COMMAND}
-			--command=${GDB_SCRIPT}
-			--args ${EXECUTABLE} ${FILE} ${ARGS}
-			RESULT_VARIABLE GDB_RESULT)
-	endif()
+	#if (GDB_COMMAND AND GDB_SCRIPT)
+	#	execute_process(COMMAND ${GDB_COMMAND}
+	#		--command=${GDB_SCRIPT}
+	#		--args ${EXECUTABLE} ${FILE} ${ARGS}
+	#			RESULT_VARIABLE GDB_RESULT)
+	#endif()
 endif()


CMake: PR changes pybind11

CMake: PR changes pybind11

--- cmake/pybind11.cmake
+++ cmake/pybind11.cmake
@@ -63,20 +63,6 @@

         set(_allPyBindWrappers "${_allPyBindWrappers};${target}" CACHE INTERNAL  "_allPyBindWrappers")

-        ## disable some warnings for MSVC builds
-        get_property(comp_opts TARGET ${target} PROPERTY COMPILE_OPTIONS)
-        # Specify warnings
-        if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
-            list(APPEND comp_opts "/wd4005") # macro redefinition    https://msdn.microsoft.com/en-us/library/8d10sc3w.aspx
-            list(APPEND comp_opts "/wd4201") # nameless struct/union https://msdn.microsoft.com/en-us/library/c89bw853.aspx
-            list(APPEND comp_opts "/wd4251") # needs dll-interface   https://msdn.microsoft.com/en-us/library/esew7y1w.aspx
-            list(APPEND comp_opts "/wd4505") # unreferenced funtion  https://msdn.microsoft.com/en-us/library/mt694070.aspx
-            if(MSVC_VERSION GREATER_EQUAL 1910)
-                list(APPEND comp_opts "/std:c++latest")
-                #list(APPEND comp_opts "/diagnostics:caret") not supporeted by cmake yet... https://developercommunity.visualstudio.com/content/problem/9385/cmakeliststxt-cannot-override-diagnosticsclassic-d.html
-            endif()
-        endif()
-        list(REMOVE_DUPLICATES comp_opts)
-        set_property(TARGET ${target} PROPERTY COMPILE_OPTIONS ${comp_opts})
+        ivw_define_standard_properties(${target})
     endif()
 endfunction()


Handle all plug-ins at once during CMake installation.

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -39,7 +39,7 @@
     MACRO(gp_item_default_embedded_path_override item default_embedded_path_var)
       GET_FILENAME_COMPONENT(_item_name \"\${item}\" NAME)
       GET_FILENAME_COMPONENT(_item_path \"\${item}\" PATH)
-      IF(_item_name MATCHES \"liborg\")
+      IF(_item_path MATCHES \"^\${CMAKE_INSTALL_PREFIX}/bin/plugins\")
         IF(APPLE)
           SET(full_path \"full_path-NOTFOUND\")
           MESSAGE(\"override: \${item}\")
@@ -56,17 +56,6 @@
           SET(\${default_embedded_path_var} \"\${_item_path}\")
         ENDIF()
       ENDIF()
-
-      #IF(_item_name MATCHES \"^liborg\")
-      #   IF(APPLE)
-      #     MESSAGE(\"override: \${item}\")
-      #     STRING(REPLACE
-      #        ${CMAKE_INSTALL_PREFIX}
-      #        @loader_path/../ \${default_embedded_path_var} \"\${_item_path}\" )
-      #   ELSE(APPLE)
-      #        SET(\${default_embedded_path_var} \"\${_item_path}\")
-      #   ENDIF(APPLE)
-      #ENDIF()
     ENDMACRO(gp_item_default_embedded_path_override)

     MACRO(gp_resolved_file_type_override file type)


COMP: Hierarchy file must never include itself.

The VTK_USE_NVCONTROL option places vtkRendering as one of its own
KIT_LIBS.  This caused the hierarchy build for Rendering to try to
read vtkRenderingHierarchy.txt, the very file that it was meant to
build.

--- CMake/vtkWrapHierarchy.cmake
+++ CMake/vtkWrapHierarchy.cmake
@@ -98,14 +98,16 @@
   SET(OTHER_HIERARCHY_FILES)
   FOREACH (TMP_LIB ${TMP_KIT_DEPENDS})
     STRING(REGEX REPLACE "vtk(.*)" "\\1" TMP_KIT "${TMP_LIB}")
-    STRING(TOUPPER "${TMP_KIT}" TMP_KIT_UPPER)
-    FOREACH (TMP_KIT_CHECK ${VTK_KITS})
-      STRING(REPLACE "_" "" TMP_KIT_CHECK_UPPER ${TMP_KIT_CHECK})
-      IF("${TMP_KIT_UPPER}" STREQUAL "${TMP_KIT_CHECK_UPPER}")
-        SET(OTHER_HIERARCHY_FILES ${OTHER_HIERARCHY_FILES}
-          "${quote}${VTK_BINARY_DIR}/${TMP_KIT}/vtk${TMP_KIT}Hierarchy.txt${quote}")
-      ENDIF("${TMP_KIT_UPPER}" STREQUAL "${TMP_KIT_CHECK_UPPER}")
-    ENDFOREACH (TMP_KIT_CHECK ${VTK_KITS})
+    IF(NOT "${TMP_KIT}" STREQUAL "${KIT}")
+      STRING(TOUPPER "${TMP_KIT}" TMP_KIT_UPPER)
+      FOREACH (TMP_KIT_CHECK ${VTK_KITS})
+        STRING(REPLACE "_" "" TMP_KIT_CHECK_UPPER ${TMP_KIT_CHECK})
+        IF("${TMP_KIT_UPPER}" STREQUAL "${TMP_KIT_CHECK_UPPER}")
+          SET(OTHER_HIERARCHY_FILES ${OTHER_HIERARCHY_FILES}
+            "${quote}${VTK_BINARY_DIR}/${TMP_KIT}/vtk${TMP_KIT}Hierarchy.txt${quote}")
+        ENDIF("${TMP_KIT_UPPER}" STREQUAL "${TMP_KIT_CHECK_UPPER}")
+      ENDFOREACH (TMP_KIT_CHECK ${VTK_KITS})
+    ENDIF(NOT "${TMP_KIT}" STREQUAL "${KIT}")
   ENDFOREACH (TMP_LIB ${TMP_KIT_DEPENDS})

   # Build the hierarchy file when the kit library is built, this


fix .pc file generation. closes #196

fix .pc file generation. closes #196

--- CMakeModules/OMPLUtils.cmake
+++ CMakeModules/OMPLUtils.cmake
@@ -36,21 +36,26 @@
         foreach(_lib ${_link_libs})
             get_filename_component(_basename ${_lib} NAME_WE)
             get_filename_component(_ext ${_lib} EXT)
-            # add link flags for dynamic libraries
-            if(_ext STREQUAL ${CMAKE_SHARED_LIBRARY_SUFFIX})
-                string(REPLACE ${CMAKE_SHARED_LIBRARY_PREFIX} "" _libname ${_basename})
-                list(APPEND _link_flags "-l${_libname}")
+            # add -lfoo to link flags
+            if (_lib MATCHES "-l.+")
+                list(APPEND _link_flags "${_lib}")
             else()
-                # OS X frameworks, which are also dynamic libraries
-                if (_ext STREQUAL ".framework")
-                    list(APPEND _link_flags "-framework ${_basename}")
+                # add link flags for dynamic libraries
+                if(_ext STREQUAL ${CMAKE_SHARED_LIBRARY_SUFFIX})
+                    string(REPLACE ${CMAKE_SHARED_LIBRARY_PREFIX} "" _libname ${_basename})
+                    list(APPEND _link_flags "-l${_libname}")
                 else()
-                    # libraries found by pkg-config are just returned as "foo",
-                    # not "libfoo.so".
-                    if(NOT _ext)
-                        list(FIND ARGV ${_basename} _index)
-                        if (_index EQUAL -1)
-                            list(APPEND _pkg_deps "${_basename}")
+                    # OS X frameworks, which are also dynamic libraries
+                    if (_ext STREQUAL ".framework")
+                        list(APPEND _link_flags "-framework ${_basename}")
+                    else()
+                        # libraries found by pkg-config are just returned as "foo",
+                        # not "libfoo.so".
+                        if(NOT _ext)
+                            list(FIND ARGV ${_basename} _index)
+                            if (_index EQUAL -1)
+                                list(APPEND _pkg_deps "${_basename}")
+                          endif()
                         endif()
                     endif()
                 endif()


ctkMacroCompilePythonScript - Do not convert INSTALL_DIR to a absolute path

Doing so will prepend the current directory to the relative path passed
to the macro and will install the files at the wrong location.

--- CMake/ctkMacroCompilePythonScript.cmake
+++ CMake/ctkMacroCompilePythonScript.cmake
@@ -36,7 +36,6 @@
   # consecutive slashes. Let's make sure there are no trailing slashes.
   get_filename_component(MY_SOURCE_DIR ${MY_SOURCE_DIR} REALPATH)
   get_filename_component(MY_DESTINATION_DIR ${MY_DESTINATION_DIR} REALPATH)
-  get_filename_component(MY_INSTALL_DIR ${MY_INSTALL_DIR} REALPATH)

   SET(input_python_files)
   SET(copied_python_files)


add 13.1 to list of supported versions

add 13.1 to list of supported versions

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -248,7 +248,7 @@
 		"gridMathematica Server")
 	# Mathematica product versions in order of preference
 	set (_MathematicaVersions
-		"13.0"
+		"13.1" "13.0"
 		"12.3" "12.2" "12.1" "12.0"
 		"11.3" "11.2" "11.1" "11.0"
 		"10.4" "10.3" "10.2" "10.1" "10.0"


BUG: Mantis-1474: try to remove system locations in OTB package

--- Packaging/post_install.cmake
+++ Packaging/post_install.cmake
@@ -17,6 +17,56 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
+function(sanitize_system_paths)
+  cmake_parse_arguments(SANITIZE  "" "SOURCE" "" ${ARGN} )
+  # does not support Windows ...
+  if(APPLE)
+    set(SHARED_EXT "\\.dylib")
+  elseif(UNIX)
+    set(SHARED_EXT "\\.so")
+  endif()
+  set(filtered_content)
+
+  file(STRINGS "${SANITIZE_SOURCE}" source_file_content NEWLINE_CONSUME)
+  string(REGEX REPLACE "\n" "\n;" source_file_content "${source_file_content}")
+  set(SEARCH_REGEX "(^[^#\"]+(LIBRARIES|INCLUDE_DIR[A-Z]*) +\")(.+)(\"[^\"]*)")
+
+  foreach(line ${source_file_content})
+    set(filtered_line "${line}")
+    if(line MATCHES "${SEARCH_REGEX}")
+      string(REGEX REPLACE "${SEARCH_REGEX}" "\\3" extract_str "${line}" )
+      string(REGEX REPLACE ";;" ";" extract_str "${extract_str}")
+      set(_to_be_removed)
+      set(_to_be_added)
+      foreach(path ${extract_str})
+        if(IS_ABSOLUTE ${path})
+          list(APPEND _to_be_removed "${path}")
+          if(NOT IS_DIRECTORY ${path})
+            if(path MATCHES "^.*/lib[^\\.]+${SHARED_EXT}.*")
+              string(REGEX REPLACE "^.*/lib([^\\.]+)${SHARED_EXT}.*" "\\1" _lib_name "${path}")
+              list(APPEND _to_be_added "${_lib_name}")
+            endif()
+          endif()
+        endif()
+      endforeach()
+      if(_to_be_removed)
+        list(REMOVE_ITEM extract_str ${_to_be_removed})
+      endif()
+      if(_to_be_added)
+        list(INSERT extract_str 0 ${_to_be_added})
+      endif()
+      if(extract_str)
+        list(REMOVE_DUPLICATES extract_str)
+      endif()
+      string(REGEX REPLACE "${SEARCH_REGEX}" "\\1${extract_str}\\4" filtered_line "${line}" )
+    endif()
+    list(APPEND filtered_content "${filtered_line}")
+  endforeach()
+
+  string(REGEX REPLACE "\n;" "\n" filtered_content "${filtered_content}")
+  file(WRITE "${SANITIZE_SOURCE}" "${filtered_content}")
+endfunction()

 #check variables are set
 foreach(var P_DIRS P_MATCH P_REPLACE)
@@ -42,5 +92,8 @@
       file(WRITE "${cmake_file}"  "# This file is modified by OTB after installation.
       \n${cmake_file_CONTENTS}")
     endif()
+    if(UNIX)
+      sanitize_system_paths(SOURCE ${cmake_file})
+    endif()
   endforeach() # foreach( cmake_file
 endforeach() # foreach( p_dir


wip: linking

wip: linking

--- testing/run_tests.sh.cmake
+++ testing/run_tests.sh.cmake
@@ -8,8 +8,9 @@
 # Author: Naoya Maruyama (naoya@matsulab.is.titech.ac.jp)

 # TODO:
-# - translation test
-# - execution test
+# - compilation
+# - linking
+# - execution

 ###############################################################
 WD=$PWD/test_output
@@ -57,25 +58,26 @@
 	src=$1
 	target=$2
 	echo compilation of $src for $target
-	src_file=$(basename $src .c).$target
-	echo $src_file
+	src_file_base=$(basename $src .c).$target
 	if [ "${MPI_ENABLED}" = "TRUE" ]; then
 		MPI_C_FLAGS="-pthread"
 		for mpiinc in $(echo "${MPI_INCLUDE_PATH}" | sed 's/;/ /g'); do
 			MPI_C_FLAGS+=" -I$mpiinc"
 		done
 	fi
+	LDFLAGS=-L${CMAKE_BINARY_DIR}/runtime
 	case $target in
 		ref)
-			src_file+=".c"
-			cc -c $src_file -I${CMAKE_SOURCE_DIR}/include $CFLAGS
+			src_file="$src_file_base".c
+			cc -c $src_file -I${CMAKE_SOURCE_DIR}/include $CFLAGS &&
+			c++ "$src_file_base".o -lphysis_rt_ref $LDFLAGS -o "$src_file_base".exe
 			;;
 		cuda)
 			if [ "${CUDA_ENABLED}" != "TRUE" ]; then
 				echo "[COMPILE] Skipping CUDA compilation (not supported)"
 				return 0
 			fi
-			src_file+=".cu"
+			src_file="$src_file_base".cu
 			nvcc -c $src_file -I${CMAKE_SOURCE_DIR}/include -Xcompiler $CFLAGS
 			;;
 		mpi)
@@ -83,7 +85,7 @@
 				echo "[COMPILE] Skipping MPI compilation (not supported)"
 				return 0
 			fi
-			src_file+=".c"
+			src_file="$src_file_base".c
 			cc -c $src_file -I${CMAKE_SOURCE_DIR}/include $MPI_C_FLAGS $CFLAGS
 			;;
 		mpi-cuda)
@@ -91,7 +93,7 @@
 				echo "[COMPILE] Skipping MPI-CUDA compilation (not supported)"
 				return 0
 			fi
-			src_file+=".cu"
+			src_file="$src_file_base".cu
 			nvcc -c $src_file -I${CMAKE_SOURCE_DIR}/include \
 				$MPI_C_FLAGS -Xcompiler $CFLAGS
 			;;


Fixed GLEW library include

Fixed GLEW library include

--- CMakeModules/KlamptDependencies.cmake
+++ CMakeModules/KlamptDependencies.cmake
@@ -148,7 +148,7 @@
   FIND_PACKAGE(GLEW)
   IF(GLEW_FOUND)
     SET(KLAMPT_DEFINITIONS ${KLAMPT_DEFINITIONS} -DHAVE_GLEW=1)
-    SET(KLAMPT_LIBRARIES ${KLAMPT_LIBRARIES} GLEW)
+    SET(KLAMPT_LIBRARIES ${KLAMPT_LIBRARIES} ${GLEW_LIBRARY})
   ELSE(GLEW_FOUND)
     SET(KLAMPT_DEFINITIONS ${KLAMPT_DEFINITIONS} -DHAVE_GLEW=0)
   ENDIF(GLEW_FOUND)


More work for DEV-41722 normalizing shared lib staging on all 3 platforms. Started refactoring Copy3rdPartyLibs.cmake to use common commands with platform specific variables.

--- indra/cmake/Copy3rdPartyLibs.cmake
+++ indra/cmake/Copy3rdPartyLibs.cmake
@@ -7,6 +7,10 @@
 include(CMakeCopyIfDifferent)

 if(WINDOWS)
+    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug")
+    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
+    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release")
+
 #*******************************
 # VIVOX - *NOTE: no debug version
 set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32")
@@ -17,32 +21,11 @@
     ortp.dll
     wrap_oal.dll
     )
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR}/Debug"
-    out_targets
-   ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR}/Release"
-    out_targets
-    ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${vivox_src_dir}
-    "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo"
-    out_targets
-    ${vivox_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})

 #*******************************
 # Misc shared libs
+
+# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
 set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
 set(debug_files
     openjpegd.dll
@@ -51,6 +34,17 @@
     libaprutil-1.dll
     libapriconv-1.dll
     )
+
+# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
+set(release_files
+    openjpeg.dll
+    libtcmalloc_minimal.dll
+    libapr-1.dll
+    libaprutil-1.dll
+    libapriconv-1.dll
+    )
+
 if (FMOD_SDK_DIR)
     set(fmod_files fmod.dll)
     copy_if_different(
@@ -76,38 +70,6 @@
     set(all_targets ${all_targets} ${out_targets})
 endif (FMOD_SDK_DIR)

-copy_if_different(
-    ${debug_src_dir}
-    "${SHARED_LIB_STAGING_DIR}/Debug"
-    out_targets
-    ${debug_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
-set(release_files
-    openjpeg.dll
-    libtcmalloc_minimal.dll
-    libapr-1.dll
-    libaprutil-1.dll
-    libapriconv-1.dll
-    )
-
-copy_if_different(
-    ${release_src_dir}
-    "${SHARED_LIB_STAGING_DIR}/Release"
-    out_targets
-    ${release_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})
-
-copy_if_different(
-    ${release_src_dir}
-    "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo"
-    out_targets
-    ${release_files}
-    )
-set(third_party_targets ${third_party_targets} ${out_targets})

 #*******************************
 # LLKDU
@@ -115,33 +77,33 @@
 if(NOT EXISTS ${internal_llkdu_path})
     if (EXISTS "${debug_src_dir}/llkdu.dll")
         set(debug_llkdu_src "${debug_src_dir}/llkdu.dll")
-        set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Debug/llkdu.dll")
+        set(debug_llkdu_dst "${SHARED_LIB_STAGING_DIR_DEBUG}/llkdu.dll")
         ADD_CUSTOM_COMMAND(
             OUTPUT  ${debug_llkdu_dst}
             COMMAND ${CMAKE_COMMAND} -E copy_if_different ${debug_llkdu_src} ${debug_llkdu_dst}
             DEPENDS ${debug_llkdu_src}
-            COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Debug"
+            COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_DEBUG}"
             )
         set(third_party_targets ${third_party_targets} $} ${debug_llkdu_dst})
     endif (EXISTS "${debug_src_dir}/llkdu.dll")

     if (EXISTS "${release_src_dir}/llkdu.dll")
         set(release_llkdu_src "${release_src_dir}/llkdu.dll")
-        set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR}/Release/llkdu.dll")
+        set(release_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELEASE}/llkdu.dll")
         ADD_CUSTOM_COMMAND(
             OUTPUT  ${release_llkdu_dst}
             COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${release_llkdu_dst}
             DEPENDS ${release_llkdu_src}
-            COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/Release"
+            COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELEASE}"
             )
         set(third_party_targets ${third_party_targets} ${release_llkdu_dst})

-        set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/llkdu.dll")
+        set(relwithdebinfo_llkdu_dst "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}/llkdu.dll")
         ADD_CUSTOM_COMMAND(
             OUTPUT  ${relwithdebinfo_llkdu_dst}
             COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${relwithdebinfo_llkdu_dst}
             DEPENDS ${release_llkdu_src}
-            COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo"
+            COMMENT "Copying llkdu.dll ${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
             )
         set(third_party_targets ${third_party_targets} ${relwithdebinfo_llkdu_dst})
     endif (EXISTS "${release_src_dir}/llkdu.dll")
@@ -168,7 +130,7 @@

         copy_if_different(
             ${debug_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR}/Debug"
+            "${SHARED_LIB_STAGING_DIR_DEBUG}"
             out_targets
             ${debug_msvc8_files}
             )
@@ -192,7 +154,7 @@

         copy_if_different(
             ${release_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR}/Release"
+            "${SHARED_LIB_STAGING_DIR_RELEASE}"
             out_targets
             ${release_msvc8_files}
             )
@@ -200,7 +162,7 @@

         copy_if_different(
             ${release_msvc8_redist_path}
-            "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo"
+            "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
             out_targets
             ${release_msvc8_files}
             )
@@ -210,12 +172,95 @@
 endif (MSVC80)

 elseif(DARWIN)
-
+    set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/universal-darwin")
+    set(vivox_files
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/debug")
+    set(debug_files
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/release")
+    set(release_files
+       )
 elseif(LINUX)
-
+    set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
+    set(vivox_files
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
+    set(debug_files
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
+    set(release_files
+       )
 else(WINDOWS)
     message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
+    set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
+    set(vivox_files
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
+    set(debug_files
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
+    set(release_files
+       )
 endif(WINDOWS)
+
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_DEBUG}"
+    out_targets
+   ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELEASE}"
+    out_targets
+    ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${vivox_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+    out_targets
+    ${vivox_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+
+
+copy_if_different(
+    ${debug_src_dir}
+    "${SHARED_LIB_STAGING_DIR_DEBUG}"
+    out_targets
+    ${debug_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${release_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELEASE}"
+    out_targets
+    ${release_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+
+copy_if_different(
+    ${release_src_dir}
+    "${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
+    out_targets
+    ${release_files}
+    )
+set(third_party_targets ${third_party_targets} ${out_targets})
+

 add_custom_target(stage_third_party_libs ALL
   DEPENDS


ENH: update ITKExamples remote module version

--- Modules/Remote/SphinxExamples.remote.cmake
+++ Modules/Remote/SphinxExamples.remote.cmake
@@ -2,5 +2,5 @@
 itk_fetch_module(SphinxExamples
   "This module builds the examples found at https://itk.org/ITKExamples/"
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKExamples.git
-  GIT_TAG 29b93b310bff5d68eec3235cb3f067b631498de5
+  GIT_TAG a3799deceb572852281d7294bbb5f7a6dc0c0117
   )


[efi bootloader] Link common/*.c in the EFI bootloader

--- bootloader/efi/GenericBuild.cmake
+++ bootloader/efi/GenericBuild.cmake
@@ -6,6 +6,7 @@
 set(
    COMPILE_FLAGS_LIST

+   -DSTATIC_EXOS_ASM_STRING
    -DEFI_FUNCTION_WRAPPER
    -DNO_EXOS_ASSERT
    -DNO_EXOS_STATIC_WRAPPER
@@ -45,12 +46,15 @@
    --target=efi-app-${EFI_ARCH}
 )

+file(GLOB COMMON_SOURCES "${CMAKE_SOURCE_DIR}/common/*.c")
+
 add_library(

    efi_app_${EFI_ARCH}
    SHARED

    ${SOURCES}
+   ${COMMON_SOURCES}
 )

 set_target_properties(


Fixed whitelist path variable names.

Fixed whitelist path variable names.

--- CMake/mitkFunctionWhitelists.cmake
+++ CMake/mitkFunctionWhitelists.cmake
@@ -81,14 +81,14 @@
 function(mitkFunctionFindWhitelists)
   set(whitelists "None")

-  file(GLOB internalWhitelistFiles "${MITK_WHITELISTS_INTERNAL_PATH}/*.cmake")
+  file(GLOB internalWhitelistFiles "${${ARGV0}_WHITELISTS_INTERNAL_PATH}/*.cmake")

   foreach(whitelistFile "${internalWhitelistFiles}")
     get_filename_component(whitelistFile "${whitelistFile}" NAME_WE)
     list(APPEND whitelists "${whitelistFile}")
   endforeach()

-  file(GLOB externalWhitelistFiles "${MITK_WHITELISTS_EXTERNAL_PATH}/*.cmake")
+  file(GLOB externalWhitelistFiles "${${ARGV0}_WHITELISTS_EXTERNAL_PATH}/*.cmake")

   foreach(whitelistFile "${externalWhitelistFiles}")
     get_filename_component(whitelistFile "${whitelistFile}" NAME_WE)


Squashed '3rdparty/github/lua534/' changes from 38da7d89..a84dcf47

a84dcf47 Merge commit '095ab9d1fa939214adc82a49946266dae1a625f7' [ci skip]
095ab9d1 Squashed '3rdparty/github/cmake-utils/' changes from 890b1bb..ee0bf6c

git-subtree-dir: 3rdparty/github/lua534
git-subtree-split: a84dcf477ea505c8b4df056191fc49d15ecc2ebf

--- 3rdparty/github/cmake-utils/cmake/MyPackageDependency.cmake
+++ 3rdparty/github/cmake-utils/cmake/MyPackageDependency.cmake
@@ -1,6 +1,6 @@
 MACRO (MYPACKAGEDEPENDENCY packageDepend packageDependSourceDir)
   #
-  # Optional argument: TESTS, LIBS, EXES, SYSTEM, LOCAL
+  # Optional argument: TESTS, LIBS, EXES, SYSTEM, LOCAL (forces ALL_IN_ONE for this dependency), STATIC
   #
   IF (ALL_IN_ONE)
     SET (_ALL_IN_ONE TRUE)
@@ -11,6 +11,7 @@
   SET (_TESTS FALSE)
   SET (_LIBS FALSE)
   SET (_EXES FALSE)
+  SET (_STATIC FALSE)
   FOREACH (_var ${ARGN})
     IF (${_var} STREQUAL TESTS)
       IF (MYPACKAGE_DEBUG)
@@ -45,6 +46,12 @@
         MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} local mode")
       ENDIF ()
       SET (_ALL_IN_ONE TRUE)
+    ENDIF ()
+    IF (${_var} STREQUAL STATIC)
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} static mode")
+      ENDIF ()
+      SET (_STATIC TRUE)
     ENDIF ()
   ENDFOREACH ()
   IF (_ALL)
@@ -148,15 +155,30 @@
       MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Inspecting target candidate ${_target}")
     ENDIF ()
     IF (TARGET ${_target})
+      #
+      # Static mode ?
+      #
+      IF (_STATIC)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding -D${packageDepend}_static compile definition to target ${_target}")
+        ENDIF ()
+        TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC -D${packageDepend}_static)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency becomes ${packageDepend}_static for target ${_target}")
+        ENDIF ()
+        SET (realPackageDepend ${packageDepend}_static)
+      ELSE ()
+        SET (realPackageDepend ${packageDepend})
+      ENDIF ()
       IF (_ALL_IN_ONE)
         #
         # Dependency by target
         #
-        IF (TARGET ${packageDepend})
-          IF (MYPACKAGE_DEBUG)
-            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding target ${packageDepend} dependency to target ${_target}")
-          ENDIF ()
-          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${packageDepend})
+        IF (TARGET ${realPackageDepend})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding target ${realPackageDepend} dependency to target ${_target}")
+          ENDIF ()
+          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${realPackageDepend})
           IF (_TESTS)
             #
             # A bit painful but the target locations are not known at this time.
@@ -164,17 +186,17 @@
             #
             GET_PROPERTY(_targets_for_test_set GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST)
             IF (NOT _targets_for_test_set)
-              SET (_targets_for_test ${packageDepend})
+              SET (_targets_for_test ${realPackageDepend})
               IF (MYPACKAGE_DEBUG)
-                MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initialized MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST with ${packageDepend}")
+                MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initialized MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST with ${realPackageDepend}")
               ENDIF ()
               SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST ${_targets_for_test})
             ELSE ()
-              LIST (FIND _targets_for_test ${packageDepend} _targets_for_test_found)
+              LIST (FIND _targets_for_test ${realPackageDepend} _targets_for_test_found)
               IF (${_targets_for_test_found} EQUAL -1)
-                LIST (APPEND _targets_for_test ${packageDepend})
+                LIST (APPEND _targets_for_test ${realPackageDepend})
                 IF (MYPACKAGE_DEBUG)
-                  MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Appended MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST with ${packageDepend}")
+                  MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Appended MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST with ${realPackageDepend}")
                 ENDIF ()
                 SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST ${_targets_for_test})
               ENDIF ()


[CMake] Fix a typo in add_compiler_rt_library.

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -196,7 +196,7 @@
     endif()
   endforeach()
   if(LIB_PARENT_TARGET)
-    add_dependencies(${LIB_PARENT_TARGET} ${libname})
+    add_dependencies(${LIB_PARENT_TARGET} ${libnames})
   endif()
 endfunction()


update

update

--- cmake/SetupProjectVariables.cmake
+++ cmake/SetupProjectVariables.cmake
@@ -46,8 +46,8 @@
   SET(GLI_INCLUDE_DIR "~/Projects/others/gli-regnirpsj-git")

   # OGL+
-  # SET(OGLplus_ROOT_DIR "~/Projects/others/oglplus-develop-git/_install")
-  SET(OGLplus_ROOT_DIR "~/Projects/others/oglplus-regnirpsj-git/_install")
+  SET(OGLplus_ROOT_DIR "~/Projects/others/oglplus-develop-git/_install")
+  # SET(OGLplus_ROOT_DIR "~/Projects/others/oglplus-regnirpsj-git/_install")
 ENDIF()

 IF(WIN32 OR WIN64)


Show actual path to which headers are copied in information message

Fixes ROOT-9047.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -856,7 +856,7 @@
       add_custom_command(
         OUTPUT ${dst}
         COMMAND ${CMAKE_COMMAND} -E copy ${src} ${dst}
-        COMMENT "Copying header ${src} to /include"
+        COMMENT "Copying header ${src} to ${CMAKE_BINARY_DIR}/include"
         DEPENDS ${src})
       list(APPEND dst_list ${dst})
     endforeach()


fdatasync() is not defined on some FreeBSD and Darwin systems.

--- include/tarantool/config.h.cmake
+++ include/tarantool/config.h.cmake
@@ -57,6 +57,10 @@
  * Defined if fdatasync(2) call is present.
  */
 #cmakedefine HAVE_FDATASYNC 1
+
+#ifndef HAVE_FDATASYNC
+	#define fdatasync fsync
+#endif
 /*
  * Defined if this platform has GNU specific memmem().
  */


fix compiler flags for clang and icc

fix compiler flags for clang and icc

also fix that icc uses SYSTEM correctly

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -30,14 +30,19 @@

 	#not supported by icc:
 	set (EXTRA_FLAGS "${EXTRA_FLAGS} -Wno-deprecated-declarations")
+	set (EXTRA_FLAGS "${EXTRA_FLAGS} -Wno-ignored-qualifiers")
+
 	message (STATUS "Clang detected")
 endif()

 if (CMAKE_COMPILER_IS_GNUCXX)
 	#not supported by icc:
 	set (EXTRA_FLAGS "${EXTRA_FLAGS} -Wno-deprecated-declarations")
-	#not supported by clang:
+	set (EXTRA_FLAGS "${EXTRA_FLAGS} -Wno-ignored-qualifiers")
+
+	#not supported by icc/clang:
 	set (CXX_EXTRA_FLAGS "${CXX_EXTRA_FLAGS} -Wstrict-null-sentinel")
+
 	message (STATUS "GCC detected")
 endif (CMAKE_COMPILER_IS_GNUCXX)

@@ -50,9 +55,10 @@
 	#statically link in libimf.so libsvml.so libirng.so libintlc.so.5
 	#and fix warning #10237: -lcilkrts linked in dynamically, # static library not available
 	set (EXTRA_FLAGS "${EXTRA_FLAGS} -static-intel -wd10237")
-	#not supported by clang:
-	set (CXX_EXTRA_FLAGS "${CXX_EXTRA_FLAGS} -Wstrict-null-sentinel")
 	message (STATUS "ICC detected")
+
+	# cmake bug: cmake thinks Intel does not know isystem
+	set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
 endif ()

@@ -67,7 +73,6 @@
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wshadow")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wcomments -Wtrigraphs -Wundef")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wuninitialized")
-set (COMMON_FLAGS "${COMMON_FLAGS} -Wno-ignored-qualifiers")

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


add -Winit-self

add -Winit-self

docu is unclear if its enabled with -Wall

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -84,7 +84,7 @@
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wformat-security")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wshadow")
 set (COMMON_FLAGS "${COMMON_FLAGS} -Wcomments -Wtrigraphs -Wundef")
-set (COMMON_FLAGS "${COMMON_FLAGS} -Wuninitialized")
+set (COMMON_FLAGS "${COMMON_FLAGS} -Wuninitialized -Winit-self -Wmaybe-uninitialized")

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


clang doesn't support -Wstrict-null-sentinel

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -36,6 +36,8 @@
 if (CMAKE_COMPILER_IS_GNUCXX)
 	#not supported by icc:
 	set (EXTRA_FLAGS "${EXTRA_FLAGS} -Wno-deprecated-declarations")
+	#not supported by clang:
+	set (CXX_EXTRA_FLAGS "${CXX_EXTRA_FLAGS} -Wstrict-null-sentinel")
 	message (STATUS "GCC detected")
 endif (CMAKE_COMPILER_IS_GNUCXX)

@@ -48,6 +50,8 @@
 	#statically link in libimf.so libsvml.so libirng.so libintlc.so.5
 	#and fix warning #10237: -lcilkrts linked in dynamically, # static library not available
 	set (EXTRA_FLAGS "${EXTRA_FLAGS} -static-intel -wd10237")
+	#not supported by clang:
+	set (CXX_EXTRA_FLAGS "${CXX_EXTRA_FLAGS} -Wstrict-null-sentinel")
 	message (STATUS "ICC detected")
 endif ()

@@ -79,7 +83,7 @@
 # Merge all flags
 #
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_STD} ${EXTRA_FLAGS} ${COMMON_FLAGS} -Wsign-compare -Wfloat-equal -Wformat-security")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STD} ${EXTRA_FLAGS} ${COMMON_FLAGS} -Wno-missing-field-initializers -Wstrict-null-sentinel")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STD} ${EXTRA_FLAGS} ${CXX_EXTRA_FLAGS} ${COMMON_FLAGS} -Wno-missing-field-initializers")

 message (STATUS "C flags are ${CMAKE_C_FLAGS}")
 message (STATUS "CXX flags are ${CMAKE_CXX_FLAGS}")


Change "GDK" to "GDK4" in FindGDK4

Change "GDK" to "GDK4" in FindGDK4

--- cmake/Modules/FindGDK4.cmake
+++ cmake/Modules/FindGDK4.cmake
@@ -1,110 +1,111 @@
 # Find GDK 4.x library and headers.
-#
+#
 # Defined variables:
-#
-#   GDK_FOUND
-#   GDK_LIBRARY_DIRS
-#   GDK_LIBRARY (cached)
-#   GDK_LIBRARY_DEBUG
-#   GDK_LIBRARY_RELEASE
-#   GDK_LIBRARIES
-#   GDK_INCLUDE_DIR (cached)
-#   GDK_INCLUDE_DIRS
-#   GDK_VERSION
-#   GDK_VERSION_MAJOR
-#   GDK_VERSION_MINOR
-#   GDK_VERSION_PATCH
-#   GDK_VERSION_TWEAK
-#
+#
+#   GDK4_FOUND
+#   GDK4_LIBRARY_DIRS
+#   GDK4_LIBRARY (cached)
+#   GDK4_LIBRARY_DEBUG
+#   GDK4_LIBRARY_RELEASE
+#   GDK4_LIBRARIES
+#   GDK4_INCLUDE_DIR (cached)
+#   GDK4_INCLUDE_DIRS
+#   GDK4_VERSION
+#   GDK4_VERSION_MAJOR
+#   GDK4_VERSION_MINOR
+#   GDK4_VERSION_PATCH
+#   GDK4_VERSION_TWEAK
+#
 # Using this module:
-#
-#   find_package(GDK VERSION 3.2.1)
-#   if(GDK_FOUND)
-#     include_directories(${GDK_INCLUDE_DIRS})
-#     target_link_libraries(foo ${Sampgdk_LIBRARIES})
+#
+#   find_package(GDK4 VERSION 3.2.1)
+#   if(GDK4_FOUND)
+#     include_directories(${GDK4_INCLUDE_DIRS})
+#     target_link_libraries(foo ${GDK4_LIBRARIES})
 #   endif()

 include(FindPackageHandleStandardArgs)

-find_path(GDK_INCLUDE_DIR NAMES "sampgdk/version.h")
+find_path(GDK4_INCLUDE_DIR NAMES "sampgdk/version.h")

-find_library(GDK_LIBRARY_DEBUG NAMES "sampgdk4_d" "sampgdk_d")
-find_library(GDK_LIBRARY_RELEASE NAMES "sampgdk4" "sampgdk")
+find_library(GDK4_LIBRARY_DEBUG   NAMES "sampgdk4_d" "sampgdk_d")
+find_library(GDK4_LIBRARY_RELEASE NAMES "sampgdk4"   "sampgdk")

-if(GDK_LIBRARY_DEBUG AND GDK_LIBRARY_RELEASE)
+if(GDK4_LIBRARY_DEBUG AND GDK4_LIBRARY_RELEASE)
   if(CMAKE_CONFIGURATIONS OR CMAKE_BUILD_TYPE)
-    set(GDK_LIBRARY debug ${GDK_LIBRARY_DEBUG} optimized ${GDK_LIBRARY_RELEASE})
+    set(GDK4_LIBRARY debug     ${GDK4_LIBRARY_DEBUG}
+                     optimized ${GDK4_LIBRARY_RELEASE})
   else()
-    set(GDK_LIBRARY ${GDK_LIBRARY_RELEASE})
+    set(GDK4_LIBRARY ${GDK4_LIBRARY_RELEASE})
   endif()
 endif()

-if(GDK_LIBRARY_DEBUG AND NOT GDK_LIBRARY_RELEASE)
-  set(GDK_LIBRARY         ${GDK_LIBRARY_DEBUG})
-  set(GDK_LIBRARY_RELEASE ${GDK_LIBRARY_DEBUG})
+if(GDK4_LIBRARY_DEBUG AND NOT GDK4_LIBRARY_RELEASE)
+  set(GDK4_LIBRARY         ${GDK4_LIBRARY_DEBUG})
+  set(GDK4_LIBRARY_RELEASE ${GDK4_LIBRARY_DEBUG})
 endif()

-if(GDK_LIBRARY_RELEASE AND NOT GDK_LIBRARY_DEBUG)
-  set(GDK_LIBRARY         ${GDK_LIBRARY_RELEASE})
-  set(GDK_LIBRARY_DEBUG   ${GDK_LIBRARY_RELEASE})
+if(GDK4_LIBRARY_RELEASE AND NOT GDK4_LIBRARY_DEBUG)
+  set(GDK4_LIBRARY         ${GDK4_LIBRARY_RELEASE})
+  set(GDK4_LIBRARY_DEBUG   ${GDK4_LIBRARY_RELEASE})
 endif()

-set(GDK_LIBRARY ${GDK_LIBRARY} CACHE FILEPATH "GDK library")
-set(GDK_INCLUDE_DIR ${GDK_INCLUDE_DIR} CACHE PATH "GDK include directory")
+set(GDK4_LIBRARY ${GDK4_LIBRARY} CACHE FILEPATH "GDK library")
+set(GDK4_INCLUDE_DIR ${GDK4_INCLUDE_DIR} CACHE PATH "GDK include directory")

 mark_as_advanced(
-  GDK_LIBRARY_DIRS
-  GDK_LIBRARY
-  GDK_LIBRARY_DEBUG
-  GDK_LIBRARY_RELEASE
-  GDK_INCLUDE_DIR
+  GDK4_LIBRARY_DIRS
+  GDK4_LIBRARY
+  GDK4_LIBRARY_DEBUG
+  GDK4_LIBRARY_RELEASE
+  GDK4_INCLUDE_DIR
 )

-foreach(lib IN LISTS GDK_LIBRARY)
+foreach(lib IN LISTS GDK4_LIBRARY)
   get_filename_component(path "${lib}" PATH)
-  list(APPEND GDK_LIBRARY_DIRS "${path}")
+  list(APPEND GDK4_LIBRARY_DIRS "${path}")
 endforeach()

-if(GDK_LIBRARY_DIRS)
-  list(REMOVE_DUPLICATES GDK_LIBRARY_DIRS)
+if(GDK4_LIBRARY_DIRS)
+  list(REMOVE_DUPLICATES GDK4_LIBRARY_DIRS)
 endif()

-set(GDK_LIBRARIES ${GDK_LIBRARY})
-set(GDK_INCLUDE_DIRS ${GDK_INCLUDE_DIR})
+set(GDK4_LIBRARIES ${GDK4_LIBRARY})
+set(GDK4_INCLUDE_DIRS ${GDK4_INCLUDE_DIR})

 mark_as_advanced(
-  GDK_LIBRARIES
-  GDK_INCLUDE_DIRS
+  GDK4_LIBRARIES
+  GDK4_INCLUDE_DIRS
 )

 function(get_version name text)
   string(REGEX MATCH "#define[   ]+SAMPGDK_VERSION_${name}[   ]+[0-9]+" match "${text}")
   if(match)
     string(REGEX REPLACE ".* ([0-9]+)" "\\1" number "${match}")
-    set(GDK_VERSION_${name} ${number} PARENT_SCOPE)
+    set(GDK4_VERSION_${name} ${number} PARENT_SCOPE)
   endif()
 endfunction()

-if(GDK_INCLUDE_DIR)
-  file(READ "${GDK_INCLUDE_DIR}/sampgdk/version.h" text)
+if(GDK4_INCLUDE_DIR)
+  file(READ "${GDK4_INCLUDE_DIR}/sampgdk/version.h" text)

   get_version(MAJOR "${text}")
   get_version(MINOR "${text}")
   get_version(PATCH "${text}")
   get_version(TWEAK "${text}")

-  if(NOT GDK_VERSION_TWEAK OR GDK_VERSION_TWEAK EQUAL 0)
-    if(NOT GDK_VERSION_PATCH OR GDK_VERSION_PATCH EQUAL 0)
-      set(GDK_VERSION "${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}")
+  if(NOT GDK4_VERSION_TWEAK OR GDK4_VERSION_TWEAK EQUAL 0)
+    if(NOT GDK4_VERSION_PATCH OR GDK4_VERSION_PATCH EQUAL 0)
+      set(GDK4_VERSION "${GDK4_VERSION_MAJOR}.${GDK4_VERSION_MINOR}")
     else()
-      set(GDK_VERSION "${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}")
+      set(GDK4_VERSION "${GDK4_VERSION_MAJOR}.${GDK4_VERSION_MINOR}.${GDK4_VERSION_PATCH}")
     endif()
   else()
-    set(GDK_VERSION "${GDK_VERSION_MAJOR}.${GDK_VERSION_MINOR}.${GDK_VERSION_PATCH}.${GDK_VERSION_TWEAK}")
+    set(GDK4_VERSION "${GDK4_VERSION_MAJOR}.${GDK4_VERSION_MINOR}.${GDK4_VERSION_PATCH}.${GDK4_VERSION_TWEAK}")
   endif()
 endif()

-find_package_handle_standard_args(GDK REQUIRED_VARS GDK_INCLUDE_DIRS
-                                                    GDK_LIBRARY_DIRS
-                                                    GDK_LIBRARIES
-                                  VERSION_VAR GDK_VERSION)
+find_package_handle_standard_args(GDK4 REQUIRED_VARS GDK4_INCLUDE_DIRS
+                                                     GDK4_LIBRARY_DIRS
+                                                     GDK4_LIBRARIES
+                                  VERSION_VAR GDK4_VERSION)


Added cvconfig.h copy during the build

Added cvconfig.h copy during the build

--- cmake/OpenCVGenHeaders.cmake
+++ cmake/OpenCVGenHeaders.cmake
@@ -1,5 +1,6 @@
 # platform-specific config file
 configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
+configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/cvconfig.h.in" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/cvconfig.h")
 install(FILES "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" DESTINATION ${OPENCV_INCLUDE_INSTALL_PATH}/opencv2 COMPONENT dev)

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


Fixed a typo

Fixed a typo

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -107,7 +107,7 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2 -msse3 -mssse3")
   IF(NOT CYGWIN)
-	  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" -fPIC)
+	  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
   ENDIF(NOT CYGWIN)

   SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")


OSX push a requirement mismatch error

OSX push a requirement mismatch error

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -169,6 +169,7 @@

 	if(${MAC_SYS} MATCHES 14)
 		set(OSX_SYSTEM 10.10)
+		cmake_minimum_required(VERSION 3.0.0) # throw an error here, older cmake cannot handle 2 digit subversion !
 	elseif(${MAC_SYS} MATCHES 13)
 		set(OSX_SYSTEM 10.9)
 	elseif(${MAC_SYS} MATCHES 12)


Fixing FindTPLMOAB.cmake to local MOABConfig.cmake

--- cmake/TPLs/FindTPLMOAB.cmake
+++ cmake/TPLs/FindTPLMOAB.cmake
@@ -1,3 +1,48 @@
+IF(MOAB_LIBRARY_DIRS)
+  SET(MOAB_LIBRARY_DIR ${MOAB_LIBRARY_DIRS})
+  SET(MOAB_DIR ${MOAB_LIBRARY_DIRS})
+ENDIF()
+
+IF(TPL_MOAB_LIBRARY_DIRS)
+  SET(MOAB_LIBRARY_DIR ${TPL_MOAB_LIBRARY_DIRS})
+  SET(MOAB_DIR ${TPL_MOAB_LIBRARY_DIRS})
+ENDIF()
+
+IF(MOAB_INCLUDE_DIRS)
+  SET(MOAB_INCLUDE_DIR ${MOAB_INCLUDE_DIRS})
+ENDIF()
+
+IF(TPL_MOAB_INCLUDE_DIRS)
+  SET(MOAB_INCLUDE_DIR ${TPL_MOAB_INCLUDE_DIRS})
+ENDIF()
+
+IF(TPL_MOAB_LIBRARIES)
+  SET(MOAB_LIBRARIES ${TPL_MOAB_LIBRARIES})
+ENDIF()
+
+FIND_PACKAGE(MOAB)
+
+IF(MOAB_FOUND)
+
+  IF(NOT(MOAB_INCLUDE_DIRS))
+    SET(MOAB_INCLUDE_DIRS ${MOAB_INCLUDES})
+  ENDIF()
+
+  IF(NOT(MOAB_LIBRARY_DIRS))
+    SET(MOAB_LIBRARY_DIRS ${MOAB_LIBRARY_DIR})
+  ENDIF()
+
+  IF(NOT(TPL_MOAB_INCLUDE_DIRS))
+    ADVANCED_SET(TPL_MOAB_INCLUDE_DIRS ${MOAB_INCLUDE_DIRS} CACHE PATH
+      "Set inside of FindTPLMOAB.cmake")
+  ENDIF()
+
+  IF(NOT(TPL_MOAB_LIBRARY_DIRS))
+    SET(TPL_MOAB_LIBRARY_DIRS ${MOAB_LIBRARY_DIRS})
+  ENDIF()
+
+ENDIF()
+
 TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES(
   MOAB
   REQUIRED_HEADERS MBInterface.hpp MBParallelComm.hpp


build: append to the computed c_compile_flags

Adjust the `c_compile_flags` variable to ensure that the flags are ordered
correctly.  This is of import for the android build which may end up using
invalid header search path ordering otherwise.  This ensures that the path
for the ICU includes comes after the C++ headers which is necessary in new
C++ releases which shadow math.h

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1209,13 +1209,21 @@
        NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/include" AND
        NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
        NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
-     target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}")
+     if(SWIFT_COMPILER_IS_MSVC_LIKE)
+       list(APPEND c_compile_flags -I;${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE})
+     else()
+       list(APPEND c_compile_flags -isystem;${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE})
+     endif()
     endif()
     if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "" AND
        NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/include" AND
        NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
        NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
-     target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}")
+     if(SWIFT_COMPILER_IS_MSVC_LIKE)
+       list(APPEND c_compile_flags -I;${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE})
+     else()
+       list(APPEND c_compile_flags -isystem;${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE})
+     endif()
     endif()
   endif()