ENH: Synchronized with cmake version of file

Syncronized change with cmake 3.10 for the GenerateExportHeader.cmake file.
This includes one bug fix, and few feature, but retains the ITK specialization
for USE_COMPILER_HIDDEN_VISIBILITY.

Change-Id: I84d1ae4bceba8111fb2e16ade9072d1876462a60

--- CMake/GenerateExportHeader.cmake
+++ CMake/GenerateExportHeader.cmake
@@ -1,3 +1,6 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
 #.rst:
 # GenerateExportHeader
 # --------------------
@@ -20,6 +23,7 @@
 #              [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
 #              [DEFINE_NO_DEPRECATED]
 #              [PREFIX_NAME <prefix_name>]
+#              [CUSTOM_CONTENT_FROM_VARIABLE <variable>]
 #    )
 #
 #
@@ -59,9 +63,10 @@
 #
 # The CMake fragment will generate a file in the
 # ``${CMAKE_CURRENT_BINARY_DIR}`` called ``somelib_export.h`` containing the
-# macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``,
-# ``SOMELIB_DEPRECATED``, ``SOMELIB_DEPRECATED_EXPORT`` and
-# ``SOMELIB_DEPRECATED_NO_EXPORT``.
+# macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``, ``SOMELIB_DEPRECATED``,
+# ``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``.
+# They will be followed by content taken from the variable specified by
+# the ``CUSTOM_CONTENT_FROM_VARIABLE`` option, if any.
 # The resulting file should be installed with other headers in the library.
 #
 # The ``BASE_NAME`` argument can be used to override the file name and the
@@ -79,7 +84,7 @@
 # ``OTHER_NAME_EXPORT``, ``OTHER_NAME_NO_EXPORT`` and ``OTHER_NAME_DEPRECATED``
 # etc.
 #
-# The ``BASE_NAME`` may be overridden by specifiying other options in the
+# The ``BASE_NAME`` may be overridden by specifying other options in the
 # function.  For example:
 #
 # .. code-block:: cmake
@@ -179,19 +184,6 @@
 # :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>` and
 # :prop_tgt:`VISIBILITY_INLINES_HIDDEN` instead.

-#=============================================================================
-# Copyright 2011 Stephen Kelly <steveire@gmail.com>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
 include(CMakeParseArguments)
 include(CheckCXXCompilerFlag)

@@ -206,7 +198,7 @@

   if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2")
     set(GCC_TOO_OLD TRUE)
-  elseif(CMAKE_COMPILER_IS_GNUC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.2")
+  elseif(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.2")
     set(GCC_TOO_OLD TRUE)
   elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0")
     set(_INTEL_TOO_OLD TRUE)
@@ -231,7 +223,11 @@
 endmacro()

 macro(_test_compiler_has_deprecated)
+  # NOTE:  Some Embarcadero compilers silently compile __declspec(deprecated)
+  # without error, but this is not a documented feature and the attribute does
+  # not actually generate any warnings.
   if(CMAKE_CXX_COMPILER_ID MATCHES Borland
+      OR CMAKE_CXX_COMPILER_ID MATCHES Embarcadero
       OR CMAKE_CXX_COMPILER_ID MATCHES HP
       OR GCC_TOO_OLD
       OR CMAKE_CXX_COMPILER_ID MATCHES PGI
@@ -259,6 +255,7 @@
   set(DEFINE_EXPORT)
   set(DEFINE_IMPORT)
   set(DEFINE_NO_EXPORT)
+
   if (COMPILER_HAS_DEPRECATED_ATTR)
     set(DEFINE_DEPRECATED "__attribute__ ((__deprecated__))")
   elseif(COMPILER_HAS_DEPRECATED)
@@ -282,10 +279,9 @@
 macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   # Option overrides
   set(options DEFINE_NO_DEPRECATED)
-  set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME
-    EXPORT_FILE_NAME
+  set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME
     DEPRECATED_MACRO_NAME NO_EXPORT_MACRO_NAME STATIC_DEFINE
-    NO_DEPRECATED_MACRO_NAME)
+    NO_DEPRECATED_MACRO_NAME CUSTOM_CONTENT_FROM_VARIABLE)
   set(multiValueArgs)

   cmake_parse_arguments(_GEH "${options}" "${oneValueArgs}" "${multiValueArgs}"
@@ -316,9 +312,7 @@
   if(_GEH_EXPORT_MACRO_NAME)
     set(EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_EXPORT_MACRO_NAME})
   endif()
-  if(NOT CMAKE_VERSION VERSION_LESS 2.8.12)
-    string(MAKE_C_IDENTIFIER ${EXPORT_MACRO_NAME} EXPORT_MACRO_NAME)
-  endif()
+  string(MAKE_C_IDENTIFIER ${EXPORT_MACRO_NAME} EXPORT_MACRO_NAME)
   if(_GEH_EXPORT_FILE_NAME)
     if(IS_ABSOLUTE ${_GEH_EXPORT_FILE_NAME})
       set(EXPORT_FILE_NAME ${_GEH_EXPORT_FILE_NAME})
@@ -329,33 +323,27 @@
   if(_GEH_DEPRECATED_MACRO_NAME)
     set(DEPRECATED_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_DEPRECATED_MACRO_NAME})
   endif()
-  if(NOT CMAKE_VERSION VERSION_LESS 2.8.12)
-    string(MAKE_C_IDENTIFIER ${DEPRECATED_MACRO_NAME} DEPRECATED_MACRO_NAME)
-  endif()
+  string(MAKE_C_IDENTIFIER ${DEPRECATED_MACRO_NAME} DEPRECATED_MACRO_NAME)
   if(_GEH_NO_EXPORT_MACRO_NAME)
     set(NO_EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_NO_EXPORT_MACRO_NAME})
   endif()
-  if(NOT CMAKE_VERSION VERSION_LESS 2.8.12)
-    string(MAKE_C_IDENTIFIER ${NO_EXPORT_MACRO_NAME} NO_EXPORT_MACRO_NAME)
-  endif()
+  string(MAKE_C_IDENTIFIER ${NO_EXPORT_MACRO_NAME} NO_EXPORT_MACRO_NAME)
   if(_GEH_STATIC_DEFINE)
     set(STATIC_DEFINE ${_GEH_PREFIX_NAME}${_GEH_STATIC_DEFINE})
   endif()
-  if(NOT CMAKE_VERSION VERSION_LESS 2.8.12)
-    string(MAKE_C_IDENTIFIER ${STATIC_DEFINE} STATIC_DEFINE)
-  endif()
+  string(MAKE_C_IDENTIFIER ${STATIC_DEFINE} STATIC_DEFINE)

   if(_GEH_DEFINE_NO_DEPRECATED)
-    set(DEFINE_NO_DEPRECATED TRUE)
+    set(DEFINE_NO_DEPRECATED 1)
+  else()
+    set(DEFINE_NO_DEPRECATED 0)
   endif()

   if(_GEH_NO_DEPRECATED_MACRO_NAME)
     set(NO_DEPRECATED_MACRO_NAME
       ${_GEH_PREFIX_NAME}${_GEH_NO_DEPRECATED_MACRO_NAME})
   endif()
-  if(NOT CMAKE_VERSION VERSION_LESS 2.8.12)
-    string(MAKE_C_IDENTIFIER ${NO_DEPRECATED_MACRO_NAME} NO_DEPRECATED_MACRO_NAME)
-  endif()
+  string(MAKE_C_IDENTIFIER ${NO_DEPRECATED_MACRO_NAME} NO_DEPRECATED_MACRO_NAME)

   set(INCLUDE_GUARD_NAME "${EXPORT_MACRO_NAME}_H")

@@ -365,6 +353,14 @@
     set(EXPORT_IMPORT_CONDITION ${TARGET_LIBRARY}_EXPORTS)
   endif()
   string(MAKE_C_IDENTIFIER ${EXPORT_IMPORT_CONDITION} EXPORT_IMPORT_CONDITION)
+
+  if(_GEH_CUSTOM_CONTENT_FROM_VARIABLE)
+    if(DEFINED "${_GEH_CUSTOM_CONTENT_FROM_VARIABLE}")
+      set(CUSTOM_CONTENT "${${_GEH_CUSTOM_CONTENT_FROM_VARIABLE}}")
+    else()
+      set(CUSTOM_CONTENT "")
+    endif()
+  endif()

   configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in"
     "${EXPORT_FILE_NAME}" @ONLY)
@@ -384,3 +380,35 @@
   _do_set_macro_values(${TARGET_LIBRARY})
   _do_generate_export_header(${TARGET_LIBRARY} ${ARGN})
 endfunction()
+
+function(add_compiler_export_flags)
+  if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
+    message(DEPRECATION "The add_compiler_export_flags function is obsolete. Use the CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target properties instead.")
+  endif()
+
+  _test_compiler_hidden_visibility()
+  _test_compiler_has_deprecated()
+
+  option(USE_COMPILER_HIDDEN_VISIBILITY
+    "Use HIDDEN visibility support if available." ON)
+  mark_as_advanced(USE_COMPILER_HIDDEN_VISIBILITY)
+  if(NOT (USE_COMPILER_HIDDEN_VISIBILITY AND COMPILER_HAS_HIDDEN_VISIBILITY))
+    # Just return if there are no flags to add.
+    return()
+  endif()
+
+  set (EXTRA_FLAGS "-fvisibility=hidden")
+
+  if(COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
+    set (EXTRA_FLAGS "${EXTRA_FLAGS} -fvisibility-inlines-hidden")
+  endif()
+
+  # Either return the extra flags needed in the supplied argument, or to the
+  # CMAKE_CXX_FLAGS if no argument is supplied.
+  if(ARGC GREATER 0)
+    set(${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE)
+  else()
+    string(APPEND CMAKE_CXX_FLAGS " ${EXTRA_FLAGS}")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE)
+  endif()
+endfunction()


don't include .hg* in tar balls

don't include .hg* in tar balls

--- CMakeModules/CPackSettings.cmake
+++ CMakeModules/CPackSettings.cmake
@@ -8,6 +8,7 @@
 set(CPACK_PACKAGE_VERSION_PATCH "${OMPL_PATCH_VERSION}")

 set(CPACK_SOURCE_IGNORE_FILES
+    "/.hg"
     "/.svn/"
     "/build/"
     ".pyc$"


fix: mark hunter <package>_DIR as advanced

hunter packages are polluting the cmake cache space and thus have
been mark as advanced as one wouldn't need to modify then in most
cases.

--- CMakeModules/Hunter/config.cmake
+++ CMakeModules/Hunter/config.cmake
@@ -7,6 +7,7 @@
         CONFIGURATION_TYPES Release
         CMAKE_ARGS CMAKE_POSITION_INDEPENDENT_CODE=ON ${ARGN}
     )
+    mark_as_advanced(${pkg_name}_DIR)
 endmacro()

 myhunter_config(Boost 1.66.0)


Fix boost version check from multiple versions of CMake

--- CMakeModules/boost_package.cmake
+++ CMakeModules/boost_package.cmake
@@ -7,7 +7,9 @@

 find_package(Boost)

-if("${Boost_VERSION}" VERSION_LESS 107000)
+if(NOT (   Boost_VERSION        VERSION_GREATER_EQUAL 107000
+        OR Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.70
+        OR Boost_VERSION_MACRO  VERSION_GREATER_EQUAL 107000))
   set(VER 1.70.0)
   set(MD5 e160ec0ff825fc2850ea4614323b1fb5)
   include(ExternalProject)


Updated PathsIFF for new gcc6.

Updated PathsIFF for new gcc6.

--- CMake/PathsIFF.cmake
+++ CMake/PathsIFF.cmake
@@ -4,7 +4,7 @@
     ### GCC Compiler
     set( USER_COMPILER_C    "gcc" )
     set( USER_COMPILER_CXX  "g++" )
-    set( USER_PATH_COMPILER "/usr/local/gcc/bin" )
+    set( USER_PATH_COMPILER "/usr/local/gcc6/bin" )
     ### QT Location
     set( USER_PATH_QT       "/usr/local/qt5" )
 endif()


fix Python install dir

fix Python install dir

--- ament_cmake_python/ament_cmake_python-extras.cmake
+++ ament_cmake_python/ament_cmake_python-extras.cmake
@@ -17,7 +17,8 @@
   if(NOT DEFINED PYTHON_INSTALL_DIR)
     set(_python_code
       "from distutils.sysconfig import get_python_lib"
-      "print(get_python_lib(prefix=''))"
+      "from os.path import relpath"
+      "print(relpath(get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}'), start='${CMAKE_INSTALL_PREFIX}'))"
     )
     execute_process(
       COMMAND


cmake: install a cl.exe binary in the tools/msbuild-bin dir

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

--- tools/driver/clang_symlink.cmake
+++ tools/driver/clang_symlink.cmake
@@ -20,6 +20,7 @@
 set(clang "clang${EXECUTABLE_SUFFIX}")
 set(clangxx "clang++${EXECUTABLE_SUFFIX}")
 set(clang_cl "clang-cl${EXECUTABLE_SUFFIX}")
+set(cl "cl${EXECUTABLE_SUFFIX}")

 message("Creating clang++ executable based on ${clang}")

@@ -32,3 +33,11 @@
 execute_process(
   COMMAND "${CMAKE_COMMAND}" -E ${CLANGXX_LINK_OR_COPY} "${clang}" "${clang_cl}"
   WORKING_DIRECTORY "${bindir}")
+
+if (WIN32)
+  message("Creating cl executable based on ${clang}")
+
+  execute_process(
+    COMMAND "${CMAKE_COMMAND}" -E ${CLANGXX_LINK_OR_COPY} "${clang}" "../msbuild-bin/${cl}"
+    WORKING_DIRECTORY "${bindir}")
+endif()


Remove dead CMake code

Remove dead CMake code

--- cmake/CommonDefs.cmake
+++ cmake/CommonDefs.cmake
@@ -76,15 +76,6 @@
 # Dependencies
 #

-# ALPSCore - brings MPI, HDF5, boost
-macro(add_alpscore)
-find_package(ALPSCore REQUIRED COMPONENTS hdf5 accumulators mc params)
-    message(STATUS "ALPSCore includes:  ${ALPSCore_INCLUDES}")
-    message(STATUS "ALPSCore libraries: ${ALPSCore_LIBRARIES}")
-    target_include_directories(${PROJECT_NAME} PUBLIC ${ALPSCore_INCLUDE_DIRS})
-    target_link_libraries(${PROJECT_NAME} PUBLIC ${ALPSCore_LIBRARIES})
-endmacro(add_alpscore)
-
 # Eigen
 macro(add_eigen3)
 find_package (Eigen3 3.1 REQUIRED)
@@ -223,29 +214,6 @@
          )
 endfunction(add_this_package)

-# add interdependencies between ${PROJECT_NAME} modules
-# Usage: add_opendf_module(pkgname1 pkgname2...)
-# Sets variable ${PROJECT_NAME}_DEPENDS
-macro(add_opendf_module)
-    list(APPEND ${PROJECT_NAME}_DEPENDS ${ARGV})
-    foreach(pkg_ ${ARGV})
-        if (DEFINED BOLD_HYB_GLOBAL_BUILD)
-            include_directories(${${pkg_}_INCLUDE_DIRS}) # this is needed to compile tests
-            message(STATUS "${pkg_} includes: ${${pkg_}_INCLUDE_DIRS}" )
-        else(DEFINED BOLD_HYB_GLOBAL_BUILD)
-            string(REGEX REPLACE "^opendf_" "" pkgcomp_ ${pkg_})
-            find_package(opendf QUIET COMPONENTS ${pkgcomp_})
-            if (opendf_${pkgcomp_}_FOUND)
-              set(${pkg_}_LIBRARIES ${opendf_${pkgcomp_}_LIBRARIES})
-            else()
-              find_package(${pkg_} REQUIRED HINTS ${BOLD_HYB_ROOT})
-            endif()
-        endif (DEFINED BOLD_HYB_GLOBAL_BUILD)
-        target_link_libraries(${PROJECT_NAME} PUBLIC ${${pkg_}_LIBRARIES})
-        message(STATUS "${pkg_} libs: ${${pkg_}_LIBRARIES}")
-    endforeach(pkg_)
-endmacro(add_opendf_module)
-
 # Generate documentation
 macro(gen_documentation)
   set(DOXYFILE_EXTRA_SOURCES "${DOXYFILE_EXTRA_SOURCES} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src" )


cmake: add usage documentation

cmake: add usage documentation

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -2,6 +2,33 @@
 # Copyright (C) 2021 Jean Pierre Cimalando <jp-dev@inbox.ru>
 #
 # SPDX-License-Identifier: ISC
+
+# ------------------------------------------------------------------------------
+# CMake support module for the DISTRHO Plugin Framework
+#
+# The purpose of this module is to help building music plugins easily, when the
+# project uses CMake as its build system.
+#
+# In order to use the helpers provided by this module, a plugin author should
+# add DPF as a subproject, making the function `dpf_add_plugin` available.
+# The usage of this function is documented below in greater detail.
+#
+# Example project `CMakeLists.txt`:
+#
+# ```
+# cmake_minimum_required(VERSION 3.7)
+# project(MyPlugin)
+#
+# add_subdirectory(DPF)
+#
+# dpf_add_plugin(MyPlugin
+#   TARGETS lv2 vst
+#   UI_TYPE opengl
+#   FILES_DSP
+#       src/MyPlugin.cpp
+#   FILES_UI
+#       src/MyUI.cpp)
+# ```

 include(CMakeParseArguments)


Add test to validate external links

Add test to validate external links

--- cmake/FindSphinx.cmake
+++ cmake/FindSphinx.cmake
@@ -112,4 +112,9 @@
     add_dependencies( ${target_base_name}_text _dependencies )
   endif()

+  if( BUILD_TESTING )
+    sphinx_add_target( ${target_base_name}_linkcheck linkcheck ${conf} ${source} ${base_destination}/linkcheck )
+
+    add_dependencies( ${target_base_name}_linkcheck _dependencies )
+  endif()
 endfunction()


Trivial commit.

Trivial commit.

--- cmake/TbagConfig.cmake
+++ cmake/TbagConfig.cmake
@@ -409,13 +409,13 @@
             "\n# else"
             "\n#  define ${__prefix_api}"
             "\n# endif"
-            "\n#else // defined(${__prefix_export_api})"
+            "\n#else /* defined(${__prefix_export_api}) */"
             "\n# if defined(__${__prefix}_PLATFORM_WINDOWS)"
             "\n#  define ${__prefix_api} __declspec(dllimport)"
             "\n# else"
             "\n#  define ${__prefix_api}"
             "\n# endif"
-            "\n#endif // defined(${__prefix_export_api})"
+            "\n#endif /* defined(${__prefix_export_api}) */"
             "\n"
             "\n#if defined(__cplusplus)"
             "\nextern \"C\" {"


cmake: XercesTest: Force stdin tests to run serially

git-svn-id: 3ec853389310512053d525963cab269c063bb453@1840586 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/XercesTest.cmake
+++ cmake/XercesTest.cmake
@@ -61,6 +61,10 @@
     ${xerces_test_extra_args}
     -P "${xerces_test_dir}/RunTest.cmake"
     )
