added full printf capabilities

added full printf capabilities

--- modules/Arduino.cmake
+++ modules/Arduino.cmake
@@ -10,13 +10,14 @@
 enable_language(ASM)

 # C only fine tunning
-set(TUNING_FLAGS "-Wl,--gc-sections -ffunction-sections -fdata-sections -fno-tree-scev-cprop -flto -fno-fat-lto-objects")
+set(TUNING_FLAGS "-Wl,-u,vfprintf -Wl,--gc-sections -ffunction-sections -fdata-sections -fno-tree-scev-cprop -flto -fno-fat-lto-objects")
 set(WARNING_FLAGS "-Wall -pedantic -Werror")

 # Compilation flags
 set(CMAKE_ASM_FLAGS "-mmcu=${ARDUINO_MCU} -DF_CPU=${ARDUINO_FCPU} -DARDUINO_ARCH_AVR ${ARDUINO_BOARD_DEFINES}")
 set(CMAKE_CXX_FLAGS "${CMAKE_ASM_FLAGS} ${TUNING_FLAGS} -fuse-linker-plugin -fno-threadsafe-statics ${WARNING_FLAGS} -std=gnu++14 -Os")
 set(CMAKE_C_FLAGS "${CMAKE_ASM_FLAGS} ${TUNING_FLAGS} -fno-fat-lto-objects ${WARNING_FLAGS} --std=gnu99 -Os")
+set(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lprintf_flt -lm" )

 # Find arduino root path
 if(ARDUINO_ROOT)


libass: add missing iconv dependency

libass: add missing iconv dependency

--- packages/libass.cmake
+++ packages/libass.cmake
@@ -10,6 +10,7 @@
         freetype2
         ${ASS_USE_FONTCONFIG}
         fribidi
+        libiconv
     GIT_REPOSITORY "https://github.com/libass/libass.git"
     GIT_TAG fonts
     UPDATE_COMMAND ""


ENH: Use new stream selection cmake

ENH: Use new stream selection cmake

--- CMake/vtkSelectStreamsLibrary.cmake
+++ CMake/vtkSelectStreamsLibrary.cmake
@@ -5,56 +5,58 @@
 # Macro to select whether to use old streams or ANSI streams.
 # Argument is the variable to set with the result (VTK_USE_ANSI_STDLIB).
 MACRO(VTK_SELECT_STREAMS_LIBRARY var)
-  CHECK_INCLUDE_FILE_CXX("iosfwd" VTK_HAVE_ANSI_STREAMS)
-  CHECK_INCLUDE_FILE_CXX("iostream.h" VTK_HAVE_OLD_STREAMS)
-  IF(VTK_HAVE_OLD_STREAMS)
-    # Some compilers have iostream.h but not strstream.h
-    # or strstrea.h.  Treat these as not having old streams.
-    CHECK_INCLUDE_FILE_CXX("strstrea.h" VTK_HAVE_OLD_STRSTREA_H)
-    CHECK_INCLUDE_FILE_CXX("strstream.h" VTK_HAVE_OLD_STRSTREAM_H)
-    IF(NOT VTK_HAVE_OLD_STRSTREAM_H)
-      IF(NOT VTK_HAVE_OLD_STRSTREA_H)
-        SET(VTK_HAVE_OLD_STREAMS 0)
-      ENDIF(NOT VTK_HAVE_OLD_STRSTREA_H)
-    ENDIF(NOT VTK_HAVE_OLD_STRSTREAM_H)
-  ENDIF(VTK_HAVE_OLD_STREAMS)
+  IF("${var}" MATCHES "^${var}$")
+    CHECK_INCLUDE_FILE_CXX("iosfwd" VTK_HAVE_ANSI_STREAMS)
+    CHECK_INCLUDE_FILE_CXX("iostream.h" VTK_HAVE_OLD_STREAMS)
+    IF(VTK_HAVE_OLD_STREAMS)
+      # Some compilers have iostream.h but not strstream.h
+      # or strstrea.h.  Treat these as not having old streams.
+      CHECK_INCLUDE_FILE_CXX("strstrea.h" VTK_HAVE_OLD_STRSTREA_H)
+      CHECK_INCLUDE_FILE_CXX("strstream.h" VTK_HAVE_OLD_STRSTREAM_H)
+      IF(NOT VTK_HAVE_OLD_STRSTREAM_H)
+        IF(NOT VTK_HAVE_OLD_STRSTREA_H)
+          SET(VTK_HAVE_OLD_STREAMS 0)
+        ENDIF(NOT VTK_HAVE_OLD_STRSTREA_H)
+      ENDIF(NOT VTK_HAVE_OLD_STRSTREAM_H)
+    ENDIF(VTK_HAVE_OLD_STREAMS)

-  IF(VTK_HAVE_ANSI_STREAMS AND VTK_HAVE_OLD_STREAMS)
-    # Have both old and new streams.  Provide the option.
-    # Default to OFF for MSVC 6 and ON for all others.
-    SET(${var}_DEFAULT ON)
-    IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-      IF("VTK_COMPILER_IS_VC6" MATCHES "^VTK_COMPILER_IS_VC6$")
-        MESSAGE(STATUS "Checking if compiler is VC6")
-        TRY_COMPILE(VTK_COMPILER_IS_VC6
-          ${VTK_BINARY_DIR}/CMakeTmp
-          ${VTK_SOURCE_DIR}/CMake/vtkTestCompilerIsVC6.cxx
-          OUTPUT_VARIABLE OUTPUT)
+    IF(VTK_HAVE_ANSI_STREAMS AND VTK_HAVE_OLD_STREAMS)
+      # Have both old and new streams.  Provide the option.
+      # Default to OFF for MSVC 6 and ON for all others.
+      SET(${var}_DEFAULT ON)
+      IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+        IF("VTK_COMPILER_IS_VC6" MATCHES "^VTK_COMPILER_IS_VC6$")
+          MESSAGE(STATUS "Checking if compiler is VC6")
+          TRY_COMPILE(VTK_COMPILER_IS_VC6
+            ${VTK_BINARY_DIR}/CMakeTmp
+            ${VTK_SOURCE_DIR}/CMake/vtkTestCompilerIsVC6.cxx
+            OUTPUT_VARIABLE OUTPUT)
+          IF(VTK_COMPILER_IS_VC6)
+            MESSAGE(STATUS "Checking if compiler is VC6 -- yes")
+            SET(VTK_COMPILER_IS_VC6 1 CACHE INTERNAL "Compiler is MSVC 6")
+          ELSE(VTK_COMPILER_IS_VC6)
+            MESSAGE(STATUS "Checking if compiler is VC6 -- no")
+            SET(VTK_COMPILER_IS_VC6 0 CACHE INTERNAL "Compiler is MSVC 6")
+            WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
+              "Determining if the compiler is MSVC 6 "
+              "failed with the following output:\n"
+              "${OUTPUT}\n" APPEND)
+          ENDIF(VTK_COMPILER_IS_VC6)
+        ENDIF("VTK_COMPILER_IS_VC6" MATCHES "^VTK_COMPILER_IS_VC6$")
         IF(VTK_COMPILER_IS_VC6)
-          MESSAGE(STATUS "Checking if compiler is VC6 -- yes")
-          SET(VTK_COMPILER_IS_VC6 1 CACHE INTERNAL "Compiler is MSVC 6")
-        ELSE(VTK_COMPILER_IS_VC6)
-          MESSAGE(STATUS "Checking if compiler is VC6 -- no")
-          SET(VTK_COMPILER_IS_VC6 0 CACHE INTERNAL "Compiler is MSVC 6")
-          WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
-            "Determining if the compiler is MSVC 6 "
-            "failed with the following output:\n"
-            "${OUTPUT}\n" APPEND)
+          SET(${var}_DEFAULT OFF)
         ENDIF(VTK_COMPILER_IS_VC6)
-      ENDIF("VTK_COMPILER_IS_VC6" MATCHES "^VTK_COMPILER_IS_VC6$")
-      IF(VTK_COMPILER_IS_VC6)
-        SET(${var}_DEFAULT OFF)
-      ENDIF(VTK_COMPILER_IS_VC6)
-    ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
-    OPTION(${var} "Use the ANSI standard iostream library." ${${var}_DEFAULT})
-    MARK_AS_ADVANCED(${var})
-  ELSE(VTK_HAVE_ANSI_STREAMS AND VTK_HAVE_OLD_STREAMS)
-    IF(VTK_HAVE_ANSI_STREAMS)
-      # Have only new streams.  Use them.
-      SET(${var} ON)
-    ELSE(VTK_HAVE_ANSI_STREAMS)
-      # Have only old streams.  Use them.
-      SET(${var} OFF)
-    ENDIF(VTK_HAVE_ANSI_STREAMS)
-  ENDIF(VTK_HAVE_ANSI_STREAMS AND VTK_HAVE_OLD_STREAMS)
+      ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+      OPTION(${var} "Use the ANSI standard iostream library." ${${var}_DEFAULT})
+      MARK_AS_ADVANCED(${var})
+    ELSE(VTK_HAVE_ANSI_STREAMS AND VTK_HAVE_OLD_STREAMS)
+      IF(VTK_HAVE_ANSI_STREAMS)
+        # Have only new streams.  Use them.
+        SET(${var} ON)
+      ELSE(VTK_HAVE_ANSI_STREAMS)
+        # Have only old streams.  Use them.
+        SET(${var} OFF)
+      ENDIF(VTK_HAVE_ANSI_STREAMS)
+    ENDIF(VTK_HAVE_ANSI_STREAMS AND VTK_HAVE_OLD_STREAMS)
+  ENDIF("${var}" MATCHES "^${var}$")
 ENDMACRO(VTK_SELECT_STREAMS_LIBRARY var)


targetLinkLibrariesWithDynamicLookup: Backport module from scikit-build

Replacing The Original SimpleITK TargetLinkLibrariesWithDynamicLookup
with the now upstream scikit-build CMake module. The goal is to have
this module mature in the scikit-build repository before CMake
adopting it.

Change-Id: I9e3eba4f3de436b297a2547c4f2a1346e6ecfec3

--- CMake/sitkTargetLinkLibrariesWithDynamicLookup.cmake
+++ CMake/sitkTargetLinkLibrariesWithDynamicLookup.cmake
@@ -1,89 +1,580 @@
-#
-# - This module provides the function
-# sitk_target_link_libraries_with_dynamic_lookup which can be used to
-# "weakly" link loadable module.
-#
-# Link a library to a target such that the symbols are resolved at
-# run-time not link-time. This should be used when compiling a
-# loadable module when the symbols should be resolve from the run-time
-# environment where the module is loaded, and not a specific system
-# library.
-#
-# Specifically, for OSX it uses undefined dynamic_lookup. This is
-# simular to using "-shared" on Linux where undefined symbols are
-# ignored.
-#
-# Additionally, the linker is checked to see if it supports undefined
+#.rst:
+#
+# Public Functions
+# ^^^^^^^^^^^^^^^^
+#
+# The following functions are defined:
+#
+# .. cmake:command:: target_link_libraries_with_dynamic_lookup
+#
+# ::
+#
+#     target_link_libraries_with_dynamic_lookup(<Target> [<Libraries>])
+#
+#
+# Useful to "weakly" link a loadable module. For example, it should be used
+# when compiling a loadable module when the symbols should be resolve from
+# the run-time environment where the module is loaded, and not a specific
+# system library.
+#
+# Like proper linking, except that the given ``<Libraries>`` are not necessarily
+# linked. Instead, the ``<Target>`` is produced in a manner that allows for
+# symbols unresolved within it to be resolved at runtime, presumably by the
+# given ``<Libraries>``.  If such a target can be produced, the provided
+# ``<Libraries>`` are not actually linked.
+#
+# It links a library to a target such that the symbols are resolved at
+# run-time not link-time.
+#
+# The linker is checked to see if it supports undefined
 # symbols when linking a shared library. If it does then the library
 # is not linked when specified with this function.
 #
