cmake: Added macOS support for avrlib

cmake: Added macOS support for avrlib

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -2136,12 +2136,22 @@
 #=============================================================================#
 if(NOT ARDUINO_FOUND AND ARDUINO_SDK_PATH)
     register_hardware_platform(${ARDUINO_SDK_PATH}/hardware/arduino/)
-
-    find_file(ARDUINO_LIBRARIES_PATH
+    register_hardware_platform(${ARDUINO_SDK_PATH}/hardware/arduino/avr)
+
+    find_file(ARDUINO_LIBRARIES_PATH_DEF
         NAMES libraries
         PATHS ${ARDUINO_SDK_PATH}
-        DOC "Path to directory containing the Arduino libraries.")
-
+        DOC "Path to directory containing the Arduino (default) libraries.")
+
+	find_file(ARDUINO_LIBRARIES_PATH_PLATFORM
+        NAMES libraries
+        PATHS ${ARDUINO_SDK_PATH}/hardware/arduino/avr/
+        DOC "Path to directory containing the Arduino (plateform specific) libraries.")
+
+	set (ARDUINO_LIBRARIES_PATH "${ARDUINO_LIBRARIES_PATH_DEF};${ARDUINO_LIBRARIES_PATH_PLATFORM}"
+		CACHE STRING "Path to directory containing the Arduino (default) libraries.")
+
+
     find_file(ARDUINO_VERSION_PATH
         NAMES lib/version.txt
         PATHS ${ARDUINO_SDK_PATH}


[build] Install export core library to build dir (#4866)

--- cmake/TaichiExportCore.cmake
+++ cmake/TaichiExportCore.cmake
@@ -4,3 +4,4 @@

 add_library(${TAICHI_EXPORT_CORE_NAME} SHARED)
 target_link_libraries(${TAICHI_EXPORT_CORE_NAME} taichi_isolated_core)
+install(TARGETS ${TAICHI_EXPORT_CORE_NAME} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/build)


install package.xml of metapackages

install package.xml of metapackages

--- cmake/catkin_workspace.cmake
+++ cmake/catkin_workspace.cmake
@@ -56,11 +56,16 @@

       list(GET CATKIN_ORDERED_PACKAGE_PATHS ${index} path)
       list(GET CATKIN_ORDERED_PACKAGES_IS_META ${index} is_meta)
+      list(GET CATKIN_ORDERED_PACKAGES ${index} name)
       if(NOT ${is_meta})
         message(STATUS "+++ add_subdirectory(${path})")
         add_subdirectory(${path})
       else()
-        message(STATUS "+++ skip meta-package '${path}'")
+        message(STATUS "+++ metapackage '${path}'")
+        install(FILES
+          ${path}/package.xml
+          DESTINATION share/${name}
+        )
       endif()
     endforeach()
   endif()


build: obsolete `INTERFACE_LINK_LIBRARIES`

This was deprecated a while ago, remove support for it.  This is no
longer used in the Swift build.  Remove the dead code.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -750,7 +750,6 @@
         GYB_SOURCES
         INCORPORATE_OBJECT_LIBRARIES
         INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
-        INTERFACE_LINK_LIBRARIES
         LINK_FLAGS
         LINK_LIBRARIES
         LLVM_COMPONENT_DEPENDS
@@ -892,7 +891,6 @@
         ${SWIFTLIB_SINGLE_DEPENDS}
         ${SWIFTLIB_SINGLE_FILE_DEPENDS}
         ${SWIFTLIB_SINGLE_LINK_LIBRARIES}
-        ${SWIFTLIB_SINGLE_INTERFACE_LINK_LIBRARIES}
       SDK ${SWIFTLIB_SINGLE_SDK}
       ARCHITECTURE ${SWIFTLIB_SINGLE_ARCHITECTURE}
       MODULE_NAME ${module_name}
@@ -1313,7 +1311,7 @@
   # import library targets when the library was added.  Use that to adjust the
   # link libraries.
   if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
-    foreach(library_list LINK_LIBRARIES INTERFACE_LINK_LIBRARIES PRIVATE_LINK_LIBRARIES)
+    foreach(library_list LINK_LIBRARIES PRIVATE_LINK_LIBRARIES)
       set(import_libraries)
       foreach(library ${SWIFTLIB_SINGLE_${library_list}})
         # Ensure that the library is a target.  If an absolute path was given,
@@ -1342,14 +1340,6 @@
     target_link_libraries("${target}" PRIVATE
         ${SWIFTLIB_SINGLE_PRIVATE_LINK_LIBRARIES})
   endif()
-  if("${libkind}" STREQUAL "OBJECT")
-    precondition_list_empty(
-        "${SWIFTLIB_SINGLE_INTERFACE_LINK_LIBRARIES}"
-        "OBJECT_LIBRARY may not link to anything")
-  else()
-    target_link_libraries("${target}" INTERFACE
-        ${SWIFTLIB_SINGLE_INTERFACE_LINK_LIBRARIES})
-  endif()

   set_property(TARGET "${target}" PROPERTY
       LINKER_LANGUAGE "CXX")
@@ -1407,7 +1397,6 @@
         C_COMPILE_FLAGS
         DEPENDS
         FILE_DEPENDS
-        INTERFACE_LINK_LIBRARIES
         LINK_LIBRARIES
         LLVM_COMPONENT_DEPENDS)

@@ -1423,9 +1412,6 @@
   endif()
   if(ASHL_DEPENDS)
     message(SEND_ERROR "library ${name} is using DEPENDS parameter which is deprecated.  Please use add_dependencies instead")
-  endif()
-  if(ASHL_INTERFACE_LINK_LIBRARIES)
-    message(SEND_ERROR "library ${name} is using INTERFACE_LINK_LIBRARIES parameter which is deprecated.  Please use target_link_libraries instead.")
   endif()
   if(ASHL_LINK_LIBRARIES)
     message(SEND_ERROR "library ${name} is using LINK_LIBRARIES parameter which is deprecated.  Please use target_link_libraries instead")
@@ -1478,7 +1464,6 @@
 #     [STATIC]
 #     [DEPENDS dep1 ...]
 #     [LINK_LIBRARIES dep1 ...]
-#     [INTERFACE_LINK_LIBRARIES dep1 ...]
 #     [SWIFT_MODULE_DEPENDS dep1 ...]
 #     [FRAMEWORK_DEPENDS dep1 ...]
 #     [FRAMEWORK_DEPENDS_WEAK dep1 ...]
@@ -1631,7 +1616,6 @@
         GYB_SOURCES
         INCORPORATE_OBJECT_LIBRARIES
         INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
-        INTERFACE_LINK_LIBRARIES
         LINK_FLAGS
         LINK_LIBRARIES
         LLVM_COMPONENT_DEPENDS


[cmake] Allow for add_swift_host_libraries to set that they shouldn't use llvm update flags.

This is specifically important for host libraries that include swift
content. llvm_update_compile_flags currently doesn't conditionalize the flags it
adds since it needs to be updated like I updated Swift's cmake in
558c9d408674a7a8e4743596e32f2c58d2e292b4.

In the short amount of time that I am dealing with upstream to patch those
flags, this patch will unblock eeckstein and let him continue with his libswift
work.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -390,6 +390,7 @@
 #     [SHARED]
 #     [STATIC]
 #     [OBJECT]
+#     [IGNORE_LLVM_UPDATE_COMPILE_FLAGS]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
 #     source1 [source2 source3 ...])
 #
@@ -407,6 +408,11 @@
 #
 # LLVM_LINK_COMPONENTS
 #   LLVM components this library depends on.
+#
+# IGNORE_LLVM_UPDATE_COMPILE_FLAGS
+#   If set do not use llvm_update_compile_flags to generate cflags/etc.  This is
+#   generally used when compiling a mixed c/c++/swift library and one wants to
+#   disable this for the swift part.
 #
 # source1 ...
 #   Sources to add into this library.
@@ -414,7 +420,8 @@
   set(options
         SHARED
         STATIC
-        OBJECT)
+        OBJECT
+        IGNORE_LLVM_UPDATE_COMPILE_FLAGS)
   set(single_parameter_options)
   set(multiple_parameter_options
         LLVM_LINK_COMPONENTS)
@@ -460,7 +467,9 @@

   add_library(${name} ${libkind} ${ASHL_SOURCES})
   add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
-  llvm_update_compile_flags(${name})
+  if (NOT ASHL_IGNORE_LLVM_UPDATE_COMPILE_FLAGS)
+    llvm_update_compile_flags(${name})
+  endif()
   swift_common_llvm_config(${name} ${ASHL_LLVM_LINK_COMPONENTS})
   set_output_directory(${name}
       BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}


Update Finduuid.cmake to work on macOS

Update Finduuid.cmake to work on macOS

On macOS there is no need for libuuid.so, the functions are provided
by the kernel, and the header comes with the OS. The updated file
only looks for a libuuid.so if it is needed.

--- cmake/modules/Finduuid.cmake
+++ cmake/modules/Finduuid.cmake
@@ -1,32 +1,56 @@
-# Try to find uuid
-# Once done, this will define
+#.rst:
+# Finduuid
+# -----------
 #
-# UUID_FOUND        - system has uuid
-# UUID_INCLUDE_DIRS - uuid include directories
-# UUID_LIBRARIES    - libraries needed to use uuid
+# Find libuuid, DCE compatible Universally Unique Identifier library.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module will set the following variables in your project:
+#
+# ``UUID_FOUND``
+#   True if libuuid has been found.
+# ``UUID_INCLUDE_DIRS``
+#   Where to find uuid/uuid.h.
+# ``UUID_LIBRARIES``
+#   The libraries to link against to use libuuid.
+#
+# Obsolete variables
+# ^^^^^^^^^^^^^^^^^^
+#
+# The following variables may also be set, for backwards compatibility:
+#
+# ``UUID_LIBRARY``
+#   where to find the libuuid library (same as UUID_LIBRARIES).
+# ``UUID_INCLUDE_DIR``
+#   where to find the uuid/uuid.h header (same as UUID_INCLUDE_DIRS).

+include(CheckCXXSymbolExists)
+include(CheckLibraryExists)
 include(FindPackageHandleStandardArgs)

-if(UUID_INCLUDE_DIRS AND UUID_LIBRARIES)
-  set(UUID_FIND_QUIETLY TRUE)
-else()
-  find_path(
-    UUID_INCLUDE_DIR
-    NAMES uuid.h
-    HINTS ${UUID_ROOT_DIR}
-    PATH_SUFFIXES include uuid)
+if(NOT UUID_INCLUDE_DIR)
+  find_path(UUID_INCLUDE_DIR uuid/uuid.h)
+endif()

-  find_library(
-    UUID_LIBRARY
-    NAMES uuid
-    HINTS ${UUID_ROOT_DIR}
-    PATH_SUFFIXES ${LIBRARY_PATH_PREFIX})
+if(EXISTS UUID_INCLUDE_DIR)
+  set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
+  set(CMAKE_REQUIRED_INCLUDES ${UUID_INCLUDE_DIRS})
+  check_cxx_symbol_exists("uuid_generate_random" "uuid/uuid.h" _uuid_header_only)
+endif()

-  set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
-  set(UUID_LIBRARIES ${UUID_LIBRARY})
+if(NOT _uuid_header_only AND NOT UUID_LIBRARY)
+  check_library_exists("uuid" "uuid_generate_random" "" _have_libuuid)
+  if(_have_libuuid)
+    set(UUID_LIBRARY "uuid")
+    set(UUID_LIBRARIES ${UUID_LIBRARY})
+  endif()
+endif()

-  find_package_handle_standard_args(
-    uuid DEFAULT_MSG UUID_LIBRARY UUID_INCLUDE_DIR)
+unset(CMAKE_REQUIRED_INCLUDES)
+unset(_uuid_header_only)
+unset(_have_libuuid)

-  mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY)
-endif()
+find_package_handle_standard_args(uuid DEFAULT_MSG UUID_INCLUDE_DIR)
+mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY)


Revert "Replace add_definitions with add_compile_definitions (-U_DEBUG)."

This reverts commit 3c2681d5edb41d76e1857e165c511b5e4ad54997.

--- cmake/third_party/xsmm.cmake
+++ cmake/third_party/xsmm.cmake
@@ -36,7 +36,7 @@
 target_compile_definitions(xsmm PRIVATE
   __BLAS=0
 )
-add_compile_definitions(-U_DEBUG)
+add_definitions(-U_DEBUG)

 set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads REQUIRED)


Start with reformatting FindHDF5.cmake

Start with reformatting FindHDF5.cmake

--- cmake_include/FindHDF5.cmake
+++ cmake_include/FindHDF5.cmake
@@ -27,31 +27,51 @@
 #====================================================================

 # looks in HDF5_ROOT environment variable for hint
-# set HDF5_FOUND HDF5_DEFINITIONS HDF5_INCLUDE_DIRS  HDF5_C_LIBRARIES HDF5_LIBRARIES  HDF5_LIBRARY_DIRS HDF5_ROOT_DIR
+# set HDF5_FOUND HDF5_DEFINITIONS HDF5_INCLUDE_DIRS  \
+# HDF5_C_LIBRARIES HDF5_LIBRARIES  HDF5_LIBRARY_DIRS HDF5_ROOT_DIR

 if (WIN32)
 #    set(HDF5_SEARCH_DEFAULT "C:/InstallKits/HDF5-1.8.6-win64")
 	set(HDF5_SEARCH_DEFAULT "C:/Program Files/HDF Group/HDF5/1.8.9")