+
+  if(AXT_STDIN)
+    set_property(TEST "${name}" PROPERTY RUN_SERIAL 1)
+  endif()
 endmacro()

 macro(add_xerces_test name)


minor comment change to force rebuild

minor comment change to force rebuild

--- hw/bsp/rp2040/family.cmake
+++ hw/bsp/rp2040/family.cmake
@@ -1,9 +1,6 @@
 cmake_minimum_required(VERSION 3.13)
 if (NOT TARGET _rp2040_family_inclusion_marker)
 	add_library(_rp2040_family_inclusion_marker INTERFACE)
-
-	# include basic family CMake functionality
-	set(FAMILY_MCUS RP2040)

 	if (NOT BOARD)
 		message(FATAL_ERROR "BOARD must be specified")
@@ -12,6 +9,8 @@
 	# add the SDK in case we are standalone tinyusb example (noop if already present)
 	include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_import.cmake)

+	# include basic family CMake functionality
+	set(FAMILY_MCUS RP2040)
 	include(${CMAKE_CURRENT_LIST_DIR}/../family_common.cmake)

 	include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)


Fix regression done in 855602928ed11c1387c9df0edb0666d13d783713

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -181,8 +181,10 @@
   list(FIND ${UPPER_PROJECT_NAME}_EXCLUDE_LIBRARIES ${_target}
        _contains_${target})
   if(${_contains_${target}} STREQUAL -1)
-    get_target_property(_fullpath ${_target} LOCATION)
-    get_filename_component(_libraryname ${_fullpath} NAME)
+    get_target_property(_libraryname ${_target} OUTPUT_NAME)
+    if(${_libraryname} MATCHES "_libraryname-NOTFOUND")
+      set(_libraryname ${_target})
+    endif()
     list(APPEND LIBRARY_NAMES ${_libraryname})
   endif()
 endforeach()


add support for static executables also with libc++

--- toolchains/linux.toolchain.cmake
+++ toolchains/linux.toolchain.cmake
@@ -35,11 +35,14 @@
 set( TNUN_LIBCPP_LOCATION /usr/include/c++/v1 )
 include( ${CMAKE_CURRENT_LIST_DIR}/gcc_compatibles_stl.cmake )

-if( ${TNUN_CPP_LIBRARY} STREQUAL "stdc++" )
-    option( TNUN_STATIC_LIBC "Link all binaries statically with libc and libc++" false )
-    if( ${TNUN_STATIC_LIBC} )
-        add_compile_options( -static )
+option( TNUN_STATIC_LIBC "Link all binaries statically with libc and libc++" false )
+
+if( ${TNUN_STATIC_LIBC} )
+    link_libraries( -static )
+    if( ${TNUN_CPP_LIBRARY} STREQUAL "stdc++" )
         link_libraries( -static-libstdc++ -static-libgcc )
+    elseif( ${TNUN_CPP_LIBRARY} STREQUAL "libc++" )
+        link_libraries( -s c++ pthread dl c++abi unwind c dl m )
     endif()
 endif()


Remove usage of find_path to locate cub/version.cuh

When a consumer of cub uses the CMake `FIND_ROOT_PATH_MODE_INCLUDE`
option it will cause all find_path searches to only occur under
the find root path. Since this normally doesn't include the
source files, it means that cub-header-search.cmake will fail
to find the cub/version.cuh file.

This issue was found when using conda-build on a project that
includes cub, since conda-build sets up a cross compilation
enviornment including a find root path.

--- cub/cmake/cub-header-search.cmake
+++ cub/cmake/cub-header-search.cmake
@@ -1,7 +1,7 @@
-unset(_CUB_VERSION_INCLUDE_DIR CACHE) # Clear old result to force search
-find_path(_CUB_VERSION_INCLUDE_DIR cub/version.cuh
-  NO_DEFAULT_PATH # Only search explicit paths below:
-  PATHS
-    "${CMAKE_CURRENT_LIST_DIR}/../.."            # Source tree
-)
-set_property(CACHE _CUB_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)
+# Parse version information from version.h in source tree
+ # Source tree
+set(_CUB_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")
+if(EXISTS "${_CUB_VERSION_INCLUDE_DIR}/cub/version.cuh")
+  set(_CUB_VERSION_INCLUDE_DIR "${_CUB_VERSION_INCLUDE_DIR}" CACHE FILEPATH "" FORCE) # Clear old result
+  set_property(CACHE _CUB_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)
+endif()


removing unnecessary include path

removing unnecessary include path

--- tools/cmake/UNIVERSALCommon.cmake
+++ tools/cmake/UNIVERSALCommon.cmake
@@ -23,7 +23,6 @@

 if(EXISTS ${UNIVERSAL_DIR}/include/universal/posit/posit.hpp)
   list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/include")
-  list(APPEND UNIVERSAL_INCLUDE_DIRS "${UNIVERSAL_DIR}/include/universal/posit")
 else()
   message(STATUS "Couldn't find the posit include directory at ${UNIVERSAL_DIR}/include")
 endif(EXISTS ${UNIVERSAL_DIR}/include/universal/posit/posit.hpp)


Have CommonCPPCTest use TEST_PREFIX and TEST_ARGS if defined

--- CommonCPPCTest.cmake
+++ CommonCPPCTest.cmake
@@ -9,7 +9,8 @@
 #   be set to configure target specific includes and link libraries, where
 #   NAME is the test filename without the .cpp extension. Per test include
 #   directories are only supported for for CMake 2.8.8
-# * For each test ${NAME}_TEST_PREFIX and ${NAME}_TEST_ARGS can be
+# * For each test ${TEST_PREFIX} and ${TEST_ARGS}, or if present,
+#   ${NAME}_TEST_PREFIX and ${NAME}_TEST_ARGS, can be
 #   set to customise the actual test command, supplying a prefix command
 #   and additional arguments to follow the test executable.
 # * TEST_LABEL sets the LABEL property on each generated test;
@@ -55,7 +56,16 @@

   # Per target test command customisation with
   # ${NAME}_TEST_PREFIX and ${NAME}_TEST_ARGS
-  add_test(${NAME} ${${NAME}_TEST_PREFIX} ${EXECUTABLE} ${${NAME}_TEST_ARGS})
+  set(RUN_PREFIX ${TEST_PREFIX})
+  if (${NAME}_TEST_PREFIX)
+    set(RUN_PREFIX ${${NAME}_TEST_PREFIX})
+  endif()
+  set(RUN_ARGS ${TEST_ARGS})
+  if (${NAME}_TEST_ARGS)
+    set(RUN_ARGS ${${NAME}_TEST_ARGS})
+  endif()
+
+  add_test(${NAME} ${RUN_PREFIX} ${EXECUTABLE} ${RUN_ARGS})

   # Add test labels
   set(TEST_LABELS ${TEST_LABEL} ${${NAME}_TEST_LABEL})


Export BACKWARD_[...] CMake variables as cache variables

If we do not export the variables set in BackwardMacros.cmake as cache variables, they will not be visible wherever add_backward() is called, and the macro will do nothing.

Also, fix typo `BACKWARD_INCLUDE_DIR` -> `BACKWARD_INCLUDE_DIRS`

--- BackwardMacros.cmake
+++ BackwardMacros.cmake
@@ -118,4 +118,7 @@
 	set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS ${BACKWARD_DEFINITIONS})
 	set_property(TARGET ${target} APPEND PROPERTY LINK_LIBRARIES ${BACKWARD_LIBRARIES})
 endmacro()
-mark_as_advanced(BACKWARD_INCLUDE_DIR BACKWARD_DEFINITIONS BACKWARD_LIBRARIES)
+set(BACKWARD_INCLUDE_DIRS ${BACKWARD_INCLUDE_DIRS} CACHE INTERNAL "BACKWARD_INCLUDE_DIRS")
+set(BACKWARD_DEFINITIONS ${BACKWARD_DEFINITIONS} CACHE INTERNAL "BACKWARD_DEFINITIONS")
+set(BACKWARD_LIBRARIES ${BACKWARD_LIBRARIES} CACHE INTERNAL "BACKWARD_LIBRARIES")
+mark_as_advanced(BACKWARD_INCLUDE_DIRS BACKWARD_DEFINITIONS BACKWARD_LIBRARIES)


Cleaned up to be able to configure and build outside the Slicer4 Tree.

Still QT linking errors so..

--- SlicerVmtk4/SuperBuild.cmake
+++ SlicerVmtk4/SuperBuild.cmake
@@ -55,7 +55,7 @@
     -D${proj}_SUPERBUILD:BOOL=OFF
     #-DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}
     # Slicer
-    -DSlicer_DIR:PATH=${Slicer_BINARY_DIR}
+    -DSlicer_DIR:PATH=${Slicer_DIR}
     # VMTK
     -DVMTK_DIR:PATH=${VMTK_DIR}
   DEPENDS