-# http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/
-#
-
-# Function: _sitkCheckUndefinedSymbolsAllowed
-#
-# Check if the linker allows undefined symbols for shared libraries.
-#
-# SITK_UNDEFINED_SYMBOLS_ALLOWED - true if the linker will allow
-#   undefined symbols for shared libraries
-#
-
-function(_sitkCheckUndefinedSymbolsAllowed)
-
-  set(VARIABLE "SITK_UNDEFINED_SYMBOLS_ALLOWED")
+# On platforms that do not support weak-linking, this function works just
+# like ``target_link_libraries``.
+#
+# .. note::
+#
+#     For OSX it uses ``undefined dynamic_lookup``. This is similar to using
+#     ``-shared`` on Linux where undefined symbols are ignored.
+#
+#     For more details, see `blog <http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/>`_
+#     from Tim D. Smith.
+#
+#
+# .. cmake:command:: check_dynamic_lookup
+#
+# Check if the linker requires a command line flag to allow leaving symbols
+# unresolved when producing a target of type ``<TargetType>`` that is
+# weakly-linked against a dependency of type ``<LibType>``.
+#
+# ``<TargetType>``
+#   can be one of "STATIC", "SHARED", "MODULE", or "EXE".
+#
+# ``<LibType>``
+#   can be one of "STATIC", "SHARED", or "MODULE".
+#
+# Long signature:
+#
+# ::
+#
+#     check_dynamic_lookup(<TargetType>
+#                          <LibType>
+#                          <ResultVar>
+#                          [<LinkFlagsVar>])
+#
+#
+# Short signature:
+#
+# ::
+#
+#     check_dynamic_lookup(<ResultVar>) # <TargetType> set to "MODULE"
+#                                       # <LibType> set to "SHARED"
+#
+#
+# The result is cached between invocations and recomputed only when the value
+# of CMake's linker flag list changes; ``CMAKE_STATIC_LINKER_FLAGS`` if
+# ``<TargetType>`` is "STATIC", and ``CMAKE_SHARED_LINKER_FLAGS`` otherwise.
+#
+#
+# Defined variables:
+#
+# ``<ResultVar>``
+#   Whether the current C toolchain supports weak-linking for target binaries of
+#   type ``<TargetType>`` that are weakly-linked against a dependency target of
+#   type ``<LibType>``.
+#
+# ``<LinkFlagsVar>``
+#   List of flags to add to the linker command to produce a working target
+#   binary of type ``<TargetType>`` that is weakly-linked against a dependency
+#   target of type ``<LibType>``.
+#
+# ``HAS_DYNAMIC_LOOKUP_<TargetType>_<LibType>``
+#   Cached, global alias for ``<ResultVar>``
+#
+# ``DYNAMIC_LOOKUP_FLAGS_<TargetType>_<LibType>``
+#   Cached, global alias for ``<LinkFlagsVar>``
+#
+#
+# Private Functions
+# ^^^^^^^^^^^^^^^^^
+#
+# The following private functions are defined:
+#
+# .. warning:: These functions are not part of the scikit-build API. They
+#     exist purely as an implementation detail and may change from version
+#     to version without notice, or even be removed.
+#
+#     We mean it.
+#
+#
+# .. cmake:command:: _get_target_type
+#
+# ::
+#
+#     _get_target_type(<ResultVar> <Target>)
+#
+#
+# Shorthand for querying an abbreviated version of the target type
+# of the given ``<Target>``.
+#
+# ``<ResultVar>`` is set to:
+#
+# - "STATIC" for a STATIC_LIBRARY,
+# - "SHARED" for a SHARED_LIBRARY,
+# - "MODULE" for a MODULE_LIBRARY,
+# - and "EXE" for an EXECUTABLE.
+#
+# Defined variables:
+#
+# ``<ResultVar>``
+#   The abbreviated version of the ``<Target>``'s type.
+#
+#
+# .. cmake:command:: _test_weak_link_project
+#
+# ::
+#
+#     _test_weak_link_project(<TargetType>
+#                             <LibType>
+#                             <ResultVar>
+#                             <LinkFlagsVar>)
+#
+#
+# Attempt to compile and run a test project where a target of type
+# ``<TargetType>`` is weakly-linked against a dependency of type ``<LibType>``:
+#
+# - ``<TargetType>`` can be one of "STATIC", "SHARED", "MODULE", or "EXE".
+# - ``<LibType>`` can be one of "STATIC", "SHARED", or "MODULE".
+#
+# Defined variables:
+#
+# ``<ResultVar>``
+#   Whether the current C toolchain can produce a working target binary of type
+#   ``<TargetType>`` that is weakly-linked against a dependency target of type
+#   ``<LibType>``.
+#
+# ``<LinkFlagsVar>``
+#   List of flags to add to the linker command to produce a working target
+#   binary of type ``<TargetType>`` that is weakly-linked against a dependency
+#   target of type ``<LibType>``.
+#
+
+function(_get_target_type result_var target)
+  set(target_type "SHARED_LIBRARY")
+  if(TARGET ${target})
+    get_property(target_type TARGET ${target} PROPERTY TYPE)
+  endif()
+
+  set(result "STATIC")
+
+  if(target_type STREQUAL "STATIC_LIBRARY")
+    set(result "STATIC")
+  endif()
+
+  if(target_type STREQUAL "SHARED_LIBRARY")
+    set(result "SHARED")
+  endif()
+
+  if(target_type STREQUAL "MODULE_LIBRARY")
+    set(result "MODULE")
+  endif()
+
+  if(target_type STREQUAL "EXECUTABLE")
+    set(result "EXE")
+  endif()
+
+  set(${result_var} ${result} PARENT_SCOPE)
+endfunction()
+
+
+function(_test_weak_link_project
+         target_type
+         lib_type
+         can_weak_link_var
+         project_name)
+
+  set(gnu_ld_ignore      "-Wl,--unresolved-symbols=ignore-all")
+  set(osx_dynamic_lookup           "-undefined dynamic_lookup")
+  set(no_flag                                               "")
+
+  foreach(link_flag_spec gnu_ld_ignore osx_dynamic_lookup no_flag)
+    set(link_flag "${${link_flag_spec}}")
+
+    set(test_project_dir "${PROJECT_BINARY_DIR}/CMakeTmp")
+    set(test_project_dir "${test_project_dir}/${project_name}")
+    set(test_project_dir "${test_project_dir}/${link_flag_spec}")
+    set(test_project_dir "${test_project_dir}/${target_type}")
+    set(test_project_dir "${test_project_dir}/${lib_type}")
+
+    set(test_project_src_dir "${test_project_dir}/src")
+    set(test_project_bin_dir "${test_project_dir}/build")
+
+    file(MAKE_DIRECTORY ${test_project_src_dir})
+    file(MAKE_DIRECTORY ${test_project_bin_dir})
+
+    set(mod_type "STATIC")
+    set(link_mod_lib TRUE)
+    set(link_exe_lib TRUE)
+    set(link_exe_mod FALSE)
+
+    if("${target_type}" STREQUAL "EXE")
+      set(link_exe_lib FALSE)
+      set(link_exe_mod TRUE)
+    else()
+      set(mod_type "${target_type}")
+    endif()
+
+    if("${mod_type}" STREQUAL "MODULE")
+      set(link_mod_lib FALSE)
+    endif()
+
+
+    file(WRITE "${test_project_src_dir}/CMakeLists.txt" "
+      cmake_minimum_required(VERSION ${CMAKE_VERSION})
+      project(${project_name} C)
+
+      include_directories(${test_project_src_dir})
+
+      add_library(number ${lib_type} number.c)
+      add_library(counter ${mod_type} counter.c)
+    ")
+
+    if("${mod_type}" STREQUAL "MODULE")
+      file(APPEND "${test_project_src_dir}/CMakeLists.txt" "
+        set_target_properties(counter PROPERTIES PREFIX \"\")
+      ")
+    endif()
+
+    if(link_mod_lib)
+      file(APPEND "${test_project_src_dir}/CMakeLists.txt" "
+        target_link_libraries(counter number)
+      ")
+    elseif(NOT link_flag STREQUAL "")
+      file(APPEND "${test_project_src_dir}/CMakeLists.txt" "
+        set_target_properties(counter PROPERTIES LINK_FLAGS \"${link_flag}\")
+      ")
+    endif()
+
+    file(APPEND "${test_project_src_dir}/CMakeLists.txt" "
+      add_executable(main main.c)
+    ")
+
+    if(link_exe_lib)
+      file(APPEND "${test_project_src_dir}/CMakeLists.txt" "
+        target_link_libraries(main number)
+      ")
+    elseif(NOT link_flag STREQUAL "")
+      file(APPEND "${test_project_src_dir}/CMakeLists.txt" "
+        target_link_libraries(main \"${link_flag}\")
+      ")
+    endif()
+
+    if(link_exe_mod)
+      file(APPEND "${test_project_src_dir}/CMakeLists.txt" "
+        target_link_libraries(main counter)
+      ")
+    else()
+      file(APPEND "${test_project_src_dir}/CMakeLists.txt" "
+        target_link_libraries(main \"${CMAKE_DL_LIBS}\")
+      ")
+    endif()
+
+    file(WRITE "${test_project_src_dir}/number.c" "
+      #include <number.h>
+
+      static int _number;
+      void set_number(int number) { _number = number; }
+      int get_number() { return _number; }
+    ")
+
+    file(WRITE "${test_project_src_dir}/number.h" "
+      #ifndef _NUMBER_H
+      #define _NUMBER_H
+      extern void set_number(int);
+      extern int get_number(void);
+      #endif
+    ")
+
+    file(WRITE "${test_project_src_dir}/counter.c" "
+      #include <number.h>
+      int count() {
+        int result = get_number();
+        set_number(result + 1);
+        return result;
+      }
+    ")
+
+    file(WRITE "${test_project_src_dir}/counter.h" "
+      #ifndef _COUNTER_H
+      #define _COUNTER_H
+      extern int count(void);
+      #endif
+    ")
+
+    file(WRITE "${test_project_src_dir}/main.c" "
+      #include <stdlib.h>
+      #include <stdio.h>
+      #include <number.h>
+    ")
+
+    if(NOT link_exe_mod)
+      file(APPEND "${test_project_src_dir}/main.c" "
+        #include <dlfcn.h>
+      ")
+    endif()
+
+    file(APPEND "${test_project_src_dir}/main.c" "
+      int my_count() {
+        int result = get_number();
+        set_number(result + 1);
+        return result;
+      }
+
+      int main(int argc, char **argv) {
+        int result;
+    ")
+
+    if(NOT link_exe_mod)
+      file(APPEND "${test_project_src_dir}/main.c" "
+        void *counter_module;
+        int (*count)(void);
+
+        counter_module = dlopen(\"./counter.so\", RTLD_LAZY | RTLD_GLOBAL);
+        if(!counter_module) goto error;
+
+        count = dlsym(counter_module, \"count\");
+        if(!count) goto error;
+      ")
+    endif()
+
+    file(APPEND "${test_project_src_dir}/main.c" "
+        result = count()    != 0 ? EXIT_FAILURE :
+                 my_count() != 1 ? EXIT_FAILURE :
+                 my_count() != 2 ? EXIT_FAILURE :
+                 count()    != 3 ? EXIT_FAILURE :
+                 count()    != 4 ? EXIT_FAILURE :
+                 count()    != 5 ? EXIT_FAILURE :
+                 my_count() != 6 ? EXIT_FAILURE : EXIT_SUCCESS;
+    ")
+
+    if(NOT link_exe_mod)
+      file(APPEND "${test_project_src_dir}/main.c" "
+        goto done;
+        error:
+          fprintf(stderr, \"Error occured:\\n    %s\\n\", dlerror());
+          result = 1;
+
+        done:
+          if(counter_module) dlclose(counter_module);
+      ")
+    endif()
+
+    file(APPEND "${test_project_src_dir}/main.c" "
+          return result;
+      }
+    ")
+
+    set(_rpath_arg)
+    if(APPLE AND ${CMAKE_VERSION} VERSION_GREATER 2.8.11)
+      set(_rpath_arg "-DCMAKE_MACOSX_RPATH='${CMAKE_MACOSX_RPATH}'")
+    endif()
+
+    try_compile(project_compiles
+                "${test_project_bin_dir}"
+                "${test_project_src_dir}"
+                "${project_name}"
+                CMAKE_FLAGS
+                  "-DCMAKE_SHARED_LINKER_FLAGS='${CMAKE_SHARED_LINKER_FLAGS}'"
+                  "-DCMAKE_ENABLE_EXPORTS=ON"
+                  ${_rpath_arg}
+                OUTPUT_VARIABLE compile_output)
+
+    set(project_works 1)
+    set(run_output)
+
+    if(project_compiles)
+      execute_process(COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}
+                              "${test_project_bin_dir}/main"
+                      WORKING_DIRECTORY "${test_project_bin_dir}"
+                      RESULT_VARIABLE project_works
+                      OUTPUT_VARIABLE run_output
+                      ERROR_VARIABLE run_output)
+    endif()
+
+    set(test_description
+        "Weak Link ${target_type} -> ${lib_type} (${link_flag_spec})")
+
+    if(project_works EQUAL 0)
+      set(project_works TRUE)
+      message(STATUS "Performing Test ${test_description} - Success")
+    else()
+      set(project_works FALSE)
+      message(STATUS "Performing Test ${test_description} - Failed")
+      file(APPEND ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeError.log
+           "Performing Test ${test_description} failed with the "
+           "following output:\n"
+           "BUILD\n-----\n${compile_output}\nRUN\n---\n${run_output}\n")
+    endif()
+
+    set(${can_weak_link_var} ${project_works} PARENT_SCOPE)
+    if(project_works)
+      set(${project_name} ${link_flag} PARENT_SCOPE)
+      break()
+    endif()
+  endforeach()
+endfunction()
+
+function(check_dynamic_lookup)
+  # Two signatures are supported:
+
+  if(ARGC EQUAL "1")
+    #
+    # check_dynamic_lookup(<ResultVar>)
+    #
+    set(target_type "MODULE")
+    set(lib_type "SHARED")
+    set(has_dynamic_lookup_var "${ARGV0}")
+    set(link_flags_var "unused")
+
+  elseif(ARGC GREATER "2")
+    #
+    # check_dynamic_lookup(<TargetType>
+    #                      <LibType>
+    #                      <ResultVar>
+    #                      [<LinkFlagsVar>])
+    #
+    set(target_type "${ARGV0}")
+    set(lib_type "${ARGV1}")
+    set(has_dynamic_lookup_var "${ARGV2}")
+    if(ARGC EQUAL "3")
+      set(link_flags_var "unused")
+    else()
+      set(link_flags_var "${ARGV3}")
+    endif()
+  else()
+    message(FATAL_ERROR "missing arguments")
+  endif()
+
+  _check_dynamic_lookup(
+    ${target_type}
+    ${lib_type}
+    ${has_dynamic_lookup_var}
+    ${link_flags_var}
+    )
+  set(${has_dynamic_lookup_var} ${${has_dynamic_lookup_var}} PARENT_SCOPE)
+  if(NOT link_flags_var STREQUAL "unused")
+    set(${link_flags_var} ${${link_flags_var}} PARENT_SCOPE)
+  endif()
+endfunction()
+
+function(_check_dynamic_lookup
+         target_type
+         lib_type
+         has_dynamic_lookup_var
+         link_flags_var
+         )

   # hash the CMAKE_FLAGS passed and check cache to know if we need to rerun
-  string(MD5 cmake_flags_hash "${CMAKE_SHARED_LINKER_FLAGS}")
-  set(cache_var "${VARIABLE}_${cmake_flags_hash}")
-
-  if(DEFINED "${cache_var}")
-    set(${VARIABLE} "${${cache_var}}"  CACHE INTERNAL "Using hash (${cmake_flags_hash}) value from TRY_COMPILE")
+  if("${target_type}" STREQUAL "STATIC")
+    string(MD5 cmake_flags_hash "${CMAKE_STATIC_LINKER_FLAGS}")
   else()
-    set(test_project_dir "${PROJECT_BINARY_DIR}/CMakeTmp/${VARIABLE}")
-
-    file(WRITE "${test_project_dir}/CMakeLists.txt"
-"
-project(undefined C)
-set( CMAKE_MACOSX_RPATH 1)
-add_library(foo SHARED \"foo.c\")
-")
-
-    file(WRITE "${test_project_dir}/foo.c"
-"
-extern int bar(void);
-int foo(void) {return bar()+1;}
-")
-
-    try_compile(${VARIABLE}
-      "${test_project_dir}"
-      "${test_project_dir}"
-      undefined
-      CMAKE_FLAGS
-        "-DCMAKE_SHARED_LINKER_FLAGS='${CMAKE_SHARED_LINKER_FLAGS}'"
-        "-DCMAKE_MACOSX_RPATH=OFF"
-      OUTPUT_VARIABLE output)
-
-    set(${cache_var} ${${VARIABLE}} CACHE INTERNAL "hashed flags with try_compile results")
-
-    if(${VARIABLE})
-      message(STATUS "Performing Test ${VARIABLE} - Success")
+    string(MD5 cmake_flags_hash "${CMAKE_SHARED_LINKER_FLAGS}")
+  endif()
+
+  set(cache_var "HAS_DYNAMIC_LOOKUP_${target_type}_${lib_type}")
+  set(cache_hash_var "HAS_DYNAMIC_LOOKUP_${target_type}_${lib_type}_hash")
+  set(result_var "DYNAMIC_LOOKUP_FLAGS_${target_type}_${lib_type}")
+
+  if(     NOT DEFINED ${cache_hash_var}
+       OR NOT "${${cache_hash_var}}" STREQUAL "${cmake_flags_hash}")
+    unset(${cache_var} CACHE)
+  endif()
+
+  if(NOT DEFINED ${cache_var})
+    set(skip_test FALSE)
+
+   if(CMAKE_CROSSCOMPILING AND NOT CMAKE_CROSSCOMPILING_EMULATOR)
+      set(skip_test TRUE)
+    endif()
+
+    if(skip_test)
+      set(has_dynamic_lookup FALSE)
+      set(link_flags)
     else()
-      message(STATUS "Performing Test ${VARIABLE} - Failed")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-        "Performing Test ${VARIABLE} failed with the following output:\n"
-        "${OUTPUT}\n")
-    endif()
-  endif()
+      _test_weak_link_project(${target_type}
+                              ${lib_type}
+                              has_dynamic_lookup
+                              link_flags)
+    endif()
+
+    set(caveat " (when linking ${target_type} against ${lib_type})")
+
+    set(${cache_var} "${has_dynamic_lookup}"
+        CACHE BOOL
+        "linker supports dynamic lookup for undefined symbols${caveat}")
+    mark_as_advanced(${cache_var})
+
+    set(${result_var} "${link_flags}"
+        CACHE BOOL
+        "linker flags for dynamic lookup${caveat}")
+    mark_as_advanced(${result_var})
+
+    set(${cache_hash_var} "${cmake_flags_hash}"
+        CACHE INTERNAL "hashed flags for ${cache_var} check")
+  endif()
+
+  set(${has_dynamic_lookup_var} "${${cache_var}}" PARENT_SCOPE)
+  set(${link_flags_var} "${${result_var}}" PARENT_SCOPE)
 endfunction()

-_sitkCheckUndefinedSymbolsAllowed()
-
-macro( sitk_target_link_libraries_with_dynamic_lookup target )
-  if ( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
-    set_target_properties( ${target} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
-  elseif(SITK_UNDEFINED_SYMBOLS_ALLOWED)
-    # linker allows undefined symbols, let's just not link
-  else()
-    target_link_libraries ( ${target} ${ARGN}  )
-  endif()
-endmacro()
+function(target_link_libraries_with_dynamic_lookup target)
+  _get_target_type(target_type ${target})
+
+  set(link_props)
+  set(link_items)
+  set(link_libs)
+
+  foreach(lib ${ARGN})
+    _get_target_type(lib_type ${lib})
+    check_dynamic_lookup(${target_type}
+                         ${lib_type}
+                         has_dynamic_lookup
+                         dynamic_lookup_flags)
+
+    if(has_dynamic_lookup)
+      if(dynamic_lookup_flags)
+        if("${target_type}" STREQUAL "EXE")
+          list(APPEND link_items "${dynamic_lookup_flags}")
+        else()
+          list(APPEND link_props "${dynamic_lookup_flags}")
+        endif()
+      endif()
+    else()
+      list(APPEND link_libs "${lib}")
+    endif()
+  endforeach()
+
+  if(link_props)
+    list(REMOVE_DUPLICATES link_props)
+  endif()
+
+  if(link_items)
+    list(REMOVE_DUPLICATES link_items)
+  endif()
+
+  if(link_libs)
+    list(REMOVE_DUPLICATES link_libs)
+  endif()
+
+  if(link_props)
+    set_target_properties(${target}
+                          PROPERTIES LINK_FLAGS "${link_props}")
+  endif()
+
+  set(links "${link_items}" "${link_libs}")
+  if(links)
+    target_link_libraries(${target} "${links}")
+  endif()
+endfunction()
+


vpr: add bucket router heap option

vpr: add bucket router heap option

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- xc/common/cmake/arch_define.cmake
+++ xc/common/cmake/arch_define.cmake
@@ -59,6 +59,7 @@
   set(YOSYS_CONV_SCRIPT ${ADD_XC_ARCH_DEFINE_YOSYS_CONV_SCRIPT})
   set(YOSYS_TECHMAP ${symbiflow-arch-defs_SOURCE_DIR}/xc/${FAMILY}/techmap)
   set(VPR_ARCH_ARGS "\
+      --router_heap bucket \
       --clock_modeling route \
       --place_delay_model delta_override \
       --router_lookahead connection_box_map \


Updated device side FW

Updated device side FW

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "b911488dc709f79c2de6abd6352fc45db45ab5cf")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "5a93c359a59b064574d39bd1e167dad3fb38350f")

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


Change the libsuffix for DAVIX library installation (CMake)

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -675,7 +675,7 @@
       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DLIB_SUFFIX=
     )
     set(DAVIX_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include/davix)
-    set(DAVIX_LIBRARY -L${CMAKE_BINARY_DIR}/lib64 -ldavix)
+    set(DAVIX_LIBRARY -L${CMAKE_BINARY_DIR}/lib -ldavix)
     set(DAVIX_INCLUDE_DIRS ${DAVIX_INCLUDE_DIR})
     set(DAVIX_LIBRARIES ${DAVIX_LIBRARY})
 endif()


Simplification of building builtin LZ4

Simplification of building builtin LZ4

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -248,32 +248,21 @@
   set(LZ4_URL ${lcgpackages}/lz4-${lz4_version}.tar.gz)
   set(LZ4_MD5 c9610c5ce97eb431dddddf0073d919b9)
   set(LZ4_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lz4${CMAKE_STATIC_LIBRARY_SUFFIX})
-  if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
-    file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/include" NATIVE_INCLUDEDIR)
-    ExternalProject_Add(
-      LZ4
-      URL ${LZ4_URL}
-      URL_MD5 ${LZ4_MD5}
-      INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND cl /c "${LZ4_CFLAGS}" -DXXH_NAMESPACE=LZ4_ lib/lz4.c lib/lz4hc.c lib/lz4frame.c lib/xxhash.c
-      BUILD_COMMAND lib /NODEFAULTLIB lz4.obj lz4hc.obj lz4frame.obj xxhash.obj /OUT:${LZ4_LIBRARIES}
-      INSTALL_COMMAND xcopy "lib\\*.h" "${NATIVE_INCLUDEDIR}\\" /Y
-      LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1
-      BUILD_BYPRODUCTS ${LZ4_LIBRARIES})
-  else()
-    ExternalProject_Add(
-      LZ4
-      URL ${LZ4_URL}
-      URL_MD5 ${LZ4_MD5}
-      INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND  /bin/sh -c "PREFIX=<INSTALL_DIR> CMAKE_PARAMS='-DCMAKE_C_COMPILER=\\\"${CMAKE_C_COMPILER}\\\" -DCMAKE_C_FLAGS=\\\"${CMAKE_C_FLAGS}\\\" -DCMAKE_OSX_SYSROOT=\\\"${CMAKE_OSX_SYSROOT}\\\"' make cmake"
-      BUILD_COMMAND /bin/sh -c "PREFIX=<INSTALL_DIR> MOREFLAGS=-fPIC make"
-      INSTALL_COMMAND /bin/sh -c "PREFIX=<INSTALL_DIR> make install"
-      LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1
-      BUILD_BYPRODUCTS ${LZ4_LIBRARIES})
-  endif()
+  ExternalProject_Add(
+    LZ4
+    URL ${LZ4_URL}
+    URL_MD5 ${LZ4_MD5}
+    INSTALL_DIR ${CMAKE_BINARY_DIR}
+    SOURCE_SUBDIR contrib/cmake_unofficial
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+              -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+              -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+              -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
+              -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
+              -DBUILD_SHARED_LIBS=OFF
+    LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1
+    BUILD_BYPRODUCTS ${LZ4_LIBRARIES})
   set(LZ4_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
-  set(LZ4_DEFINITIONS -DBUILTIN_LZ4)
 endif()


cmake: Fixed a bug where python 3.8 was not detected on Windows

Fixed a bug where python 3.8 was not detected on Windows.

Python 3.8 was released two weeks ago and any Windows user that
installs it will detect the wrong version.

Also add detection for 3.9 for future-proofing.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/backports/FindPythonInterp.cmake
+++ cmake/backports/FindPythonInterp.cmake
@@ -79,7 +79,7 @@

 set(_PYTHON1_VERSIONS 1.6 1.5)
 set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
-set(_PYTHON3_VERSIONS 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+set(_PYTHON3_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)

 if(PythonInterp_FIND_VERSION)
     if(PythonInterp_FIND_VERSION_COUNT GREATER 1)


[CMake] Fix the builds on osx conditionally addubg the isysroot switch

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1198,7 +1198,9 @@
     install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries FILES_MATCHING PATTERN "tbb*")
   else()
     ROOT_ADD_CXX_FLAG(_tbb_cxxflags -mno-rtm)
-    if(APPLE)
+    # Here we check that the CMAKE_OSX_SYSROOT variable is not empty otherwise
+    # it can happen that a "-isysroot" switch is added without an argument.
+    if(APPLE AND CMAKE_OSX_SYSROOT)
       set(_tbb_cxxflags "${_tbb_cxxflags} -isysroot ${CMAKE_OSX_SYSROOT}")
     endif()
     set(TBB_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libtbb${CMAKE_SHARED_LIBRARY_SUFFIX})


Create imported target for Vdt if found

Create imported target for Vdt if found

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1437,6 +1437,7 @@
   endif()
   if(builtin_vdt)
     set(vdt_version 0.4.1)
+    set(VDT_FOUND True)
     set(VDT_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}vdt${CMAKE_SHARED_LIBRARY_SUFFIX})
     ExternalProject_Add(
       VDT
@@ -1454,6 +1455,12 @@
             DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT extra-headers)
     set(vdt ON CACHE BOOL "" FORCE)
   endif()
+endif()
+
+if(VDT_FOUND AND NOT TARGET Vdt::Vdt)
+  add_library(Vdt::Vdt INTERFACE IMPORTED)
+  set_property(TARGET Vdt::Vdt PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${VDT_INCLUDE_DIRS}")
+  set_property(TARGET Vdt::Vdt PROPERTY INTERFACE_LINK_LIBRARIES "${VDT_LIBRARIES}")
 endif()

 #---Check for VecGeom--------------------------------------------------------------------


Updated toolchains.

Updated toolchains.

--- toolchain/toolchain-android.cmake
+++ toolchain/toolchain-android.cmake
@@ -1,2 +1,2 @@
 set(CMAKE_SYSTEM_NAME Android)
-set(CMAKE_CROSSCOMPILING_EMULATOR qemu-x86_64-static)+set(CMAKE_CROSSCOMPILING_EMULATOR qemu-arm)


Remove gen expr use from COMPONENT prop of install

Generator expression based alternative seems to be working
from newer cmakes but not in older versions.

--- CMakeModules/SplitDebugInfo.cmake
+++ CMakeModules/SplitDebugInfo.cmake
@@ -37,59 +37,66 @@
   endif ()

   if (SPLIT_TOOL_EXISTS)
-    get_target_property(TARGET_TYPE ${_target} TYPE)
-    set(PREFIX_EXPR_1
-      "$<$<STREQUAL:$<TARGET_PROPERTY:${_target},PREFIX>,>:${CMAKE_${TARGET_TYPE}_PREFIX}>")
-    set(PREFIX_EXPR_2
-      "$<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:${_target},PREFIX>,>>:$<TARGET_PROPERTY:${_target},PREFIX>>")
-    set(PREFIX_EXPR_FULL "${PREFIX_EXPR_1}${PREFIX_EXPR_2}")
+    get_target_property(TRGT_PREFIX ${_target} PREFIX)
+    if(TRGT_PREFIX)
+      set(prefix ${TRGT_PREFIX})
+    else()
+      get_target_property(TRGT_TYPE ${_target} TYPE)
+      set(prefix "${CMAKE_${TRGT_TYPE}_PREFIX}")
+    endif()

-    # If a custom OUTPUT_NAME was specified, use it.
-    set(OUTPUT_NAME_EXPR_1
-        "$<$<STREQUAL:$<TARGET_PROPERTY:${_target},OUTPUT_NAME>,>:${_target}>")
-    set(OUTPUT_NAME_EXPR_2
-        "$<$<NOT:$<STREQUAL:$<TARGET_PROPERTY:${_target},OUTPUT_NAME>,>>:$<TARGET_PROPERTY:${_target},OUTPUT_NAME>>")
-    set(OUTPUT_NAME_EXPR "${OUTPUT_NAME_EXPR_1}${OUTPUT_NAME_EXPR_2}")
-    set(OUTPUT_NAME_FULL "${PREFIX_EXPR_FULL}${OUTPUT_NAME_EXPR}$<TARGET_PROPERTY:${_target},POSTFIX>")
+    get_target_property(TRGT_OUT_NAME ${_target} OUTPUT_NAME)
+    if(TRGT_OUT_NAME)
+      set(outName ${TRGT_OUT_NAME})
+    else()
+      set(outName "${_target}")
+    endif()

-    set(SPLIT_DEBUG_TARGET_EXT ".debug")
+    get_target_property(TRGT_POSTFIX ${_target} POSTFIX)
+    if(TRGT_POSTFIX)
+      set(postfix ${TRGT_POSTFIX})
+    else()
+      get_target_property(TRGT_TYPE ${_target} TYPE)
+      set(postfix "${CMAKE_${TRGT_TYPE}_POSTFIX}")
+    endif()
+
+    set(OUT_NAME "${prefix}${outName}")
+    set(OUT_NAME_WE "${OUT_NAME}${postfix}")
+    set(SPLIT_DEBUG_OUT_FILE_EXT ".debug")
     if(APPLE)
-        set(SPLIT_DEBUG_TARGET_EXT ".dSYM")
+      set(SPLIT_DEBUG_OUT_FILE_EXT ".dSYM")
     endif()
-    set(SPLIT_DEBUG_SOURCE "$<TARGET_FILE:${_target}>")
-    set(SPLIT_DEBUG_TARGET_NAME
-        "$<TARGET_FILE_DIR:${_target}>/${OUTPUT_NAME_FULL}")
-    set(SPLIT_DEBUG_TARGET
-        "${SPLIT_DEBUG_TARGET_NAME}${SPLIT_DEBUG_TARGET_EXT}")
+    set(SPLIT_DEBUG_SRC_FILE "$<TARGET_FILE:${_target}>")
+    set(SPLIT_DEBUG_OUT_NAME "$<TARGET_FILE_DIR:${_target}>/${OUT_NAME_WE}")
+    set(SPLIT_DEBUG_OUT_FILE "${SPLIT_DEBUG_OUT_NAME}${SPLIT_DEBUG_OUT_FILE_EXT}")

     if(APPLE)
       add_custom_command(TARGET ${_target} POST_BUILD
-          COMMAND dsymutil ${SPLIT_DEBUG_SOURCE} -o ${SPLIT_DEBUG_TARGET}
+          COMMAND dsymutil ${SPLIT_DEBUG_SRC_FILE} -o ${SPLIT_DEBUG_OUT_FILE}
           #TODO(pradeep) From initial research stripping debug info from
           # is removing debug LC_ID_DYLIB command also which is make
           # shared library unusable. Confirm this from OSX expert
           # and remove these comments and below command
-          #COMMAND ${CMAKE_STRIP} --strip-debug ${SPLIT_DEBUG_SOURCE}
+          #COMMAND ${CMAKE_STRIP} --strip-debug ${SPLIT_DEBUG_SRC_FILE}
         )
     else(APPLE)
       add_custom_command(TARGET ${_target} POST_BUILD
         COMMAND ${CMAKE_OBJCOPY}
-          --only-keep-debug ${SPLIT_DEBUG_SOURCE} ${SPLIT_DEBUG_TARGET}
+          --only-keep-debug ${SPLIT_DEBUG_SRC_FILE} ${SPLIT_DEBUG_OUT_FILE}
         COMMAND ${CMAKE_STRIP}
-          --strip-debug ${SPLIT_DEBUG_SOURCE}
+          --strip-debug ${SPLIT_DEBUG_SRC_FILE}
         COMMAND ${CMAKE_OBJCOPY}
-          --add-gnu-debuglink=${SPLIT_DEBUG_TARGET} ${SPLIT_DEBUG_SOURCE}
+          --add-gnu-debuglink=${SPLIT_DEBUG_OUT_FILE} ${SPLIT_DEBUG_SRC_FILE}
         )
     endif()

-    install(FILES
-      ${SPLIT_DEBUG_TARGET}
+    install(FILES ${SPLIT_DEBUG_OUT_FILE}
       DESTINATION ${_destination_dir}
-      COMPONENT "${OUTPUT_NAME_FULL}_debug_symbols"
+      COMPONENT "${OUT_NAME}_debug_symbols"
       )

     # Make sure the file is deleted on `make clean`.
     set_property(DIRECTORY APPEND
-      PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${SPLIT_DEBUG_TARGET})
+      PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${SPLIT_DEBUG_OUT_FILE})
   endif(SPLIT_TOOL_EXISTS)
 endfunction(af_split_debug_info)


ENH:use superbuild version of libjpeg if USE_SYSTEM_JPEG is off

--- SuperBuild/CMake/External_tiff.cmake
+++ SuperBuild/CMake/External_tiff.cmake
@@ -21,9 +21,17 @@
   INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
   # set proj back to its original value
   set(proj TIFF)
-
-  ADD_SUPERBUILD_CONFIGURE_VAR(ZLIB_INCLUDE_DIR --with-zlib-include-dir)
-
+
+  set(TIFF_SB_CONFIG)
+  if(NOT USE_SYSTEM_ZLIB)
+    list(APPEND TIFF_SB_CONFIG "--with-zlib-include-dir=${SB_INSTALL_PREFIX}/include")
+    list(APPEND TIFF_SB_CONFIG "--with-zlib-lib-dir=${SB_INSTALL_PREFIX}/lib")
+  endif()
+  if(NOT USE_SYSTEM_JPEG)
+    list(APPEND TIFF_SB_CONFIG "--with-jpeg-include-dir=${SB_INSTALL_PREFIX}/include")
+    list(APPEND TIFF_SB_CONFIG "--with-jpeg-lib-dir=${SB_INSTALL_PREFIX}/lib")
+  endif()
+
   if(MSVC)
     #is JPEG required for linux also?


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


Added support to overwrite the generator type. Eigen'fied the new variables.

--- test/testsuite.cmake
+++ test/testsuite.cmake
@@ -27,6 +27,13 @@
 #  - EIGEN_WORK_DIR: directory used to download the source files and make the builds
 #      default: folder which contains this script
 #  - EIGEN_CMAKE_ARGS: additional arguments passed to cmake
+#  - EIGEN_GENERATOR_TYPE: allows to overwrite the generator type
+#      default: nmake (windows
+#      See http://www.cmake.org/cmake/help/cmake2.6docs.html#section_Generators for a complete
+#      list of supported generators.
+#  - EIGEN_NO_UPDATE: allows to submit dash boards from local repositories
+#      This might be interesting in case you want to submit dashboards
+#      including local changes.
 #  - CTEST_SOURCE_DIRECTORY: path to eigen's src (use a new and empty folder, not the one you are working on)
 #      default: <EIGEN_WORK_DIR>/src
 #  - CTEST_BINARY_DIRECTORY: build directory
@@ -132,11 +139,11 @@

 ## mandatory variables (the default should be ok in most cases):

-if(NOT IGNORE_CVS)
+if(NOT EIGEN_NO_UPDATE)
   SET (CTEST_CVS_COMMAND "hg")
   SET (CTEST_CVS_CHECKOUT "${CTEST_CVS_COMMAND} clone http://bitbucket.org/eigen/eigen2 \"${CTEST_SOURCE_DIRECTORY}\"")
   SET(CTEST_BACKUP_AND_RESTORE TRUE) # the backup is CVS related ...
-endif(NOT IGNORE_CVS)
+endif(NOT EIGEN_NO_UPDATE)

 # which ctest command to use for running the dashboard
 SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE}")
@@ -158,15 +165,24 @@
 # any quotes inside of this string if you use it
 if(WIN32 AND NOT UNIX)
   #message(SEND_ERROR "win32")
-  set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"NMake Makefiles\" -DCMAKE_MAKE_PROGRAM=nmake")
-  SET (CTEST_INITIAL_CACHE "
-    MAKECOMMAND:STRING=nmake -i
-    CMAKE_MAKE_PROGRAM:FILEPATH=nmake
-    CMAKE_GENERATOR:INTERNAL=NMake Makefiles
-    CMAKE_BUILD_TYPE:STRING=Release
-    BUILDNAME:STRING=${EIGEN_BUILD_STRING}
-    SITE:STRING=${EIGEN_SITE}
-  ")
+  if(EIGEN_GENERATOR_TYPE)
+    set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"${EIGEN_GENERATOR_TYPE}\"")
+    SET (CTEST_INITIAL_CACHE "
+      CMAKE_BUILD_TYPE:STRING=Release
+      BUILDNAME:STRING=${EIGEN_BUILD_STRING}
+      SITE:STRING=${EIGEN_SITE}
+    ")
+  else(EIGEN_GENERATOR_TYPE)
+    set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"NMake Makefiles\" -DCMAKE_MAKE_PROGRAM=nmake")
+    SET (CTEST_INITIAL_CACHE "
+      MAKECOMMAND:STRING=nmake -i
+      CMAKE_MAKE_PROGRAM:FILEPATH=nmake
+      CMAKE_GENERATOR:INTERNAL=NMake Makefiles
+      CMAKE_BUILD_TYPE:STRING=Release
+      BUILDNAME:STRING=${EIGEN_BUILD_STRING}
+      SITE:STRING=${EIGEN_SITE}
+    ")
+  endif(EIGEN_GENERATOR_TYPE)
 else(WIN32 AND NOT UNIX)
   SET (CTEST_INITIAL_CACHE "
     BUILDNAME:STRING=${EIGEN_BUILD_STRING}


SuperBuild: fix itk version

SuperBuild: fix itk version

--- SuperBuild/CMake/External_itk.cmake
+++ SuperBuild/CMake/External_itk.cmake
@@ -175,12 +175,7 @@
     CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )

-  # write patch in binary dir
-  #file(WRITE ${CMAKE_BINARY_DIR}/itk_patch_1.cmake
-  #  "configure_file(${CMAKE_SOURCE_DIR}/patches_ITK/hashtable.hxx.in
-  #   ${ITK_SB_SRC}/Modules/ThirdParty/KWSys/src/KWSys/hashtable.hxx.in COPYONLY)")
-
-  set(_SB_ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.6)
+  set(_SB_ITK_DIR ${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.8)

 endif()
 endif()


SuperBuild: missing options in External_otb

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -198,6 +198,10 @@
       -DOTB_USE_OPENJPEG:BOOL=${OTB_USE_OPENJPEG}
       -DOTB_USE_QT4:BOOL=${OTB_USE_QT4}
       -DOTB_USE_SIFTFAST:BOOL=${OTB_USE_SIFTFAST}
+      -DOTB_USE_OPENGL:BOOL=${OTB_USE_OPENGL}
+      -DOTB_USE_GLEW:BOOL=${OTB_USE_GLEW}
+      -DOTB_USE_GLFW:BOOL=${OTB_USE_GLFW}
+      -DOTB_USE_GLUT:BOOL=${OTB_USE_GLUT}
       ${OTB_SB_CONFIG}
       ${OTB_SB_LARGEINPUT_CONFIG}
       -DOTB_WRAP_PYTHON:BOOL=${OTB_WRAP_PYTHON}


[UPD] Try to find Octave in a third subfolder from C:\Octave*.
[UPD] Fatal error triggered when finding Octave under Windows if the compiler used is not the same than the one used to compile Octave.

git-svn-id: ed06c97986a68fa016311908f99ed1538fbb9b5d@953 93be6e1e-6fcc-11de-baec-69240fdc299a

--- CMake/FindOctave.cmake
+++ CMake/FindOctave.cmake
@@ -27,16 +27,44 @@
 SET(OCTAVE_MEXFILE_EXT mex)

 IF(WIN32)
-  FILE(GLOB OCTAVE_PATHS "c:/Octave/*")
+  SET(OCTAVE_PATHS_L1 )
+  SET(OCTAVE_PATHS_L2 )
+  # Level 0
+  FILE(GLOB OCTAVE_PATHS_L0 "c:/Octave*")
+  # Level 1
+  FOREACH(_file_ ${OCTAVE_PATHS_L0})
+    FILE(GLOB OCTAVE_PATHS_TEMP "${_file_}/*")
+    SET(OCTAVE_PATHS_L1 ${OCTAVE_PATHS_L1};${OCTAVE_PATHS_TEMP})
+  ENDFOREACH(_file_ OCTAVE_PATHS_L0)
+  # Level 2
+  FOREACH(_file_ ${OCTAVE_PATHS_L1})
+    FILE(GLOB OCTAVE_PATHS_TEMP "${_file_}/*")
+    SET(OCTAVE_PATHS_L2 ${OCTAVE_PATHS_L2};${OCTAVE_PATHS_TEMP})
+  ENDFOREACH(_file_ OCTAVE_PATHS_L1)
+  # Merge levels
+  SET(OCTAVE_PATHS ${OCTAVE_PATHS_L0} ${OCTAVE_PATHS_L1} ${OCTAVE_PATHS_L2})
+
   FIND_PATH(OCTAVE_ROOT "bin/octave.exe" ${OCTAVE_PATHS})
+  FIND_PATH(OCTAVE_USE_MINGW32 "bin/mingw32-make.exe" "${OCTAVE_ROOT}/mingw32")
+
+  IF(MSVC AND OCTAVE_USE_MINGW32)
+    MESSAGE(FATAL_ERROR
+      "You must use the generator \"MinGW Makefiles\" as the "
+      "version of Octave installed on your computer was compiled "
+      "with MinGW. You should also specify the native compiler "
+      "(GCC, G++ and GFortan) and add the path of MinGW in the "
+      "environment variable PATH. Contact the developers of the "
+      "project for more details")
+  ENDIF(MSVC AND OCTAVE_USE_MINGW32)

   FILE(GLOB OCTAVE_INCLUDE_PATHS "${OCTAVE_ROOT}/include/octave-*/octave")
   FILE(GLOB OCTAVE_LIBRARIES_PATHS "${OCTAVE_ROOT}/lib/octave-*")
-
+
   # LIBOCTINTERP, LIBOCTAVE, LIBCRUFT names
   SET(LIBOCTINTERP "liboctinterp")
   SET(LIBOCTAVE "liboctave")
   SET(LIBCRUFT "libcruft")
+
 ELSE(WIN32)
   IF(APPLE)
     FILE(GLOB OCTAVE_PATHS "/Applications/Octave*")


enable symbolizer on any platform with backtrace(3)

Summary:
Now that symbolizer has precise feature flags, enable
FOLLY_USE_SYMBOLIZER on any platform that has backtrace(3), which is
all that's needed to get a useful stack trace printed in the signal
handler.

Reviewed By: yfeldblum, luciang

Differential Revision: D23361609

fbshipit-source-id: b124f7fd01e94f90d8f8586555a64bd6e412040c

--- CMake/folly-deps.cmake
+++ CMake/folly-deps.cmake
@@ -165,7 +165,7 @@

 set(FOLLY_HAVE_BACKTRACE ${Backtrace_FOUND})
 set(FOLLY_HAVE_DWARF ${LIBDWARF_FOUND})
-if (APPLE OR (FOLLY_HAVE_ELF AND FOLLY_HAVE_DWARF AND FOLLY_HAVE_BACKTRACE AND LIBUNWIND_FOUND))
+if (NOT WIN32)
   set(FOLLY_USE_SYMBOLIZER ON)
 endif()
 message(STATUS "Setting FOLLY_USE_SYMBOLIZER: ${FOLLY_USE_SYMBOLIZER}")


Fixed install path of dependency binaries in CMake script

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -22,30 +22,30 @@
 option(OGRE_COPY_DEPENDENCIES "Copy dependency libs to the build directory" TRUE)

 macro(install_debug INPUT)
-  if (EXISTS ${OGRE_DEP_DIR}/lib/debug/${INPUT})
-    if (IS_DIRECTORY ${OGRE_DEP_DIR}/lib/debug/${INPUT})
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
+  if (EXISTS ${OGRE_DEP_DIR}/bin/debug/${INPUT})
+    if (IS_DIRECTORY ${OGRE_DEP_DIR}/bin/debug/${INPUT})
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
     else ()
-      install(FILES ${OGRE_DEP_DIR}/lib/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
+      install(FILES ${OGRE_DEP_DIR}/bin/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
     endif ()
   else()
-    message(send_error "${OGRE_DEP_DIR}/lib/debug/${INPUT} did not exist, can't install!")
+    message(send_error "${OGRE_DEP_DIR}/bin/debug/${INPUT} did not exist, can't install!")
   endif ()
 endmacro()

 macro(install_release INPUT)
-  if (EXISTS ${OGRE_DEP_DIR}/lib/release/${INPUT})
-    if (IS_DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT})
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
+  if (EXISTS ${OGRE_DEP_DIR}/bin/release/${INPUT})
+    if (IS_DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT})
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
     else ()
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
     endif ()
   else()
-    message(send_error "${OGRE_DEP_DIR}/lib/release/${INPUT} did not exist, can't install!")
+    message(send_error "${OGRE_DEP_DIR}/bin/release/${INPUT} did not exist, can't install!")
   endif ()
 endmacro()


Support MVAPICH2 1.9

Support MVAPICH2 1.9

--- CMake/hoomd/HOOMDMPISetup.cmake
+++ CMake/hoomd/HOOMDMPISetup.cmake
@@ -12,7 +12,7 @@
             # find out if this is MVAPICH2
             get_filename_component(_mpi_library_dir ${MPI_LIBRARY} PATH)
             find_program(MPICH2_VERSION
-                NAMES mpich2version
+                NAMES mpichversion mpich2version
                 HINTS ${_mpi_library_dir} ${_mpi_library_dir}/../bin
             )
             if (MPICH2_VERSION)


Issue #38: Minimise python warnings.

Issue #38: Minimise python warnings.

--- CMake/mpAddPythonBindings.cmake
+++ CMake/mpAddPythonBindings.cmake
@@ -20,31 +20,33 @@
 endif()

 if(BUILD_Python_Boost OR BUILD_Python_PyBind)
+
   find_package(PythonInterp)
   message("Found python interpreter: ${PYTHON_EXECUTABLE}")
   find_package(PythonLibs)
   message("Found python library version: ${PYTHONLIBS_VERSION_STRING}")
+
+  if (NOT PythonLibs_FOUND)
+    set(BUILD_Python_Boost OFF CACHE BOOL "Build boost::python bindings." FORCE)
+    set(BUILD_Python_PyBind OFF CACHE BOOL "Build PyBind11 bindings." FORCE)
+    message("Forcing BUILD_Python_Boost and BUILD_Python_PyBind to OFF as no Python libs were found.")
+  endif()
+
+  if (PythonLibs_FOUND)
+    if(BUILD_Python_Boost OR BUILD_Python_PyBind)
+      set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
+      message("Forcing BUILD_SHARED_LIBS to OFF as you want a python module.")
+    endif()
+  endif()
+
+  if(BUILD_Python_Boost)
+    list(APPEND MYPROJECT_BOOST_LIBS "system")
+    if (${PYTHON_VERSION_MAJOR} EQUAL 3 AND WITHIN_SUBBUILD)
+      list(APPEND MYPROJECT_BOOST_LIBS "python3")
+    else()
+      list(APPEND MYPROJECT_BOOST_LIBS "python")
+    endif()
+    list(REMOVE_DUPLICATES MYPROJECT_BOOST_LIBS)
+  endif()
+
 endif()
-
-if (NOT PythonLibs_FOUND)
-  set(BUILD_Python_Boost OFF CACHE BOOL "Build boost::python bindings." FORCE)
-  set(BUILD_Python_PyBind OFF CACHE BOOL "Build PyBind11 bindings." FORCE)
-  message("Forcing BUILD_Python_Boost and BUILD_Python_PyBind to OFF as no Python libs were found.")
-endif()
-
-if (PythonLibs_FOUND)
-  if(BUILD_Python_Boost OR BUILD_Python_PyBind)
-    set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE)
-    message("Forcing BUILD_SHARED_LIBS to OFF as you want a python module.")
-  endif()
-endif()
-
-if(BUILD_Python_Boost)
-  list(APPEND MYPROJECT_BOOST_LIBS "system")
-  if (${PYTHON_VERSION_MAJOR} EQUAL 3 AND WITHIN_SUBBUILD)
-    list(APPEND MYPROJECT_BOOST_LIBS "python3")
-  else()
-    list(APPEND MYPROJECT_BOOST_LIBS "python")
-  endif()
-  list(REMOVE_DUPLICATES MYPROJECT_BOOST_LIBS)
-endif()


Issue #44: Detect python include dir using python.

--- CMake/mpAddPythonBindings.cmake
+++ CMake/mpAddPythonBindings.cmake
@@ -28,9 +28,20 @@

   if (DEFINED MYPROJECT_PYTHON_VERSION)
     find_package(PythonInterp ${MYPROJECT_PYTHON_VERSION} EXACT REQUIRED)
-    find_package(PythonLibs ${MYPROJECT_PYTHON_VERSION} EXACT REQUIRED)
   else()
-    find_package(PythonInterp)
+    find_package(PythonInterp REQUIRED)
+
+    execute_process(
+      COMMAND "${PYTHON_EXECUTABLE}" -c
+              "from __future__ import print_function\ntry: import sysconfig; print(sysconfig.get_config_h_filename(), end='')\nexcept:pass\n"
+              OUTPUT_VARIABLE Py_INCLUDE_FILE)
+    get_filename_component(PYTHON_INCLUDE_DIR ${Py_INCLUDE_FILE} DIRECTORY)
+    message("Found python include dirs from python: ${PYTHON_INCLUDE_DIR}")
+    execute_process(
+      COMMAND "${PYTHON_EXECUTABLE}" -c
+              "from __future__ import print_function\ntry: import sysconfig; print(sysconfig.get_path('stdlib'), end='')\nexcept:pass\n"
+              OUTPUT_VARIABLE Py_LIB_DIR)
+    message("Found python lib dirs from python: ${Py_LIB_DIR}")
     find_package(PythonLibs)
   endif()


updating for package

updating for package

--- source/Packaging.cmake
+++ source/Packaging.cmake
@@ -98,7 +98,7 @@
 ####
 SET(ENV_ONLY_PACKAGE_SF1 $ENV{ONLY_PACKAGE_SF1})
 IF(NOT ENV_ONLY_PACKAGE_SF1)
-  INSTALL_RELATED_LIBRARIES(${Boost_LIBRARIES})
+#  INSTALL_RELATED_LIBRARIES(${Boost_LIBRARIES})
   INSTALL_RELATED_LIBRARIES(${izenelib_LIBRARIES})
   INSTALL_RELATED_LIBRARIES(${ilplib_LIBRARIES})
   INSTALL_RELATED_LIBRARIES(${imllib_LIBRARIES})
@@ -120,8 +120,20 @@

   INSTALL_RELATED_LIBRARIES(${TokyoCabinet_LIBRARIES})
   INSTALL_RELATED_LIBRARIES(${Glog_LIBRARIES})
-  INSTALL_RELATED_LIBRARIES(${Thrift_LIBRARIES})
   INSTALL_RELATED_LIBRARIES(${MYSQL_LIBRARIES})
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_date_time.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_filesystem.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_iostreams.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_program_options.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_regex.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_serialization.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_system.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_thread.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_unit_test_framework.so.1.47.0")
+  INSTALL_RELATED_LIBRARIES("/usr/local/lib/libthrift.so")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libicuuc.so")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libicui18n.so")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libicudata.so")

   IF( USE_WISEKMA )
     INSTALL( DIRECTORY ${wisekma_KNOWLEDGE}


MacOS: look for libs in newer subfolders

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -108,11 +108,11 @@
     # If this is Darwin, only accept Darwin
     if(APPLE)
       set(match FALSE)
-      string(FIND "${library}" "x64Darwin15clang7.0" _found)
+      string(FIND "${library}" "x64Darwin16clang8.0" _found)
       if(NOT ${_found} EQUAL -1)
         set(match TRUE)
       else()
-        string(FIND "${library}" "x64Darwin14clang6.0" _found)
+        string(FIND "${library}" "x64Darwin15clang7.0" _found)
         if(NOT ${_found} EQUAL -1)
           set(match TRUE)
         endif()


Increase the default 2MB stack size to 16 MB

--- cmake/OpenfastFortranOptions.cmake
+++ cmake/OpenfastFortranOptions.cmake
@@ -95,6 +95,13 @@
   if(CMAKE_BUILD_TYPE MATCHES Debug)
     set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fcheck=all -pedantic -fbacktrace" )
   endif()
+
+  if(CYGWIN)
+    # increase the default 2MB stack size to 16 MB
+    MATH(EXPR stack_size "16 * 1024 * 1024")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS},--stack,${stack_size}")
+  endif()
+
 endmacro(set_fast_gfortran)

 #


Stop building conan openblas every time

Stop building conan openblas every time

Former-commit-id: 8592c27a03d669316a2e5166b7dc87686aaf0f86

--- cmake/SetupDependenciesConan.cmake
+++ cmake/SetupDependenciesConan.cmake
@@ -105,7 +105,6 @@
                 ${DMRG_CONAN_OPTIONS}
                 KEEP_RPATHS
                 BUILD missing
-                BUILD openblas # This builds openblas everytime on github actions
         )

     endif()


[CMake] Use CLANG_INCLUDE_DIRS

[CMake] Use CLANG_INCLUDE_DIRS

Instead of listing all the clang include directories manually, just use
CLANG_INCLUDE_DIRS from the Clang CMake package that we import.

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -129,10 +129,8 @@

   set(CMAKE_INCLUDE_CURRENT_DIR ON)
   include_directories("${LLVM_BINARY_DIR}/include"
-                      "${LLVM_BINARY_DIR}/tools/clang/include"
                       "${LLVM_MAIN_INCLUDE_DIR}"
-                      "${PATH_TO_CLANG_BUILD}/include"
-                      "${LLDB_PATH_TO_CLANG_SOURCE}/include"
+                      "${CLANG_INCLUDE_DIRS}"
                       "${LLDB_PATH_TO_SWIFT_BUILD}/include"
                       "${LLDB_PATH_TO_SWIFT_SOURCE}/include"
                       "${CMAKE_CURRENT_SOURCE_DIR}/source")


fix: Update example config

fix: Update example config

--- examples/config.cmake
+++ examples/config.cmake
@@ -9,9 +9,9 @@

 [colors]
 background = #222
-background-dark = #bb
+background-alt = #444
 foreground = #dfdfdf
-foreground-dark = #55
+foreground-alt = #55
 primary = #ffb52a
 secondary = #e60053
 alert = #bd2c40
@@ -73,7 +73,7 @@

 format-underline = ${colors.secondary}
 format-prefix = " "
-format-prefix-foreground = ${colors.foreground-dark}
+format-prefix-foreground = ${colors.foreground-alt}

 label-layout = %layout%

@@ -92,14 +92,14 @@
 label-mounted = %mountpoint%: %percentage_free%

 label-unmounted = %mountpoint%: not mounted
-label-unmounted-foreground = ${colors.foreground-dark}
+label-unmounted-foreground = ${colors.foreground-alt}

 [module/bspwm]
 type = internal/bspwm
 ws-icon-default = x

 label-focused = %index%
-label-focused-background = ${colors.foreground-dark}
+label-focused-background = ${colors.background-alt}
 label-focused-underline= ${colors.primary}
 label-focused-padding = 2

@@ -111,7 +111,7 @@
 label-urgent-padding = 2

 label-empty = %index%
-label-empty-foreground = ${colors.foreground-dark}
+label-empty-foreground = ${colors.foreground-alt}
 label-empty-padding = 2

 [module/i3]
@@ -177,13 +177,13 @@
 bar-fill-foreground = #9f78e1
 bar-empty = ─
 bar-empty-font = 2
-bar-empty-foreground = ${colors.foreground-dark}
+bar-empty-foreground = ${colors.foreground-alt}

 [module/cpu]
 type = internal/cpu
 interval = 2
 format-prefix = " "
-format-prefix-foreground = ${colors.foreground-dark}
+format-prefix-foreground = ${colors.foreground-alt}
 format-underline = #f90000
 label = %percentage%

@@ -191,7 +191,7 @@
 type = internal/memory
 interval = 2
 format-prefix = " "
-format-prefix-foreground = ${colors.foreground-dark}
+format-prefix-foreground = ${colors.foreground-alt}
 format-underline = #4bffdc
 label = %percentage_used%

@@ -206,14 +206,14 @@

 label-connected = %essid%
 label-disconnected = %ifname% disconnected
-label-disconnected-foreground = ${colors.foreground-dark}
+label-disconnected-foreground = ${colors.foreground-alt}

 ramp-signal-0 = 
 ramp-signal-1 = 
 ramp-signal-2 = 
 ramp-signal-3 = 
 ramp-signal-4 = 
-ramp-signal-foreground = ${colors.foreground-dark}
+ramp-signal-foreground = ${colors.foreground-alt}

 [module/eth]
 type = internal/network
@@ -222,19 +222,19 @@

 format-connected-underline = #55aa55
 format-connected-prefix = " "
-format-connected-foreground-foreground = ${colors.foreground-dark}
+format-connected-foreground-foreground = ${colors.foreground-alt}
 label-connected = %local_ip%

 format-disconnected-underline = ${self.format-connected-underline}
 label-disconnected = %ifname% disconnected
-label-disconnected-foreground = ${colors.foreground-dark}
+label-disconnected-foreground = ${colors.foreground-alt}

 [module/date]
 type = internal/date
 date = %H:%M
 interval = 5
 format-prefix = " "
-format-prefix-foreground = ${colors.foreground-dark}
+format-prefix-foreground = ${colors.foreground-alt}
 format-underline = #0a6cf5

 [module/volume]
@@ -245,7 +245,7 @@
 label-volume-foreground = ${root.foreground}

 format-muted-prefix = " "
-format-muted-foreground = ${colors.foreground-dark}
+format-muted-foreground = ${colors.foreground-alt}
 label-muted = sound muted

 bar-volume-width = 10
@@ -264,7 +264,7 @@
 bar-volume-fill-font = 2
 bar-volume-empty = ─
 bar-volume-empty-font = 2
-bar-volume-empty-foreground = ${colors.foreground-dark}
+bar-volume-empty-foreground = ${colors.foreground-alt}

 [module/battery]
 type = internal/battery
@@ -279,18 +279,18 @@
 format-discharging-underline = ${self.format-charging-underline}

 format-full-prefix = " "
-format-full-prefix-foreground = ${colors.foreground-dark}
+format-full-prefix-foreground = ${colors.foreground-alt}
 format-full-underline = ${self.format-charging-underline}

 ramp-capacity-0 = 
 ramp-capacity-1 = 
 ramp-capacity-2 = 
-ramp-capacity-foreground = ${colors.foreground-dark}
+ramp-capacity-foreground = ${colors.foreground-alt}

 animation-charging-0 = 
 animation-charging-1 = 
 animation-charging-2 = 
-animation-charging-foreground = ${colors.foreground-dark}
+animation-charging-foreground = ${colors.foreground-alt}
 animation-charging-framerate = 750

 [module/temperature]
@@ -310,7 +310,7 @@
 ramp-0 = 
 ramp-1 = 
 ramp-2 = 
-ramp-foreground = ${colors.foreground-dark}
+ramp-foreground = ${colors.foreground-alt}

 [module/powermenu]
 type = custom/menu
@@ -320,7 +320,7 @@
 label-close =  cancel
 label-close-foreground = ${colors.secondary}
 label-separator = |
-label-separator-foreground = ${colors.foreground-dark}
+label-separator-foreground = ${colors.foreground-alt}

 menu-0-0 = reboot
 menu-0-0-exec = menu-open-1


Don't look for CppUnit unless BUILD_TESTS, general cleanup.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -9,39 +9,37 @@
 include(TestFloatFormat)

 # Check if the size of numeric types are suitable.
-
 check_type_size("short" SIZEOF_SHORT)
 if(NOT ${SIZEOF_SHORT} EQUAL 2)
-  MESSAGE(FATAL_ERROR "TagLib requires that short is 16-bit wide.")
+  message(FATAL_ERROR "TagLib requires that short is 16-bit wide.")
 endif()

 check_type_size("int" SIZEOF_INT)
 if(NOT ${SIZEOF_INT} EQUAL 4)
-  MESSAGE(FATAL_ERROR "TagLib requires that int is 32-bit wide.")
+  message(FATAL_ERROR "TagLib requires that int is 32-bit wide.")
 endif()

 check_type_size("long long" SIZEOF_LONGLONG)
 if(NOT ${SIZEOF_LONGLONG} EQUAL 8)
-  MESSAGE(FATAL_ERROR "TagLib requires that long long is 64-bit wide.")
+  message(FATAL_ERROR "TagLib requires that long long is 64-bit wide.")
 endif()

 check_type_size("wchar_t" SIZEOF_WCHAR_T)
 if(${SIZEOF_WCHAR_T} LESS 2)
-  MESSAGE(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.")
+  message(FATAL_ERROR "TagLib requires that wchar_t is sufficient to store a UTF-16 char.")
 endif()

 check_type_size("float" SIZEOF_FLOAT)
 if(NOT ${SIZEOF_FLOAT} EQUAL 4)
-  MESSAGE(FATAL_ERROR "TagLib requires that float is 32-bit wide.")
+  message(FATAL_ERROR "TagLib requires that float is 32-bit wide.")
 endif()

 check_type_size("double" SIZEOF_DOUBLE)
 if(NOT ${SIZEOF_DOUBLE} EQUAL 8)
-  MESSAGE(FATAL_ERROR "TagLib requires that double is 64-bit wide.")
+  message(FATAL_ERROR "TagLib requires that double is 64-bit wide.")
 endif()

 # Determine the CPU byte order.
-
 test_big_endian(IS_BIG_ENDIAN)

 if(NOT IS_BIG_ENDIAN)
@@ -51,19 +49,16 @@
 endif()

 # Check if the format of floating point types are suitable.
-
 test_float_format(FP_IEEE754)
 if(${FP_IEEE754} EQUAL 1)
   set(FLOAT_BYTEORDER 1)
 elseif(${FP_IEEE754} EQUAL 2)
   set(FLOAT_BYTEORDER 2)
 else()
-  MESSAGE(FATAL_ERROR "TagLib requires that floating point types are IEEE754 compliant.")
-endif()
-
+  message(FATAL_ERROR "TagLib requires that floating point types are IEEE754 compliant.")
+endif()

 # Determine which kind of atomic operations your compiler supports.
-
 check_cxx_source_compiles("
   #include <atomic>
   int main() {
@@ -207,21 +202,27 @@
 endif()

 # Determine whether your compiler supports some safer version of sprintf.
-
 check_cxx_source_compiles("
   #include <cstdio>
-  int main() { char buf[20]; snprintf(buf, 20, \"%d\", 1); return 0; }
+  int main() {
+    char buf[20];
+    snprintf(buf, 20, \"%d\", 1);
+    return 0;
+  }
 " HAVE_SNPRINTF)

 if(NOT HAVE_SNPRINTF)
   check_cxx_source_compiles("
     #include <cstdio>
-    int main() { char buf[20]; sprintf_s(buf, \"%d\", 1);  return 0; }
+    int main() {
+      char buf[20];
+      sprintf_s(buf, \"%d\", 1);
+      return 0;
+    }
   " HAVE_SPRINTF_S)
 endif()

 # Check for libz using the cmake supplied FindZLIB.cmake
-
 if(NOT ZLIB_SOURCE)
   find_package(ZLIB)
   if(ZLIB_FOUND)
@@ -231,8 +232,11 @@
   endif()
 endif()

-find_package(CppUnit)
-if(NOT CppUnit_FOUND AND BUILD_TESTS)
-  message(STATUS "CppUnit not found, disabling tests.")
-  set(BUILD_TESTS OFF)
-endif()
+if(BUILD_TESTS)
+  find_package(CppUnit)
+  if(NOT CppUnit_FOUND AND BUILD_TESTS)
+    message(STATUS "CppUnit not found, disabling tests.")
+    set(BUILD_TESTS OFF)
+  endif()
+endif()
+


COMP temporarily disable mitkTrackingDeviceSourceTest

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -14,6 +14,6 @@
    mitkNavigationDataTransformFilterTest.cpp
    mitkNDIPassiveToolTest.cpp
    mitkTimeStampTest.cpp
-   mitkTrackingDeviceSourceTest.cpp
+   #mitkTrackingDeviceSourceTest.cpp
    mitkTrackingVolumeTest.cpp
 )


CMake: Support tinyfiledialogs installations through vcpkg

--- CMake/InstallTinyFileDialogs.cmake
+++ CMake/InstallTinyFileDialogs.cmake
@@ -1,17 +1,20 @@
-FetchContent_Declare (
-	tinyfiledialogs
-	GIT_REPOSITORY [[https://git.code.sf.net/p/tinyfiledialogs/code]]
-	GIT_TAG [[e11f94cd7887b101d64f74892d769f0139b5e166]]
-)
+find_package (tinyfiledialogs QUIET)
+if (NOT tinyfiledialogs_FOUND)
+	FetchContent_Declare (
+		tinyfiledialogs
+		GIT_REPOSITORY [[https://git.code.sf.net/p/tinyfiledialogs/code]]
+		GIT_TAG [[e11f94cd7887b101d64f74892d769f0139b5e166]]
+	)

-FetchContent_GetProperties (tinyfiledialogs)
-if (NOT tinyfiledialogs_POPULATED)
-	message (STATUS "Cloning tinyfiledialogs…")
-	FetchContent_Populate (tinyfiledialogs)
+	FetchContent_GetProperties (tinyfiledialogs)
+	if (NOT tinyfiledialogs_POPULATED)
+		message (STATUS "Cloning tinyfiledialogs…")
+		FetchContent_Populate (tinyfiledialogs)
+	endif ()
+
+	add_library( tinyfiledialogs::tinyfiledialogs INTERFACE IMPORTED)
+	set_target_properties(tinyfiledialogs::tinyfiledialogs PROPERTIES
+		INTERFACE_INCLUDE_DIRECTORIES "${tinyfiledialogs_SOURCE_DIR}"
+		INTERFACE_SOURCES "${tinyfiledialogs_SOURCE_DIR}/tinyfiledialogs.c"
+	)
 endif ()
-
-add_library( tinyfiledialogs::tinyfiledialogs INTERFACE IMPORTED)
-set_target_properties(tinyfiledialogs::tinyfiledialogs PROPERTIES
-	INTERFACE_INCLUDE_DIRECTORIES "${tinyfiledialogs_SOURCE_DIR}"
-	INTERFACE_SOURCES "${tinyfiledialogs_SOURCE_DIR}/tinyfiledialogs.c"
-)


Fix the library name in the FindGLES2 script

--- CMake/Packages/FindOpenGLES2.cmake
+++ CMake/Packages/FindOpenGLES2.cmake
@@ -50,7 +50,7 @@

     FIND_LIBRARY(OPENGLES2_gl_LIBRARY
-      NAMES GLES_CM
+      NAMES GLESv2
       PATHS /opt/graphics/OpenGL/lib
             /usr/openwin/lib
             /usr/shlib /usr/X11R6/lib


change glbinding cmake build script to be consistent with others

--- CMakeModules/build_glbinding.cmake
+++ CMakeModules/build_glbinding.cmake
@@ -28,13 +28,15 @@
     GIT_REPOSITORY https://github.com/cginternals/glbinding.git
     GIT_TAG v2.1.1
     UPDATE_COMMAND ""
+    PREFIX "${prefix}"
+    INSTALL_DIR "${prefix}"
     CONFIGURE_COMMAND ${CMAKE_COMMAND} -Wno-dev "-G${CMAKE_GENERATOR}" <SOURCE_DIR>
     -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
     -DCMAKE_CXX_FLAGS:STRING=${CXXFLAGS}
     -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
     -DCMAKE_C_FLAGS:STRING=${CFLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-    -DCMAKE_INSTALL_PREFIX:STRING=${prefix}
+    -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
     -DBUILD_SHARED_LIBS:BOOL=OFF
     -DOPTION_BUILD_TESTS:BOOL=OFF
     ${byproducts}
@@ -42,10 +44,12 @@

 ADD_LIBRARY(glbinding IMPORTED STATIC)

+ExternalProject_Get_Property(glb-ext install_dir)
+
 SET_TARGET_PROPERTIES(glbinding PROPERTIES IMPORTED_LOCATION ${glbinding_location})

 ADD_DEPENDENCIES(glbinding glb-ext)

-SET(GLBINDING_INCLUDE_DIRS ${prefix}/include CACHE INTERNAL "" FORCE)
+SET(GLBINDING_INCLUDE_DIRS ${install_dir}/include CACHE INTERNAL "" FORCE)
 SET(GLBINDING_LIBRARIES ${glbinding_location} CACHE INTERNAL "" FORCE)
 SET(GLBINDING_FOUND ON CACHE INTERNAL "" FORCE)


Not block PDB file in multithreaded build on Windows.

If used cl compiler, but generator is not Visual Studio e.g. Ninja,
enable FS option to prevent blocking PDB file in multithreaded build.

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -265,6 +265,11 @@
   endif()
 endif()

+if(MSVC12 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+  set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /FS")
+  set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /FS")
+endif()
+
 # Extra link libs if the user selects building static libs:
 if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID)
   # Android does not need these settings because they are already set by toolchain file


[CMake] Use ABI version 2 for C++ library in Fuchsia

Fuchsia has always been using ABI version 2 but I forgot this option
when setting up the cache file for runtimes build.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@308705 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -46,6 +46,7 @@
   set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
   set(RUNTIMES_${target}-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+  set(RUNTIMES_${target}-fuchsia_LIBCXX_ABI_VERSION 2 CACHE STRING "")
 endforeach()

 # Setup toolchain.


Fix typo

Fix typo

--- PolysquareCommon.cmake
+++ PolysquareCommon.cmake
@@ -160,7 +160,7 @@

     endif (ADD_CHECK_VERAPP)

-    if (ADD_CHECK_CPPCEHCK)
+    if (ADD_CHECK_CPPCHECK)

         cppcheck_target_sources (${TARGET}
                                  INCLUDES


Remove prefixing of install components, obsoleted by Collage separation

--- PurpleAddLibrary.cmake
+++ PurpleAddLibrary.cmake
@@ -32,7 +32,6 @@
     )

   parse_arguments(THIS "${ARG_NAMES}" "${OPTION_NAMES}" ${ARGN})
-  string(REGEX MATCH "^[a-z]+" SHORT_NAME ${THIS_HEADERS_PREFIX})

   if(MSVC OR XCODE_VERSION)
     set(THIS_DEFINITIONS ${UPPER_NAME}_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}\")
@@ -82,9 +81,8 @@
       LINK_LIBRARIES "${THIS_LINK_LIBRARIES}"
       FOLDER "Libraries" PROJECT_LABEL "${NAME}"
       )
-
     if(NOT THIS_EXCLUDE_FROM_ALL)
-      purple_install_pdb(${THIS_TARGET} DESTINATION bin COMPONENT ${SHORT_NAME}dev)
+      purple_install_pdb(${THIS_TARGET} DESTINATION bin COMPONENT dev)
     endif(NOT THIS_EXCLUDE_FROM_ALL)
   endif(THIS_SHARED)

@@ -115,15 +113,15 @@
   foreach(HEADER ${THIS_HEADERS})
     string(REGEX MATCH "(.*)[/\\]" DIR ${HEADER})
     install(FILES ${HEADER}
-      DESTINATION include/${THIS_HEADERS_PREFIX}/${DIR} COMPONENT ${SHORT_NAME}dev)
+      DESTINATION include/${THIS_HEADERS_PREFIX}/${DIR} COMPONENT dev)
     #set_property(SOURCE ${HEADER} PROPERTY MACOSX_PACKAGE_LOCATION Headers/${DIR})
   endforeach(HEADER ${THIS_HEADERS})

   if(NOT THIS_EXCLUDE_FROM_ALL)
     install(TARGETS ${THIS_TARGETS}
-      ARCHIVE DESTINATION ${LIBRARY_DIR} COMPONENT ${SHORT_NAME}dev
-      RUNTIME DESTINATION bin COMPONENT ${SHORT_NAME}lib
-      LIBRARY DESTINATION ${LIBRARY_DIR} COMPONENT ${SHORT_NAME}lib
+      ARCHIVE DESTINATION ${LIBRARY_DIR} COMPONENT dev
+      RUNTIME DESTINATION bin COMPONENT lib
+      LIBRARY DESTINATION ${LIBRARY_DIR} COMPONENT lib
       )
   endif(NOT THIS_EXCLUDE_FROM_ALL)
 endfunction(PURPLE_ADD_LIBRARY NAME)


Disable unused Paraview options

Disable unused Paraview options

--- Superbuild/Projects/paraview.cmake
+++ Superbuild/Projects/paraview.cmake
@@ -10,7 +10,7 @@
     -DPARAVIEW_ENABLE_VTK_MODULES_AS_NEEDED:BOOL=FALSE
     -DPARAVIEW_ENABLE_WEB:BOOL=FALSE
     -DPARAVIEW_ENABLE_MATPLOTLIB:BOOL=FALSE
-    -DPARAVIEW_ENABLE_SPYPLOT_MARKER:BOOL=FALSE
+    -DPARAVIEW_ENABLE_SPYPLOT_MARKERS:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_AcceleratedAlgorithms:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_AdiosReader:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_AnalyzeNIfTIIO:BOOL=FALSE
@@ -45,7 +45,9 @@
     -DHDF5_ENABLE_EMBEDDED_LIBINFO:BOOL=FALSE
     -DHDF5_ENABLE_DIRECT_VFD:BOOL=FALSE
     -DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION:BOOL=FALSE
-
+    -DPARAVIEW_CLIENT_RENDER_SERVER_TESTS:BOOL=FALSE
+    -DPARAVIEW_COLLABORATION_TESTING:BOOL=FALSE
+    -DVTK_BUILD_QT_DESIGNER_PLUGIN:BOOL=FALSE

     -DPARAVIEW_BUILD_PLUGIN_PythonQtPlugin:BOOL=TRUE
     -DPYTHONQT_DIR:PATH=<INSTALL_DIR>


use SOURCE_SUBDIR for NIFTYPET

use SOURCE_SUBDIR for NIFTYPET

--- SuperBuild/External_NIFTYPET.cmake
+++ SuperBuild/External_NIFTYPET.cmake
@@ -53,11 +53,12 @@
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${${proj}_URL}"
     GIT_TAG "${${proj}_TAG}"
-    SOURCE_DIR ${${proj}_SOURCE_DIR}/niftypet/niftypet
+    SOURCE_DIR ${${proj}_SOURCE_DIR}
     BINARY_DIR ${${proj}_BINARY_DIR}
     DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR}
     STAMP_DIR ${${proj}_STAMP_DIR}
     TMP_DIR ${${proj}_TMP_DIR}
+    SOURCE_SUBDIR niftypet

     CMAKE_ARGS
         -DCMAKE_PREFIX_PATH=${SUPERBUILD_INSTALL_DIR}


trying to fix linux build error

trying to fix linux build error

--- indra/cmake/Copy3rdPartyLibs.cmake
+++ indra/cmake/Copy3rdPartyLibs.cmake
@@ -268,12 +268,15 @@
         libopenal.so
         libopenjpeg.so
         libssl.so
-        libtcmalloc_minimal.so
         libuuid.so.16
         libuuid.so.16.0.22
         libssl.so.1.0.0
         libfontconfig.so.1.4.4
        )
+
+    if (USE_TCMALLOC)
+      set(release_files ${release_files} "libtcmalloc_minimal.so")
+    endif (USE_TCMALLOC)

     if (FMOD)
       set(release_files ${release_files} "libfmod-3.75.so")


[CMake] Plugins now handle export.

[CMake] Plugins now handle export.

--- cmake-modules/hpp-core-plugin.cmake
+++ cmake-modules/hpp-core-plugin.cmake
@@ -20,7 +20,8 @@
   SET(multiValueArgs
     SOURCES
     LINK_DEPENDENCIES
-    PKG_CONFIG_DEPENDENCIES)
+    PKG_CONFIG_DEPENDENCIES
+    EXPORT)
   CMAKE_PARSE_ARGUMENTS(PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   IF(PLUGIN_EXCLUDE_FROM_ALL)
     SET(_options ${_options} EXCLUDE_FROM_ALL)
@@ -34,7 +35,9 @@
   ENDFOREACH()

   IF(NOT PLUGIN_EXCLUDE_FROM_ALL)
-    INSTALL(TARGETS ${PLUGIN_NAME} DESTINATION lib/hppPlugins)
+    INSTALL(TARGETS ${PLUGIN_NAME}
+      EXPORT ${PLUGIN_EXPORT}
+      DESTINATION lib/hppPlugins)
   ENDIF()
 ENDMACRO()


Fix installation of cxxabi.h through libc++.

Previously, the install command for the cxxabi headers specified
the wrong component, and therefore they were not being included
in the install-cxx command.

This patch corrects the component name.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@318989 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/HandleLibCXXABI.cmake
+++ cmake/Modules/HandleLibCXXABI.cmake
@@ -56,7 +56,7 @@
         if (LIBCXX_INSTALL_HEADERS)
           install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
             DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir}
-            COMPONENT libcxx
+            COMPONENT cxx-headers
             PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
             )
         endif()


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

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


cmake setup fixed

cmake setup fixed

--- cmake/avr-arduino-toolchain.cmake
+++ cmake/avr-arduino-toolchain.cmake
@@ -51,7 +51,7 @@
 set(MONITOR_ARGS            "${PROG_DEV} ${BAUD}"   CACHE STRING  "serial monitor arguments")

 set(COMPILER_FLAGS          "-Os -Wall -Wno-unknown-pragmas -Wextra -MMD -mmcu=${MCU} -DF_CPU=${F_CPU}" CACHE STRING "")
-set(CMAKE_C_FLAGS           "${COMPILER_FLAGS} -std=gnu99 -mcall-prologues -ffunction-sections -fdata-sections" CACHE STRING "")
+set(CMAKE_C_FLAGS           "${COMPILER_FLAGS} -std=gnu99 -ffunction-sections -fdata-sections" CACHE STRING "")
 set(CMAKE_CXX_FLAGS         "${COMPILER_FLAGS} -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics" CACHE STRING "")
 set(CMAKE_ASM_FLAGS         "-x assembler-with-cpp ${COMPILER_FLAGS} " CACHE STRING "")
 set(CMAKE_EXE_LINKER_FLAGS  "-Wl,--gc-sections ${EXTRA_LIBS}" CACHE STRING "")
@@ -118,53 +118,58 @@
     set (ARDUINO_SDK_PATH "$ENV{ARDUINO_SDK_PATH}" CACHE PATH "Arduino SDK Path" FORCE)
 endif()

-# only prepare the toolchain
-if(NOT(TARGET arduin-core) AND DEFINED ARDUINO_SDK_PATH AND IS_DIRECTORY ${ARDUINO_SDK_PATH})
-    # set the paths
-    set(ARDUINO_CORES_PATH ${ARDUINO_SDK_PATH}/hardware/arduino/avr/cores/arduino)
-    set(ARDUINO_VARIANTS_PATH ${ARDUINO_SDK_PATH}/hardware/arduino/avr/variants/standard)
-    set(ARDUINO_LIBRARIES_PATH ${ARDUINO_SDK_PATH}/hardware/arduino/avr/libraries)
-
-    # add some of the default definitions (TODO: identify from Arduino IDE)
-    add_definitions(-DARDUINO=10605)
-    add_definitions(-DARDUINO_AVR_UNO)
-    add_definitions(-DARDUINO_ARCH_AVR)
-
-    # configure the core library
-    file(GLOB_RECURSE ARDUINO_CORES_SRCS ${ARDUINO_CORES_PATH}/*.S ${ARDUINO_CORES_PATH}/*.c ${ARDUINO_CORES_PATH}/*.cpp)
-    if(NOT TARGET ${NAME} arduino-core)
-        add_library(arduino-core ${ARDUINO_CORES_SRCS})
-    endif()
-    target_include_directories(arduino-core PUBLIC ${ARDUINO_CORES_PATH})
-    target_include_directories(arduino-core PUBLIC ${ARDUINO_VARIANTS_PATH})
-
-    # configure all the additional libraries in the core
-    file(GLOB CORE_DIRS ${ARDUINO_LIBRARIES_PATH}/*)
-    set(ARDUINO_LIBS "" CACHE INTERNAL "arduino core libraries")
-    foreach(libdir ${CORE_DIRS})
-        get_filename_component(libname ${libdir} NAME)
-        if(IS_DIRECTORY ${libdir})
-            file(GLOB_RECURSE sources ${libdir}/*.cpp ${libdir}/*.S ${libdir}/*.c )
-            string(REGEX REPLACE "examples/.*" "" sources "${sources}")
-            if(sources)
-                if(NOT TARGET ${libname})
-                    message(STATUS "Adding Arduino Core library: ${libname}")
-                    add_library(${libname} ${sources})
+set(ARDUINO_CORE_LIBS "" CACHE INTERNAL "arduino core libraries")
+function(setup_arduino_core)
+    if(DEFINED ARDUINO_SDK_PATH AND IS_DIRECTORY ${ARDUINO_SDK_PATH} AND NOT(TARGET arduino-core))
+        # set the paths
+        set(ARDUINO_CORES_PATH      ${ARDUINO_SDK_PATH}/hardware/arduino/avr/cores/arduino CACHE STRING "")
+        set(ARDUINO_VARIANTS_PATH   ${ARDUINO_SDK_PATH}/hardware/arduino/avr/variants/standard CACHE STRING "")
+        set(ARDUINO_LIBRARIES_PATH  ${ARDUINO_SDK_PATH}/hardware/arduino/avr/libraries CACHE STRING "")
+
+        # find arduino-core sources
+        file(GLOB_RECURSE CORE_SOURCES ${ARDUINO_CORES_PATH}/*.S ${ARDUINO_CORES_PATH}/*.c ${ARDUINO_CORES_PATH}/*.cpp)
+
+        set(ARDUINO_CORE_SRCS ${CORE_SOURCES} CACHE STRING "Arduino core library sources")
+
+        # setup the main arduino core target
+        add_library(arduino-core ${ARDUINO_CORE_SRCS})
+        target_include_directories(arduino-core PUBLIC ${ARDUINO_CORES_PATH})
+        target_include_directories(arduino-core PUBLIC ${ARDUINO_VARIANTS_PATH})
+
+        # configure all the additional libraries in the core
+        file(GLOB CORE_DIRS ${ARDUINO_LIBRARIES_PATH}/*)
+        foreach(libdir ${CORE_DIRS})
+            get_filename_component(libname ${libdir} NAME)
+            if(IS_DIRECTORY ${libdir})
+                file(GLOB_RECURSE sources ${libdir}/*.cpp ${libdir}/*.S ${libdir}/*.c )
+                string(REGEX REPLACE "examples/.*" "" sources "${sources}")
+                if(sources)
+                    if(NOT TARGET ${libname})
+                        message(STATUS "Adding Arduino Core library: ${libname}")
+                        add_library(${libname} ${sources})
+                    endif()
+                    target_link_libraries(${libname} arduino-core)
+                    foreach(src ${sources})
+                        get_filename_component(dir ${src} PATH)
+                        target_include_directories(${libname} PUBLIC ${dir})
+                    endforeach()
+                    list(APPEND ARDUINO_CORE_LIBS ${libname})
+                    set(ARDUINO_CORE_LIBS ${ARDUINO_CORE_LIBS} CACHE INTERNAL "arduino core libraries")
+                else()
+                    include_directories(SYSTEM ${libdir})
                 endif()
-                target_link_libraries(${libname} arduino-core)
-                foreach(src ${sources})
-                    get_filename_component(dir ${src} PATH)
-                    target_include_directories(${libname} PUBLIC ${dir})
-                endforeach()
-                list(APPEND ARDUINO_LIBS ${libname})
-            else()
-                include_directories(SYSTEM ${libdir})
-            endif()
-        endif()
-    endforeach()
-endif()
+            endif()
+        endforeach()
+
+        # add some of the default definitions (TODO: identify from Arduino IDE)
+        add_definitions(-DARDUINO=10605)
+        add_definitions(-DARDUINO_AVR_UNO)
+        add_definitions(-DARDUINO_ARCH_AVR)
+     endif()
+endfunction()

 function(add_sketches SKETCHES_PATH)
+    setup_arduino_core()
     if(TARGET arduino-core)
         # finally add all the sketches
         file(GLOB SRC_DIRS "${SKETCHES_PATH}/*/CMakeLists.txt")
@@ -181,49 +186,46 @@
     endif()
 endfunction()

-set(SKETCH_LIBS "" CACHE INTERNAL "arduino sketch libraries")
+set(SKETCH_LIBS "" CACHE STRING "arduino sketch libraries")
 # add a sketch dependency by giving the target and a git url
 function(target_sketch_library TARGET NAME URL)
-    if(TARGET arduino-core)
-        if(NOT TARGET ${NAME})
-            # try to install dependent libraries
-            find_package(Git)
-            if(GIT_FOUND)
-                # clone dependency into libraries
-                get_filename_component(MYLIBS "${CMAKE_CURRENT_SOURCE_DIR}/../libraries" REALPATH)
-                if(NOT EXISTS ${MYLIBS})
-                    message(STATUS "creating library directory: ${MYLIBS}")
-                    file(MAKE_DIRECTORY ${MYLIBS})
-                endif()
-                if(NOT EXISTS ${MYLIBS}/${NAME})
-                    message(STATUS "Installing ${NAME} (${URL})")
-                    execute_process(
-                        COMMAND ${GIT_EXECUTABLE} clone "${URL}" "${NAME}"
-                        WORKING_DIRECTORY ${MYLIBS})
-                endif()
-
-                # now add a library target
-                file(GLOB_RECURSE sources ${MYLIBS}/${NAME}/*.S ${MYLIBS}/${NAME}/*.c ${MYLIBS}/${NAME}/*.cpp )
-                string(REGEX REPLACE "examples/.*" "" sources "${sources}")
-                if(sources)
-                    message(STATUS "Adding external library: ${NAME}")
-                    add_library(${NAME} ${sources})
-                    target_link_libraries(${NAME} ${ARDUINO_LIBS} ${SKETCH_LIBS})
-                    list(APPEND SKETCH_LIBS ${NAME})
-                    set(SKETCH_LIBS ${SKETCH_LIBS} CACHE INTERNAL "arduino sketch libraries")
-                    foreach(src ${sources})
-                        get_filename_component(dir ${src} PATH)
-                        target_include_directories(${NAME} PUBLIC ${dir})
-                    endforeach()
-                else()
-                    message(FATAL_ERROR "Could not find sources in library ${NAME}!")
-                endif()
+    setup_arduino_core()
+    if(TARGET arduino-core AND NOT TARGET ${NAME})
+        # try to install dependent libraries
+        find_package(Git)
+        if(GIT_FOUND)
+            # clone dependency into libraries
+            get_filename_component(MYLIBS "${CMAKE_CURRENT_SOURCE_DIR}/../libraries" REALPATH)
+            if(NOT EXISTS ${MYLIBS})
+                message(STATUS "creating library directory: ${MYLIBS}")
+                file(MAKE_DIRECTORY ${MYLIBS})
+            endif()
+            if(NOT EXISTS ${MYLIBS}/${NAME})
+                message(STATUS "Installing ${NAME} (${URL})")
+                execute_process(
+                    COMMAND ${GIT_EXECUTABLE} clone "${URL}" "${NAME}"
+                    WORKING_DIRECTORY ${MYLIBS})
+            endif()
+
+            # now add a library target
+            file(GLOB_RECURSE sources ${MYLIBS}/${NAME}/*.S ${MYLIBS}/${NAME}/*.c ${MYLIBS}/${NAME}/*.cpp )
+            string(REGEX REPLACE "examples/.*" "" sources "${sources}")
+            if(sources)
+                message(STATUS "Adding external library: ${NAME}")
+                add_library(${NAME} ${sources})
+                target_link_libraries(${NAME} ${ARDUINO_CORE_LIBS} ${SKETCH_LIBS})
+                list(APPEND SKETCH_LIBS ${NAME})
+                set(SKETCH_LIBS ${SKETCH_LIBS} CACHE STRING "arduino sketch libraries")
+                foreach(src ${sources})
+                    get_filename_component(dir ${src} PATH)
+                    target_include_directories(${NAME} PUBLIC ${dir})
+                endforeach()
             else()
-                message(FATAL_ERROR "Missing git, please install and try again!")
-            endif()
+                message(FATAL_ERROR "Could not find sources in library ${NAME}!")
+            endif()
+        else()
+            message(FATAL_ERROR "Missing git, please install and try again!")
         endif()
         target_link_libraries(${TARGET} ${NAME})
-    else()
-        message(WARNING "No Arduino SDK found at '${ARDUINO_SDK_PATH}', can't compile 3rd party libs!")
     endif()
 endfunction(target_sketch_library)


[Fuchsia] Use llvm-objcopy as objcopy on non-Darwin hosts

llvm-objcopy already supports all the necessary functionality for ELF.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@322252 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -17,6 +17,7 @@
 if(NOT APPLE)
   set(LLVM_ENABLE_LLD ON CACHE BOOL "")
   set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
+  set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
 endif()

 if(APPLE)


[CMake] Include llvm-strip in Fuchsia toolchain distribution

Now that llvm-strip is available, include it in the Fuchsia toolchain.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@331826 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -108,6 +108,7 @@
   llvm-readelf
   llvm-readobj
   llvm-size
+  llvm-strip
   llvm-symbolizer
   opt
   sancov


Place the generated .pcm file on the same location as the library (2nd). Introduced NOINSTALL option in ROOT_GENERATE_DICTIONARY(...) macro to disable installation of .pcm files.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -213,7 +213,7 @@
 #                                                    STAGE1 LINKDEF linkdef OPTIONS opt1 opt2 ...)
 #---------------------------------------------------------------------------------------------------
 function(ROOT_GENERATE_DICTIONARY dictionary)
-  CMAKE_PARSE_ARGUMENTS(ARG "STAGE1;MULTIDICT" "MODULE" "LINKDEF;OPTIONS;DEPENDENCIES" ${ARGN})
+  CMAKE_PARSE_ARGUMENTS(ARG "STAGE1;MULTIDICT;NOINSTALL" "MODULE" "LINKDEF;OPTIONS;DEPENDENCIES" ${ARGN})

   #---roottest compability---------------------------------
   if(CMAKE_ROOTTEST_DICT)
@@ -298,6 +298,7 @@
     endif()
   else()
     set(library_name ${libprefix}${deduced_arg_module}${libsuffix})
+    set(newargs -s ${library_output_dir}/${library_name})
     set(pcm_name ${library_output_dir}/${libprefix}${deduced_arg_module}_rdict.pcm)
     set(rootmap_name ${library_output_dir}/${libprefix}${deduced_arg_module}.rootmap)
   endif()
@@ -338,7 +339,7 @@
   get_filename_component(dictname ${dictionary} NAME)

   #---roottest compability
-  if(CMAKE_ROOTTEST_DICT OR (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY))
+  if(ARG_NOINSTALL OR CMAKE_ROOTTEST_DICT OR (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY))
     add_custom_target(${dictname} DEPENDS ${dictionary}.cxx)
   else()
     add_custom_target(${dictname} DEPENDS ${dictionary}.cxx)


Fix for ROOT-8698 - CMake build does not ignore previous ROOT installations

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -472,7 +472,7 @@
   if(ARG_TEST) # we are building a test, so add EXCLUDE_FROM_ALL
     set(_all EXCLUDE_FROM_ALL)
   endif()
-  include_directories(${CMAKE_BINARY_DIR}/include)                # This is a copy and certainly should last one
+  include_directories(BEFORE ${CMAKE_BINARY_DIR}/include)
   set(library_name ${library})
   if(TARGET ${library})
     message("Target ${library} already exists. Renaming target name to ${library}_new")
@@ -578,7 +578,7 @@
 function(ROOT_OBJECT_LIBRARY library)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "BUILTINS"  ${ARGN})
   ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS})
-  include_directories(AFTER ${CMAKE_BINARY_DIR}/include)
+  include_directories(BEFORE ${CMAKE_BINARY_DIR}/include)
   add_library( ${library} OBJECT ${lib_srcs})
   if(lib_srcs MATCHES "(^|/)(G__[^.]*)[.]cxx.*")
      add_dependencies(${library} ${CMAKE_MATCH_2})
@@ -635,7 +635,7 @@
 function(ROOT_MODULE_LIBRARY library)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "LIBRARIES" ${ARGN})
   ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS})
-  include_directories(${CMAKE_BINARY_DIR}/include)
+  include_directories(BEFORE ${CMAKE_BINARY_DIR}/include)
   add_library( ${library} SHARED ${lib_srcs})
   add_dependencies(${library} move_headers)
   set_target_properties(${library}  PROPERTIES ${ROOT_LIBRARY_PROPERTIES})
@@ -783,7 +783,7 @@
   if(ARG_TEST) # we are building a test, so add EXCLUDE_FROM_ALL
     set(_all EXCLUDE_FROM_ALL)
   endif()
-  include_directories(${CMAKE_BINARY_DIR}/include)
+  include_directories(BEFORE ${CMAKE_BINARY_DIR}/include)
   add_executable( ${executable} ${_all} ${exe_srcs})
   target_link_libraries(${executable} ${ARG_LIBRARIES} )
   if(WIN32 AND ${executable} MATCHES .exe)


Fix a build issue in onnxruntime_unittests.cmake (#307)

--- cmake/onnxruntime_unittests.cmake
+++ cmake/onnxruntime_unittests.cmake
@@ -41,7 +41,7 @@
     if (onnxruntime_USE_CUDA)
       # disable a warning from the CUDA headers about unreferenced local functions
       if (MSVC)
-        target_compile_options(onnxruntime_providers_cuda PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler /wd4505>"
+        target_compile_options(${_UT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler /wd4505>"
                 "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/wd4505>")
       endif()
     endif()


Fix missing include in FindPythonModule.cmake.

--- cmake/Modules/FindPythonModule.cmake
+++ cmake/Modules/FindPythonModule.cmake
@@ -1,6 +1,7 @@
 # Find if a Python module is installed
 # Found at http://www.cmake.org/pipermail/cmake/2011-January/041666.html
 # To use do: find_python_module(PyQt4 REQUIRED)
+include(FindPackageHandleStandardArgs)
 function(find_python_module module)
 	string(TOUPPER ${module} module_upper)
 	if(NOT PY_${module_upper})


[Exp PyROOT] Unset variables before looking for Python

The following CMake variables:
PYTHON_INCLUDE_DIR
PYTHON_LIBRARY
are unset in order to allow the use to specify only -DPYTHON_EXECUTABLE
at configure time.

The following variable:
CMAKE_INSTALL_PYROOTIR
is unset in order to install the package in the correct path.

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -388,6 +388,9 @@
 #---Check for Python installation-------------------------------------------------------

 message(STATUS "Looking for python")
+unset(PYTHON_INCLUDE_DIR CACHE)
+unset(PYTHON_LIBRARY CACHE)
+unset(CMAKE_INSTALL_PYROOTDIR)
 # Python is required by header and manpage generation

 if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)