-	find_library(HDF5_SHARED_LIBRARIES NAMES hdf5dll HINTS ${HDF5_SEARCH} ENV HDF5_ROOT PATHS ${HDF5_SEARCH_DEFAULT} PATH_SUFFIXES dll bin lib DOC "location of hdf5 dll" NO_SYSTEM_ENVIRONMENT_PATH)
-	find_library(HDF5_STATIC_LIBRARIES NAMES hdf5 HINTS ${HDF5_SEARCH} ENV HDF5_ROOT PATHS ${HDF5_SEARCH_DEFAULT} PATH_SUFFIXES lib DOC "location of hdf5 lib" NO_SYSTEM_ENVIRONMENT_PATH)
+	find_library(HDF5_SHARED_LIBRARIES NAMES hdf5dll
+                 HINTS ${HDF5_SEARCH} ENV HDF5_ROOT
+                 PATHS ${HDF5_SEARCH_DEFAULT}
+                 PATH_SUFFIXES dll bin lib
+                 DOC "location of hdf5 dll" NO_SYSTEM_ENVIRONMENT_PATH)
+	find_library(HDF5_STATIC_LIBRARIES NAMES hdf5
+                 HINTS ${HDF5_SEARCH} ENV HDF5_ROOT
+                 PATHS ${HDF5_SEARCH_DEFAULT}
+                 PATH_SUFFIXES lib
+                 DOC "location of hdf5 lib" NO_SYSTEM_ENVIRONMENT_PATH)
 else(WIN32)
     set(HDF5_SEARCH_DEFAULT "/usr" "/usr/local" "/usr/local/hdf5" "/sw")
-	find_library(HDF5_SHARED_LIBRARIES NAMES hdf5 HINTS ${HDF5_SEARCH} ENV HDF5_ROOT PATHS ${HDF5_SEARCH_DEFAULT} PATH_SUFFIXES lib DOC "location of hdf5 dll")
-	find_library(HDF5_STATIC_LIBRARIES NAMES hdf5 HINTS ${HDF5_SEARCH} ENV HDF5_ROOT PATHS ${HDF5_SEARCH_DEFAULT} PATH_SUFFIXES lib DOC "location of hdf5 lib")
+	find_library(HDF5_SHARED_LIBRARIES NAMES hdf5
+                 HINTS ${HDF5_SEARCH} ENV HDF5_ROOT
+                 PATHS ${HDF5_SEARCH_DEFAULT}
+                 PATH_SUFFIXES lib
+                 DOC "location of hdf5 dll")
+	find_library(HDF5_STATIC_LIBRARIES NAMES hdf5
+                 HINTS ${HDF5_SEARCH} ENV HDF5_ROOT
+                 PATHS ${HDF5_SEARCH_DEFAULT}
+                 PATH_SUFFIXES lib DOC "location of hdf5 lib")
 endif(WIN32)

 mark_as_advanced(HDF5_SHARED_LIBRARIES HDF5_STATIC_LIBRARIES)

 if (HDF5_SHARED_LIBRARIES)
-    set(HDF5_LIBRARIES ${HDF5_SHARED_LIBRARIES} CACHE FILEPATH "Location of HDF5 libraries")
+    set(HDF5_LIBRARIES ${HDF5_SHARED_LIBRARIES}
+        CACHE FILEPATH "Location of HDF5 libraries")
 	get_filename_component(_HDF5_LIBDIR ${HDF5_SHARED_LIBRARIES} PATH)
 elseif (HDF5_STATIC_LIBRARIES)
-    set(HDF5_LIBRARIES ${HDF5_STATIC_LIBRARIES} CACHE FILEPATH "Location of HDF5 libraries")
+    set(HDF5_LIBRARIES ${HDF5_STATIC_LIBRARIES}
+        CACHE FILEPATH "Location of HDF5 libraries")
 	get_filename_component(_HDF5_LIBDIR ${HDF5_STATIC_LIBRARIES} PATH)
 endif()
 set(HDF5_DEFINITIONS "")
 get_filename_component(HDF5_ROOT_DIR "${_HDF5_LIBDIR}/.." ABSOLUTE)
-find_path(HDF5_INCLUDE_DIRS NAMES hdf5.h HINTS ${HDF5_SEARCH} ENV HDF5_ROOT PATHS ${HDF5_SEARCH_DEFAULT} PATH_SUFFIXES include DOC "location of hdf5 includes" NO_SYSTEM_ENVIRONMENT_PATH)
+find_path(HDF5_INCLUDE_DIRS NAMES hdf5.h HINTS ${HDF5_SEARCH} ENV HDF5_ROOT
+          PATHS ${HDF5_SEARCH_DEFAULT} PATH_SUFFIXES include
+          DOC "location of hdf5 includes" NO_SYSTEM_ENVIRONMENT_PATH)

 mark_as_advanced(HDF5_LIBRARIES HDF5_INCLUDE_DIRS)


Update TubeTK repository location to GitHub

The TubeTK repository has moved to GitHub.

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -52,7 +52,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     PREFIX ${proj}-prefix
-    GIT_REPOSITORY "http://tubetk.org/TubeTK.git"
+    GIT_REPOSITORY "https://github.com/TubeTK/TubeTK.git"
     GIT_TAG "1c0002f8532fa3232426a827ecced2207f93612b"
     INSTALL_COMMAND ""
     CMAKE_ARGS


ENH: superbuild: only compile needed boost libraries

--- Superbuild/CMake/External_boost.cmake
+++ Superbuild/CMake/External_boost.cmake
@@ -55,6 +55,7 @@
         CONFIGURE_COMMAND
           ${BOOST_SB_BUILD_DIR}/bootstrap.sh
             --prefix=${SB_INSTALL_PREFIX}
+            --with-libraries=graph,test,regex
         BUILD_COMMAND ./b2
         INSTALL_COMMAND ./b2 install
         PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory


CHECK_CXX_COMPILER_FLAG_AND_ENABLE_IT(): slight tuning

--- cmake/Modules/CheckCXXCompilerFlagAndEnableIt.cmake
+++ cmake/Modules/CheckCXXCompilerFlagAndEnableIt.cmake
@@ -1,7 +1,10 @@
 include(CheckCXXCompilerFlag)

 macro (CHECK_CXX_COMPILER_FLAG_AND_ENABLE_IT _FLAG)
-  set(_RESULT "CXX_COMPILER_UNDERSTANDS_${_FLAG}")
+  string(TOUPPER "${_FLAG}" _RESULT)
+  string(REPLACE "-" "_" _RESULT "${_RESULT}")
+  string(REPLACE "=" "_" _RESULT "${_RESULT}")
+  set(_RESULT "HAVE_CXX_FLAG${_RESULT}")

   set(CMAKE_REQUIRED_FLAGS_ORIG "${CMAKE_REQUIRED_FLAGS}")
   set(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS}")


added command to run setup.py from Examples.cmake itself;

--- Examples/Examples.cmake
+++ Examples/Examples.cmake
@@ -202,6 +202,7 @@
 			target_link_libraries(pyMTF2 mtf ${MTF_LIBS} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${PYTHON_LIBS})
 			install(TARGETS pyMTF2 LIBRARY DESTINATION ${MTF_PY_INSTALL_DIR} COMPONENT py2)
 			add_custom_target(py2 DEPENDS pyMTF2)
+			install(CODE "execute_process(COMMAND python setup.py install -f --prefix=${MTF_PY_INSTALL_DIR} WORKING_DIRECTORY python")
 			install(DIRECTORY ${MTF_INCLUDE_DIRS}
 				DESTINATION ${MTF_HEADER_INSTALL_DIR}
 				COMPONENT header


Bugfix cmake find dependecy in sub sub modules

--- Config/config.cmake
+++ Config/config.cmake
@@ -16,3 +16,31 @@

 # Set compilation flags
 add_definitions(${CXX_FLAGS})
+
+# Define find depenedencies
+function(find_dependencies packagName)
+
+    # Test if target is defined
+    if(NOT TARGET ${packagName})
+
+        # Test if CMakeFile exist for this library
+        if(EXISTS ${PROJECT_SOURCE_DIR}/Dependencies/${packagName}/CMakeLists.txt)
+
+
+            # Include package
+            add_subdirectory(${PROJECT_SOURCE_DIR}/Dependencies/${packagName})
+
+            # Set include dir
+            set(${packagName}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/Dependencies/${packagName}/Sources" PARENT_SCOPE)
+
+
+        else()
+
+            # Find package
+            find_package(${packagName})
+
+        endif()
+
+    endif()
+
+endfunction()


ERR: fix typo

ERR: fix typo

--- GenerateVTKConfig.cmake
+++ GenerateVTKConfig.cmake
@@ -41,7 +41,7 @@

 IF(VTK_WRAP_JAVA)
   SET(VTK_INCLUDE_DIRS_SYS ${VTK_INCLUDE_DIRS_SYS}
-      ${JAVA_INCLUDE_PATH1} ${JAVA_INCLUDE_PATH2})
+      ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
 ENDIF(VTK_WRAP_JAVA)

 IF(VTK_HAVE_VG500)


Adding additional web upload script so we can upload to both www.bluequartz.net and www.openmbir.org

--- Resources/CPack/PackageProject.cmake
+++ Resources/CPack/PackageProject.cmake
@@ -89,6 +89,10 @@
 configure_file(${PROJECT_RESOURCES_DIR}/upload.sh.in
                ${PROJECT_BINARY_DIR}/upload.sh)

+set (TomoEngine_WEBSITE_SERVER_PATH "/var/www/www.openmbir.org/binaries/.")
+configure_file(${PROJECT_RESOURCES_DIR}/upload.sh.in
+${PROJECT_BINARY_DIR}/web_upload.sh)
+
 # Create an NSIS based installer for Windows Systems
 IF(WIN32 AND NOT UNIX)
   # There is a bug in NSIS that does not handle full unix paths properly. Make


fixed external dependencies include

fixed external dependencies include

--- CMake/WkBuild.cmake
+++ CMake/WkBuild.cmake
@@ -63,7 +63,7 @@
         #
         IF ( ${ARGC} GREATER 2 )
                 FOREACH ( looparg ${ARGN} )
-                        INCLUDE_DIRECTORIES(ext/${looparg}/include)
+                        INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ext/${looparg}/include)
                 ENDFOREACH ( looparg )
         ENDIF ( ${ARGC} GREATER 2  )


bump version number

bump version number

--- CMake/version.cmake
+++ CMake/version.cmake
@@ -1,3 +1,3 @@
 set (VV_VERSION_MAJOR 2)
 set (VV_VERSION_MINOR 5)
-set (VV_VERSION_PATCH 1)
+set (VV_VERSION_PATCH 2)


Fix TBB on Windows

Fix TBB on Windows

--- cmake/modules/FindTBB.cmake
+++ cmake/modules/FindTBB.cmake
@@ -53,6 +53,7 @@
   NAMES include/tbb/tbb.h
   PATHS ENV TBB
         ENV TBBROOT
+        ENV TBB_ROOT
         ENV TBB40_INSTALL_DIR
         ENV TBB30_INSTALL_DIR
         ENV TBB22_INSTALL_DIR
@@ -65,7 +66,13 @@
   PATH_SUFFIXES include
   DOC "TBB include directory")

-IF (MSVC11)
+IF (MSVC15)
+  SET (_TBB_COMPILER vc14)
+ELSEIF (MSVC14)
+  SET (_TBB_COMPILER vc14)
+ELSEIF (MSVC12)
+  SET (_TBB_COMPILER vc12)
+ELSEIF (MSVC11)
   SET (_TBB_COMPILER vc11)
 ELSEIF (MSVC10)
   SET (_TBB_COMPILER vc10)
@@ -75,7 +82,7 @@
   SET (_TBB_COMPILER vc8)
 ELSEIF (WIN32)
   SET (_TBB_COMPILER vc_mt)
-ENDIF (MSVC11)
+ENDIF (MSVC15)

 IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
   SET (_TBB_POSSIBLE_LIB_SUFFIXES lib/intel64/${_TBB_COMPILER})


SuperBuild: call patch source macro in geos build

--- SuperBuild/CMake/External_geos.cmake
+++ SuperBuild/CMake/External_geos.cmake
@@ -28,4 +28,6 @@
   ${GEOS_SB_CONFIG}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND} )

+SUPERBUILD_PATCH_SOURCE(GEOS)
+
 SUPERBUILD_UPDATE_CMAKE_VARIABLES(GEOS FALSE)


BUG: superbuild: don't use geos dll on msvc

--- SuperBuild/CMake/External_geos.cmake
+++ SuperBuild/CMake/External_geos.cmake
@@ -32,7 +32,7 @@

   set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
   if(WIN32)
-    set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/bin/geos.dll)
+    set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/geos.lib)
   elseif(UNIX)
     set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeos${CMAKE_SHARED_LIBRARY_SUFFIX})
   endif()


cmake: Remove invalid DTIProcess external project

This external project corresponds to DTIProcessToolkit (this project)