Fix OSX build (closes #142)

Fix OSX build (closes #142)

--- deps/lua-openssl.cmake
+++ deps/lua-openssl.cmake
@@ -5,49 +5,50 @@
   ${LUA_OPENSSL_DIR}/src
 )

-find_package(Threads)
-if (CMAKE_THREAD_LIBS_INIT)
-    add_definitions(-DPTHREADS)
-endif (CMAKE_THREAD_LIBS_INIT)
+if(WIN32)
+else()
+  find_package(Threads)
+  add_definitions(-DPTHREADS)
+endif()

 add_library(lua_openssl
-  ${LUA_OPENSSL_DIR}/src/asn1.c
-  ${LUA_OPENSSL_DIR}/src/auxiliar.c
-  ${LUA_OPENSSL_DIR}/src/bio.c
-  ${LUA_OPENSSL_DIR}/src/callback.c
-  ${LUA_OPENSSL_DIR}/src/cipher.c
-  ${LUA_OPENSSL_DIR}/src/cms.c
-  ${LUA_OPENSSL_DIR}/src/compat.c
-  ${LUA_OPENSSL_DIR}/src/crl.c
-  ${LUA_OPENSSL_DIR}/src/csr.c
-  ${LUA_OPENSSL_DIR}/src/dh.c
-  ${LUA_OPENSSL_DIR}/src/digest.c
-  ${LUA_OPENSSL_DIR}/src/dsa.c
-  ${LUA_OPENSSL_DIR}/src/ec.c
-  ${LUA_OPENSSL_DIR}/src/engine.c
-  ${LUA_OPENSSL_DIR}/src/hmac.c
-  ${LUA_OPENSSL_DIR}/src/lbn.c
-  ${LUA_OPENSSL_DIR}/src/lhash.c
-  ${LUA_OPENSSL_DIR}/src/misc.c
-  ${LUA_OPENSSL_DIR}/src/ocsp.c
-  ${LUA_OPENSSL_DIR}/src/oids.txt
-  ${LUA_OPENSSL_DIR}/src/openssl.c
-  ${LUA_OPENSSL_DIR}/src/ots.c
-  ${LUA_OPENSSL_DIR}/src/pkcs12.c
-  ${LUA_OPENSSL_DIR}/src/pkcs7.c
-  ${LUA_OPENSSL_DIR}/src/pkey.c
-  ${LUA_OPENSSL_DIR}/src/private.h
-  ${LUA_OPENSSL_DIR}/src/rsa.c
-  ${LUA_OPENSSL_DIR}/src/sk.h
-  ${LUA_OPENSSL_DIR}/src/ssl.c
-  ${LUA_OPENSSL_DIR}/src/th-lock.c
-  ${LUA_OPENSSL_DIR}/src/util.c
-  ${LUA_OPENSSL_DIR}/src/x509.c
-  ${LUA_OPENSSL_DIR}/src/xattrs.c
-  ${LUA_OPENSSL_DIR}/src/xexts.c
-  ${LUA_OPENSSL_DIR}/src/xname.c
-  ${LUA_OPENSSL_DIR}/src/xalgor.c
-  ${LUA_OPENSSL_DIR}/src/xstore.c
+  ${LUA_OPENSSL_DIR}/src/asn1.c
+  ${LUA_OPENSSL_DIR}/src/auxiliar.c
+  ${LUA_OPENSSL_DIR}/src/bio.c
+  ${LUA_OPENSSL_DIR}/src/callback.c
+  ${LUA_OPENSSL_DIR}/src/cipher.c
+  ${LUA_OPENSSL_DIR}/src/cms.c
+  ${LUA_OPENSSL_DIR}/src/compat.c
+  ${LUA_OPENSSL_DIR}/src/crl.c
+  ${LUA_OPENSSL_DIR}/src/csr.c
+  ${LUA_OPENSSL_DIR}/src/dh.c
+  ${LUA_OPENSSL_DIR}/src/digest.c
+  ${LUA_OPENSSL_DIR}/src/dsa.c
+  ${LUA_OPENSSL_DIR}/src/ec.c
+  ${LUA_OPENSSL_DIR}/src/engine.c
+  ${LUA_OPENSSL_DIR}/src/hmac.c
+  ${LUA_OPENSSL_DIR}/src/lbn.c
+  ${LUA_OPENSSL_DIR}/src/lhash.c
+  ${LUA_OPENSSL_DIR}/src/misc.c
+  ${LUA_OPENSSL_DIR}/src/ocsp.c
+  ${LUA_OPENSSL_DIR}/src/oids.txt
+  ${LUA_OPENSSL_DIR}/src/openssl.c
+  ${LUA_OPENSSL_DIR}/src/ots.c
+  ${LUA_OPENSSL_DIR}/src/pkcs12.c
+  ${LUA_OPENSSL_DIR}/src/pkcs7.c
+  ${LUA_OPENSSL_DIR}/src/pkey.c
+  ${LUA_OPENSSL_DIR}/src/private.h
+  ${LUA_OPENSSL_DIR}/src/rsa.c
+  ${LUA_OPENSSL_DIR}/src/sk.h
+  ${LUA_OPENSSL_DIR}/src/ssl.c
+  ${LUA_OPENSSL_DIR}/src/th-lock.c
+  ${LUA_OPENSSL_DIR}/src/util.c
+  ${LUA_OPENSSL_DIR}/src/x509.c
+  ${LUA_OPENSSL_DIR}/src/xattrs.c
+  ${LUA_OPENSSL_DIR}/src/xexts.c
+  ${LUA_OPENSSL_DIR}/src/xname.c
+  ${LUA_OPENSSL_DIR}/src/xalgor.c
+  ${LUA_OPENSSL_DIR}/src/xstore.c
 )

 set_target_properties(lua_openssl PROPERTIES


cmake: Fix for cmake's head.

cmake: Fix for cmake's head.

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -179,7 +179,7 @@

 check_symbol_exists(connect "sys/types.h;sys/socket.h" HAVE_CONNECT)
 if(NOT HAVE_CONNECT)
-    check_library_exists(connect socket HAVE_CONNECT)
+    check_library_exists(connect socket "" HAVE_CONNECT)
     if(NOT HAVE_CONNECT)
         vlc_module_add_link_libraries(libvlc connect)
         vlc_module_add_link_libraries(cdda   connect)
@@ -292,7 +292,7 @@
   COMMAND sh -c "${command}"
   OUTPUT_VARIABLE ${var}
   OUTPUT_STRIP_TRAILING_WHITESPACE)
- string( REPLACE "\n" "\\n" ${var} ${${var}})
+ string( REPLACE "\n" "\\n" ${var} "${${var}}")
 endmacro(command_to_configvar)

 command_to_configvar( "whoami" VLC_COMPILE_BY )


git-svn-id: https://svn.icg.tugraz.at/svn/vmgpu/trunk/vmlibraries/imageutilities@10172 358b74ad-2626-0410-af80-f4c3c349ae55

--- imageutilities/cmake/FindImageUtilities.cmake
+++ imageutilities/cmake/FindImageUtilities.cmake
@@ -251,7 +251,7 @@
     if(MATLAB_FOUND)
       include_directories(${MATLAB_INCLUDE_DIRS})
       set(IU_IUMATLAB_LIB_DEPENDENCIES ${IU_IUMATLAB_LIB_DEPENDENCIES} ${MATLAB_LIBRARIES})
-    endif(MATLAB_INCLUDE_DIR)
+    endif(MATLAB_FOUND)

   endif(IU_IUMATLAB_FOUND)


Add build configuration for MITK Phenotyping


fix openlf compile under ubuntu 16.04

fix openlf compile under ubuntu 16.04

Change-Id: Ic6ccfcfafd2ebdf69926ad7de9a1b40a82fc717f

--- VAD_HDF5.cmake
+++ VAD_HDF5.cmake
@@ -22,6 +22,8 @@
   if (NOT TARGET hdf5_cpp)
     add_library(hdf5_cpp INTERFACE IMPORTED)

+    unset(_FOUND_H5CPP)
+    unset(_FOUND_H5CPP CACHE)
     # search cxx header and add to hdf5_cpp target (workaround for various ways that findhdf5/hdf5config are broken on different systems)
     h5_try_dir("${HDF5_CXX_INCLUDE_DIRS}")
     h5_try_dir("${HDF5_CXX_INCLUDE_DIR}")


Clang compilation flag for linux

Clang compilation flag for linux

--- scripts/OptimizationFlags.cmake
+++ scripts/OptimizationFlags.cmake
@@ -9,7 +9,7 @@
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
   set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wcheck -wd2259,981,869,383 -Wno-unknown-pragmas")
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  set(CMAKE_CXX_FLAGS "-W -pedantic -stdlib=libc++ -std=c++11 -Wno-long-long -Wno-unused-parameter -Wno-unknown-pragmas -Wno-c++0x-extensions -Wno-variadic-macros")
+  set(CMAKE_CXX_FLAGS "-Wextra -pedantic -std=c++11 -Wno-long-long -Wno-unused-parameter -Wno-unknown-pragmas -Wno-c++0x-extensions -Wno-variadic-macros")
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Sun")
   set(CMAKE_CXX_FLAGS "-erroff=wvarhidemem,hidevf,badstring,largeshift -errtags=yes")
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "PGI")


CMake: Find Freetype changed to search from higher version to lower - now it OgreMain links with 2311 source if found (need to delete cache entries)

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype freetype219 freetype235 freetype238 freetype239 freetype2311)
+set(FREETYPE_LIBRARY_NAMES freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


Modified library cmake macro to include the export headers in the install.

--- src/cmake/SetupDetranLibrary.cmake
+++ src/cmake/SetupDetranLibrary.cmake
@@ -26,17 +26,19 @@
                        STATIC_DEFINE     ${CAP_LIB_NAME}_BUILT_AS_STATIC
 )

-# Install
+# Install headers and other includes
 FILE(GLOB_RECURSE files
      RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
      ${CMAKE_CURRENT_SOURCE_DIR}/*.hh
      ${CMAKE_CURRENT_SOURCE_DIR}/*.i
 )
-#message("my files are ${files}")
 install(FILES       ${files}
         DESTINATION include/${LIB_NAME})
 install(TARGETS     ${LIB_NAME}
         DESTINATION lib)
+install(FILES       ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}_export.hh
+        DESTINATION include/${LIB_NAME})
+

 # Setup for testing
 if(DETRAN_ENABLE_TEST)


Add freetype version 2.5.2

Add freetype version 2.5.2

--HG--
branch : v1-9

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype251 freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
+set(FREETYPE_LIBRARY_NAMES freetype252 freetype251 freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


Patch [3427552] - FindOpenGLES.cmake doesn't support OpenGL ES 1.1 spec

--HG--
branch : v1-8

--- CMake/Packages/FindOpenGLES.cmake
+++ CMake/Packages/FindOpenGLES.cmake
@@ -42,17 +42,14 @@

   ELSE(APPLE)

-
-
     FIND_PATH(OPENGLES_INCLUDE_DIR GLES/gl.h
       /usr/openwin/share/include
       /opt/graphics/OpenGL/include /usr/X11R6/include
       /usr/include
     )

-
     FIND_LIBRARY(OPENGLES_gl_LIBRARY
-      NAMES GLES_CM
+      NAMES GLES_CM GLESv1_CM
       PATHS /opt/graphics/OpenGL/lib
             /usr/openwin/lib
             /usr/shlib /usr/X11R6/lib
@@ -62,16 +59,13 @@
     # On Unix OpenGL most certainly always requires X11.
     # Feel free to tighten up these conditions if you don't
     # think this is always true.
-    # It's not true on OSX.

     IF (OPENGLES_gl_LIBRARY)
       IF(NOT X11_FOUND)
         INCLUDE(FindX11)
       ENDIF(NOT X11_FOUND)
       IF (X11_FOUND)
-        IF (NOT APPLE)
-          SET (OPENGLES_LIBRARIES ${X11_LIBRARIES})
-        ENDIF (NOT APPLE)
+        SET (OPENGLES_LIBRARIES ${X11_LIBRARIES})
       ENDIF (X11_FOUND)
     ENDIF (OPENGLES_gl_LIBRARY)

@@ -99,4 +93,4 @@
   set(CMAKE_PREFIX_PATH ${CMAKE_SYSYEM_OUT_DIR})
   FIND_LIBRARY(OPENGLES_gl_LIBRARY libgles_cm )
   set(CMAKE_PREFIX_PATH ${ORIGINAL_CMAKE_PREFIX_PATH})
-endif()+endif()


[CMake] Correct Emscripten script.

[CMake] Correct Emscripten script.

--- EMULATOR/PLATFORM/Emscripten.cmake
+++ EMULATOR/PLATFORM/Emscripten.cmake
@@ -1,8 +1,10 @@
 if(EMSCRIPTEN)
-
-Message("Compiling for Emscripten!")

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_SDL=2 --emrun -s ASSERTIONS=1 --std=c++11 -s GLOBAL_BASE=1048576 -s USE_WEBGL2=1 -s FULL_ES3=1 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1")
 set(SDL2_LIBRARIES "-s USE_SDL=2")
+set(PSX_LIB ${ROOT_DIR}/EMSCRIPTEN/EMULATOR/libPSX.bc)
+link_directories(${ROOT_DIR}/EMSCRIPTEN/EMULATOR/)
+link_directories(${ROOT_DIR})
+set(CMAKE_EXECUTABLE_SUFFIX ".html")

 endif()


Push ParaView forward for OpenGL2/TIFF writer updates

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


Bump the ParaView SHA for bug fixes and updates

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


ENH: update GIT_TAG for mosaic remote module

--- Modules/Remote/Mosaic.remote.cmake
+++ Modules/Remote/Mosaic.remote.cmake
@@ -5,5 +5,5 @@
 https://github.com/remicres/otb-mosaic
 "
   GIT_REPOSITORY https://github.com/remicres/otb-mosaic.git
-  GIT_TAG 1d557e3c69cb11428f5dbf7c7039dc966dd8c51e
+  GIT_TAG 851b7b2913465d9988020949ac682c883350214e
 )


Hack applied to get FindBoost.cmake to honor BOOST_ROOT in linux. This may break FindBoost in windows, I'm not sure.

FindBoost.cmake really needs a rewrite from scratch. It should have a BOOST_INSTALL_PREFIX or something like that from which it references everything. That way, switching between 2 different version of boost will be easy in cmake.

git-svn-id: 4ba210d0a933e3fb1aa9ab096f190cd38965d92a@920 fa922fa7-2fde-0310-acd8-f43f465a7996

--- src/CMake/boost/FindBoost.cmake
+++ src/CMake/boost/FindBoost.cmake
@@ -207,8 +207,24 @@
 	-gcc41-mt
 	-gcc41-mt-s
     )
+
+	set(BOOST_INCLUDE_SEARCH_DIRS
+      $ENV{BOOST_ROOT}/include
+      $ENV{BOOST_ROOT}
+	  /usr
+	  /usr/local
+	  )
+    set(BOOST_LIBRARIES_SEARCH_DIRS
+      $ENV{BOOST_ROOT}/lib
+      $ENV{BOOST_ROOT}
+	  /usr
+	  /usr/local
+	  )
+
   endif (WIN32)

+  MESSAGE(STATUS "Searching for boost: ${BOOST_INCLUDE_SEARCH_DIRS}")
+
   find_path(BOOST_INCLUDE_DIR
     NAMES
       boost/config.hpp
@@ -216,6 +232,7 @@
       ${BOOST_INCLUDE_SEARCH_DIRS}
     PATH_SUFFIXES
       ${BOOST_PATH_SUFFIX}
+	NO_DEFAULT_PATH
   )

   foreach (TMP_BOOST_LIBRARIES_SUFFIX ${BOOST_LIBRARIES_SUFFIXES} "")
@@ -226,6 +243,7 @@
           boost_date_time${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )

       if (BOOST_DATE_TIME_LIBRARY)
@@ -246,6 +264,7 @@
           boost_filesystem${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_FILESYSTEM_LIBRARY)

@@ -255,6 +274,7 @@
           boost_iostreams${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_IOSTREAMS_LIBRARY)

@@ -264,6 +284,7 @@
           boost_prg_exec_monitor${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_PRG_EXEC_MONITOR_LIBRARY)

@@ -273,6 +294,7 @@
           boost_program_options${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_PROGRAM_OPTIONS_LIBRARY)

@@ -282,6 +304,7 @@
           boost_python${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_PYTHON_LIBRARY)

@@ -291,6 +314,7 @@
           boost_regex${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_REGEX_LIBRARY)

@@ -300,6 +324,7 @@
           boost_serialization${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_SERIALIZATION_LIBRARY)

@@ -309,6 +334,7 @@
           boost_signals${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_SIGNALS_LIBRARY)

@@ -323,6 +349,7 @@
           ${_name}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_TEST_EXEC_MONITOR_LIBRARY)

@@ -333,6 +360,7 @@
           boost_thread-mt
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_THREAD_LIBRARY)

@@ -348,6 +376,7 @@
           ${_boost_unit_test_lib_name}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_UNIT_TEST_FRAMEWORK_LIBRARY)

@@ -357,6 +386,7 @@
           boost_wserialization${TMP_BOOST_LIBRARIES_SUFFIX}
         PATHS
           ${BOOST_LIBRARIES_SEARCH_DIRS}
+		NO_DEFAULT_PATH
       )
     endif (NOT BOOST_WSERIALIZATION_LIBRARY)


fixed: setup lib dir suffix and platform info in external helper init

git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@2121 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/ExternalProjectHelper.cmake
+++ CMake/ExternalProjectHelper.cmake
@@ -14,6 +14,18 @@
   MESSAGE(STATUS "ARGS: ${ARGC} | ${ARGV} ")

   SET(_OSG_COMPONENTS ${ARGV})
+
+  SET(OSG_PLATFORM_64 0)
+  SET(OSG_PLATFORM_32 0)
+  SET(OSG_LIBDIR_SUFFIX "")
+
+  IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    SET(OSG_PLATFORM_64 1)
+    SET(OSG_LIBDIR_SUFFIX "64")
+    SET(OSG_LIBDIR_BASE_SUFFIX "64")
+  ELSE()
+    SET(OSG_PLATFORM_32 1)
+  ENDIF()

   #############
   #### OpenSG


Hide FREETYPE_FT2BUILD_INCLUDE_DIR variable

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -49,6 +49,7 @@
 make_library_set(FREETYPE_LIBRARY)

 findpkg_finish(FREETYPE)
+mark_as_advanced(FREETYPE_FT2BUILD_INCLUDE_DIR)
 if (NOT FREETYPE_FT2BUILD_INCLUDE_DIR STREQUAL FREETYPE_INCLUDE_DIR)
   set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_FT2BUILD_INCLUDE_DIR})
 endif ()


Option values must be either ON or OFF, no 0 or 1 allowed

--- Examples/Plugins/PluginList.cmake
+++ Examples/Plugins/PluginList.cmake
@@ -14,5 +14,12 @@
   org.mitk.example.gui.regiongrowing:ON

   org.mitk.example.gui.imaging:ON
-  org.mitk.example.gui.opencv:${MITK_USE_OpenCV}
 )
+
+if(MITK_USE_OpenCV)
+  list(APPEND MITK_EXAMPLE_PLUGINS
+       org.mitk.example.gui.opencv:ON)
+else()
+  list(APPEND MITK_EXAMPLE_PLUGINS
+       org.mitk.example.gui.opencv:OFF)
+endif()


Buildroot.cmake: Find all external scripts at the same time

--- Buildroot.cmake
+++ Buildroot.cmake
@@ -32,7 +32,20 @@
                         "Makefile will overwrite Buildroot's Makefile.")
 endif()

-find_program(CONFIG_TOOL config ${CMAKE_CURRENT_SOURCE_DIR}/support/scripts NO_DEFAULT_PATH)
+set(BUILDROOT_SCRIPTS_DIR ${CMAKE_CURRENT_LIST_DIR}/support/scripts)
+
+find_program(
+    BUILDROOT_CHECK_TARGET_CREATED_FILES check-target-created-files
+        ${BUILDROOT_SCRIPTS_DIR} NO_DEFAULT_PATH)
+find_program(
+    BUILDROOT_CLEAN buildroot-clean
+        ${BUILDROOT_SCRIPTS_DIR} NO_DEFAULT_PATH)
+find_program(
+    BUILDROOT_CONFIG_TOOL config
+        ${BUILDROOT_SCRIPTS_DIR} NO_DEFAULT_PATH)
+find_program(
+    BUILDROOT_MAKE_WRAPPER buildroot-make-wrapper
+        ${BUILDROOT_SCRIPTS_DIR} NO_DEFAULT_PATH)

 # Buildroot downloads nearly 700MB of source code, it makes sense to share
 # this between each of the builds. We use the BR2_DL_DIR setting to do that.
@@ -408,9 +421,13 @@
 # better way to do this!
 function(buildroot_edit_config_file file)
     # This uses scripts/config from the Linux source tree.
+    if(NOT EXISTS ${BUILDROOT_CONFIG_TOOL})
+        message(FATAL_ERROR "Could not find support/scripts/config.")
+    endif()
+
     set(commands ${ARGN})
     execute_process(
-        COMMAND env CONFIG_=BR2_ ${CONFIG_TOOL} --file ${file} ${commands}
+        COMMAND env CONFIG_=BR2_ ${BUILDROOT_CONFIG_TOOL} --file ${file} ${commands}
     )
 endfunction()

@@ -426,7 +443,7 @@
     set(ENV{CONFIG_} "BR2_")
     execute_process(
         COMMAND
-            ${CMAKE_SOURCE_DIR}/support/scripts/config --file ${file} --keep-case --state ${option_name}
+            ${BUILDROOT_CONFIG_TOOL} --file ${file} --keep-case --state ${option_name}
         OUTPUT_VARIABLE
             out
     )
@@ -490,7 +507,7 @@
     set(commands ${ARGN})

     if(NOT IS_ABSOLUTE ${input})
-        set(input ${source_dir}/${input})
+        set(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
     endif()

     configure_file(${input} ${build_dir}/.config.stamp)
@@ -511,7 +528,7 @@
     add_custom_command(
         OUTPUT ${output}
         COMMAND
-            ${CMAKE_SOURCE_DIR}/support/scripts/buildroot-make-wrapper ${build_dir} ${buildroot_target} ${build_log}
+            ${BUILDROOT_MAKE_WRAPPER} ${build_dir} ${buildroot_target} ${build_log}

         ${stamp_command}

@@ -524,7 +541,7 @@
         # keep track of every single output file, so it could be that deleting
         # the ${check_files} completely breaks the Buildroot build.
         COMMAND
-            ${CMAKE_SOURCE_DIR}/support/scripts/check-target-created-files ${name} ${output} ${check_files}
+            ${BUILDROOT_CHECK_TARGET_CREATED_FILES} ${name} ${output} ${check_files}

         WORKING_DIRECTORY
             ${source_dir}
@@ -565,7 +582,7 @@
         COMMAND
             tar --extract --directory=${output_dir} --file ${output_file}
         COMMAND
-            ${CMAKE_SOURCE_DIR}/support/scripts/check-target-created-files "${name}" ${output_file} ${check_files}
+            ${BUILDROOT_CHECK_TARGET_CREATED_FILES} "${name}" ${output_file} ${check_files}
         OUTPUT ${output_file} ${check_files}
         DEPENDS "${extra_depends}"
         COMMENT "Using prebuilt version of ${name}"
@@ -612,7 +629,7 @@
     add_custom_target(
         ${name}-clean
         COMMAND
-            ${CMAKE_SOURCE_DIR}/support/scripts/buildroot-clean ${build_dir} ${outputs}
+            ${BUILDROOT_CLEAN} ${build_dir} ${outputs}
         VERBATIM
     )
 endfunction()


CMakeUnit: Only print custom command during the execution of tests

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -233,14 +233,18 @@
     _cmake_unit_append_command_being_accumulated ()

     # Now loop over ADD_CUSTOM_COMMAND_PRINT_STRINGS to build the
-    # ADD_CUSTOM_COMMAND_APPEND_ARGUMENTS list
-    set (ADD_CUSTOM_COMMAND_APPEND_ARGUMENTS)
-    foreach (STRING ${ADD_CUSTOM_COMMAND_PRINT_STRINGS})
-
-        list (APPEND ADD_CUSTOM_COMMAND_APPEND_ARGUMENTS
-              COMMAND "${CMAKE_COMMAND}" -E echo "${STRING}")
-
-    endforeach ()
+    # ADD_CUSTOM_COMMAND_APPEND_ARGUMENTS list, but only if
+    # we are actually in a test
+    set (PHASE "${_CMAKE_UNIT_PHASE}") # NOLINT:access/private_var
+    if (PHASE STREQUAL "CONFIGURE")
+        set (ADD_CUSTOM_COMMAND_APPEND_ARGUMENTS)
+        foreach (STRING ${ADD_CUSTOM_COMMAND_PRINT_STRINGS})
+
+            list (APPEND ADD_CUSTOM_COMMAND_APPEND_ARGUMENTS
+                  COMMAND "${CMAKE_COMMAND}" -E echo "${STRING}")
+
+        endforeach ()
+    endif ()

     # Obviously, the private function must be accessed
     _add_custom_command (${ARGN} # NOLINT:access/other_private


Add missing file dependency for gyb'd attribute generation.

--- cmake/modules/SwiftHandleGybSources.cmake
+++ cmake/modules/SwiftHandleGybSources.cmake
@@ -128,6 +128,7 @@
       "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}/gyb_syntax_support/Classification.py"
       "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}/gyb_syntax_support/kinds.py"
       "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}/gyb_syntax_support/Node.py"
+      "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}/gyb_syntax_support/AttributeKinds.py"
       "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}/gyb_syntax_support/AttributeNodes.py"
       "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}/gyb_syntax_support/AvailabilityNodes.py"
       "${SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE}/gyb_syntax_support/CommonNodes.py"


REFAC: update patchelf verison to 0.12

REFAC: update patchelf verison to 0.12

--- Packaging/External_patchelf.cmake
+++ Packaging/External_patchelf.cmake
@@ -41,8 +41,8 @@

 ExternalProject_Add(PATCHELF
   PREFIX "${PATCHELF_PREFIX_DIR}"
-  URL                 "https://nixos.org/releases/patchelf/patchelf-0.10/patchelf-0.10.tar.bz2"
-  URL_MD5             6c3f3a06a95705870d129494a6880106
+  URL                 "https://github.com/NixOS/patchelf/archive/refs/tags/0.12.tar.gz"
+  URL_MD5             b9d1161e52e2f342598deabf7d85ed24
   DOWNLOAD_DIR        "${DOWNLOAD_LOCATION}"
   SOURCE_DIR          "${PATCHELF_SOURCE_DIR}"
   BINARY_DIR          "${PATCHELF_SOURCE_DIR}"


Fallback to variable based library for link dependency on threads

Change-Id: I776bdde66afaaeaeda107fb43892bc9515f80fea

--- CMake/FindGTest.cmake
+++ CMake/FindGTest.cmake
@@ -213,6 +213,9 @@
         if(TARGET Threads::Threads)
           set_target_properties(GTest::GTest PROPERTIES
             INTERFACE_LINK_LIBRARIES "Threads::Threads")
+        else()
+          set_target_properties(GTest::GTest PROPERTIES
+            INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}" )
         endif()
         if(GTEST_INCLUDE_DIRS)
             set_target_properties(GTest::GTest PROPERTIES


install dir->no lib

install dir->no lib

--- CMake/UseCyclus.cmake
+++ CMake/UseCyclus.cmake
@@ -117,7 +117,7 @@
   # install library
   install(
     TARGETS ${lib_root}
-    LIBRARY DESTINATION lib/cyclus/lib${lib_root}
+    LIBRARY DESTINATION lib/cyclus/${lib_root}
     COMPONENT ${lib_root}
     )
   SET(


test support added

test support added

--- CMake/UseCyclus.cmake
+++ CMake/UseCyclus.cmake
@@ -64,11 +64,12 @@
       COMMENT "Executing ${CYCPP} ${HIN} ${PREPROCESSOR} ${HFLAG} ${ORIG} ${INCL_ARGS}"
       )
     ADD_CUSTOM_COMMAND(
-      OUTPUT ${CCOUT}
+      OUTPUT ${CCOUT}
+      OUTPUT ${HOUT}
       COMMAND ${CYCPP} ${HIN} ${PREPROCESSOR} ${HFLAG} ${ORIG} ${INCL_ARGS}
       COMMAND ${CYCPP} ${CCIN} ${PREPROCESSOR} ${CCFLAG} ${ORIG} ${INCL_ARGS}
+      DEPENDS ${HIN}
       DEPENDS ${CCIN}
-      DEPENDS ${HIN}
       COMMENT "Executing ${CYCPP} ${HIN} ${PREPROCESSOR} ${HFLAG} ${ORIG} ${INCL_ARGS}"
       COMMENT "Executing ${CYCPP} ${CCIN} ${PREPROCESSOR} ${CCFLAG} ${ORIG} ${INCL_ARGS}"
       )
@@ -100,13 +101,67 @@
   ENDIF(EXISTS "${HOUT}")

   # add tests
-  IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_name}_tests.cc")
+  SET(CCTIN "${CMAKE_CURRENT_SOURCE_DIR}/${_name}_tests.cc")
+  SET(CCTOUT "${BUILD_DIR}/${_name}_tests.cc")
+  SET(HTIN "${CMAKE_CURRENT_SOURCE_DIR}/${_name}_tests.h")
+  SET(HTOUT "${BUILD_DIR}/${_name}_tests.h")
+  SET(CMD "cp")
+  IF(EXISTS "${CCTIN}")
+    MESSAGE(STATUS "Copying ${CCTIN} to ${CCTOUT}.")
+    # FILE(COPY ${CCTIN} DESTINATION ${BUILD_DIR})
+    EXECUTE_PROCESS(COMMAND ${CMD} ${CCTIN} ${CCTOUT})
+    IF(EXISTS "${HTIN}")
+      MESSAGE(STATUS "Copying ${HTIN} to ${HTOUT}.")
+      # FILE(COPY ${HTIN} DESTINATION ${BUILD_DIR})
+      EXECUTE_PROCESS(COMMAND ${CMD} ${HTIN} ${HTOUT})
+      ADD_CUSTOM_COMMAND(
+      	OUTPUT ${HTOUT}
+      	OUTPUT ${CCTOUT}
+	COMMAND ${CMD} ${HTIN} ${HTOUT}
+	COMMAND ${CMD} ${CCTIN} ${CCTOUT}
+	DEPENDS ${HIN}
+	DEPENDS ${CCIN}
+	DEPENDS ${HTIN}
+	DEPENDS ${CCTIN}
+	COMMENT "Copying ${HTIN} to ${HTOUT}."
+	COMMENT "Copying ${CCTIN} to ${CCTOUT}."
+	)
+      # ADD_CUSTOM_TARGET(
+      # 	${_dir}TestCp ALL
+      # 	COMMAND ${CMD} ${HTIN} ${HTOUT}
+      # 	COMMAND ${CMD} ${CCTIN} ${CCTOUT}
+      # 	DEPENDS ${HTIN}
+      # 	DEPENDS ${CCTIN}
+      # 	COMMENT "Copying ${HTIN} to ${HTOUT}."
+      # 	COMMENT "Copying ${CCTIN} to ${CCTOUT}."
+      # 	)
+      SET("${_dir}TestHeader"
+	"${HTOUT}"
+	CACHE INTERNAL "CMake is really silly, the silliest, tin fact" FORCE
+	)
+    ELSE(EXISTS "${HTIN}")
+      ADD_CUSTOM_COMMAND(
+	OUTPUT ${CCTOUT}
+	COMMAND ${CMD} ${CCTIN} ${CCTOUT}
+	DEPENDS ${CCTIN}
+	DEPENDS ${CCIN}
+	COMMENT "Copying ${CCTIN} to ${CCTOUT}."
+	)
+      # ADD_CUSTOM_TARGET(
+      # 	${_dir}TestCp ALL
+      # 	COMMAND ${CMD} ${CCTIN} ${CCTOUT}
+      # 	DEPENDS ${CCTIN}
+      # 	COMMENT "Copying ${CCTIN} to ${CCTOUT}."
+      # 	)
+    ENDIF(EXISTS "${HTIN}")
     SET("${_dir}TestSource"
-      "${CMAKE_CURRENT_SOURCE_DIR}/${_name}_tests.cc"
-      "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.cc"
-      CACHE INTERNAL "CMake is really silly, the silliest, in fact" FORCE
+      "${CCOUT}"
+      "${CCTOUT}"
+      CACHE INTERNAL "CMake is really silly, the silliest, tin fact" FORCE
       )
-  ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_name}_tests.cc")
+    ADD_LIBRARY(${_dir}Tests ${${_dir}TestSource})
+    TARGET_LINK_LIBRARIES(${_dir}Tests dl cycluscore ${CYCLUS_GTEST_LIBRARIES})
+  ENDIF(EXISTS "${CCTIN}")

   MESSAGE(STATUS "Finished construction of build files for agent: ${_dir}")
 ENDMACRO()


install dir update

install dir update

--- CMake/UseCyclus.cmake
+++ CMake/UseCyclus.cmake
@@ -117,7 +117,7 @@
   # install library
   install(
     TARGETS ${lib_root}
-    LIBRARY DESTINATION cyclus/lib${lib_root}
+    LIBRARY DESTINATION lib/cyclus/lib${lib_root}
     COMPONENT ${lib_root}
     )
   SET(


Avoid some "unknown compiler options" warnings in MSVC builds

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -177,7 +177,12 @@
   add_library("${OBJLIB}" OBJECT ${args_SRCS})
   add_dependencies("${OBJLIB}" Halide)
   target_include_directories("${OBJLIB}" PRIVATE "${CMAKE_BINARY_DIR}/include")
-  target_compile_options("${OBJLIB}" PRIVATE "-std=c++11" "-fno-rtti")
+  if (NOT MSVC)
+    target_compile_options("${OBJLIB}" PRIVATE "-std=c++11") # Halide clients need C++11
+    if(NOT HALIDE_ENABLE_RTTI)
+      target_compile_options("${OBJLIB}" PRIVATE "-fno-rtti")
+    endif()
+  endif()
   foreach(STUB ${args_STUB_DEPS})
     halide_add_generator_stub_dependency(TARGET ${OBJLIB} STUB_GENERATOR_TARGET ${STUB})
   endforeach()


adding support for using OPENNI_ROOT cmake and environment variables to find OpenNI

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

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -18,14 +18,15 @@

 #add a hint so that it can find it without the pkg-config
 find_path(OPENNI_INCLUDE_DIR XnStatus.h
-          HINTS ${PC_OPENNI_INCLUDEDIR} ${PC_OPENNI_INCLUDE_DIRS} /usr/include/openni
+          HINTS ${PC_OPENNI_INCLUDEDIR} ${PC_OPENNI_INCLUDE_DIRS} /usr/include/openni "${OPENNI_ROOT}" "$ENV{OPENNI_ROOT}"
           PATHS "$ENV{PROGRAMFILES}/OpenNI/Include" "$ENV{PROGRAMW6432}/OpenNI/Include"
-          PATH_SUFFIXES openni)
+          PATH_SUFFIXES openni include Include)
 #add a hint so that it can find it without the pkg-config
 find_library(OPENNI_LIBRARY
              NAMES OpenNI64 OpenNI
-             HINTS ${PC_OPENNI_LIBDIR} ${PC_OPENNI_LIBRARY_DIRS} /usr/lib
-             PATHS "$ENV{PROGRAMFILES}/OpenNI/Lib" "$ENV{PROGRAMW6432}/OpenNI/Lib64")
+             HINTS ${PC_OPENNI_LIBDIR} ${PC_OPENNI_LIBRARY_DIRS} /usr/lib "${OPENNI_ROOT}" "$ENV{OPENNI_ROOT}"
+             PATHS "$ENV{PROGRAMFILES}/OpenNI/Lib" "$ENV{PROGRAMW6432}/OpenNI/Lib64"
+			 PATH_SUFFIXES lib Lib Lib64)

 set(OPENNI_INCLUDE_DIRS ${OPENNI_INCLUDE_DIR})
 if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")


Add auto detection to Intel OCL

Add auto detection to Intel OCL

--- cmake/OpenCVDetectOpenCL.cmake
+++ cmake/OpenCVDetectOpenCL.cmake
@@ -81,6 +81,7 @@
     set(ENV_AMDAPPSDKROOT $ENV{AMDAPPSDKROOT})
     set(ENV_OPENCLROOT $ENV{OPENCLROOT})
     set(ENV_CUDA_PATH $ENV{CUDA_PATH})
+    set(ENV_INTELOCLSDKROOT $ENV{INTELOCLSDKROOT})
     if(ENV_AMDSTREAMSDKROOT)
       set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_AMDAPPSDKROOT}/include)
       if(CMAKE_SIZEOF_VOID_P EQUAL 4)
@@ -108,6 +109,13 @@
         set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} /usr/lib)
       else()
         set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} /usr/lib64)
+      endif()
+    elseif(ENV_INTELOCLSDKROOT)
+      set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_INTELOCLSDKROOT}/include)
+      if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+        set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_INTELOCLSDKROOT}/lib/x86)
+      else()
+        set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_INTELOCLSDKROOT}/lib/x64)
       endif()
     endif()


Updated ASSIMP find script

Updated ASSIMP find script

--- cmake/modules/FindASSIMP.cmake
+++ cmake/modules/FindASSIMP.cmake
@@ -8,7 +8,7 @@

 SET(ASSIMP "assimp")

-FIND_PATH(ASSIMP_INCLUDE_DIR NAMES assimp/assimp.h
+FIND_PATH(ASSIMP_INCLUDE_DIR NAMES assimp/ai_assert.h
   PATHS
   /usr/include
   /usr/local/include


[CMake][Exp PyROOT] Remove subdirectory lib/pythonX.Y from setting pyunittest environment

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -1582,17 +1582,10 @@
 #----------------------------------------------------------------------------
 function(ROOT_ADD_PYUNITTEST name file)
   CMAKE_PARSE_ARGUMENTS(ARG "WILLFAIL" "" "COPY_TO_BUILDDIR;ENVIRONMENT" ${ARGN})
-  if(pyroot_experimental)
-    set(ROOT_ENV ROOTSYS=${ROOTSYS}
-        PATH=${ROOTSYS}/bin:$ENV{PATH}
-        LD_LIBRARY_PATH=${ROOTSYS}/lib:${ROOTSYS}/lib/${python_dir}:$ENV{LD_LIBRARY_PATH}
-        PYTHONPATH=${ROOTSYS}/lib:${ROOTSYS}/lib/${python_dir}:$ENV{PYTHONPATH})
-  else()
-    set(ROOT_ENV ROOTSYS=${ROOTSYS}
-        PATH=${ROOTSYS}/bin:$ENV{PATH}
-        LD_LIBRARY_PATH=${ROOTSYS}/lib:$ENV{LD_LIBRARY_PATH}
-        PYTHONPATH=${ROOTSYS}/lib:$ENV{PYTHONPATH})
-  endif()
+  set(ROOT_ENV ROOTSYS=${ROOTSYS}
+      PATH=${ROOTSYS}/bin:$ENV{PATH}
+      LD_LIBRARY_PATH=${ROOTSYS}/lib:$ENV{LD_LIBRARY_PATH}
+      PYTHONPATH=${ROOTSYS}/lib:$ENV{PYTHONPATH})
   string(REGEX REPLACE "[_]" "-" good_name "${name}")
   get_filename_component(file_name ${file} NAME)
   get_filename_component(file_dir ${file} DIRECTORY)


Add support for GTEST_ROOT as source directory.

The current recommendation for the Google Test project is to build the
library as part of the project with the add_subdirectory
command. While Redhat based Linux distribution contain binary packages
with the library Debian based systems only include the source code.

This patch adds the feature to FindGTest to enable usage of  GTest
source code by adding the source directory to a project.

Change-Id: Ie0cfb1fcbfbf6c7854a793c0e094c01fbb3768cd

--- CMake/FindGTest.cmake
+++ CMake/FindGTest.cmake
@@ -30,11 +30,13 @@
 #   the directory containing the Google Test headers
 #
 # The library variables below are set as normal variables.  These
-# contain debug/optimized keywords when a debugging library is found.
+# variables may contain debug/optimized keywords when a debugging
+# library is found, or may be the name of targets if Google Test
+# source directory is found.
 #
 # ``GTEST_LIBRARIES``
-#   The Google Test ``gtest`` library; note it also requires linking
-#   with an appropriate thread library
+#   The Google Test ``gtest`` library; note it may also requires
+#   linking  with an appropriate thread library
 # ``GTEST_MAIN_LIBRARIES``
 #   The Google Test ``gtest_main`` library
 # ``GTEST_BOTH_LIBRARIES``
@@ -46,8 +48,8 @@
 # The following cache variables may also be set:
 #
 # ``GTEST_ROOT``
-#   The root directory of the Google Test installation (may also be
-#   set as an environment variable)
+#   The root directory of the Google Test installation or installed
+#   source directory (may also be set as an environment variable).
 # ``GTEST_MSVC_SEARCH``
 #   If compiling with MSVC, this variable can be set to ``MT`` or
 #   ``MD`` (the default) to enable searching a GTest build tree
@@ -149,7 +151,68 @@
     mark_as_advanced(${_name})
 endfunction()

-#
+function(_gtest_use_gtest_source)
+
+  # Prevent overriding the parent project's compiler/linker
+  # settings on Windows
+  set(gtest_force_shared_crt ON CACHE INTERNAL "")
+
+  # Avoid CMP0063 warning
+  set(CMAKE_C_VISIBILITY_PRESET)
+  set(CMAKE_CXX_VISIBILITY_PRESET)
+  set(CMAKE_VISIBILITY_INLINES_HIDDEN)
+
+  set(BUILD_GTEST                 ON  CACHE INTERNAL "Builds the googletest subproject.")
+  set(BUILD_GMOCK                 OFF CACHE INTERNAL "Builds the googlemock subproject.")
+  set(gtest_build_samples         OFF CACHE INTERNAL "Build gtest's sample programs.")
+  set(gtest_build_tests           OFF CACHE INTERNAL "Build all of gtest's own tests.")
+  set(gtest_disable_pthreads      ON  CACHE INTERNAL "Disable uses of pthreads in gtest.")
+  set(gtest_hide_internal_symbols OFF CACHE INTERNAL "Build gtest with internal symbols hidden in shared libraries.")
+
+  set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "GTest")
+
+  # Must build GTest as static since EXCLUDE_FROM_ALL, would exclude
+  # needed GTest shared libraries from being installed.
+  set(BUILD_SHARED_LIBS OFF)
+
+  # Add googletest directly to our build but exclude from using it's
+  # target's and installation unless referenced by other dependencies.
+  add_subdirectory("${GTEST_ROOT}"
+    "${CMAKE_CURRENT_BINARY_DIR}/GTest-build" EXCLUDE_FROM_ALL)
+
+endfunction()
+
+#
+
+
+if(NOT "${GTEST_ROOT}" STREQUAL "" AND EXISTS "${GTEST_ROOT}/CMakeLists.txt")
+
+  find_path(GTEST_INCLUDE_DIRS gtest/gtest.h
+    PATHS "${GTEST_ROOT}"
+    NO_DEFAULT_PATH)
+
+  if(NOT "${GTEST_INCLUDE_DIRS}" STREQUAL "")
+
+    message(STATUS "Adding Google Test source directory as subdirectory.")
+    set(GTEST_FOUND 1)
+    set(GTEST_LIBRARIES gtest)
+    set(GTEST_MAIN_LIBRARIES gtest_main)
+    set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
+
+    _gtest_use_gtest_source()
+
+    add_library(GTest::GTest ALIAS ${GTEST_LIBRARIES})
+    add_library(GTest::Main ALIAS ${GTEST_MAIN_LIBRARIES})
+
+    return()
+
+  else()
+    message(WARNING "CTEST_ROOT appears to be a source directory \
+    but \"gtest/gtest.h\"  can not be found in source directory: \
+    ${GTEST_ROOT}")
+  endif()
+
+endif ()

 if(NOT DEFINED GTEST_MSVC_SEARCH)
     set(GTEST_MSVC_SEARCH MD)


impl uses pass3 orig now, should fix before releasing into wild

--- CMake/UseCyclus.cmake
+++ CMake/UseCyclus.cmake
@@ -34,7 +34,8 @@
   # process impl
   SET(CCIN "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.cc")
   SET(CCOUT "-o=${BUILD_DIR}/${_name}.cc")
-  MESSAGE(STATUS "Executing ${CYCPP} ${CCIN} ${CCOUT}")
+  SET(ORIG "--pass3-use-orig")
+  MESSAGE(STATUS "Executing ${CYCPP} ${CCIN} ${CCOUT} ${ORIG}")
   EXECUTE_PROCESS(COMMAND ${CYCPP} ${CCIN} ${CCOUT})

   # add library


Don't pass all trace lines through CMakeParseArguments

--- CMakeUnitRunner.cmake
+++ CMakeUnitRunner.cmake
@@ -432,10 +432,10 @@
           "                            PHASE DRIVER)\n"
           "set (LOG_COVERAGE \"${CMAKE_UNIT_COVERAGE_FILE}\")\n"
           "if (LOG_COVERAGE)\n"
-          "    file (STRINGS \"${DRIVER_ERROR_LOG}\" TRACE_LINES)\n"
           "    _cmake_unit_filter_trace_lines (FILTERED_LINES\n"
           "                                    TEST_NAME \"${TEST_NAME}\"\n"
-          "                                    TRACE_LINES \${TRACE_LINES}\n"
+          "                                    TRACE_FILE\n"
+          "                                    \"\${LOG_COVERAGE}\"\n"
           "                                    COVERAGE_FILES\n"
           "                                    ${COVERAGE_FILES})\n"
           "    file (APPEND \"${ABSOLUTE_COVERAGE_FILE_PATH}\"\n"
@@ -789,7 +789,7 @@
     cmake_parse_arguments (FILTER_COVERAGE
                            ""
                            "TEST_NAME"
-                           "TRACE_LINES;COVERAGE_FILES"
+                           "TRACE_FILE;COVERAGE_FILES"
                            ${ARGN})

     set (COVERAGE_FILE_CONTENTS "")
@@ -800,6 +800,7 @@

     endforeach ()

+    file (STRINGS "${FILTER_COVERAGE_TRACE_FILE}" FILTER_COVERAGE_TRACE_LINES)
     foreach (LINE ${FILTER_COVERAGE_TRACE_LINES})

         # Search for lines matching a trace pattern
@@ -858,16 +859,14 @@

         if (EXISTS "${ERROR_LOG_FILE}")

-            file (STRINGS "${ERROR_LOG_FILE}" ERROR_LOG)
-
             get_property (COVERAGE_FILES
                           GLOBAL PROPERTY _CMAKE_UNIT_COVERAGE_LOGGING_FILES)

             _cmake_unit_filter_trace_lines (COVERAGE_FILE_CONTENTS
                                             TEST_NAME
                                             "${COVERAGE_PHASE_TEST_NAME}"
-                                            TRACE_LINES
-                                            "${ERROR_LOG}"
+                                            TRACE_FILE
+                                            "${ERROR_LOG_FILE}"
                                             COVERAGE_FILES ${COVERAGE_FILES})

             # Use relative path


libgfortran is an alternative to libf2c.

--- cmake-set-dependencies.cmake
+++ cmake-set-dependencies.cmake
@@ -1,3 +1,8 @@
+# Copyright (C) 2012 - 2015 by Pedro Mendes, Virginia Tech Intellectual
+# Properties, Inc., University of Heidelberg, and The University
+# of Manchester.
+# All rights reserved.
+
 ###############################################################################
 #
 # Description       : CMake overwrite dependencies script
@@ -7,19 +12,8 @@
 # This file is part of COPASI.  Please visit http://COPASI.org for more
 # information about COPASI, and the latest version of COPASI.
 #
-# Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
-# Properties, Inc., University of Heidelberg, and The University
-# of Manchester.
-# All rights reserved.
 #
-# Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
-# Properties, Inc., EML Research, gGmbH, University of Heidelberg,
-# and The University of Manchester.
-# All rights reserved.
 #
-# Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
-# Properties, Inc. and EML Research, gGmbH.
-# All rights reserved.
 #
 ###############################################################################

@@ -185,8 +179,16 @@
 if (NOT APPLE)
   # clapack
   set (CLAPACK_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "clapack include directory" FORCE)
+
+  set(CLAPACK_LIBRARY_F2C "${COPASI_DEPENDENCY_DIR}/lib/libf2c.a")
+
+  if (NOT EXISTS "${CLAPACK_LIBRARY_F2C}")
+    set(CLAPACK_LIBRARY_F2C "/usr/lib/libgfortran.so")
+  endif()
+
+
   set (CLAPACK_LIBRARIES
-       ${COPASI_DEPENDENCY_DIR}/lib/liblapack.a;${COPASI_DEPENDENCY_DIR}/lib/libblas.a;${COPASI_DEPENDENCY_DIR}/lib/libf2c.a
+       ${COPASI_DEPENDENCY_DIR}/lib/liblapack.a;${COPASI_DEPENDENCY_DIR}/lib/libblas.a;${CLAPACK_LIBRARY_F2C}
        CACHE FILEPATH "lapack library" FORCE)

   add_definitions(-DHAVE_BLASWRAP_H)


Added so that cucumber-test targets include their binary dir (where the executable lands). Useful to access generated config files etc.

--- cmake/cucumber-testing.cmake
+++ cmake/cucumber-testing.cmake
@@ -38,6 +38,10 @@
         PRIVATE
             ${arg_TARGETS}
             cucumber-cpp
+    )
+    target_include_directories( ${FEATURE_NAME}
+        PRIVATE
+            "$<TARGET_FILE_DIR:${FEATURE_NAME}>"
     )

     if(NOT arg_FEATURES_ROOT)


Forward compiler flags to Fortran workaround

--- cmake/language_support.cmake
+++ cmake/language_support.cmake
@@ -24,6 +24,8 @@
   set(text
     "project(test NONE)
     cmake_minimum_required(VERSION 2.6.0)
+    set (CMAKE_Fortran_FLAGS \"${CMAKE_Fortran_FLAGS}\")
+    set (CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS}\")
     enable_language(${language} OPTIONAL)
   ")
   file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language})


build: support SWIFT_MODULE_DEPENDS_WINDOWS

Add support for depending on swift modules for the windows target.  This
is needed as the private swift modules start to build on Windows.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1619,6 +1619,7 @@
         SWIFT_MODULE_DEPENDS_OSX
         SWIFT_MODULE_DEPENDS_TVOS
         SWIFT_MODULE_DEPENDS_WATCHOS
+        SWIFT_MODULE_DEPENDS_WINDOWS
         TARGET_SDKS)

   cmake_parse_arguments(SWIFTLIB
@@ -1742,6 +1743,9 @@
     elseif(${sdk} STREQUAL HAIKU)
       list(APPEND swiftlib_module_depends_flattened
            ${SWIFTLIB_SWIFT_MODULE_DEPENDS_HAIKU})
+    elseif(${sdk} STREQUAL WINDOWS)
+      list(APPEND swiftlib_module_depends_flattened
+           ${SWIFTLIB_SWIFT_MODULE_DEPENDS_WINDOWS})
     endif()

     # Collect architecture agnostic SDK framework dependencies


build: enable ABI breaking std::atomic changes on MSVC

The std::atomic implementation in MSVC broke ABI compatibility across a
minor update (VS2015U2).  Permit the ABI breaking change for the use in
the runtime.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -241,6 +241,8 @@
     list(APPEND result "-D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP")
     # TODO(compnerd) handle /MT
     list(APPEND result "-D_DLL")
+    # NOTE: We assume that we are using VS 2015 U2+
+    list(APPEND result "-D_ENABLE_ATOMIC_ALIGNMENT_FIX")
   endif()

   if(CFLAGS_ENABLE_ASSERTIONS)


Bump boost version, make dependency stricter

Use EXACT version, since a mismatching boost version might cause issues
between a host and a client.

--- cmake_support/FindDeps.cmake
+++ cmake_support/FindDeps.cmake
@@ -6,14 +6,13 @@
             add_definitions( -DBOOST_THREAD_USE_LIB )
         endif(MINGW)
 endif(WIN32)
+
 set(Boost_ADDITIONAL_VERSIONS 1.59 1.60)
-find_package( Boost 1.59 COMPONENTS filesystem system thread date_time program_options atomic serialization chrono )

-if( NOT Boost_FOUND )
-	message( FATAL_ERROR "Cannot find Boost!" )
-endif()
+find_package( Boost 1.60 EXACT REQUIRED
+        COMPONENTS filesystem system thread date_time program_options atomic serialization chrono )

-find_package( OpenGL )
+find_package( OpenGL REQUIRED )

 # add possible lib names at the end of the arg list
 macro( my_find_package pkg_name header default_lib_name )


Fixed configure file

Fixed configure file

--- src/specific.h.cmake
+++ src/specific.h.cmake
@@ -1,6 +1,6 @@
 #ifndef SPECIFIC_H_INCLUDED
 #define SPECIFIC_H_INCLUDED

-#cmakedefine @CMAKE_INSTALL_PREFIX@
+#cmakedefine CMAKE_INSTALL_PREFIX @CMAKE_INSTALL_PREFIX@

 #endif // SPECIFIC_H_INCLUDED


Use -Wnoexcept

Use -Wnoexcept

--- build_settings.cmake
+++ build_settings.cmake
@@ -36,7 +36,7 @@
 # Warnings that are specific to C++ compilation
 # Note: this is not a union of C_WARN_OPTS, since CMAKE_CXX_FLAGS already includes CMAKE_C_FLAGS, which in turn includes C_WARN_OPTS transitively
 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
-  set(CXX_SPECIFIC_WARN_OPTS "-Wnon-virtual-dtor -Wformat-security -Wno-overloaded-virtual")
+  set(CXX_SPECIFIC_WARN_OPTS "-Wnoexcept -Wnon-virtual-dtor -Wformat-security -Wno-overloaded-virtual")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks")
   if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
     set(VESPA_ATOMIC_LIB "")
@@ -53,7 +53,7 @@
     endif()
   endif()
 else()
-  set(CXX_SPECIFIC_WARN_OPTS "-Wsuggest-override -Wnon-virtual-dtor -Wformat-security")
+  set(CXX_SPECIFIC_WARN_OPTS "-Wnoexcept -Wsuggest-override -Wnon-virtual-dtor -Wformat-security")
   if(VESPA_OS_DISTRO_COMBINED STREQUAL "centos 8" OR
       (VESPA_OS_DISTRO STREQUAL "rhel" AND
 	VESPA_OS_DISTRO_VERSION VERSION_GREATER_EQUAL "8" AND


added check for -msse2 flag

added check for -msse2 flag

--- cmake/CompilerOptimizations.cmake
+++ cmake/CompilerOptimizations.cmake
@@ -45,6 +45,16 @@
 endif()

+check_c_compiler_flag(-msse2 HAS_SSE2)
+check_cxx_compiler_flag(-msse2 HAS_CXX_SSE2)
+  if (HAS_SSE2)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
+endif()
+if (HAS_CXX_SSE2)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+endif()
+
+
 check_c_compiler_flag(-fomit-frame-pointer HAS_OMIT_FRAME_POINTER)
 check_cxx_compiler_flag(-fomit-frame-pointer HAS_CXX_OMIT_FRAME_POINTER)
 if (HAS_OMIT_FRAME_POINTER)


toolchain fix

toolchain fix

--- 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 -ffunction-sections -fdata-sections" CACHE STRING "")
+set(CMAKE_C_FLAGS           "${COMPILER_FLAGS} -std=gnu99 -mcall-prologues -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 "")


Added missing help on CMAKE_BUILD_TYPE.

Added missing help on CMAKE_BUILD_TYPE.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -57,8 +57,9 @@
 endif()

 #---Set a default build type for single-configuration CMake generators if no build type is set------
+set(CMAKE_CONFIGURATION_TYPES Release MinSizeRel Debug RelWithDebInfo)
 if(NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE)
+  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: Release, MinSizeRel, Debug, RelWithDebInfo." FORCE)
 endif()
 message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")


Store CMAKE_BUILD_TYPE content in uppercase

to ease comparisons throughout the whole cmake code.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -62,6 +62,8 @@
   set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: Release, MinSizeRel, Debug, RelWithDebInfo, Optimized." FORCE)
 endif()
 message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+# to be case independent throughout the whole CMake code
+set(CMAKE_BUILD_TYPE ${uppercase_CMAKE_BUILD_TYPE})

 include(CheckCXXCompilerFlag)
 include(CheckCCompilerFlag)


From Lorenzo:
avoid to run script for preparing environment for rootcint, since the
script is not always copied in ROOTSYS/bin.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@41749 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -58,7 +58,8 @@
   if(WIN32)
     set(rootcint_cmd rootcint)
   else()
-    set(rootcint_cmd ${ROOTSYS}/bin/setenvwrap.csh ${ld_library_path}=${ROOTSYS}/lib ${ROOTSYS}/bin/rootcint)
+    set(rootcint_cmd rootcint)
+#    set(rootcint_cmd ${ROOTSYS}/bin/setenvwrap.csh ${ld_library_path}=${ROOTSYS}/lib ${ROOTSYS}/bin/rootcint)
   endif()
   set(rlibmap_cmd rlibmap)
 endif()


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/gloox/hunter.cmake
+++ cmake/projects/gloox/hunter.cmake
@@ -5,6 +5,17 @@
 include(hunter_pick_scheme)

 # List of versions here...
+
+hunter_add_version(
+    PACKAGE_NAME
+    gloox
+    VERSION
+    "1.0.20-p1"
+    URL
+    "https://github.com/designerror/gloox/archive/v1.0.20-p1.tar.gz"
+    SHA1
+    b071e9b11c4afaa308a5f0c01df627388915bf6b
+)

 hunter_add_version(
     PACKAGE_NAME


 SET CTEST_NIGHTLY_START_TIME to 19:00:00 CEST
So we need to program Nightly test just before this time
see : http://www.cmake.org/Wiki/CTest:Nightly,_Experimental,_Continuous

git-svn-id: 8b72b58fb31a931b6e9a2bd3bb08bc6614045fb1@3420 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- test/openVibeTests.cmake
+++ test/openVibeTests.cmake
@@ -109,7 +109,8 @@
 ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")

 SET(CTEST_PROJECT_NAME "OpenViBe")
-#SET(CTEST_NIGHTLY_START_TIME "20:00:00 EST")
+# set time for update
+SET(CTEST_NIGHTLY_START_TIME "19:00:00 CEST")
 SET(CTEST_DROP_METHOD "http")
 SET(CTEST_DROP_SITE "cdash.inria.fr")
 SET(CTEST_DROP_LOCATION "/CDash/submit.php?project=OpenViBe")


FindCUDA.cmake a little better, with indentation

--- cmake/FindCUDA.cmake
+++ cmake/FindCUDA.cmake
@@ -1,8 +1,13 @@
+if(NOT WITH_CUDA)
+   message(STATUS "Not CUDA")
+   return()
+endif()
+
 find_package(CUDA)
 if(CUDA_VERSION)
-    message(STATUS "With CUDA version ${CUDA_VERSION}")
-    set(HAVE_CUDA true)
+   message(STATUS "With CUDA version ${CUDA_VERSION}")
+   set(HAVE_CUDA true)
 else()
-    message(STATUS "Without CUDA")
-    set(HAVE_CUDA false)
+   message(STATUS "Without CUDA")
+   set(HAVE_CUDA false)
 endif(CUDA_VERSION)


Modification de la génération de plugins_d.cfg pour windows en debug

--- cmake/Function.cmake
+++ cmake/Function.cmake
@@ -25,12 +25,14 @@
 	make_directory(${destDir})

 	IF(${isDebug} EQUAL 0)
-		set(FILE_DEST "${destDir}/plugins.cfg")
+		set(SUFFIXE_DEBUG "")
 		set(END_VAR_TYPE "REL")
 	ELSE(${isDebug} EQUAL 0)
-		set(FILE_DEST "${destDir}/plugins_d.cfg")
+		set(SUFFIXE_DEBUG "_d")
 		set(END_VAR_TYPE "DBG")
 	ENDIF(${isDebug} EQUAL 0)
+
+	set(FILE_DEST "${destDir}/plugins${SUFFIXE_DEBUG}.cfg")

 	file(WRITE ${FILE_DEST} "# Defines plugins to load\n\n# Define plugin folder\n")

@@ -46,31 +48,31 @@
 	IF(NOT OGRE_RenderSystem_Direct3D9_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_RenderSystem_Direct3D9_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_Direct3D9\n")
+	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_Direct3D9${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_RenderSystem_Direct3D10_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_RenderSystem_Direct3D10_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_Direct3D10\n")
+	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_Direct3D10${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_RenderSystem_Direct3D11_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_RenderSystem_Direct3D11_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_Direct3D11\n")
+	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_Direct3D11${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_RenderSystem_GL_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_RenderSystem_GL_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_GL\n")
+	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_GL${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_RenderSystem_GLES_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_RenderSystem_GLES_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_GLES\n")
+	file(APPEND ${FILE_DEST} "Plugin=RenderSystem_GLES${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "\n")

@@ -78,37 +80,37 @@
 	IF(NOT OGRE_Plugin_ParticleFX_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_Plugin_ParticleFX_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=Plugin_ParticleFX\n")
+	file(APPEND ${FILE_DEST} "Plugin=Plugin_ParticleFX${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_Plugin_BSPSceneManager_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_Plugin_BSPSceneManager_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=Plugin_BSPSceneManager\n")
+	file(APPEND ${FILE_DEST} "Plugin=Plugin_BSPSceneManager${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_Plugin_CgProgramManager_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_Plugin_CgProgramManager_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=Plugin_CgProgramManager\n")
+	file(APPEND ${FILE_DEST} "Plugin=Plugin_CgProgramManager${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_Plugin_PCZSceneManager_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_Plugin_PCZSceneManager_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=Plugin_PCZSceneManager\n")
+	file(APPEND ${FILE_DEST} "Plugin=Plugin_PCZSceneManager${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_Plugin_OctreeZone_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_Plugin_OctreeZone_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=Plugin_OctreeZone\n")
+	file(APPEND ${FILE_DEST} "Plugin=Plugin_OctreeZone${SUFFIXE_DEBUG}\n")

 	file(APPEND ${FILE_DEST} "	")
 	IF(NOT OGRE_Plugin_OctreeSceneManager_LIBRARY_${END_VAR_TYPE})
 		file(APPEND ${FILE_DEST} "# ")
 	ENDIF(NOT OGRE_Plugin_OctreeSceneManager_LIBRARY_${END_VAR_TYPE})
-	file(APPEND ${FILE_DEST} "Plugin=Plugin_OctreeSceneManager\n")
+	file(APPEND ${FILE_DEST} "Plugin=Plugin_OctreeSceneManager${SUFFIXE_DEBUG}\n")

 endmacro(writePluginFile)


--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -249,6 +249,9 @@
          string(REPLACE " -Wparentheses " " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
          string(REPLACE " -Wparentheses " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
          set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -Wno-parentheses")
+      elseif(Vc_GCC_VERSION VERSION_EQUAL 4.6.0)
+         UserWarning("GCC 4.6.0 miscompiles AVX loads/stores, leading to spurious segfaults. Disabling AVX per default.")
+         set(Vc_AVX_INTRINSICS_BROKEN true)
       elseif(Vc_GCC_VERSION VERSION_EQUAL 4.7.0)
          UserWarning("GCC 4.7.0 miscompiles at -O3, adding -fno-predictive-commoning to the compiler flags as workaround")
          set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -fno-predictive-commoning")


Fixed CMake bug when using Clang compiler.

--- cmake/Compiler.cmake
+++ cmake/Compiler.cmake
@@ -85,7 +85,7 @@
         string(REPLACE "\n" "" Compiler_VERSION ${Compiler_VERSION})

         # Specify compatibility check
-        set(Compiler_CHECK "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\")")
+        set(Compiler_CHECK "\"${CMAKE_CXX_COMPILER_ID}\" STREQUAL \"Clang\"")

     endif()


cmake: update findllvm.cmake file to include llvm12 libraries

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -194,78 +194,57 @@
   # This list can be re-generated with `llvm-config --libfiles` and then
   # reformatting using your favorite text editor. Note we do not execute
   # `llvm-config` here because we are cross compiling.
+  FIND_AND_ADD_LLVM_LIB(LLVMWindowsManifest)
   FIND_AND_ADD_LLVM_LIB(LLVMXRay)
-  FIND_AND_ADD_LLVM_LIB(LLVMWindowsManifest)
-  FIND_AND_ADD_LLVM_LIB(LLVMSymbolize)
-  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoPDB)
-  FIND_AND_ADD_LLVM_LIB(LLVMOrcJIT)
-  FIND_AND_ADD_LLVM_LIB(LLVMOrcError)
-  FIND_AND_ADD_LLVM_LIB(LLVMJITLink)
-  FIND_AND_ADD_LLVM_LIB(LLVMObjectYAML)
-  FIND_AND_ADD_LLVM_LIB(LLVMMCA)
-  FIND_AND_ADD_LLVM_LIB(LLVMLTO)
-  FIND_AND_ADD_LLVM_LIB(LLVMPasses)
-  FIND_AND_ADD_LLVM_LIB(LLVMCoroutines)
-  FIND_AND_ADD_LLVM_LIB(LLVMObjCARCOpts)
-  FIND_AND_ADD_LLVM_LIB(LLVMExtensions)
+  FIND_AND_ADD_LLVM_LIB(LLVMLibDriver)
+  FIND_AND_ADD_LLVM_LIB(LLVMDlltoolDriver)
+  FIND_AND_ADD_LLVM_LIB(LLVMCoverage)
   FIND_AND_ADD_LLVM_LIB(LLVMLineEditor)
-  FIND_AND_ADD_LLVM_LIB(LLVMLibDriver)
-  FIND_AND_ADD_LLVM_LIB(LLVMInterpreter)
-  FIND_AND_ADD_LLVM_LIB(LLVMFuzzMutate)
-  FIND_AND_ADD_LLVM_LIB(LLVMMCJIT)
-  FIND_AND_ADD_LLVM_LIB(LLVMExecutionEngine)
-  FIND_AND_ADD_LLVM_LIB(LLVMRuntimeDyld)
-  FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinker)
-  FIND_AND_ADD_LLVM_LIB(LLVMDlltoolDriver)
-  FIND_AND_ADD_LLVM_LIB(LLVMOption)
-  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoGSYM)
-  FIND_AND_ADD_LLVM_LIB(LLVMCoverage)
   FIND_AND_ADD_LLVM_LIB(LLVMXCoreDisassembler)
   FIND_AND_ADD_LLVM_LIB(LLVMXCoreCodeGen)
   FIND_AND_ADD_LLVM_LIB(LLVMXCoreDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMXCoreInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMX86Disassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMX86AsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMX86CodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMX86AsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMX86Desc)
   FIND_AND_ADD_LLVM_LIB(LLVMX86Info)
   FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyCodeGen)
   FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyDesc)
-  FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMWebAssemblyInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMSystemZDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMSystemZAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMSystemZCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMSystemZAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMSystemZDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMSystemZInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMSparcDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMSparcAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMSparcCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMSparcAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMSparcDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMSparcInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMRISCVDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMRISCVAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMRISCVCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMRISCVAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMRISCVDesc)
-  FIND_AND_ADD_LLVM_LIB(LLVMRISCVUtils)
   FIND_AND_ADD_LLVM_LIB(LLVMRISCVInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMPowerPCDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMPowerPCAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMPowerPCCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMPowerPCAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMPowerPCDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMPowerPCInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMNVPTXCodeGen)
   FIND_AND_ADD_LLVM_LIB(LLVMNVPTXDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMNVPTXInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMMSP430Disassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMMSP430AsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMMSP430CodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMMSP430AsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMMSP430Desc)
   FIND_AND_ADD_LLVM_LIB(LLVMMSP430Info)
   FIND_AND_ADD_LLVM_LIB(LLVMMipsDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMMipsAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMMipsCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMMipsAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMMipsDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMMipsInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMLanaiDisassembler)
@@ -279,44 +258,73 @@
   FIND_AND_ADD_LLVM_LIB(LLVMHexagonDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMHexagonInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMBPFDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMBPFAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMBPFCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMBPFAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMBPFDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMBPFInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMAVRDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMAVRAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMAVRCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMAVRAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMAVRDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMAVRInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMARMDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMARMAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMARMCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMARMAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMARMDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMARMUtils)
   FIND_AND_ADD_LLVM_LIB(LLVMARMInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUDisassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUCodeGen)
-  FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
-  FIND_AND_ADD_LLVM_LIB(LLVMipo)
-  FIND_AND_ADD_LLVM_LIB(LLVMInstrumentation)
-  FIND_AND_ADD_LLVM_LIB(LLVMVectorize)
-  FIND_AND_ADD_LLVM_LIB(LLVMLinker)
-  FIND_AND_ADD_LLVM_LIB(LLVMIRReader)
-  FIND_AND_ADD_LLVM_LIB(LLVMAsmParser)
-  FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenMP)
-  FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUAsmParser)
   FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUDesc)
   FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUUtils)
   FIND_AND_ADD_LLVM_LIB(LLVMAMDGPUInfo)
   FIND_AND_ADD_LLVM_LIB(LLVMAArch64Disassembler)
+  FIND_AND_ADD_LLVM_LIB(LLVMAArch64AsmParser)
+  FIND_AND_ADD_LLVM_LIB(LLVMAArch64CodeGen)
+  FIND_AND_ADD_LLVM_LIB(LLVMAArch64Desc)
+  FIND_AND_ADD_LLVM_LIB(LLVMAArch64Utils)
+  FIND_AND_ADD_LLVM_LIB(LLVMAArch64Info)
+  FIND_AND_ADD_LLVM_LIB(LLVMOrcJIT)
+  FIND_AND_ADD_LLVM_LIB(LLVMMCJIT)
+  FIND_AND_ADD_LLVM_LIB(LLVMJITLink)
+  FIND_AND_ADD_LLVM_LIB(LLVMOrcTargetProcess)
+  FIND_AND_ADD_LLVM_LIB(LLVMOrcShared)
+  FIND_AND_ADD_LLVM_LIB(LLVMInterpreter)
+  FIND_AND_ADD_LLVM_LIB(LLVMExecutionEngine)
+  FIND_AND_ADD_LLVM_LIB(LLVMRuntimeDyld)
+  FIND_AND_ADD_LLVM_LIB(LLVMSymbolize)
+  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoPDB)
+  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoGSYM)
+  FIND_AND_ADD_LLVM_LIB(LLVMOption)
+  FIND_AND_ADD_LLVM_LIB(LLVMObjectYAML)
+  FIND_AND_ADD_LLVM_LIB(LLVMMCA)
   FIND_AND_ADD_LLVM_LIB(LLVMMCDisassembler)
-  FIND_AND_ADD_LLVM_LIB(LLVMAArch64CodeGen)
+  FIND_AND_ADD_LLVM_LIB(LLVMLTO)
+  FIND_AND_ADD_LLVM_LIB(LLVMPasses)
   FIND_AND_ADD_LLVM_LIB(LLVMCFGuard)
+  FIND_AND_ADD_LLVM_LIB(LLVMCoroutines)
+  FIND_AND_ADD_LLVM_LIB(LLVMObjCARCOpts)
+  FIND_AND_ADD_LLVM_LIB(LLVMHelloNew)
+  FIND_AND_ADD_LLVM_LIB(LLVMipo)
+  FIND_AND_ADD_LLVM_LIB(LLVMVectorize)
+  FIND_AND_ADD_LLVM_LIB(LLVMLinker)
+  FIND_AND_ADD_LLVM_LIB(LLVMInstrumentation)
+  FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenMP)
+  FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenACC)
+  FIND_AND_ADD_LLVM_LIB(LLVMExtensions)
+  FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinker)
   FIND_AND_ADD_LLVM_LIB(LLVMGlobalISel)
-  FIND_AND_ADD_LLVM_LIB(LLVMSelectionDAG)
+  FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
   FIND_AND_ADD_LLVM_LIB(LLVMAsmPrinter)
   FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARF)
+  FIND_AND_ADD_LLVM_LIB(LLVMSelectionDAG)
   FIND_AND_ADD_LLVM_LIB(LLVMCodeGen)
+  FIND_AND_ADD_LLVM_LIB(LLVMIRReader)
+  FIND_AND_ADD_LLVM_LIB(LLVMAsmParser)
+  FIND_AND_ADD_LLVM_LIB(LLVMInterfaceStub)
+  FIND_AND_ADD_LLVM_LIB(LLVMFileCheck)
+  FIND_AND_ADD_LLVM_LIB(LLVMFuzzMutate)
   FIND_AND_ADD_LLVM_LIB(LLVMTarget)
   FIND_AND_ADD_LLVM_LIB(LLVMScalarOpts)
   FIND_AND_ADD_LLVM_LIB(LLVMInstCombine)
@@ -327,19 +335,15 @@
   FIND_AND_ADD_LLVM_LIB(LLVMProfileData)
   FIND_AND_ADD_LLVM_LIB(LLVMObject)
   FIND_AND_ADD_LLVM_LIB(LLVMTextAPI)
+  FIND_AND_ADD_LLVM_LIB(LLVMMCParser)
+  FIND_AND_ADD_LLVM_LIB(LLVMMC)
+  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)
+  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoMSF)
   FIND_AND_ADD_LLVM_LIB(LLVMBitReader)
   FIND_AND_ADD_LLVM_LIB(LLVMCore)
   FIND_AND_ADD_LLVM_LIB(LLVMRemarks)
   FIND_AND_ADD_LLVM_LIB(LLVMBitstreamReader)
-  FIND_AND_ADD_LLVM_LIB(LLVMAArch64AsmParser)
-  FIND_AND_ADD_LLVM_LIB(LLVMMCParser)
-  FIND_AND_ADD_LLVM_LIB(LLVMAArch64Desc)
-  FIND_AND_ADD_LLVM_LIB(LLVMMC)
-  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)
-  FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoMSF)
   FIND_AND_ADD_LLVM_LIB(LLVMBinaryFormat)
-  FIND_AND_ADD_LLVM_LIB(LLVMAArch64Utils)
-  FIND_AND_ADD_LLVM_LIB(LLVMAArch64Info)
   FIND_AND_ADD_LLVM_LIB(LLVMSupport)
   FIND_AND_ADD_LLVM_LIB(LLVMDemangle)
 endif()


Added release flag to optimize with -O3

Added release flag to optimize with -O3

--- cmake/Platform.cmake
+++ cmake/Platform.cmake
@@ -30,7 +30,9 @@
     message(WARNING "This build has not yet been tested with VC++")
     set(PLATFORM_FLAGS)
 else (MSVC)
-    set(PLATFORM_FLAGS "-Wall" "-Wno-packed-bitfield-compat" "-O3" "-std=c++11" )
+    set(PLATFORM_FLAGS "-Wall" "-Wno-packed-bitfield-compat" "-std=c++11" )
+
+    set(CMAKE_CSS_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
 endif (MSVC)

 add_definitions(${PLATFORM_FLAGS})


quote flags correctly that contain spaces inside single quotes (used in AliRoot)

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -493,7 +493,20 @@
    # make a semicolon separated list of all flags
    string(TOUPPER "${CMAKE_BUILD_TYPE}" _tmp)
    set(_tmp "CMAKE_CXX_FLAGS_${_tmp}")
-   string(REPLACE " " ";" _flags "${CMAKE_CXX_FLAGS} ${${_tmp}} ${_flags}")
+   string(REPLACE " " ";" _tmp "${CMAKE_CXX_FLAGS} ${${_tmp}} ${_flags}")
+   set(_flags)
+   foreach(item ${_tmp})
+      if(item MATCHES "^[^']*'[^']*$")
+         if(_str)
+            list(APPEND _flags "${_str} ${item}")
+            unset(_str)
+         else()
+            set(_str "${item}")
+         endif()
+      else()
+         list(APPEND _flags "${item}")
+      endif()
+   endforeach()
    get_directory_property(_inc INCLUDE_DIRECTORIES)
    foreach(_i ${_inc})
       list(APPEND _flags "-I${_i}")


qemu_x86_long: don't munge to elf32 in-place

Instead, use the QEMU_KERNEL_FILE facility to perform the
change in a new file zephyr-qemu.elf. This is what will
be sent to the emulator.

Fixes an issue where opening zephyr.elf in GDB would treat
it as a 32-bit binary instead of what it actually is,
forcing the user to override the arch setting.

Fixes: #19734

Signed-off-by: Andrew Boie <aab045b28152628be6af0e556050d0381fd0a34d@intel.com>

--- cmake/emu/qemu.cmake
+++ cmake/emu/qemu.cmake
@@ -236,11 +236,14 @@
 if(CONFIG_X86_LONGMODE)
   # QEMU doesn't like 64-bit ELF files. Since we don't use any >4GB
   # addresses, converting it to 32-bit is safe enough for emulation.
-  list(APPEND PRE_QEMU_COMMANDS
+  set(QEMU_KERNEL_FILE "${CMAKE_BINARY_DIR}/zephyr-qemu.elf")
+  add_custom_target(qemu_kernel_target
     COMMAND
     ${CMAKE_OBJCOPY}
     -O elf32-i386
     $<TARGET_FILE:${logical_target_for_zephyr_elf}>
+    ${CMAKE_BINARY_DIR}/zephyr-qemu.elf
+    DEPENDS ${logical_target_for_zephyr_elf}
     )
 endif()


span: remove span std define

span: remove span std define

--- cmake/external.cmake
+++ cmake/external.cmake
@@ -35,6 +35,5 @@

 add_library(span INTERFACE)
 target_include_directories(span SYSTEM INTERFACE ${CMAKE_SOURCE_DIR}/external/span-lite/include)
-#target_compile_definitions(span INTERFACE span_CONFIG_SELECT_SPAN=span_SPAN_STD)

 #///////////////////////////////////////////////////////////////////////////////


Suppress excessive warnings for Y3 packages

--- bootstrap/get.cmake
+++ bootstrap/get.cmake
@@ -40,7 +40,7 @@
 endif()

 function(y3_cmake _dir)
-  cmake_parse_arguments(_arg "" "TARGET" "CONFIG;OPTIONS" ${ARGN})
+  cmake_parse_arguments(_arg "" "TARGET" "CL;CONFIG;OPTIONS" ${ARGN})
   message(STATUS "[Y3] Building ${_dir}")
   execute_process(COMMAND ${CMAKE_COMMAND} -G ${GENERATOR} ${BUILD_DIR}/${_dir}
       -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG=${PREFIX_DIR}/lib
@@ -54,8 +54,12 @@
   else()
     set(_target "install")
   endif()
+  if(_arg_CL)
+    string(REPLACE ";" " " _cl "${_arg_CL}")
+    set(_env_cl "CL=$ENV{CL} ${_cl}")
+  endif()
   foreach(_config ${_arg_CONFIG})
-    execute_process(COMMAND ${CMAKE_COMMAND} --build ${BUILD_DIR}/${_dir} --config ${_config} --target ${_target} ${BUILD_OPTIONS}
+    execute_process(COMMAND ${CMAKE_COMMAND} -E env ${_env_cl} ${CMAKE_COMMAND} --build ${BUILD_DIR}/${_dir} --config ${_config} --target ${_target} ${BUILD_OPTIONS}
       WORKING_DIRECTORY ${BUILD_DIR}/${_dir})
   endforeach()
 endfunction()
@@ -263,7 +267,8 @@
   y3_cmake(${_package}
     TARGET "zlibstatic"
     CONFIG ${CONFIGS}
-    OPTIONS -DSKIP_INSTALL_FILES=ON)
+    OPTIONS -DSKIP_INSTALL_FILES=ON
+    CL -wd4267)
   file(INSTALL
     ${BUILD_DIR}/${_package}/zconf.h
     ${BUILD_DIR}/${_package}/zlib.h
@@ -327,7 +332,8 @@
   y3_cmake(${_package}
     TARGET "vorbisfile"
     CONFIG ${CONFIGS}
-    OPTIONS -DCMAKE_DEBUG_POSTFIX=d -DOGG_ROOT=${PREFIX_DIR})
+    OPTIONS -DCMAKE_DEBUG_POSTFIX=d -DOGG_ROOT=${PREFIX_DIR}
+    CL -wd4244 -wd4267 -wd4305 -wd4996)
   file(INSTALL
     ${BUILD_DIR}/${_package}/include/vorbis/codec.h
     ${BUILD_DIR}/${_package}/include/vorbis/vorbisfile.h


Update java version for DEFAULT_JAVA_HOME.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -403,12 +403,12 @@
   if (DEFINED JAVA_HOME)
     return()
   endif()
-  set(DEFAULT_JAVA_HOME "/usr/lib/jvm/java-11-openjdk")
+  set(DEFAULT_JAVA_HOME "/usr/lib/jvm/java-17-openjdk")
   if(APPLE)
     execute_process(COMMAND "/usr/libexec/java_home" OUTPUT_VARIABLE DEFAULT_JAVA_HOME)
     string(STRIP "${DEFAULT_JAVA_HOME}" DEFAULT_JAVA_HOME)
-  elseif(VESPA_OS_DISTRO STREQUAL "ubuntu")
-    set(DEFAULT_JAVA_HOME "/usr/lib/jvm/java-11-openjdk-amd64" PARENT_SCOPE)
+  elseif(VESPA_OS_DISTRO STREQUAL "ubuntu" OR VESPA_OS_DISTRO STREQUAL "debian")
+    set(DEFAULT_JAVA_HOME "/usr/lib/jvm/java-17-openjdk-amd64" PARENT_SCOPE)
   endif()
   if(COMMAND vespa_use_specific_java_home)
     vespa_use_specific_java_home()


fix: Set aggregate lists in FindSuiteSparse only when config found [CMake]

--- CMake/Modules/FindSuiteSparse.cmake
+++ CMake/Modules/FindSuiteSparse.cmake
@@ -220,7 +220,6 @@
     endforeach ()
   endif ()
 endif ()
-set(SuiteSparse_config_INCLUDE_DIRS ${SuiteSparse_config_INCLUDE_DIR})
 mark_as_advanced(SuiteSparse_config_INCLUDE_DIR)

 _suitesparse_get_library_suffixes(_suitesparse_library_suffixes SuiteSparse_config)
@@ -230,14 +229,18 @@
   PATH_SUFFIXES ${_suitesparse_library_suffixes}
   NO_DEFAULT_PATH
 )
-set(SuiteSparse_config_LIBRARIES ${SuiteSparse_config_LIBRARY})
-get_filename_component(SuiteSparse_LIBRARY_DIR "${SuiteSparse_config_LIBRARY}" PATH)
 mark_as_advanced(SuiteSparse_config_LIBRARY)

 if (SuiteSparse_config_INCLUDE_DIR AND SuiteSparse_config_LIBRARY)
   set(SuiteSparse_config_FOUND 1)
+  set(SuiteSparse_config_INCLUDE_DIRS ${SuiteSparse_config_INCLUDE_DIR})
+  set(SuiteSparse_config_LIBRARIES    ${SuiteSparse_config_LIBRARY})
+  get_filename_component(SuiteSparse_LIBRARY_DIR "${SuiteSparse_config_LIBRARY}" PATH)
 else ()
   set(SuiteSparse_config_FOUND 0)
+  set(SuiteSparse_config_INCLUDE_DIRS)
+  set(SuiteSparse_config_LIBRARIES)
+  set(SuiteSparse_LIBRARY_DIR)
 endif ()

 _suitesparse_debug_message("Config (FOUND=${SuiteSparse_config_FOUND}):")
@@ -314,12 +317,10 @@
       PATH_SUFFIXES ${_suitesparse_include_suffixes}
       NO_DEFAULT_PATH
     )
-    set(SuiteSparse_${_suitesparse_component}_INCLUDE_DIRS
-      ${SuiteSparse_${_suitesparse_component}_INCLUDE_DIR}
-    )
     mark_as_advanced(SuiteSparse_${_suitesparse_component}_INCLUDE_DIR)

     # Find component library file
+    set(SuiteSparse_${_suitesparse_component}_LIBRARIES)
     _suitesparse_get_library_suffixes(_suitesparse_library_suffixes ${_suitesparse_component})
     find_library(SuiteSparse_${_suitesparse_component}_LIBRARY
       NAMES ${_suitesparse_component_lower}
@@ -328,17 +329,22 @@
       PATH_SUFFIXES ${_suitesparse_library_suffixes}
       NO_DEFAULT_PATH
     )
-    set(SuiteSparse_${_suitesparse_component}_LIBRARIES
-      ${SuiteSparse_${_suitesparse_component}_LIBRARY}
-    )
     mark_as_advanced(SuiteSparse_${_suitesparse_component}_LIBRARY)

-    # Mark component as either found or not
+    # Mark component as either found or not and init aggregates
     if (SuiteSparse_${_suitesparse_component}_INCLUDE_DIR AND
         SuiteSparse_${_suitesparse_component}_LIBRARY)
       set(SuiteSparse_${_suitesparse_component}_FOUND 1)
+      set(SuiteSparse_${_suitesparse_component}_INCLUDE_DIRS
+        ${SuiteSparse_${_suitesparse_component}_INCLUDE_DIR}
+      )
+      set(SuiteSparse_${_suitesparse_component}_LIBRARIES
+        ${SuiteSparse_${_suitesparse_component}_LIBRARY}
+      )
     else ()
       set(SuiteSparse_${_suitesparse_component}_FOUND 0)
+      set(SuiteSparse_${_suitesparse_component}_INCLUDE_DIRS)
+      set(SuiteSparse_${_suitesparse_component}_LIBRARIES)
     endif ()

   endif ()
@@ -446,17 +452,23 @@

 # ------------------------------------------------------------------------------
 # Aggregate found libraries
-set(SuiteSparse_INCLUDE_DIR  ${SuiteSparse_config_INCLUDE_DIR})
-set(SuiteSparse_INCLUDE_DIRS ${SuiteSparse_config_INCLUDE_DIRS})
-set(SuiteSparse_LIBRARIES    ${SuiteSparse_config_LIBRARIES})
-foreach (_suitesparse_component IN LISTS SuiteSparse_COMPONENTS)
-  if (SuiteSparse_${_suitesparse_component}_FOUND)
-    list(APPEND SuiteSparse_INCLUDE_DIRS SuiteSparse_${_suitesparse_component}_INCLUDE_DIRS)
-    list(APPEND SuiteSparse_LIBRARIES    SuiteSparse_${_suitesparse_component}_LIBRARIES)
-  endif ()
-endforeach ()
-_suitesparse_remove_duplicate_paths(SuiteSparse_INCLUDE_DIRS)
-_suitesparse_remove_duplicate_libraries(SuiteSparse_LIBRARIES)
+if (SuiteSparse_config_FOUND)
+  set(SuiteSparse_INCLUDE_DIR  ${SuiteSparse_config_INCLUDE_DIR})
+  set(SuiteSparse_INCLUDE_DIRS ${SuiteSparse_config_INCLUDE_DIRS})
+  set(SuiteSparse_LIBRARIES    ${SuiteSparse_config_LIBRARIES})
+  foreach (_suitesparse_component IN LISTS SuiteSparse_COMPONENTS)
+    if (SuiteSparse_${_suitesparse_component}_FOUND)
+      list(APPEND SuiteSparse_INCLUDE_DIRS SuiteSparse_${_suitesparse_component}_INCLUDE_DIRS)
+      list(APPEND SuiteSparse_LIBRARIES    SuiteSparse_${_suitesparse_component}_LIBRARIES)
+    endif ()
+  endforeach ()
+  _suitesparse_remove_duplicate_paths(SuiteSparse_INCLUDE_DIRS)
+  _suitesparse_remove_duplicate_libraries(SuiteSparse_LIBRARIES)
+else ()
+  set(SuiteSparse_INCLUDE_DIR)
+  set(SuiteSparse_INCLUDE_DIRS)
+  set(SuiteSparse_LIBRARIES)
+endif ()

 # ------------------------------------------------------------------------------
 # Handle QUIET, REQUIRED, and [EXACT] VERSION arguments and set SuiteSparse_FOUND


Add x86_64 to list of archs for iOS simulator

Most new Macs and iOS devices are 64-bit now, so make it a default.

Change-Id: I4dd8a49557ad08f7bfd495f1517d53eb92eef297

--- CMake/ios.simulator.toolchain.cmake
+++ CMake/ios.simulator.toolchain.cmake
@@ -31,7 +31,7 @@
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__PHONE_OS_VERSION_MIN_REQIORED=50000")
 endif()

-set(CMAKE_OSX_ARCHITECTURES i386)
+set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")


ENH: continuing to refine this macro. It will execute if the macro has changed since the last time CMakeOutput.log was changed.

--- CMake/itkCheckCXXAcceptsFlags.cmake
+++ CMake/itkCheckCXXAcceptsFlags.cmake
@@ -8,7 +8,10 @@
 #  VAR   - variable to store whether compiler accepts the FLAGS (TRUE or FALSE)
 #
 MACRO(itkCHECK_CXX_ACCEPTS_FLAGS FLAGS VAR)
-  IF(NOT DEFINED ${VAR})
+    #
+    # If this file changed since CMakeOutput.log changed rerun the macro
+    #
+    IF(NOT DEFINED ${VAR} OR ${CMAKE_SOURCE_DIR}/CMake/itkCheckCXXAcceptsFlags.cmake IS_NEWER_THAN ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log)
     SET(_SOURCE "int main() { return 0;}\n")
     FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
       "${_SOURCE}")
@@ -51,5 +54,5 @@
        "Source file was:\n${_SOURCE}\n")
    ENDIF(${VAR})

-  ENDIF(NOT DEFINED ${VAR})
+   ENDIF(NOT DEFINED ${VAR} OR ${CMAKE_SOURCE_DIR}/CMake/itkCheckCXXAcceptsFlags.cmake IS_NEWER_THAN ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log)
 ENDMACRO(itkCHECK_CXX_ACCEPTS_FLAGS)


added function for removing compile options from specific target

--- build_options.cmake
+++ build_options.cmake
@@ -44,6 +44,16 @@
         string( REPLACE "${option}" "" current_compile_options "${current_compile_options}" )
     endforeach()
     set_directory_properties( PROPERTIES COMPILE_OPTIONS "${current_compile_options}" )
+endfunction()
+
+function( TNUN_target_remove_compile_options target configuration )
+    string( TOUPPER ${configuration} configuration )
+    get_target_property( current_compile_options ${target} COMPILE_OPTIONS )
+    foreach( arg ${ARGN} )
+        set( option $<$<CONFIG:${configuration}>:${arg}> )
+        string( REPLACE "${option}" "" current_compile_options "${current_compile_options}" )
+    endforeach()
+    set_target_properties( ${target} PROPERTIES COMPILE_OPTIONS "${current_compile_options}" )
 endfunction()

 ################################################################################