--- SuperBuild/External_DTIProcess.cmake
+++ SuperBuild/External_DTIProcess.cmake
@@ -1,115 +0,0 @@
-if( NOT EXTERNAL_SOURCE_DIRECTORY )
-  set( EXTERNAL_SOURCE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ExternalSources )
-endif()
-if( NOT EXTERNAL_BINARY_DIRECTORY )
-  set( EXTERNAL_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
-endif()
-
-# Make sure this file is included only once by creating globally unique varibles
-# based on the name of this included file.
-get_filename_component(CMAKE_CURRENT_LIST_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
-if(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED)
-  return()
-endif()
-set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1)
-
-## External_${extProjName}.cmake files can be recurisvely included,
-## and cmake variables are global, so when including sub projects it
-## is important make the extProjName and proj variables
-## appear to stay constant in one of these files.
-## Store global variables before overwriting (then restore at end of this file.)
-ProjectDependancyPush(CACHED_extProjName ${extProjName})
-ProjectDependancyPush(CACHED_proj ${proj})
-
-# Make sure that the ExtProjName/IntProjName variables are unique globally
-# even if other External_${ExtProjName}.cmake files are sourced by
-# SlicerMacroCheckExternalProjectDependency
-set(extProjName DTIProcess) #The find_package known name
-set(proj        DTIProcess) #This local name
-set(${extProjName}_REQUIRED_VERSION "")  #If a required version is necessary, then set this, else leave blank
-
-#if(${USE_SYSTEM_${extProjName}})
-#  unset(${extProjName}_DIR CACHE)
-#endif()
-
-# Sanity checks
-if(DEFINED ${extProjName}_DIR AND NOT EXISTS ${${extProjName}_DIR})
-  message(FATAL_ERROR "${extProjName}_DIR variable is defined but corresponds to non-existing directory (${${extProjName}_DIR})")
-endif()
-
-if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" ) )
-  #message(STATUS "${__indent}Adding project ${proj}")
-  # Set dependency list
-  set(${proj}_DEPENDENCIES ITKv4 VTK SlicerExecutionModel )
-  if( BUILD_DWIAtlas )
-    list( APPEND ${proj}_DEPENDENCIES Boost )
-  endif()
-
-  # Include dependent projects if any
-  SlicerMacroCheckExternalProjectDependency(${proj})
-  # Set CMake OSX variable to pass down the external project
-  set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS)
-  if(APPLE)
-    list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS
-      -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-      -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
-      -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET})
-  endif()
-  if( BUILD_DWIAtlas )
-    set( DWIAtlasVars
-        -DBOOST_ROOT:PATH=${BOOST_ROOT}
-        -DBOOST_INCLUDE_DIR:PATH=${BOOST_INCLUDE_DIR}
-        -DBUILD_dwiAtlas:BOOL=ON
-       )
-  endif()
-  ### --- Project specific additions here
-  set(${proj}_CMAKE_OPTIONS
-    ${DWIAtlasVars}
-    -DBOOST_ROOT:PATH=${BOOST_ROOT}
-    -DBOOST_INCLUDE_DIR:PATH=${BOOST_INCLUDE_DIR}
-    -DUSE_SYSTEM_ITK:BOOL=ON
-    -DUSE_SYSTEM_VTK:BOOL=ON
-    -DUSE_SYSTEM_SlicerExecutionModel:BOOL=ON
-    -DDTIProcess_SUPERBUILD:BOOL=OFF
-    -DEXECUTABLES_ONLY:BOOL=ON
-    )
-
-  ### --- End Project specific additions
-  set( ${proj}_REPOSITORY ${git_protocol}://github.com/NIRALUser/DTIProcessToolkit.git)
-  set( ${proj}_GIT_TAG a7c39e485e492bc6b72f72348939d47835cd56cc )
-  ExternalProject_Add(${proj}
-    GIT_REPOSITORY ${${proj}_REPOSITORY}
-    GIT_TAG ${${proj}_GIT_TAG}
-    SOURCE_DIR ${EXTERNAL_SOURCE_DIRECTORY}/${proj}
-    BINARY_DIR ${EXTERNAL_BINARY_DIRECTORY}/${proj}-build
-    LOG_CONFIGURE 0  # Wrap configure in script to ignore log output from dashboards
-    LOG_BUILD     0  # Wrap build in script to to ignore log output from dashboards
-    LOG_TEST      0  # Wrap test in script to to ignore log output from dashboards
-    LOG_INSTALL   0  # Wrap install in script to to ignore log output from dashboards
-    CMAKE_GENERATOR ${gen}
-    CMAKE_ARGS
-      ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS}
-      ${COMMON_EXTERNAL_PROJECT_ARGS}
-      ${${proj}_CMAKE_OPTIONS}
-      ## We really do want to install to remove uncertainty about where the tools are
-      ## (on Windows, tools might be in subfolders, like "Release", "Debug",...)
-      -DCMAKE_INSTALL_PREFIX:PATH=${EXTERNAL_BINARY_DIRECTORY}/${proj}-install
-    DEPENDS
-      ${${proj}_DEPENDENCIES}
-    INSTALL_COMMAND ""
-  )
-  set(${extProjName}_DIR ${EXTERNAL_BINARY_DIRECTORY}/${proj}-build)
-else()
-  if(${USE_SYSTEM_${extProjName}})
-    find_package(${extProjName} ${${extProjName}_REQUIRED_VERSION} REQUIRED)
-    message("USING the system ${extProjName}, set ${extProjName}_DIR=${${extProjName}_DIR}")
-  endif()
-  # The project is provided using ${extProjName}_DIR, nevertheless since other
-  # project may depend on ${extProjName}, let's add an 'empty' one
-  SlicerMacroEmptyExternalProject(${proj} "${${proj}_DEPENDENCIES}")
-endif()
-
-list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS ${extProjName}_DIR:PATH)
-
-ProjectDependancyPop(CACHED_extProjName extProjName)
-ProjectDependancyPop(CACHED_proj proj)


TEST: fix test depends

TEST: fix test depends

--- Packaging/testing.cmake
+++ Packaging/testing.cmake
@@ -49,7 +49,7 @@
   WORKING_DIRECTORY ${testing_dir}
   )

-set_tests_properties ( Tu_uninstall_otb PROPERTIES DEPENDS Tu_install_package)
+set_tests_properties ( Tu_uninstall_otb PROPERTIES DEPENDS Tu_selftester)

 #if(UNIX)


BUG: tests must depends on each other

BUG: tests must depends on each other

--- Packaging/testing.cmake
+++ Packaging/testing.cmake
@@ -59,9 +59,8 @@

 #configure test dependencies..
 set_tests_properties ( Tu_selftester PROPERTIES DEPENDS Tu_install_package)
-set_tests_properties ( Tu_build_examples PROPERTIES DEPENDS Tu_install_package)
-set_tests_properties ( Tu_uninstall_otb PROPERTIES DEPENDS Tu_install_package)
-
+set_tests_properties ( Tu_build_examples PROPERTIES DEPENDS Tu_selftester)
+set_tests_properties ( Tu_uninstall_otb PROPERTIES DEPENDS Tu_build_examples)

 #if(UNIX)
   #TODO: add test with shellcheck for script files


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Remove obselete FindForge.cmake

Remove obselete FindForge.cmake

--- CMakeModules/FindForge.cmake
+++ CMakeModules/FindForge.cmake
@@ -1,99 +0,0 @@
-# - Find Forge
-
-# Defines the following variables:
-# FORGE_INCLUDE_DIRECTORIES    - Location of FORGE's include directory.
-# FORGE_LIBRARIES              - Location of FORGE's libraries.
-# FORGE_FOUND                  - True if FORGE has been located
-#
-# You may provide a hint to where FORGE's root directory may be located
-# by setting FORGE_ROOT_DIR before calling this script.
-#
-# ----------------------------------------------------------------------------
-#
-# FORGE_FOUND        - True of the FORGE library has been found.
-# FORGE_LIBRARIES    - Location of FORGE library, if found
-#
-# Variables used by this module, they can change the default behaviour and
-# need to be set before calling find_package:
-#
-#=============================================================================
-# Copyright (c) 2014, ArrayFire
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification,
-# are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright notice, this
-#   list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright notice, this
-#   list of conditions and the following disclaimer in the documentation and/or
-#   other materials provided with the distribution.
-#
-# * Neither the name of the ArrayFire nor the names of its
-#   contributors may be used to endorse or promote products derived from
-#   this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#=============================================================================
-
-IF(FORGE_INCLUDE_DIRECTORIES)
-  # Already in cache, be silent
-  set (FORGE_FIND_QUIETLY TRUE)
-ENDIF()
-
-# Find the FORGE install directories and headers:
-FIND_PATH(FORGE_ROOT_DIR
-    NAMES include/forge.h
-    PATH_SUFFIXES forge FORGE FORGE
-    HINTS "${CMAKE_INSTALL_PREFIX}" "${FORGE_ROOT_DIR}" "${FORGE_ROOT_DIR}/lib" "${FORGE_ROOT_DIR}/lib64" "${CMAKE_SOURCE_DIR}/.." "${CMAKE_SOURCE_DIR}/../.."
-    DOC "FORGE root directory.")
-
-FIND_PATH(FORGE_PACKAGE_DIR
-    NAMES include/forge.h lib
-    HINTS "${FORGE_ROOT_DIR}/package" "${FORGE_ROOT_DIR}/build/package" "${FORGE_ROOT_DIR}"
-    DOC "FORGE Package directory.")
-
-FIND_PATH(FORGE_INCLUDE_DIRECTORIES
-    NAMES forge.h
-    HINTS "${FORGE_PACKAGE_DIR}/include"
-    DOC "FORGE Include directory")
-
-# Find all libraries required for the FORGE
-FIND_LIBRARY(FORGE_LIBRARY
-    NAMES forge
-    HINTS "${FORGE_PACKAGE_DIR}/lib")
-
-FIND_PACKAGE(GLEWmx REQUIRED)
-
-IF(GLEWMX_FOUND AND OPENGL_FOUND)
-    IF(FORGE_INCLUDE_DIRECTORIES)
-        SET(FORGE_INCLUDE_DIRECTORIES ${FORGE_INCLUDE_DIRECTORIES} ${GLEW_INCLUDE_DIR}
-            CACHE INTERNAL "All include dirs required for FORGE'")
-    ENDIF()
-    IF(FORGE_LIBRARY)
-        SET(FORGE_LIBRARIES ${FORGE_LIBRARY} ${GLEWmx_LIBRARY} ${OPENGL_gl_LIBRARY}
-            CACHE INTERNAL "All libraries required for FORGE'")
-    ENDIF()
-    # handle the QUIETLY and REQUIRED arguments and set FORGE_FOUND to TRUE if
-    # all listed variables are TRUE
-    INCLUDE (FindPackageHandleStandardArgs)
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(FORGE DEFAULT_MSG FORGE_LIBRARIES FORGE_INCLUDE_DIRECTORIES)
-    MARK_AS_ADVANCED(FORGE_LIBRARIES FORGE_INCLUDE_DIRECTORIES)
-
-ELSE(GLEWMX_FOUND AND OPENGL_FOUND)
-    IF(NOT GLEWMX_FOUND)
-        MESSAGE(FATAL_ERROR "GLEW-MX Not Found")
-    ELSEIF(NOT OPENGL_FOUND)
-        MESSAGE(FATAL_ERROR "OpenGL Not Found")
-    ENDIF()
-ENDIF(GLEWMX_FOUND AND OPENGL_FOUND)


[cpack] setting package name, vendor, description

--- CMakeModules/installer.cmake
+++ CMakeModules/installer.cmake
@@ -1,28 +1,27 @@
 include(InstallRequiredSystemLibraries)

-set(CPACK_PACKAGE_CONTACT "someone@eos.org")
+set(CPACK_PACKAGE_CONTACT "support@block.one")
 set(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_BINARY_DIR}/packages)
 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)

 SET(CPACK_PACKAGE_DIRECTORY "${CMAKE_INSTALL_PREFIX}")
-set(CPACK_PACKAGE_NAME "eos")
-set(CPACK_PACKAGE_VENDOR "EOSIO")
+set(CPACK_PACKAGE_NAME "EOS.IO")
+set(CPACK_PACKAGE_VENDOR "black.one")
 set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
 set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
 set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
-set(CPACK_PACKAGE_DESCRIPTION "A client for the Eos network")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A client for the Eos network")
+set(CPACK_PACKAGE_DESCRIPTION "A client for the EOS.IO network")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A client for the EOS.IO network")
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
-set(CPACK_PACKAGE_INSTALL_DIRECTORY "Eos ${CPACK_PACKAGE_VERSION}")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "EOS.IO ${CPACK_PACKAGE_VERSION}")

 if(WIN32)
- SET(CPACK_GENERATOR "ZIP;NSIS")
- set(CPACK_PACKAGE_NAME "Eos") # override above
+ set(CPACK_GENERATOR "ZIP;NSIS")
  set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
- set(CPACK_NSIS_PACKAGE_NAME "Eos v${CPACK_PACKAGE_VERSION}")
+ set(CPACK_NSIS_PACKAGE_NAME "EOS.IO v${CPACK_PACKAGE_VERSION}")
  set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}")
- set(CPACK_NSIS_DEFINES "  !define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"Eos\\\"")
+ set(CPACK_NSIS_DEFINES "  !define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"EOS.IO\\\"")
  # it seems like windows zip files usually don't have a single directory inside them, unix tgz frequently do
  SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
 elseif(APPLE)


Mention exact hash of CMakeRC

Mention exact hash of CMakeRC

--- CMake/CMakeRC.cmake
+++ CMake/CMakeRC.cmake
@@ -1,4 +1,4 @@
-# From https://github.com/vector-of-bool/cmrc
+# From https://github.com/vector-of-bool/cmrc/blob/e7ba9e9417960b2a5cefc9e79e8af8b06bfde3d1/CMakeRC.cmake

 # This block is executed when generating an intermediate resource file, not when
 # running in CMake configure mode


Ensure 'superbuild_include_once' works independently of the caller scope.

By using GLOBAL property instead of a local variable, the file will
be properly "include guarded" even if included from within a function.

See #418

--- CMake/ctkMacroCheckExternalProjectDependency.cmake
+++ CMake/ctkMacroCheckExternalProjectDependency.cmake
@@ -26,13 +26,27 @@
   set(EXTERNAL_PROJECT_FILE_PREFIX "External_")
 endif()

+#
+# superbuild_include_once()
+#
+# superbuild_include_once() is a macro intented to be used as include guard.
+#
+# It ensures that the CMake code placed after the include guard in a CMake file included
+# using either 'include(/path/to/file.cmake)' or 'include(cmake_module)' will be executed
+# once.
+#
+# It internally set the global property '<CMAKE_CURRENT_LIST_FILENAME>_FILE_INCLUDED' to check if
+# a file has already been included.
+#
 macro(superbuild_include_once)
   # Make sure this file is included only once
   get_filename_component(CMAKE_CURRENT_LIST_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
-  if(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED)
+  set(_property_name ${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED)
+  get_property(${_property_name} GLOBAL PROPERTY ${_property_name})
+  if(${_property_name})
     return()
   endif()
-  set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1)
+  set_property(GLOBAL PROPERTY ${_property_name} 1)
 endmacro()

 macro(_epd_status txt)
@@ -77,7 +91,8 @@
   else()
     set(dependency_str " ")
     foreach(dep ${${proj}_DEPENDENCIES})
-      if(${EXTERNAL_PROJECT_FILE_PREFIX}${dep}_FILE_INCLUDED)
+      get_property(_is_included GLOBAL PROPERTY ${EXTERNAL_PROJECT_FILE_PREFIX}${dep}_FILE_INCLUDED)
+      if(_is_included)
         set(dependency_str "${dependency_str}${dep}[INCLUDED], ")
       else()
         set(dependency_str "${dependency_str}${dep}, ")
@@ -97,7 +112,8 @@

   # Include dependencies
   foreach(dep ${${proj}_DEPENDENCIES})
-    if(NOT External_${dep}_FILE_INCLUDED)
+    get_property(_is_included GLOBAL PROPERTY External_${dep}_FILE_INCLUDED)
+    if(NOT _is_included)
       # XXX - Refactor - Add a single variable named 'EXTERNAL_PROJECT_DIRS'
       if(EXISTS "${EXTERNAL_PROJECT_DIR}/${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake")
         include(${EXTERNAL_PROJECT_DIR}/${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake)
@@ -135,7 +151,7 @@
     foreach(possible_proj ${__epd_${CMAKE_PROJECT_NAME}_projects})
       if(NOT ${possible_proj} STREQUAL ${CMAKE_PROJECT_NAME})

-        unset(${EXTERNAL_PROJECT_FILE_PREFIX}${possible_proj}_FILE_INCLUDED)
+        set_property(GLOBAL PROPERTY ${EXTERNAL_PROJECT_FILE_PREFIX}${possible_proj}_FILE_INCLUDED 0)

         # XXX - Refactor - The following code should be re-organized
         if(DEFINED ${possible_proj}_enabling_variable)


add missing doc for SKIP_TEST

add missing doc for SKIP_TEST

--- ament_cmake_gtest/cmake/ament_add_gtest.cmake
+++ ament_cmake_gtest/cmake/ament_add_gtest.cmake
@@ -37,6 +37,8 @@
 # :param SKIP_LINKING_MAIN_LIBRARIES: if set skip linking against the gtest
 #   main libraries
 # :type SKIP_LINKING_MAIN_LIBRARIES: option
+# :param SKIP_TEST: if set mark the test as being skipped
+# :type SKIP_TEST: option
 # :param ENV: list of env vars to set; listed as ``VAR=value``
 # :type ENV: list of strings
 # :param APPEND_ENV: list of env vars to append if already set, otherwise set;


Remove the prefix option as it bugs on windows

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -34,8 +34,6 @@
   set(BOOST_B2_EXE "b2.exe")
 endif()

-set( BOOST_BOOTSTRAP_OPTIONS "${BOOST_BOOTSTRAP_OPTIONS} --prefix=${SB_INSTALL_PREFIX}")
-
 set(BOOST_CONFIGURE_COMMAND ${CMAKE_COMMAND}
   -E chdir ${BOOST_SB_SRC}
   ${BOOST_BOOTSTRAP_FILE} ${BOOST_BOOTSTRAP_OPTIONS}
@@ -45,7 +43,6 @@
 # must be passed to b2. Why? Windows... That is why...
 # Libraries we need from boost
 set( boost_libraries_to_build "system;serialization;filesystem;test;date_time;program_options;thread")
-message( "boost_libraries_to_build = ${boost_libraries_to_build}")
 # add libraries to b2 option
 set(BOOST_SB_CONFIG)
 foreach(lib ${boost_libraries_to_build})


COMP: Adding facilities to find opencv

COMP: Adding facilities to find opencv


fixed: fill OpenSG_LIBRARIES on win32 platform

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

--- CMake/FindOpenSG.cmake
+++ CMake/FindOpenSG.cmake
@@ -56,7 +56,7 @@
 # remove references to boost.
 #########################################################################

-MACRO(__OpenSG_ADJUST_LIB_VARS basename)
+MACRO(__OpenSG_ADJUST_LIB_VARS basename component)
     IF(OpenSG_INCLUDE_DIR)
         IF(NOT WIN32)
           IF(OpenSG_${basename}_LIBRARY_DEBUG AND OpenSG_${basename}_LIBRARY_RELEASE)
@@ -99,6 +99,7 @@

               SET(OpenSG_${basename}_FOUND ON CACHE INTERNAL "Whether the OpenSG ${basename} library found")

+              SET(OpenSG_${basename}_LIBRARY ${component}Lib)
           ENDIF()
         ENDIF(NOT WIN32)
     ENDIF(OpenSG_INCLUDE_DIR)
@@ -195,7 +196,7 @@
     SET(OpenSG_FOUND TRUE)
     FOREACH(COMPONENT ${OpenSG_FIND_COMPONENTS})
         STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
-        __OpenSG_ADJUST_LIB_VARS(${UPPERCOMPONENT})
+        __OpenSG_ADJUST_LIB_VARS(${UPPERCOMPONENT} ${COMPONENT})
         SET(OpenSG_LIBRARIES ${OpenSG_LIBRARIES} ${OpenSG_${UPPERCOMPONENT}_LIBRARY})

         SETUP_OSG_LIB_TARGETS(${COMPONENT} ${UPPERCOMPONENT})
@@ -303,7 +304,7 @@
           )
         ENDIF(WIN32)

-        __OpenSG_ADJUST_LIB_VARS(${UPPERCOMPONENT})
+        __OpenSG_ADJUST_LIB_VARS(${UPPERCOMPONENT} ${COMPONENT})

     ENDFOREACH(COMPONENT)
     # ------------------------------------------------------------------------


Disable some warning options on clang. Disable null pointer check deletion on clang.

--- build_settings.cmake
+++ build_settings.cmake
@@ -22,7 +22,8 @@
 # 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")
-  set(CXX_SPECIFIC_WARN_OPTS "-Wnon-virtual-dtor -Wformat-security")
+  set(CXX_SPECIFIC_WARN_OPTS "-Wnon-virtual-dtor -Wformat-security -Wno-overloaded-virtual")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks")
 else()
   set(CXX_SPECIFIC_WARN_OPTS "-Wsuggest-override -Wnon-virtual-dtor -Wformat-security")
 endif()


inttypes recover fix

inttypes recover fix

--- cmake/MyPackageCheckCommonSizes.cmake
+++ cmake/MyPackageCheckCommonSizes.cmake
@@ -1,5 +1,23 @@
 MACRO (MYPACKAGECHECKCOMMONSIZES)
+  INCLUDE (CheckIncludeFile)
   INCLUDE (CheckTypeSize)
+
+  SET (CMAKE_EXTRA_INCLUDE_FILES_BACKUP ${CMAKE_EXTRA_INCLUDE_FILES}) # backup
+  SET (CMAKE_EXTRA_INCLUDE_FILES) # reset
+  CHECK_INCLUDE_FILE ("stdint.h"       HAVE_STDINT_H)
+  IF (HAVE_STDINT_H)
+    LIST (APPEND CMAKE_EXTRA_INCLUDE_FILES "stdint.h")
+  ENDIF ()
+  CHECK_INCLUDE_FILE ("inttypes.h"     HAVE_INTTYPES_H)
+  IF (HAVE_INTTYPES_H)
+    LIST (APPEND CMAKE_EXTRA_INCLUDE_FILES "inttypes.h")
+  ENDIF ()
+  CHECK_INCLUDE_FILE ("sys/inttypes.h" HAVE_SYS_INTTYPES_H)
+  IF (HAVE_SYS_INTTYPES_H)
+    LIST (APPEND CMAKE_EXTRA_INCLUDE_FILES "sys/inttypes.h")
+  ENDIF ()
+
+  CHECK_TYPE_SIZE("char" SIZEOF_CHAR)
   CHECK_TYPE_SIZE("short" SIZEOF_SHORT)
   CHECK_TYPE_SIZE("int" SIZEOF_INT)
   CHECK_TYPE_SIZE("long" SIZEOF_LONG)
@@ -7,6 +25,7 @@
   CHECK_TYPE_SIZE("float" SIZEOF_FLOAT)
   CHECK_TYPE_SIZE("double" SIZEOF_DOUBLE)
   CHECK_TYPE_SIZE("long double" SIZEOF_LONG_DOUBLE)
+  CHECK_TYPE_SIZE("unsigned char" SIZEOF_UNSIGNED_CHAR)
   CHECK_TYPE_SIZE("unsigned short" SIZEOF_UNSIGNED_SHORT)
   CHECK_TYPE_SIZE("unsigned int" SIZEOF_UNSIGNED_INT)
   CHECK_TYPE_SIZE("unsigned long" SIZEOF_UNSIGNED_LONG)
@@ -17,6 +36,7 @@
   #
   FOREACH (_sign "" "u")
     FOREACH (_size 8 16 32 64)
+      MATH(EXPR  _sizeof "${_size} / 8")
       SET (_mytype    MYPACKAGE_${_sign}int${_size})
       STRING (TOUPPER ${_mytype} _MYTYPE)
       SET (_MYTYPEDEF ${_MYTYPE}_TYPEDEF)
@@ -32,7 +52,7 @@
         CHECK_TYPE_SIZE (${_type} ${_TYPE})
         IF (HAVE_${_TYPE})
           SET (HAVE_${_MYTYPE} TRUE)
-          SET (${_MYTYPE} ${${_TYPE}})
+          SET (SIZEOF_${_MYTYPE} ${${_TYPE}})
           SET (${_MYTYPEDEF} ${_type})
           BREAK ()
         ENDIF ()
@@ -41,16 +61,15 @@
         #
         # Try with C types
         #
-        FOREACH (_c "short" "int" "long" "long long")
+        FOREACH (_c "char" "short" "int" "long" "long long")
           IF ("${_sign}" STREQUAL "u")
             SET (_c "unsigned ${_c}")
           ENDIF ()
           STRING (TOUPPER ${_c} _C)
           STRING (REPLACE " " "_" _C "${_C}")
           IF (HAVE_SIZEOF_${_C})
-            IF (${SIZEOF_${_C}} EQUAL ${_size})
+            IF (${SIZEOF_${_C}} EQUAL ${_sizeof})
               SET (HAVE_${_MYTYPE} TRUE)
-              SET (${_MYTYPE} ${${_TYPE}})
               SET (${_MYTYPEDEF} ${_c})
               BREAK ()
             ENDIF ()
@@ -59,8 +78,9 @@
       ENDIF ()
       MARK_AS_ADVANCED (
         HAVE_${_MYTYPE}
-        ${_MYTYPE}
         ${_MYTYPEDEF})
     ENDFOREACH ()
   ENDFOREACH ()
+
+  SET (CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES_BACKUP}) # restore
 ENDMACRO()


[unittest] Add /usr/lib/swift to the rpath of unit test executables

As a postprocessing step for unittest executables, `utils/swift-rpathize.py` unconditionally rewrites the install name of any library linked from /usr/lib/swift to be `@rpath`-relative, in an effort to load the just-built libraries instead of the OS-supplied ones.

This works great for dylibs like libswiftCore.dylib that are built as part of the toolchain, but `/usr/lib/swift` also includes a huge number of overlay dylibs that are no longer part of this repository. These dylibs must ~always be loaded from the OS location.

In order to prevent load-time issues, we need to add /usr/lib/swift to the rpath, so any libraries that we haven’t built will be picked up from there.

We could also do this by extending swift-rpathize.py with an allow (or deny) list, but keeping the list up to date would generate a bunch of maintenance work we could do without.

--- cmake/modules/AddSwiftUnittests.cmake
+++ cmake/modules/AddSwiftUnittests.cmake
@@ -42,7 +42,7 @@
   if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
     # Add an @rpath to the swift library directory.
     set_target_properties(${test_dirname} PROPERTIES
-      BUILD_RPATH ${SWIFT_LIBRARY_OUTPUT_INTDIR}/swift/macosx)
+      BUILD_RPATH "${SWIFT_LIBRARY_OUTPUT_INTDIR}/swift/macosx;${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
     # Force all the swift libraries to be found via rpath.
     add_custom_command(TARGET "${test_dirname}" POST_BUILD
       COMMAND "${SWIFT_SOURCE_DIR}/utils/swift-rpathize.py"


Added some help to FindPyne

Added some help to FindPyne

--- cmake/FindPyne.cmake
+++ cmake/FindPyne.cmake
@@ -7,6 +7,15 @@
 #  PYNE_PREFIX                - path to the PyNE installation
 #  PYNE_LIBS_DIR              - path to the PyNE libs dir
 #  PYNE_INCLUDE_DIR           - path to where PyNE header files are
+#
+# To use PyNE add the following lines to your main CMakeLists.txt file:
+#
+#   # Find the Pyne installation
+#   find_package(Pyne REQUIRED)
+#   link_directories(${PYNE_LIBS_DIR})
+#   include_directories(${PYNE_INCLUDE_DIR})
+#
+# Enjoy!

 # Use the Python interpreter to find the libs.
 if(Pyne_FIND_REQUIRED)


upgrade gtest version

upgrade gtest version

--- cmake/UnitTest.cmake
+++ cmake/UnitTest.cmake
@@ -7,7 +7,7 @@
 FetchContent_Declare(
         googletest
         GIT_REPOSITORY https://github.com/google/googletest.git
-        GIT_TAG        release-1.8.1
+        GIT_TAG        release-1.11.0
 )

 FetchContent_GetProperties(googletest)


link ws2 on windows

link ws2 on windows

--- cmake/examples.cmake
+++ cmake/examples.cmake
@@ -20,4 +20,7 @@
         ${Boost_THREAD_LIBRARY}
         ${CMAKE_THREAD_LIBS_INIT}
     )
+    if(WIN32)
+        target_link_libraries(${EXAMPLE_NAME} ws2_32)
+    endif()
 endforeach(EXAMPLE)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp


cleanup: remove an unused variable

cleanup: remove an unused variable

--- cmake/fips.cmake
+++ cmake/fips.cmake
@@ -195,7 +195,6 @@

     # setup the target group variable, used to group targets into folders in IDEs
     set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-    set(TARGET_GROUP "")

     # check whether python is installed
     find_program(PYTHON "python")


Find ISPC also in PATH, and check required version

--- cmake/ispc.cmake
+++ cmake/ispc.cmake
@@ -14,32 +14,50 @@
 ## limitations under the License.                                           ##
 ## ======================================================================== ##

-SET(ISPC_VERSION 1.8.0)
-
-IF (APPLE)
-  SET(OSPRAY_ISPC_DIRECTORY ${PROJECT_SOURCE_DIR}/../ispc-v${ISPC_VERSION}-osx CACHE STRING "ISPC Directory")
-SET(ISPC_EXE_NAME "ispc")
-ELSEIF(WIN32)
-  SET(OSPRAY_ISPC_DIRECTORY ${PROJECT_SOURCE_DIR}/../ispc-v${ISPC_VERSION}-windows CACHE STRING "ISPC Directory")
-SET(ISPC_EXE_NAME "ispc.exe")
-ELSE()
-  SET(OSPRAY_ISPC_DIRECTORY ${PROJECT_SOURCE_DIR}/../ispc-v${ISPC_VERSION}-linux CACHE STRING "ISPC Directory")
-SET(ISPC_EXE_NAME "ispc")
+SET(ISPC_VERSION_REQUIRED "1.7.1")
+
+IF (NOT OSPRAY_ISPC_DIRECTORY)
+  # try sibling folder as hint for path of ISPC
+  SET(ISPC_VERSION_HINT "1.8.0")
+  IF (APPLE)
+    SET(OSPRAY_ISPC_DIRECTORY ${PROJECT_SOURCE_DIR}/../ispc-v${ISPC_VERSION_HINT}-osx)
+  ELSEIF(WIN32)
+    SET(OSPRAY_ISPC_DIRECTORY ${PROJECT_SOURCE_DIR}/../ispc-v${ISPC_VERSION_HINT}-windows)
+  ELSE()
+    SET(OSPRAY_ISPC_DIRECTORY ${PROJECT_SOURCE_DIR}/../ispc-v${ISPC_VERSION_HINT}-linux)
+  ENDIF()
 ENDIF()
-MARK_AS_ADVANCED(OSPRAY_ISPC_DIRECTORY)
-
-IF (NOT EXISTS "${OSPRAY_ISPC_DIRECTORY}/${ISPC_EXE_NAME}")
-  MESSAGE("********************************************")
-  MESSAGE("Could not find ISPC (tried ${OSPRAY_ISPC_DIRECTORY}.")
-  MESSAGE("")
-  MESSAGE("This version of ospray expects you to have a binary install of ISPC version ${ISPC_VERSION}, and expects this to be installed in the sibling directory to where the ospray source are located. Please go to https://ispc.github.io/downloads.html, select the binary release for your particular platform, and unpack it to ${PROJECT_SOURCE_DIR}/../")
-  MESSAGE("")
-  MESSAGE("If you insist on using your own custom install of ISPC, please make sure that the 'OSPRAY_ISPC_DIRECTORY' variable is properly set in cmake.")
-  MESSAGE("********************************************")
-  MESSAGE(FATAL_ERROR "Could not find ISPC. Exiting")
-ELSE()
-  SET(ISPC_BINARY ${OSPRAY_ISPC_DIRECTORY}/${ISPC_EXE_NAME})
+
+IF (NOT ISPC_BINARY)
+  FIND_PROGRAM(ISPC_BINARY ispc ${OSPRAY_ISPC_DIRECTORY})
+  IF (NOT ISPC_BINARY)
+    MESSAGE("********************************************")
+    MESSAGE("Could not find Intel SPMD Compiler (ISPC) (tried PATH and ${OSPRAY_ISPC_DIRECTORY}).")
+    MESSAGE("")
+    MESSAGE("This version of ospray expects you to have a binary install of ISPC version ${ISPC_VERSION_REQUIRED} or later, and expects it to be accessible via PATH or installed in the sibling directory to where the ospray source are located. Please go to https://ispc.github.io/downloads.html, select the binary release for your particular platform, and unpack it to ${PROJECT_SOURCE_DIR}/../")
+    MESSAGE("")
+    MESSAGE("If you insist on using your own custom install of ISPC, please make sure that the 'OSPRAY_ISPC_DIRECTORY' variable is properly set in cmake.")
+    MESSAGE("********************************************")
+    MESSAGE(FATAL_ERROR "Could not find ISPC. Exiting")
+  ELSE()
+    MESSAGE(STATUS "Found Intel SPMD Compiler (ISPC): ${ISPC_BINARY}")
+  ENDIF()
 ENDIF()
+
+IF(NOT ISPC_VERSION)
+  EXECUTE_PROCESS(COMMAND ${ISPC_BINARY} --version OUTPUT_VARIABLE ISPC_OUTPUT)
+  STRING(REGEX MATCH " [0-9]+[.][0-9]+[.][0-9]+ " ISPC_VERSION "${ISPC_OUTPUT}")
+
+  IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)
+    MESSAGE(FATAL_ERROR "Need at least version ${ISPC_VERSION_REQUIRED} of Intel SPMD Compiler (ISPC).")
+  ENDIF()
+
+  SET(ISPC_VERSION ${ISPC_VERSION} CACHE STRING "ISPC Version")
+  MARK_AS_ADVANCED(ISPC_VERSION)
+  MARK_AS_ADVANCED(ISPC_BINARY)
+ENDIF()
+
+

 # ##################################################################
 # add macro ADD_DEFINITIIONS_ISCP() that allows to pass #define's to


Fix default soundfont on Windows

Fix default soundfont on Windows

Reported by Bernd Casper.

--- fluidsynth/cmake_admin/DefaultDirs.cmake
+++ fluidsynth/cmake_admin/DefaultDirs.cmake
@@ -3,7 +3,7 @@

 # DEFAULT_SOUNDFONT - automatically loaded in some use cases
 if ( WIN32 )
-  set (DEFAULT_SOUNDFONT "C:\\soundfonts\\default.sf2" CACHE STRING
+  set (DEFAULT_SOUNDFONT "C:\\\\soundfonts\\\\default.sf2" CACHE STRING
        "Default soundfont file")
 else ( WIN32 )
   set (DEFAULT_SOUNDFONT "share/soundfonts/default.sf2" CACHE STRING


Disables Allogen bridge generation under Windows

--- CMake/CompileAllogenInterface.cmake
+++ CMake/CompileAllogenInterface.cmake
@@ -56,10 +56,10 @@
     set(multiValueArgs IDL IMPORT)
     cmake_parse_arguments(IFT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-    if (NOT Maven_FOUND OR NOT ALLOGEN_COMPILER OR ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
+#    if (NOT Maven_FOUND OR NOT ALLOGEN_COMPILER OR ${CMAKE_GENERATOR} MATCHES "Visual Studio")
         file(WRITE ${IFT_MODULE_NAME} "")
         return()
-    endif ()
+#    endif ()

     set(import_args "")
     if(IFT_IMPORT)


Issue #37: Fix case of gflags Lib folder on Windows.

--- CMake/ExternalProjects/gflags.cmake
+++ CMake/ExternalProjects/gflags.cmake
@@ -52,7 +52,11 @@
   )

   set(gflags_DIR ${proj_INSTALL})
-  set(gflags_LIBRARY_DIR ${gflags_DIR}/lib)     # gflags-config.cmake doesn't export this.
+  if(WIN32)
+    set(gflags_LIBRARY_DIR ${gflags_DIR}/Lib)     # gflags-config.cmake doesn't export this.
+  else()
+    set(gflags_LIBRARY_DIR ${gflags_DIR}/lib)     # gflags-config.cmake doesn't export this.
+  endif()
   set(gflags_INCLUDE_DIR ${gflags_DIR}/include)

   mitkFunctionInstallExternalCMakeProject(${proj})


Recently the CEGUI renderer was configured on OS X to use an executable path from within the Plugins area, but this wasn't getting symlinked in.

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -299,6 +299,12 @@
           ${OGRE_SAMPLE_CONTENTS_PATH}/Plugins/
         )
       endif()
+      if (OGRE_BUILD_CEGUIRENDERER)
+        add_custom_command(TARGET ${SAMPLENAME} POST_BUILD
+        COMMAND ln ARGS -s -f ${CMAKE_BINARY_DIR}/lib/$(CONFIGURATION)/libCEGUIOgreRenderer.dylib
+          ${OGRE_SAMPLE_CONTENTS_PATH}/Plugins/
+        )
+      endif()
     endif()
   endif (APPLE)


Don't apply visibility settings to statically built samples.  Fixes linking problems with Xcode 4 and iOS.

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -293,14 +293,17 @@
       endif()
     endif(NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
   endif (APPLE)
-  if (CMAKE_COMPILER_IS_GNUCXX)
-    # add GCC visibility flags to shared library build
-    set_target_properties(${SAMPLENAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
-    set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN}")
-    set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN}")
-    # disable "lib" prefix on Unix
-    set_target_properties(${SAMPLENAME} PROPERTIES PREFIX "")
-  endif (CMAKE_COMPILER_IS_GNUCXX)
+  if (NOT OGRE_STATIC)
+    if (CMAKE_COMPILER_IS_GNUCXX)
+      # add GCC visibility flags to shared library build
+      set_target_properties(${SAMPLENAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
+      set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN}")
+      set_target_properties(${SAMPLENAME} PROPERTIES XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN "${XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN}")
+      # disable "lib" prefix on Unix
+      set_target_properties(${SAMPLENAME} PROPERTIES PREFIX "")
+    endif (CMAKE_COMPILER_IS_GNUCXX)
+  endif()
+
   if (OGRE_INSTALL_SAMPLES)
 	ogre_install_target(${SAMPLENAME} ${OGRE_SAMPLE_PATH} FALSE)
   endif()


Remove 'PIE' for Clang ThreadSanitizer

Remove 'PIE' for Clang ThreadSanitizer

--- flags/sanitize_thread.cmake
+++ flags/sanitize_thread.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ruslan Baratov
+# Copyright (c) 2014-2017, Ruslan Baratov
 # All rights reserved.

 if(DEFINED POLLY_FLAGS_SANITIZE_THREAD_CMAKE_)
@@ -10,11 +10,16 @@
 include(polly_add_cache_flag)

 polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=thread")
-polly_add_cache_flag(CMAKE_CXX_FLAGS "-fPIE")
-polly_add_cache_flag(CMAKE_CXX_FLAGS "-pie")
 polly_add_cache_flag(CMAKE_CXX_FLAGS "-g")

 polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=thread")
-polly_add_cache_flag(CMAKE_C_FLAGS "-fPIE")
-polly_add_cache_flag(CMAKE_C_FLAGS "-pie")
 polly_add_cache_flag(CMAKE_C_FLAGS "-g")
+
+# NOTE:
+#
+#   PIE flags removed because it's not a requirement anymore:
+#   * https://github.com/google/sanitizers/issues/503#issuecomment-137946595
+#
+#   With PIE flags sanitizer doesn't work on Ubuntu 14.04/16.04
+#   producing runtime error "ThreadSanitizer: unexpected memory mapping":
+#   * https://github.com/google/sanitizers/issues/503


Setting git version from current source directory

--- cmake/modules/GetGitRevisionDescription.cmake
+++ cmake/modules/GetGitRevisionDescription.cmake
@@ -110,7 +110,7 @@

 		${ARGN}
 		WORKING_DIRECTORY
-		"${CMAKE_SOURCE_DIR}"
+        "${CMAKE_CURRENT_SOURCE_DIR}"
 		RESULT_VARIABLE
 		res
 		OUTPUT_VARIABLE


Plugins do not need the MITK tag file, as they will only reference other plugins

--- CMake/mitkMacroCreateCTKPlugin.cmake
+++ CMake/mitkMacroCreateCTKPlugin.cmake
@@ -15,16 +15,9 @@
       set(is_test_plugin)
     endif()

-    set(_mitk_tagfile )
-
-    if(EXISTS ${MITK_DOXYGEN_TAGFILE_NAME})
-      # Todo: Point to stable documentations for stable builds
-      set(_mitk_tagfile "${MITK_DOXYGEN_TAGFILE_NAME}=http://docs.mitk.org/nightly-qt4/")
-    endif()
-
     MACRO_CREATE_CTK_PLUGIN(EXPORT_DIRECTIVE ${_PLUGIN_EXPORT_DIRECTIVE}
                             EXPORTED_INCLUDE_SUFFIXES ${_PLUGIN_EXPORTED_INCLUDE_SUFFIXES}
-                            DOXYGEN_TAGFILES ${_PLUGIN_DOXYGEN_TAGFILES} ${_mitk_tagfile}
+                            DOXYGEN_TAGFILES ${_PLUGIN_DOXYGEN_TAGFILES}
                             ${is_test_plugin})

     target_link_libraries(${PLUGIN_TARGET} ${ALL_LIBRARIES})


attempt to suppress annoying warnings with older gcc

--- CMakeModules/FindCompilerFlags.cmake
+++ CMakeModules/FindCompilerFlags.cmake
@@ -12,6 +12,15 @@
   string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
 endif()

+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE
+		        GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+message(STATUS "GCC version: ${GCC_VERSION}")
+if (GCC_VERSION VERSION_GREATER 4.6 OR GCC_VERSION VERSION_EQUAL 4.6)
+elseif (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+add_definitions("-Wno-conversion")
+endif()
+
 if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND "${CMAKE_BUILD_TYPE}" MATCHES "Debug")
   if (NOT APPLE OR DARWIN_VERSION GREATER 12)
     add_definitions("-sanitize=undefined,address")


Disable one vc test for gcc51

Disable one vc test for gcc51

--- test/CTestCustom.cmake
+++ test/CTestCustom.cmake
@@ -15,7 +15,7 @@
       vc-math_VC_LOG_ILP2_sse
       vc-math_VC_LOG_ILP_sse
       stressVdt)
-elseif(CTEST_BUILD_NAME MATCHES clang7)
+elseif(CTEST_BUILD_NAME MATCHES clang7 OR CTEST_BUILD_NAME MATCHES gcc51)
   set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE}
       vc-swizzles_avx)
 endif()


use -nodefaultlibs for clients

use -nodefaultlibs for clients

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


boards: arm: nucleo_h743zi runner openocd requires reset halt

Add the command to the openocd runner so that a board reset happens
after flash and verify

Signed-off-by: Francois Ramu <b83adc7f8a23ee911a37fcb61c4033581aae0b7a@st.com>

--- boards/arm/nucleo_h743zi/board.cmake
+++ boards/arm/nucleo_h743zi/board.cmake
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: Apache-2.0

+board_runner_args(openocd --cmd-post-verify "reset halt")
 board_runner_args(jlink "--device=STM32H743ZI" "--speed=4000")
 board_runner_args(stm32cubeprogrammer "--port=swd" "--reset=hw")


Add -DQT_NO_DEBUG and -DNDEBUG to moc in release mode.

	* build-aux/cmake/modules/Gostai.cmake: Do that.

--- build-aux/cmake/modules/Gostai.cmake
+++ build-aux/cmake/modules/Gostai.cmake
@@ -38,7 +38,14 @@
   # =================== #
   qt4_wrap_ui(${name}_UI_SOURCES ${${name}_UIS})
   qt4_add_resources(${name}_RES_SOURCES ${${name}_RESOURCES})
-  qt4_wrap_cpp(${name}_MOC_SOURCES ${${name}_MOCS})
+
+  set(${name}_MOC_OPTIONS "")
+  if(CMAKE_BUILD_TYPE STREQUAL "Release")
+    list(APPEND ${name}_MOC_OPTIONS "-DQT_NO_DEBUG")
+    list(APPEND ${name}_MOC_OPTIONS "-DNDEBUG")
+  endif(CMAKE_BUILD_TYPE STREQUAL "Release")
+  qt4_wrap_cpp(${name}_MOC_SOURCES ${${name}_MOCS}
+    OPTIONS ${${name}_MOC_OPTIONS})

   set(${name}_ALL_SOURCES
     ${${name}_SOURCES}


Remove TODO comment

Remove TODO comment

--- chainerx_cc/third_party/abseil.cmake
+++ chainerx_cc/third_party/abseil.cmake
@@ -4,8 +4,6 @@
 include(ExternalProject)
 ExternalProject_Add(pybind11
     GIT_REPOSITORY    https://github.com/abseil/abseil-cpp.git
-    # TODO(take-cheeze): Use tag instead as soon as 201906 is out
-    # https://github.com/abseil/abseil-cpp/releases
     GIT_TAG           20190808
     SOURCE_DIR        "${CMAKE_CURRENT_BINARY_DIR}/abseil"
     BINARY_DIR        ""


another attempt to fix IPP detection on x64 (ticket #1294)

--- OpenCVFindIPP.cmake
+++ OpenCVFindIPP.cmake
@@ -43,6 +43,14 @@
 set(IPPVM      "vm")   # vector math

+set(IPP_X64 0)
+if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
+    set(IPP_X64 1)
+endif()
+if (CMAKE_CL_64)
+    set(IPP_X64 1)
+endif()
+
 # ------------------------------------------------------------------------
 # This function detect IPP version by analyzing ippversion.h file
 # Note, ippversion.h file was inroduced since IPP 5.3
@@ -96,11 +104,7 @@
     set(IPPCV      "cv")       # computer vision
     set(IPPVM      "vm")       # vector math

-    if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
-        set(IPP_ARCH "em64t")
-    endif()
-
-    if (CMAKE_CL_64)
+    if (IPP_X64)
         set(IPP_ARCH "em64t")
     endif()

@@ -171,7 +175,7 @@
         set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
         set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib     PARENT_SCOPE)

-        if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
+        if (IPP_X64)
             if(NOT EXISTS ${IPP_ROOT_DIR}/../em64t)
                 message(SEND_ERROR "IPP EM64T libraries not found")
             endif()
@@ -192,7 +196,7 @@
         # set INCLUDE and LIB folders
         set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)

-        if (CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
+        if (IPP_X64)
             if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
                 message(SEND_ERROR "IPP EM64T libraries not found")
             endif()


Fix package config failure handling (partial #240)

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -65,7 +65,7 @@
 # reset before using them
   "set(_req)\n"
   "set(_quiet)\n"
-  "set(_fail)\n"
+  "set(${PROJECT_NAME}_fail)\n"
   "set(${UPPER_PROJECT_NAME}_COMPONENTS)\n"
   "if(NOT ${UPPER_PROJECT_NAME}_FOUND)\n"
   "  set(${UPPER_PROJECT_NAME}_STATUS ON)\n"
@@ -90,7 +90,7 @@
 )

 set(_config_file_standard_find
-  "if(NOT _fail)\n"
+  "if(NOT ${PROJECT_NAME}_fail)\n"
 # setup INCLUDE_DIRS and DEB_DEPENDENCIES
   "  list(APPEND ${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${PROJECT_NAME}_PREFIX_DIR}/include)\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEPENDENCIES \"${CPACK_PACKAGE_NAME} (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
@@ -108,7 +108,7 @@
   "\n"
   "      if(\${_component}_libraryname MATCHES \"\${_component}_libraryname-NOTFOUND\")\n"
   "        if(${PROJECT_NAME}_FIND_REQUIRED_\${_component})\n"
-  "          set(_fail \"Component library \${_component} not found\")\n"
+  "          set(${PROJECT_NAME}_fail \"Component \${_component} ${${PROJECT_NAME}_fail}\")\n"
   "          message(FATAL_ERROR \"   ${PROJECT_NAME}_\${_component} \"\n"
   "            \"not found in \${${PROJECT_NAME}_PREFIX_DIR}/lib\")\n"
   "        elseif(NOT _quiet)\n"
@@ -128,7 +128,7 @@
   "    find_file(${UPPER_PROJECT_NAME}_FILE NAMES ${${UPPER_PROJECT_NAME}_FIND_FILES} NO_DEFAULT_PATH\n"
   "              PATHS \${${PROJECT_NAME}_PREFIX_DIR} PATH_SUFFIXES include)\n"
   "    if(${UPPER_PROJECT_NAME}_FILE MATCHES \"${UPPER_PROJECT_NAME}_FILE-NOTFOUND\")\n"
-  "      set(_fail \"${${UPPER_PROJECT_NAME}_FIND_FILES} not found\")\n"
+  "      set(${PROJECT_NAME}_fail \"${${UPPER_PROJECT_NAME}_FIND_FILES} ${${PROJECT_NAME}_fail}\")\n"
   "      if(_out)\n"
   "        message(\${_output_type} \"   Missing the ${PROJECT_NAME} \"\n"
   "          \"file in \${${PROJECT_NAME}_PREFIX_DIR}/include.\")\n"
@@ -142,7 +142,7 @@
   "      find_library(\${_LIBRARYNAME}_LIBRARY \${_libraryname} NO_DEFAULT_PATH\n"
   "                   PATHS \${${PROJECT_NAME}_PREFIX_DIR} PATH_SUFFIXES lib ${PYTHON_LIBRARY_PREFIX})\n"
   "      if(\${_LIBRARYNAME}_LIBRARY MATCHES \"\${_LIBRARYNAME}_LIBRARY-NOTFOUND\")\n"
-  "        set(_fail \"\${_libraryname} not found\")\n"
+  "        set(${PROJECT_NAME}_fail \"\${_libraryname} ${${PROJECT_NAME}_fail}\")\n"
   "        if(_out)\n"
   "          message(\${_output_type}\n"
   "            \"   Missing \${_libraryname} in \${${PROJECT_NAME}_PREFIX_DIR}/lib\")\n"
@@ -166,7 +166,7 @@
 )

 set(_config_file_subproject_find
-  "if(NOT _fail)\n"
+  "if(NOT ${PROJECT_NAME}_fail)\n"
 # setup INCLUDE_DIRS and DEB_DEPENDENCIES
   "  list(APPEND ${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${PROJECT_NAME}_PREFIX_DIR}/include)\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEPENDENCIES \"${CPACK_PACKAGE_NAME} (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
@@ -206,7 +206,7 @@
   "list(APPEND ${UPPER_PROJECT_NAME}_LIBRARIES \${${UPPER_PROJECT_NAME}_DEP_LIBRARIES})\n"
   "set(${UPPER_PROJECT_NAME}_DEP_LIBRARIES)\n"
 # finally report about found or not found
-  "if(_fail)\n"
+  "if(${PROJECT_NAME}_fail)\n"
   "  set(${UPPER_PROJECT_NAME}_FOUND)\n"
   "  set(${PROJECT_NAME}_FOUND)\n"
   "  set(${UPPER_PROJECT_NAME}_VERSION)\n"
@@ -217,7 +217,7 @@
   "  set(${UPPER_PROJECT_NAME}_LIBRARY)\n"
   "  set(${UPPER_PROJECT_NAME}_COMPONENTS)\n"
   "  if(_out)\n"
-  "    message(STATUS \"Could not find ${PROJECT_NAME}: \${_fail}\")\n"
+  "    message(STATUS \"Could not find ${PROJECT_NAME}: \${${PROJECT_NAME}_fail} not found\")\n"
   "  endif()\n"
   "else()\n"
   "  set(${UPPER_PROJECT_NAME}_FOUND TRUE)\n"
@@ -355,7 +355,7 @@
     "  list(APPEND ${UPPER_PROJECT_NAME}_DEP_LIBRARIES \${${${_dependent}_name}_LIBRARIES})\n"
     "  list(APPEND ${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${${_dependent}_name}_INCLUDE_DIRS})\n"
     "else()\n"
-    "  set(_fail \"${_dependent} not found\")\n"
+    "  set(${PROJECT_NAME}_fail \"${_dependent} ${${PROJECT_NAME}_fail}\")\n"
     "endif()\n"
     # Restore the situation of the dependent library without accumulating the dependent libraries
     "set(${${_dependent}_name}_LIBRARIES \${_${${_dependent}_name}_libraries_backup})\n"


Swapped to cmake generator expressions for build types

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

--- cmake/config/OpenVDBBuildTypes.cmake
+++ cmake/config/OpenVDBBuildTypes.cmake
@@ -1,68 +1,60 @@
+
+# Requires add_link_options from 3.13
+cmake_minimum_required(VERSION 3.13)
+
 # Build Types
 set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
-    CACHE STRING [=[Choose the type of build. CMake natively supports the following options: None Debug Release
-        RelWithDebInfo MinSizeRel. OpenVDB additionally supports the following sanitizers and tools:
-        coverage tsan asan lsan msan ubsan]=]
-    FORCE)
+  CACHE STRING [=[Choose the type of build. CMake natively supports the following options: None Debug Release
+    RelWithDebInfo MinSizeRel. OpenVDB additionally supports the following sanitizers and tools:
+    coverage tsan asan lsan msan ubsan]=]
+  FORCE)
+
+# Note that the thread, address and memory sanitizers are incompatible with each other
+set(EXTRA_BUILD_TYPES coverage tsan asan lsan msan ubsan)
+
+# Set all build flags to empty (unless they have been provided)

 # DebugNoInfo - An internal build type only used by the OpenVDB CI. no optimizations, no symbols, asserts enabled
-set(CMAKE_CXX_FLAGS_DebugNoInfo ""
-  CACHE STRING "Flags used by the C++ compiler during DebugNoInfo builds." FORCE)
+set(CMAKE_CXX_FLAGS_DebugNoInfo "" CACHE STRING "Flags used by the C++ compiler during DebugNoInfo builds.")
+
+foreach(TYPE ${EXTRA_BUILD_TYPES})
+  set(CMAKE_CXX_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the C++ compiler during ${TYPE} builds.")
+  set(CMAKE_SHARED_LINKER_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the linker during ${TYPE} builds.")
+  set(CMAKE_EXE_LINKER_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the linker during ${TYPE} builds.")
+endforeach()
+
+# Init generator options - we use generator expressions to allow builds with both
+# clang and GCC. Sanitizers are currently only configured for clang and GCC.
+# @todo from CMake 3.15, switch to comma list of CXX_COMPILER_ID.

 # Coverage
-set(CMAKE_CXX_FLAGS_COVERAGE "--coverage"
-  CACHE STRING "Flags used by the C++ compiler during code coverage builds." FORCE)
-set(CMAKE_STATIC_LINKER_FLAGS_COVERAGE "--coverage"
-  CACHE STRING "Flags used by the linker during code coverage builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage"
-  CACHE STRING "Flags used by the linker during code coverage builds." FORCE)
-set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage"
-  CACHE STRING "Flags used by the linker during code coverage builds." FORCE)
-
-# Note that the thread, address and memory sanitizers are icompatible with each other
-set(SANITIZERS tsan asan lsan msan ubsan)
+add_compile_options("$<$<CONFIG:COVERAGE>:--coverage>")
+add_link_options("$<$<CONFIG:COVERAGE>:--coverage>")

 # ThreadSanitizer
-set(CMAKE_CXX_FLAGS_TSAN "-fsanitize=thread -g -O1"
-  CACHE STRING "Flags used by the C++ compiler during ThreadSanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_TSAN "-fsanitize=thread"
-  CACHE STRING "Flags used by the linker during ThreadSanitizer builds." FORCE)
-set(CMAKE_EXE_LINKER_FLAGS_TSAN "-fsanitize=thread"
-  CACHE STRING "Flags used by the linker during ThreadSanitizer builds." FORCE)
+add_compile_options("$<$<AND:$<CONFIG:TSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=thread>")
+add_compile_options("$<$<AND:$<CONFIG:TSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-g;-O1>")
+add_link_options("$<$<AND:$<CONFIG:TSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=thread>")

 # AddressSanitize
-if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
-  set(CMAKE_CXX_FLAGS_ASAN "-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
-    CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds." FORCE)
-  set(CMAKE_SHARED_LINKER_FLAGS_ASAN "-fsanitize=address"
-    CACHE STRING "Flags used by the linker during AddressSanitizer builds." FORCE)
-  set(CMAKE_EXE_LINKER_FLAGS_ASAN "-fsanitize=address"
-    CACHE STRING "Flags used by the linker during AddressSanitizer builds." FORCE)
-elseif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
-  set(CMAKE_CXX_FLAGS_ASAN "-fsanitize=address -fno-optimize-sibling-calls -fno-omit-frame-pointer -g -O1"
-    CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds." FORCE)
-endif()
+add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=address>")
+add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fno-omit-frame-pointer;-g;-O1>")
+add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize-address-use-after-scope;-fno-optimize-sibling-calls>")
+# -fsanitize-address-use-after-scope added in GCC 7
+add_compile_options("$<$<AND:$<CONFIG:ASAN>,$<CXX_COMPILER_ID:GNU>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,7.0.0>>:-fsanitize-address-use-after-scope>")
+add_link_options("$<$<AND:$<CONFIG:ASAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=address>")

 # LeakSanitizer
-set(CMAKE_CXX_FLAGS_LSAN "-fsanitize=leak -fno-omit-frame-pointer -g -O1"
-  CACHE STRING "Flags used by the C++ compiler during LeakSanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_LSAN "-fsanitize=leak"
-  CACHE STRING "Flags used by the linker during LeakSanitizer builds." FORCE)
-set(CMAKE_EXE_LINKER_FLAGS_LSAN "-fsanitize=leak"
-  CACHE STRING "Flags used by the linker during LeakSanitizer builds." FORCE)
+add_compile_options("$<$<AND:$<CONFIG:LSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=leak>")
+add_compile_options("$<$<AND:$<CONFIG:LSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fno-omit-frame-pointer;-g;-O1>")
+add_link_options("$<$<AND:$<CONFIG:LSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=leak>")

 # MemorySanitizer
-set(CMAKE_CXX_FLAGS_MSAN "-fsanitize=memory -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O2"
-  CACHE STRING "Flags used by the C++ compiler during MemorySanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_MSAN "-fsanitize=memory"
-  CACHE STRING "Flags used by the linker during MemorySanitizer builds." FORCE)
-set(CMAKE_EXE_LINKER_FLAGS_MSAN "-fsanitize=memory"
-  CACHE STRING "Flags used by the linker during MemorySanitizer builds." FORCE)
+add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=memory>")
+add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fno-omit-frame-pointer;-g;-O2>")
+add_compile_options("$<$<AND:$<CONFIG:MSAN>,$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:--fno-optimize-sibling-calls;-fsanitize-memory-track-origins=2>")
+add_link_options("$<$<AND:$<CONFIG:MSAN>,$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=memory>")

 # UndefinedBehaviour
-set(CMAKE_CXX_FLAGS_UBSAN "-fsanitize=undefined"
-  CACHE STRING "Flags used by the C++ compiler during UndefinedBehaviourSanitizer builds." FORCE)
-set(CMAKE_SHARED_LINKER_FLAGS_UBSAN "-fsanitize=undefined"
-  CACHE STRING "Flags used by the linker during UndefinedBehaviourSanitizer builds." FORCE)
-set(CMAKE_EXE_LINKER_FLAGS_UBSAN "-fsanitize=undefined"
-  CACHE STRING "Flags used by the linker during UndefinedBehaviourSanitizer builds." FORCE)
+add_compile_options("$<$<AND:$<CONFIG:UBSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=undefined>")
+add_link_options("$<$<AND:$<CONFIG:UBSAN>,$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>>:-fsanitize=undefined>")


Fixing overlooked case of needing to define EL_HAVE_BLAS_SUFFIX and EL_HAVE_LAPACK_SUFFIX if ScaLAPACK built its own OpenBLAS or BLIS which is separate from Elemental's

--- cmake/external_projects/ElMath.cmake
+++ cmake/external_projects/ElMath.cmake
@@ -258,6 +258,13 @@
   endif()
 endif()

+if(EL_BLAS_SUFFIX)
+  set(EL_HAVE_BLAS_SUFFIX TRUE)
+endif()
+if(EL_LAPACK_SUFFIX)
+  set(EL_HAVE_LAPACK_SUFFIX TRUE)
+endif()
+
 # Check/predict the BLAS and LAPACK underscore conventions
 # ========================================================
 if(NOT EL_BUILT_BLIS_LAPACK AND NOT EL_BUILT_OPENBLAS)
@@ -274,7 +281,6 @@
     if(NOT EL_HAVE_DAXPY_SUFFIX)
       message(FATAL_ERROR "daxpy${EL_BLAS_SUFFIX} was not detected")
     endif()
-    set(EL_HAVE_BLAS_SUFFIX TRUE)
   else()
     El_check_function_exists(daxpy  EL_HAVE_DAXPY)
     El_check_function_exists(daxpy_ EL_HAVE_DAXPY_POST)
@@ -294,7 +300,6 @@
     if(NOT EL_HAVE_DPOTRF_SUFFIX)
       message(FATAL_ERROR "dpotrf${EL_LAPACK_SUFFIX} was not detected")
     endif()
-    set(EL_HAVE_LAPACK_SUFFIX TRUE)
   else()
     El_check_function_exists(dpotrf  EL_HAVE_DPOTRF)
     El_check_function_exists(dpotrf_ EL_HAVE_DPOTRF_POST)


Fixing typo with coverage option

Fixing typo with coverage option

--- cmake/modules/RootBenchOptions.cmake
+++ cmake/modules/RootBenchOptions.cmake
@@ -1 +1 @@
-set(coverage OFF "Test coverage")+set(coverage "RootBenchmark coverage" OFF)


Enable arrow with all=ON, but not by default


whoops - one line, nay, one *word* fix to my mac universal patch. Reviewed by cg

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -67,7 +67,7 @@
     endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
   endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
   set(LL_ARCH ${ARCH}_darwin)
-  set(LL_ARCH_DIR ${ARCH}-darwin)
+  set(LL_ARCH_DIR universal-darwin)
 endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")


eliminated warning about missing doxygen.

it seemed unnecessary to bug the user about doxygen's absence when WANT_DOCS is not specified.

--- cmake/doxygen.cmake
+++ cmake/doxygen.cmake
@@ -65,9 +65,11 @@
 function(add_doxygen TARGET DOXYGEN_PROJECT_NAME)

 	if (NOT DOXYGEN_FOUND)
-		message(WARNING
-			"i will be unable to generate documentation because doxygen could not be found.")
-		return()
+		if (WANT_DOCS)
+			message(SEND_ERROR
+				"i will be unable to generate documentation because doxygen could not be found.")
+			return()
+		endif()
 	endif()

 	foreach(i ${ARGN})


cmake: export Zephyr modules as Kconfig variables.

In CMake it is possible to reference each Zephyr module as a CMake
variable. This commit introduces the same feature to Kconfig, so that
it is possible to reference a module in consistent way in both CMake
and Kconfig.

To include a file from module FOO in CMake, use:
include(${ZEPHYR_FOO_MODULE_DIR}/somefile.cmake

To source a file from module FOO in Kconfig, use:
source "$(ZEPHYR_FOO_MODULE_DIR)/Kconfig.somefile"

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

--- cmake/kconfig.cmake
+++ cmake/kconfig.cmake
@@ -47,6 +47,17 @@
 # character in the C shell, so we make it into a question-mark
 # separated list instead.
 string(REPLACE ";" "?" DTS_ROOT_BINDINGS "${DTS_ROOT_BINDINGS}")
+
+# Export each `ZEPHYR_<module>_MODULE_DIR` to Kconfig.
+# This allows Kconfig files to refer relative from a modules root as:
+# source "$(ZEPHYR_FOO_MODULE_DIR)/Kconfig"
+foreach(module_name ${ZEPHYR_MODULE_NAMES})
+  string(TOUPPER ${module_name} MODULE_NAME_UPPER)
+  list(APPEND
+       ZEPHYR_KCONFIG_MODULES_DIR
+       "ZEPHYR_${MODULE_NAME_UPPER}_MODULE_DIR=${ZEPHYR_${MODULE_NAME_UPPER}_MODULE_DIR}"
+  )
+endforeach()

 # A list of common environment settings used when invoking Kconfig during CMake
 # configure time or menuconfig and related build target.
@@ -64,6 +75,8 @@
   KCONFIG_BINARY_DIR=${KCONFIG_BINARY_DIR}
   TOOLCHAIN_KCONFIG_DIR=${TOOLCHAIN_KCONFIG_DIR}
   EDT_PICKLE=${EDT_PICKLE}
+  # Export all Zephyr modules to Kconfig
+  ${ZEPHYR_KCONFIG_MODULES_DIR}
 )

 # Allow out-of-tree users to add their own Kconfig python frontend


use CMAKE_INSTALL_LIBDIR for rpath for stability of packaging

--- cmake/package.cmake
+++ cmake/package.cmake
@@ -20,9 +20,9 @@
   set(CMAKE_SKIP_INSTALL_RPATH OFF)
   if (APPLE)
     set(CMAKE_MACOSX_RPATH ON)
-    set(CMAKE_INSTALL_RPATH "@executable_path/" "@executable_path/../lib")
-  else()
-    set(CMAKE_INSTALL_RPATH "\$ORIGIN:\$ORIGIN/../lib")
+    set(CMAKE_INSTALL_RPATH "@executable_path/" "@executable_path/../${CMAKE_INSTALL_LIBDIR}")
+  else()
+    set(CMAKE_INSTALL_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
     # on per target basis:
     #set_TARGET_PROPERTIES(apps INSTALL_RPATH "$ORIGIN:$ORIGIN/../lib")
     #set_TARGET_PROPERTIES(libs INSTALL_RPATH "$ORIGIN")


Add newline on *.cmake files, not counting cmake-modules/

--- cmake_package.cmake
+++ cmake_package.cmake
@@ -1,2 +1,2 @@
 set(CMAKE_INSTALL_PREFIX $ENV{CMAKE_INSTALL_PREFIX})
-include(cmake_install.cmake)+include(cmake_install.cmake)


Add support tbb in local build dirs, and from composer installs.

--- CMake/FindTBB.cmake
+++ CMake/FindTBB.cmake
@@ -27,9 +27,12 @@
 #
 #
 # This module reads hints about search locations from variables:
-#  ENV TBB_ARCH_PLATFORM for windows only
-#  ENV TBB_ROOT or just TBB_ROOT
-#
+#  ENV TBB_ARCH_PLATFORM - for eg. set it to "mic" for Xeon Phi builds
+#  ENV TBB_ROOT or just TBB_ROOT - root directory of tbb installation
+#  ENV TBB_BUILD_PREFIX - specifies the build prefix for user built tbb
+#                         libraries. Should be specified with ENV TBB_ROOT
+#                         and optionally...
+#  ENV TBB_BUILD_DIR - if build directory is different than ${TBB_ROOT}/build
 #
 #
 # Modified by Robert Maynard from the original OGRE source
@@ -142,10 +145,20 @@
 set(TBB_PREFIX_PATH ${TBB_ROOT} ${ENV_TBB_ROOT})
 create_search_paths(TBB)

-# get the arch, only used by windows
-if($ENV{TBB_ARCH_PLATFORM})
-    set(TBB_ARCH_PLATFORM $ENV{TBB_ARCH_PLATFORM})
-endif()
+# If user built from sources
+set(TBB_BUILD_PREFIX $ENV{TBB_BUILD_PREFIX})
+if (TBB_BUILD_PREFIX AND ENV_TBB_ROOT)
+  getenv_path(TBB_BUILD_DIR)
+  if (NOT ENV_TBB_BUILD_DIR)
+    set(ENV_TBB_BUILD_DIR ${ENV_TBB_ROOT}/build)
+  endif ()
+
+  # include directory under ${ENV_TBB_ROOT}/include
+  list(APPEND TBB_LIB_SEARCH_PATH
+    ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_release
+    ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_debug)
+endif ()
+

 # For Windows, let's assume that the user might be using the precompiled
 # TBB packages from the main website. These use a rather awkward directory
@@ -187,10 +200,37 @@
   endforeach ()
 endif ()

+
+# check compiler ABI
+if (CMAKE_CXX_COMPILER_ID EQUAL GNU AND
+    CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
+  set(COMPILER_PREFIX "gcc4.1")
+else () # Assume compatibility with 4.4 for other compilers
+  set(COMPILER_PREFIX "gcc4.4")
+endif ()
+
+# if platform architecture is explicitly specified
+set(TBB_ARCH_PLATFORM $ENV{TBB_ARCH_PLATFORM})
+if (TBB_ARCH_PLATFORM)
+  foreach (dir ${TBB_PREFIX_PATH})
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/${TBB_ARCH_PLATFORM}/lib)
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/${TBB_ARCH_PLATFORM})
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib)
+  endforeach ()
+endif ()
+
 foreach (dir ${TBB_PREFIX_PATH})
-  list(APPEND TBB_LIB_SEARCH_PATH ${dir}/${TBB_ARCH_PLATFORM}/lib)
-  list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/${TBB_ARCH_PLATFORM})
-  list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib)
+  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64)
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${COMPILER_PREFIX})
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/lib)
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${COMPILER_PREFIX}/lib)
+  else ()
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32)
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${COMPILER_PREFIX})
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/lib)
+    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${COMPILER_PREFIX}/lib)
+  endif ()
 endforeach ()


Add parmetis tests and a configuration without pumi to run tests

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -112,6 +112,7 @@
   "-DCMAKE_C_FLAGS=${flags}"
   "-DCMAKE_CXX_FLAGS=${flags} -std=c++11"
   "-DCMAKE_EXE_LINKER_FLAGS=-ldl ${flags} -pthread"
+  "-DENABLE_PARMETIS=ON"
   "-DENABLE_PUMI=ON"
   "-DSCOREC_PREFIX=/usr/local/pumi/core/"
   "-DIS_TESTING=ON"
@@ -131,6 +132,7 @@
   "-DCMAKE_EXE_LINKER_FLAGS=-ldl ${flags} -pthread"
   "-DENABLE_PUMI=ON"
   "-DSCOREC_PREFIX=/usr/local/pumi/core/"
+  "-DENABLE_PARMETIS=ON"
   "-DIS_TESTING=ON"
   "-DMESHES=/lore/diamog/cdash/repos/EnGPar/pumi-meshes/"
   "-DGRAPHS=/lore/diamog/cdash/repos/EnGPar/EnGPar-graphs/"
@@ -141,5 +143,24 @@
 build_subproject(memcheck "${CONFIGURE_VALGRIND}")
 test_subproject(memcheck)

+SET(CONFIGURE_NOPUMI
+  "-DCMAKE_C_COMPILER=mpicc"
+  "-DCMAKE_CXX_COMPILER=mpicxx"
+  "-DCMAKE_C_FLAGS=${flags}"
+  "-DCMAKE_CXX_FLAGS=${flags} -std=c++11"
+  "-DCMAKE_EXE_LINKER_FLAGS=-ldl ${flags} -pthread"
+  "-DENABLE_PARMETIS=OFF"
+  "-DENABLE_ZOLTAN=ON"
+  "-DENABLE_PUMI=OFF"
+  "-DSCOREC_PREFIX=/usr/local/pumi/core/"
+  "-DIS_TESTING=ON"
+  "-DMESHES=/lore/diamog/cdash/repos/EnGPar/pumi-meshes/"
+  "-DGRAPHS=/lore/diamog/cdash/repos/EnGPar/EnGPar-graphs/"
+  )
+
+message(STATUS "configure options ${CONFIGURE_NOPUMI}")
+build_subproject(no_pumi "${CONFIGURE_NOPUMI}")
+test_subproject(no_pumi)
+

 message("DONE")


downgrade Project.xml submit fail to warning

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -281,7 +281,7 @@
   ctest_submit(FILES "${CTEST_SCRIPT_DIRECTORY}/Project.xml"
       RETURN_VALUE HAD_ERROR)
   if(HAD_ERROR)
-    message(FATAL_ERROR "Cannot submit SCOREC Project.xml!")
+    message(WARNING "Cannot submit SCOREC Project.xml!")
   endif()
 endif()


Set CMAKE_INSTALL_RPATH to fix libdir for MacOS and gnuinstall

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -258,12 +258,16 @@
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # point to directories outside the build tree to the install RPATH

 # Check whether to add RPATH to the installation (the build tree always has the RPATH enabled)
-if(rpath OR gnuinstall)
+if(rpath)
   set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) # install LIBDIR
   set(CMAKE_SKIP_INSTALL_RPATH FALSE)          # don't skip the full RPATH for the install tree
 elseif(APPLE)
   set(CMAKE_INSTALL_NAME_DIR "@rpath")
-  set(CMAKE_INSTALL_RPATH "@loader_path/../lib")    # self relative LIBDIR
+  if(gnuinstall)
+    set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) # install LIBDIR
+  else()
+    set(CMAKE_INSTALL_RPATH "@loader_path/../lib")    # self relative LIBDIR
+  endif()
   set(CMAKE_SKIP_INSTALL_RPATH FALSE)          # don't skip the full RPATH for the install tree
 else()
   set(CMAKE_SKIP_INSTALL_RPATH TRUE)           # skip the full RPATH for the install tree


Use CMAKE_SYSTEM_PROCESSOR to detect Arm

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -89,9 +89,10 @@
 endif()

 # VC does not support yet Arm processors.
-if (ROOT_ARCHITECTURE STREQUAL "linuxarm64")
-  set(vc_defvalue OFF)
-endif()
+if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+   set(vc_defvalue OFF)
+endif()
+

 ROOT_BUILD_OPTION(afdsmgrd OFF "Dataset manager for PROOF-based analysis facilities")


cpu.cmake: fix compiler flag detection w/3.17.0+

Between 3.17.0 and 3.18.2 check_cxx_compiler_flag() sets a normal
variable at parent scope while check_cxx_source_compiles() continues to
set an internal cache variable, so we unset both to avoid the failure /
success state persisting between checks.

This was fixed in 3.18.3 [1], but regressed shortly afterward [2];
currently seen with 3.20.0 installed via homebrew.

[1] https://gitlab.kitware.com/cmake/cmake/-/issues/21207
[2]
90dead024c CheckCompilerFlag: unified way to check compiler flags per language

Change-Id: I57282f89b07a9cfd85aca7569380f7d115c0b3cf

--- cmake/cpu.cmake
+++ cmake/cpu.cmake
@@ -125,6 +125,12 @@
       list(GET SIMD_DISABLE_FLAGS ${I_SIMD} SIMD_COMPILE_FLAG)
       include(CheckCCompilerFlag)
       if(SIMD_COMPILE_FLAG)
+        # Between 3.17.0 and 3.18.2 check_cxx_compiler_flag() sets a normal
+        # variable at parent scope while check_cxx_source_compiles() continues
+        # to set an internal cache variable, so we unset both to avoid the
+        # failure / success state persisting between checks. See
+        # https://gitlab.kitware.com/cmake/cmake/-/issues/21207.
+        unset(HAS_COMPILE_FLAG)
         unset(HAS_COMPILE_FLAG CACHE)
         check_c_compiler_flag(${SIMD_COMPILE_FLAG} HAS_COMPILE_FLAG)
         if(HAS_COMPILE_FLAG)
@@ -142,6 +148,7 @@
                                   "warning: argument unused during compilation:"
                                   ${COMMON_PATTERNS})
           if(NOT FLAG_${SIMD_COMPILE_FLAG})
+            unset(HAS_COMPILE_FLAG)
             unset(HAS_COMPILE_FLAG CACHE)
           endif()
         endif()


[fixed] BOTG_INCLUDE to allow more than one download


fix hip packaging directory for hip runtime


CMake fix for APR: don't break the build if `apr-1-config --libs` is the empty string.

--- cmake/FindApr.cmake
+++ cmake/FindApr.cmake
@@ -46,4 +46,4 @@
 _apr_invoke(APR_EXTRALIBS "(^| )-l" --libs)

 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(APR DEFAULT_MSG APR_CFLAGS APR_INCLUDES APR_LIBS APR_EXTRALIBS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(APR DEFAULT_MSG APR_CFLAGS APR_INCLUDES APR_LIBS)


CMake fixes for houdini17

CMake fixes for houdini17

Signed-off-by: Nick Avramoussis <4c6772d20f21e1f087b814400acc0120202ec49e@dneg.com>

--- cmake/FindHDK.cmake
+++ cmake/FindHDK.cmake
@@ -217,12 +217,21 @@
 	  SET ( HDK_DEFINITIONS " -DDLLEXPORT= -D_GNU_SOURCE -DLINUX -DAMD64 -m64 -fPIC -DSIZEOF_VOID_P=8 -DSESI_LITTLE_ENDIAN -DENABLE_THREADS -DUSE_PTHREADS -D_REENTRANT -D_FILE_OFFSET_BITS=64 -c -DGCC4 -DGCC3 -Wno-deprecated")
 	  SET ( DEBUG_HDK_DEFINITIONS " -DDLLEXPORT= -D_GNU_SOURCE -DLINUX -DAMD64 -m64 -fPIC -DSIZEOF_VOID_P=8 -DSESI_LITTLE_ENDIAN -DENABLE_THREADS -DUSE_PTHREADS -D_REENTRANT -D_FILE_OFFSET_BITS=64 -c -DGCC4 -DGCC3 -Wno-deprecated -g")
 	ENDIF ()
+
+    # Split each definition and add them separately (otherwise we can get into weird string manipulation issues within CMake)
+    SEPARATE_ARGUMENTS( DEBUG_HDK_DEFINITIONS )
+    SEPARATE_ARGUMENTS( HDK_DEFINITIONS )
+
     # MESSAGE ( "DEBUG_HDK_DEFINITIONS = ${DEBUG_HDK_DEFINITIONS}" )
-	# MESSAGE ( "HDK_DEFINITIONS = ${HDK_DEFINITIONS} ")
+    # MESSAGE ( "HDK_DEFINITIONS = ${HDK_DEFINITIONS} ")
     IF (CMAKE_BUILD_TYPE MATCHES Debug)
-      ADD_DEFINITIONS ( "${DEBUG_HDK_DEFINITIONS}" )
+      FOREACH ( DEFINITION ${DEBUG_HDK_DEFINITIONS} )
+        ADD_DEFINITIONS( ${DEFINITION} )
+      ENDFOREACH ()
     ELSE (CMAKE_BUILD_TYPE MATCHES Debug)
-      ADD_DEFINITIONS ( "${HDK_DEFINITIONS}" )
+      FOREACH ( DEFINITION ${HDK_DEFINITIONS} )
+        ADD_DEFINITIONS( ${DEFINITION} )
+      ENDFOREACH ()
     ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)

   ENDIF (WIN32)


Populate HIP_CLANG_PATH if its not declared

Change-Id: Ibc1f2e9b3389b6cc7a58579cfb293999ad6e9398

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -217,6 +217,18 @@
     set(CMAKE_HIP_CREATE_SHARED_MODULE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <LINK_LIBRARIES> -shared" )
     set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 elseif("${HIP_COMPILER}" STREQUAL "clang")
+    #Set HIP_CLANG_PATH
+    if("x${HIP_CLANG_PATH}" STREQUAL "x")
+        if(DEFINED ENV{HIP_CLANG_PATH})
+            set(HIP_CLANG_PATH $ENV{HIP_CLANG_PATH})
+        elseif(DEFINED ENV{ROCM_PATH})
+            set(HIP_CLANG_PATH "$ENV{ROCM_PATH}/llvm/bin")
+        elseif(DEFINED ENV{HIP_PATH})
+            set(HIP_CLANG_PATH "$ENV{HIP_PATH}/../llvm/bin")
+        else()
+            set(HIP_CLANG_PATH "/opt/rocm/llvm/bin")
+        endif()
+    endif()
     #Number of parallel jobs by default is 1
     if(NOT DEFINED HIP_CLANG_NUM_PARALLEL_JOBS)
       set(HIP_CLANG_NUM_PARALLEL_JOBS 1)