cmake: Try doing always-rebuild differently

--- cmake/post.service.cmake
+++ cmake/post.service.cmake
@@ -352,8 +352,9 @@
 endif()

 # Depending on the output of this command will make it always run. Like magic.
-add_custom_command(OUTPUT fake_news
-      COMMAND cmake -E touch_nocreate alternative_facts)
+add_custom_command(
+    OUTPUT fake_news
+    COMMAND cmake -E echo)

 # add memdisk
 function(add_memdisk DISK)
@@ -363,7 +364,7 @@
     OUTPUT  memdisk.o
     COMMAND python ${INSTALL_LOC}/memdisk/memdisk.py --file memdisk.asm ${DISK_RELPATH}
     COMMAND nasm -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} memdisk.asm -o memdisk.o
-    DEPENDS ${DISK_RELPATH} fake_news
+    DEPENDS ${DISK_RELPATH}
   )
   add_library(memdisk STATIC memdisk.o)
   set_target_properties(memdisk PROPERTIES LINKER_LANGUAGE CXX)
@@ -378,7 +379,7 @@
       COMMAND ${INSTALL_LOC}/bin/diskbuilder -o memdisk.fat ${REL_PATH}
       DEPENDS fake_news
       )
-    add_custom_target(diskbuilder ALL DEPENDS memdisk.fat)
+  add_custom_target(diskbuilder DEPENDS memdisk.fat)
   add_dependencies(service diskbuilder)
   add_memdisk("${CMAKE_BINARY_DIR}/memdisk.fat")
 endfunction()


this always runs

this always runs

--- cmake/stm32/common.cmake
+++ cmake/stm32/common.cmake
@@ -43,11 +43,12 @@
 find_program(CMAKE_CPPFILT NAMES ${STM32_TARGET_TRIPLET}-c++filt PATHS ${TOOLCHAIN_BIN_PATH} NO_DEFAULT_PATH)

 function(stm32_print_size_of_target TARGET)
-    add_custom_command(
-       TARGET ${TARGET}
-       POST_BUILD
-       COMMAND ${CMAKE_SIZE} ${TARGET}${CMAKE_EXECUTABLE_SUFFIX_C}
-       COMMENT "Target Sizes: "
+    # this target is always considered out of date so size will always be displayed on build
+    add_custom_target(
+        ${TARGET}_size
+        ALL COMMAND ${CMAKE_SIZE} ${TARGET}${CMAKE_EXECUTABLE_SUFFIX_C}
+        DEPENDS ${TARGET}${CMAKE_EXECUTABLE_SUFFIX_C}
+        COMMENT "Target sizes:"
     )
 endfunction()


Always add H5_BUILT_AS_DYNAMIC_LIB definition when building shared lib

Some FindHDF5 and hdf5-config versions do not define this automatically.

--- cmake/thirdParties.cmake
+++ cmake/thirdParties.cmake
@@ -28,16 +28,16 @@
     elseif(TARGET hdf5)
         # target from hdf5 1.8 config
         target_link_libraries(HDF5::HDF5 INTERFACE hdf5)
-        if(NOT HDF5_USE_STATIC_LIBRARIES)
-            set_target_properties(HDF5::HDF5 PROPERTIES
-                INTERFACE_COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB"
-            )
-        endif()
     else()
         # results from CMake FindHDF5
         set_target_properties(HDF5::HDF5 PROPERTIES
             INTERFACE_INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIRS}"
             INTERFACE_LINK_LIBRARIES "${HDF5_LIBRARIES}"
+        )
+    endif()
+    if(NOT HDF5_USE_STATIC_LIBRARIES)
+        set_target_properties(HDF5::HDF5 PROPERTIES
+            INTERFACE_COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB"
         )
     endif()
 endif()


Use absolute paths as working directory

Use absolute paths as working directory

Windows can resolve relative paths that contain non-existing folders.
Unix can't. This fix harmonizes the behavior and now supports
non-existing folders in relative paths on all platforms.

--- CMake/MITKDashboardScript.download.cmake
+++ CMake/MITKDashboardScript.download.cmake
@@ -299,6 +299,8 @@
     set(ARG_WORKING_DIRECTORY "${CTEST_SOURCE_DIRECTORY}")
   endif()

+  get_filename_component(ARG_WORKING_DIRECTORY "${ARG_WORKING_DIRECTORY}" ABSOLUTE)
+
   execute_process(
     WORKING_DIRECTORY "${ARG_WORKING_DIRECTORY}"
     RESULT_VARIABLE error_code
@@ -321,6 +323,8 @@
   if(NOT ARG_WORKING_DIRECTORY)
     set(ARG_WORKING_DIRECTORY "${CTEST_SOURCE_DIRECTORY}")
   endif()
+
+  get_filename_component(ARG_WORKING_DIRECTORY "${ARG_WORKING_DIRECTORY}" ABSOLUTE)

   set(args WORKING_DIRECTORY "${ARG_WORKING_DIRECTORY}" "log" "-1")


DOC: add comment to why these steps?

DOC: add comment to why these steps?

--- SuperBuild/CMake/External_zlib.cmake
+++ SuperBuild/CMake/External_zlib.cmake
@@ -39,12 +39,14 @@
   LOG_INSTALL 1
   )

+#patch zlib cmake to disable static build on request
 if(UNIX)
   ExternalProject_Add_Step(ZLIB remove_static
     COMMAND ${CMAKE_COMMAND} -E remove ${SB_INSTALL_PREFIX}/lib/libz.a
     DEPENDEES install)
 endif()

+#check who uses zdll.lib and remove this hack
 if(MSVC)
   ExternalProject_Add_Step(ZLIB msvc_copy_hell
     COMMAND ${CMAKE_COMMAND} -E copy ${ZLIB_SB_BUILD_DIR}/zlib.lib ${SB_INSTALL_PREFIX}/lib/zdll.lib


ENH: parse versions in SystemCheckup

ENH: parse versions in SystemCheckup

--- SuperBuild/CMake/SystemCheckup.cmake
+++ SuperBuild/CMake/SystemCheckup.cmake
@@ -7,89 +7,149 @@
 # contains the CMAKE_INSTALL_PREFIX (-> superbuild libs)
 list(REMOVE_ITEM CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})

-macro(SB_BASIC_LIBRARY_CHECKUP var)
+# macro to encapsulate a find_package(XXX QUIET)
+# output variables are :
+#   _SB_CHECKUP_XXX_FOUND           : lib is found ?
+#   _SB_CHECKUP_XXX_VERSION         : version found
+#   _SB_CHECKUP_XXX_NAME            : name found
+macro(SB_CHECKUP_FIND_PACKAGE var)
   find_package(${var} QUIET)
   string(TOUPPER ${var} _uppervar)
-  unset(_SB_CHECKUP_RESULT_VERSION)
-  set(_find_var_result 0)
-  set(_var_name "")
+  set(_SB_CHECKUP_${_uppervar}_VERSION NOTFOUND)
+  set(_SB_CHECKUP_${_uppervar}_FOUND FALSE)
+  set(_SB_CHECKUP_${_uppervar}_NAME NOTFOUND)
   if(${var}_FOUND)
-    set(_find_var_result 1)
-    set(_var_name ${var})
+    set(_SB_CHECKUP_${_uppervar}_FOUND TRUE)
+    set(_SB_CHECKUP_${_uppervar}_NAME ${var})
   elseif(${_uppervar}_FOUND)
-    set(_find_var_result 1)
-    set(_var_name ${_uppervar})
+    set(_SB_CHECKUP_${_uppervar}_FOUND TRUE)
+    set(_SB_CHECKUP_${_uppervar}_NAME ${_uppervar})
   endif()

-  if(_find_var_result)
+  if(_SB_CHECKUP_${_uppervar}_FOUND)
+    set(_var_name ${_SB_CHECKUP_${_uppervar}_NAME})
     message(STATUS "|------------------------------------------------")
-    message(STATUS "|${var} : found")
+    message(STATUS "|${var} found")
     if(DEFINED ${_var_name}_VERSION)
-      message(STATUS "|${var} : version = ${${_var_name}_VERSION}")
-      set(_SB_CHECKUP_RESULT_VERSION ${${_var_name}_VERSION})
+      message(STATUS "|  version = ${${_var_name}_VERSION}")
+      set(_SB_CHECKUP_${_uppervar}_VERSION ${${_var_name}_VERSION})
     elseif(DEFINED ${_var_name}_VERSION_STRING)
-      message(STATUS "|${var} : version = ${${_var_name}_VERSION_STRING}")
-      set(_SB_CHECKUP_RESULT_VERSION ${${_var_name}_VERSION_STRING})
+      message(STATUS "|  version = ${${_var_name}_VERSION_STRING}")
+      set(_SB_CHECKUP_${_uppervar}_VERSION ${${_var_name}_VERSION_STRING})
     elseif(DEFINED ${_var_name}_VERSION_MAJOR AND DEFINED ${_var_name}_VERSION_MINOR AND DEFINED ${_var_name}_VERSION_PATCH)
-      message(STATUS "|${var} : version = ${${_var_name}_VERSION_MAJOR}.${${_var_name}_VERSION_MINOR}.${${_var_name}_VERSION_PATCH}")
-      set(_SB_CHECKUP_RESULT_VERSION "${${_var_name}_VERSION_MAJOR}.${${_var_name}_VERSION_MINOR}.${${_var_name}_VERSION_PATCH}")
+      message(STATUS "|  version = ${${_var_name}_VERSION_MAJOR}.${${_var_name}_VERSION_MINOR}.${${_var_name}_VERSION_PATCH}")
+      set(_SB_CHECKUP_${_uppervar}_VERSION "${${_var_name}_VERSION_MAJOR}.${${_var_name}_VERSION_MINOR}.${${_var_name}_VERSION_PATCH}")
     endif()
-    if(DEFINED ${_var_name}_DIR)
-      message(STATUS "|${var} : directory = ${${_var_name}_DIR}")
-    endif()
-    if(DEFINED ${_var_name}_LIBRARIES)
-      message(STATUS "|${var} : libraries = ${${_var_name}_LIBRARIES}")
-    endif()
-    if(DEFINED ${_var_name}_INCLUDE_DIRS)
-      message(STATUS "|${var} : includes = ${${_var_name}_INCLUDE_DIRS}")
-    endif()
+
   endif()
-endmacro(SB_BASIC_LIBRARY_CHECKUP)
+endmacro(SB_CHECKUP_FIND_PACKAGE)
+
+macro(SB_CHECKUP_SPLIT_VERSION var)
+  string(TOUPPER ${var} _upperlib)
+  if(_SB_CHECKUP_${_upperlib}_VERSION)
+    string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1"
+           _SB_CHECKUP_${_upperlib}_VERSION_MAJOR
+           ${_SB_CHECKUP_${_upperlib}_VERSION})
+    string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2"
+           _SB_CHECKUP_${_upperlib}_VERSION_MINOR
+           ${_SB_CHECKUP_${_upperlib}_VERSION})
+    string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3"
+           _SB_CHECKUP_${_upperlib}_VERSION_PATCH
+           ${_SB_CHECKUP_${_upperlib}_VERSION})
+    math(EXPR _SB_CHECKUP_${_upperlib}_VERSION_NUMBER
+      "((${_SB_CHECKUP_${_upperlib}_VERSION_MAJOR})*100+${_SB_CHECKUP_${_upperlib}_VERSION_MINOR})*100+${_SB_CHECKUP_${_upperlib}_VERSION_PATCH}")
+  endif()
+endmacro(SB_CHECKUP_SPLIT_VERSION)
+
+macro(SB_CHECKUP_FIND_VERSIONS lib header major_name minor_name patch_name)
+  string(TOUPPER ${lib} _upperlib)
+  if(_SB_CHECKUP_${_upperlib}_FOUND AND EXISTS ${header})
+    unset(_header_content)
+    set(_major_regex ".*# *define +${major_name} +([0-9]+).*")
+    set(_minor_regex ".*# *define +${minor_name} +([0-9]+).*")
+    set(_patch_regex ".*# *define +${patch_name} +([0-9]+).*")
+    file(READ ${header} _header_content)
+    string(REGEX REPLACE ${_major_regex} "\\1"
+           _SB_CHECKUP_${_upperlib}_VERSION_MAJOR
+           ${_header_content})
+    string(REGEX REPLACE ${_minor_regex} "\\1"
+           _SB_CHECKUP_${_upperlib}_VERSION_MINOR
+           ${_header_content})
+    string(REGEX REPLACE ${_patch_regex} "\\1"
+           _SB_CHECKUP_${_upperlib}_VERSION_PATCH
+           ${_header_content})
+    math(EXPR _SB_CHECKUP_${_upperlib}_VERSION_NUMBER
+      "((${_SB_CHECKUP_${_upperlib}_VERSION_MAJOR})*100+${_SB_CHECKUP_${_upperlib}_VERSION_MINOR})*100+${_SB_CHECKUP_${_upperlib}_VERSION_PATCH}")
+    set(_SB_CHECKUP_${_upperlib}_VERSION "${_SB_CHECKUP_${_upperlib}_VERSION_MAJOR}.${_SB_CHECKUP_${_upperlib}_VERSION_MINOR}.${_SB_CHECKUP_${_upperlib}_VERSION_PATCH}")
+    message(STATUS "|  version = ${_SB_CHECKUP_${_upperlib}_VERSION}")
+  endif()
+endmacro(SB_CHECKUP_FIND_VERSIONS)

 # Boost
-SB_BASIC_LIBRARY_CHECKUP(Boost)
+SB_CHECKUP_FIND_PACKAGE(Boost)
+if(_SB_CHECKUP_BOOST_VERSION)
+  set(_SB_CHECKUP_BOOST_VERSION_NUMBER ${_SB_CHECKUP_BOOST_VERSION})
+endif()

 # Curl
-SB_BASIC_LIBRARY_CHECKUP(CURL)
+SB_CHECKUP_FIND_PACKAGE(CURL)
+SB_CHECKUP_SPLIT_VERSION(CURL)

 # GDAL
-SB_BASIC_LIBRARY_CHECKUP(GDAL)
+SB_CHECKUP_FIND_PACKAGE(GDAL)
+SB_CHECKUP_FIND_VERSIONS(GDAL
+                         ${GDAL_INCLUDE_DIR}/gdal_version.h
+                         GDAL_VERSION_MAJOR
+                         GDAL_VERSION_MINOR
+                         GDAL_VERSION_REV)

 # GeoTIFF
-SB_BASIC_LIBRARY_CHECKUP(GeoTIFF)
+SB_CHECKUP_FIND_PACKAGE(GeoTIFF)

 # ITK
-SB_BASIC_LIBRARY_CHECKUP(ITK)
+SB_CHECKUP_FIND_PACKAGE(ITK)

 # libkml
-SB_BASIC_LIBRARY_CHECKUP(LibKML)
+SB_CHECKUP_FIND_PACKAGE(LibKML)
+SB_CHECKUP_FIND_VERSIONS(LibKML
+                         ${LIBKML_INCLUDE_DIR}/kml/base/version.h
+                         LIBKML_MAJOR_VERSION
+                         LIBKML_MINOR_VERSION
+                         LIBKML_MICRO_VERSION)

 # LibSVM
-SB_BASIC_LIBRARY_CHECKUP(LibSVM)
+SB_CHECKUP_FIND_PACKAGE(LibSVM)
+SB_CHECKUP_SPLIT_VERSION(LibSVM)

 # muParser
-SB_BASIC_LIBRARY_CHECKUP(MuParser)
+SB_CHECKUP_FIND_PACKAGE(MuParser)

 # muParserX
-SB_BASIC_LIBRARY_CHECKUP(MuParserX)
+SB_CHECKUP_FIND_PACKAGE(MuParserX)

 # OpenCV
-SB_BASIC_LIBRARY_CHECKUP(OpenCV)
+SB_CHECKUP_FIND_PACKAGE(OpenCV)
+SB_CHECKUP_SPLIT_VERSION(OpenCV)

 # OpenJPEG
-SB_BASIC_LIBRARY_CHECKUP(OpenJPEG)
+SB_CHECKUP_FIND_PACKAGE(OpenJPEG)

 # OpenThreads
-SB_BASIC_LIBRARY_CHECKUP(OpenThreads)
+SB_CHECKUP_FIND_PACKAGE(OpenThreads)

 # OSSIM
-SB_BASIC_LIBRARY_CHECKUP(Ossim)
+SB_CHECKUP_FIND_PACKAGE(Ossim)

 # Qt4
-SB_BASIC_LIBRARY_CHECKUP(Qt4)
+SB_CHECKUP_FIND_PACKAGE(Qt4)
+if(_SB_CHECKUP_QT4_FOUND)
+  set(_SB_CHECKUP_QT4_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
+  message(STATUS "|  version = ${_SB_CHECKUP_QT4_VERSION}")
+  SB_CHECKUP_SPLIT_VERSION(Qt4)
+endif()

 # TinyXML
-SB_BASIC_LIBRARY_CHECKUP(TinyXML)
+SB_CHECKUP_FIND_PACKAGE(TinyXML)

 message(STATUS "|------------------------------------------------")
 # restore real install prefix


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   19)
+SET(KWSYS_DATE_STAMP_DAY   20)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


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 01)

 # 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
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

 # 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 01)

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


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   10)
+SET(KWSYS_DATE_STAMP_DAY   11)


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   27)
+SET(KWSYS_DATE_STAMP_DAY   28)


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 07)

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


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   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 06)

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


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)


Set version number to 0.7.1

Set version number to 0.7.1

--- cmake/Config.cmake
+++ cmake/Config.cmake
@@ -2,7 +2,7 @@
 # setup version numbers
 set(VERSION_MAJOR 0)
 set(VERSION_MINOR 7)
-set(VERSION_PATCH 0)
+set(VERSION_PATCH 1)
 set(VERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 message("Project version: ${VERSION_STR}")


Travis-CI: trying to understand why the tests don't pass on OS X while they do locally.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -88,9 +88,9 @@

     # Keep track of some information about Qt

-    SET(QT_BINARY_DIR ${_qt5Widgets_install_prefix}/bin)
-    SET(QT_LIBRARY_DIR ${_qt5Widgets_install_prefix}/lib)
-    SET(QT_PLUGINS_DIR ${_qt5Widgets_install_prefix}/plugins)
+    GET_FILENAME_COMPONENT(QT_BINARY_DIR ${_qt5Widgets_install_prefix}/bin REALPATH)
+    GET_FILENAME_COMPONENT(QT_LIBRARY_DIR ${_qt5Widgets_install_prefix}/lib REALPATH)
+    GET_FILENAME_COMPONENT(QT_PLUGINS_DIR ${_qt5Widgets_install_prefix}/plugins REALPATH)
     SET(QT_VERSION_MAJOR ${Qt5Widgets_VERSION_MAJOR})
     SET(QT_VERSION_MINOR ${Qt5Widgets_VERSION_MINOR})
     SET(QT_VERSION_PATCH ${Qt5Widgets_VERSION_PATCH})
@@ -984,10 +984,6 @@
     FOREACH(DEPENDENCY ${ARGN})
         SET(DEPENDENCY_FILENAME ${DEPENDENCY}.framework/Versions/${QT_VERSION_MAJOR}/${DEPENDENCY})

-MESSAGE("=========")
-MESSAGE("REPLACING: ${QT_LIBRARY_DIR}/${DEPENDENCY_FILENAME}")
-MESSAGE("WITH:      @rpath/${DEPENDENCY_FILENAME}")
-MESSAGE("=========")
         ADD_CUSTOM_COMMAND(TARGET ${PROJECT_TARGET} POST_BUILD
                            COMMAND install_name_tool -change ${QT_LIBRARY_DIR}/${DEPENDENCY_FILENAME}
                                                              @rpath/${DEPENDENCY_FILENAME}


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -1197,7 +1197,7 @@
         ENDIF()
     ENDIF()

-    # Retrieve the file from the OpenCOR website, if needed
+    # Retrieve the file from the given location, if needed
     # Note: we would normally provide the SHA-1 value to the FILE(DOWNLOAD)
     #       call, but this would create an empty file to start with and if the
     #       file cannot be downloaded for some reason or another, then we would


cmake: bump cotire to version 1.8.0

cmake: bump cotire to version 1.8.0

--- cmake/cotire.cmake
+++ cmake/cotire.cmake
@@ -3,7 +3,7 @@
 # See the cotire manual for usage hints.
 #
 #=============================================================================
-# Copyright 2012-2016 Sascha Kratky
+# Copyright 2012-2018 Sascha Kratky
 #
 # Permission is hereby granted, free of charge, to any person
 # obtaining a copy of this software and associated documentation
@@ -43,7 +43,7 @@
 endif()

 set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.7.9")
+set (COTIRE_CMAKE_MODULE_VERSION "1.8.0")

 # activate select policies
 if (POLICY CMP0025)
@@ -104,6 +104,11 @@
 if (POLICY CMP0054)
 	# only interpret if() arguments as variables or keywords when unquoted
 	cmake_policy(SET CMP0054 NEW)
+endif()
+
+if (POLICY CMP0055)
+	# strict checking for break() command
+	cmake_policy(SET CMP0055 NEW)
 endif()

 include(CMakeParseArguments)
@@ -234,7 +239,13 @@
 				# add to excluded sources, if file has custom compile flags
 				list (APPEND _excludedSourceFiles "${_sourceFile}")
 			else()
-				list (APPEND _sourceFiles "${_sourceFile}")
+				get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS)
+				if (_sourceCompileOptions)
+					# add to excluded sources, if file has list of custom compile options
+					list (APPEND _excludedSourceFiles "${_sourceFile}")
+				else()
+					list (APPEND _sourceFiles "${_sourceFile}")
+				endif()
 			endif()
 		endif()
 	endforeach()
@@ -293,7 +304,7 @@
 	set (${_valuesVar} ${_values} PARENT_SCOPE)
 endfunction()

-function (cotire_resolve_config_properites _configurations _propertiesVar)
+function (cotire_resolve_config_properties _configurations _propertiesVar)
 	set (_properties "")
 	foreach (_property ${ARGN})
 		if ("${_property}" MATCHES "<CONFIG>")
@@ -309,8 +320,8 @@
 	set (${_propertiesVar} ${_properties} PARENT_SCOPE)
 endfunction()

-function (cotire_copy_set_properites _configurations _type _source _target)
-	cotire_resolve_config_properites("${_configurations}" _properties ${ARGN})
+function (cotire_copy_set_properties _configurations _type _source _target)
+	cotire_resolve_config_properties("${_configurations}" _properties ${ARGN})
 	foreach (_property ${_properties})
 		get_property(_isSet ${_type} ${_source} PROPERTY ${_property} SET)
 		if (_isSet)
@@ -320,13 +331,18 @@
 	endforeach()
 endfunction()

-function (cotire_get_target_usage_requirements _target _targetRequirementsVar)
+function (cotire_get_target_usage_requirements _target _config _targetRequirementsVar)
 	set (_targetRequirements "")
 	get_target_property(_librariesToProcess ${_target} LINK_LIBRARIES)
 	while (_librariesToProcess)
 		# remove from head
 		list (GET _librariesToProcess 0 _library)
 		list (REMOVE_AT _librariesToProcess 0)
+		if (_library MATCHES "^\\$<\\$<CONFIG:${_config}>:([A-Za-z0-9_:-]+)>$")
+			set (_library "${CMAKE_MATCH_1}")
+		elseif (_config STREQUAL "None" AND _library MATCHES "^\\$<\\$<CONFIG:>:([A-Za-z0-9_:-]+)>$")
+			set (_library "${CMAKE_MATCH_1}")
+		endif()
 		if (TARGET ${_library})
 			list (FIND _targetRequirements ${_library} _index)
 			if (_index LESS 0)
@@ -441,7 +457,7 @@
 	# interface compile options from linked library targets
 	if (_target)
 		set (_linkedTargets "")
-		cotire_get_target_usage_requirements(${_target} _linkedTargets)
+		cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
 		foreach (_linkedTarget ${_linkedTargets})
 			get_target_property(_targetOptions ${_linkedTarget} INTERFACE_COMPILE_OPTIONS)
 			if (_targetOptions)
@@ -573,7 +589,7 @@
 	# interface include directories from linked library targets
 	if (_target)
 		set (_linkedTargets "")
-		cotire_get_target_usage_requirements(${_target} _linkedTargets)
+		cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
 		foreach (_linkedTarget ${_linkedTargets})
 			get_target_property(_linkedTargetType ${_linkedTarget} TYPE)
 			if (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE AND NOT CMAKE_VERSION VERSION_LESS "3.4.0" AND
@@ -627,7 +643,7 @@
 	if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
 		list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
 	endif()
-	if (WIN32)
+	if (WIN32 AND NOT MINGW)
 		# convert Windows paths in include directories to CMake paths
 		if (_includeDirs)
 			set (_paths "")
@@ -703,7 +719,7 @@
 	endif()
 	# interface compile definitions from linked library targets
 	set (_linkedTargets "")
-	cotire_get_target_usage_requirements(${_target} _linkedTargets)
+	cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
 	foreach (_linkedTarget ${_linkedTargets})
 		get_target_property(_definitions ${_linkedTarget} INTERFACE_COMPILE_DEFINITIONS)
 		if (_definitions)
@@ -711,7 +727,7 @@
 		endif()
 	endforeach()
 	# parse additional compile definitions from target compile flags
-	# and don't look at directory compile definitions, which we already handled
+	# and do not look at directory compile definitions, which we already handled
 	set (_targetFlags "")
 	cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
 	cotire_filter_compile_flags("${_language}" "D" _definitions _ignore ${_targetFlags})
@@ -859,6 +875,9 @@
 		list (APPEND ${_cmdVar} "--warn-uninitialized")
 	endif()
 	list (APPEND ${_cmdVar} "-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>")
+	if (XCODE)
+		list (APPEND ${_cmdVar} "-DXCODE:BOOL=TRUE")
+	endif()
 	if (COTIRE_VERBOSE)
 		list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=ON")
 	elseif("${CMAKE_GENERATOR}" MATCHES "Makefiles")
@@ -875,6 +894,9 @@
 	endif()
 	if (NOT _compilerArg1)
 		set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
+	endif()
+	if (WIN32)
+		file (TO_NATIVE_PATH "${_compilerExe}" _compilerExe)
 	endif()
 	string (STRIP "${_compilerArg1}" _compilerArg1)
 	if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
@@ -902,16 +924,16 @@
 		foreach (_include ${_includeDirs})
 			if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
 				file (TO_NATIVE_PATH "${_include}" _include)
-				list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+				list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
 			else()
 				set (_index -1)
 				if ("${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" MATCHES ".+")
 					list (FIND ${_systemIncludesVar} "${_include}" _index)
 				endif()
 				if (_index GREATER -1)
-					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${_include}")
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
 				else()
-					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
 				endif()
 			endif()
 		endforeach()
@@ -1070,12 +1092,11 @@

 macro (cotire_parse_line _line _headerFileVar _headerDepthVar)
 	if (MSVC)
-		# cl.exe /showIncludes output looks different depending on the language pack used, e.g.:
+		# cl.exe /showIncludes produces different output, depending on the language pack used, e.g.:
 		# English: "Note: including file:   C:\directory\file"
 		# German: "Hinweis: Einlesen der Datei:   C:\directory\file"
 		# We use a very general regular expression, relying on the presence of the : characters
 		if (_line MATCHES "( +)([a-zA-Z]:[^:]+)$")
-			# Visual Studio compiler output
 			string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
 			get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" ABSOLUTE)
 		else()
@@ -1233,11 +1254,19 @@
 		set (${_includesVar} "" PARENT_SCOPE)
 		return()
 	endif()
-	list (APPEND _cmd ${_existingSourceFiles})
+	# add source files to be scanned
+	if (WIN32)
+		foreach (_sourceFile ${_existingSourceFiles})
+			file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative)
+			list (APPEND _cmd "${_sourceFileNative}")
+		endforeach()
+	else()
+		list (APPEND _cmd ${_existingSourceFiles})
+	endif()
 	if (COTIRE_VERBOSE)
 		message (STATUS "execute_process: ${_cmd}")
 	endif()
-	if (_option_COMPILER_ID MATCHES "MSVC")
+	if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
 		# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
 		unset (ENV{VS_UNICODE_OUTPUT})
 	endif()
@@ -1473,11 +1502,16 @@
 	if (_unparsedLines)
 		if (COTIRE_VERBOSE OR _scanResult OR NOT _selectedHeaders)
 			list (LENGTH _unparsedLines _skippedLineCount)
-			message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesFile}")
+			if (WIN32)
+				file (TO_NATIVE_PATH "${_unparsedLinesFile}" _unparsedLinesLogPath)
+			else()
+				set (_unparsedLinesLogPath "${_unparsedLinesFile}")
+			endif()
+			message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesLogPath}")
 		endif()
 		string (REPLACE ";" "\n" _unparsedLines "${_unparsedLines}")
 	endif()
-	file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}")
+	file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}\n")
 endfunction()

 function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flagsVar)
@@ -1507,7 +1541,7 @@
 			# append to list
 			list (APPEND _flags -H -E)
 			if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
-				list (APPEND _flags "-fdirectives-only")
+				list (APPEND _flags -fdirectives-only)
 			endif()
 		else()
 			# return as a flag string
@@ -1517,16 +1551,36 @@
 			endif()
 		endif()
 	elseif (_compilerID MATCHES "Clang")
-		# Clang options used
-		# -H print the name of each header file used
-		# -E invoke preprocessor
-		# -fno-color-diagnostics don't prints diagnostics in color
-		if (_flags)
-			# append to list
-			list (APPEND _flags -H -E -fno-color-diagnostics)
-		else()
-			# return as a flag string
-			set (_flags "-H -E -fno-color-diagnostics")
+		if (UNIX)
+			# Clang options used
+			# -H print the name of each header file used
+			# -E invoke preprocessor
+			# -fno-color-diagnostics do not print diagnostics in color
+			# -Eonly just run preprocessor, no output
+			if (_flags)
+				# append to list
+				list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
+			else()
+				# return as a flag string
+				set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly")
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /TC treat all files named on the command line as C source files
+			# /TP treat all files named on the command line as C++ source files
+			# /EP preprocess to stdout without #line directives
+			# -H print the name of each header file used
+			# -fno-color-diagnostics do not print diagnostics in color
+			# -Eonly just run preprocessor, no output
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags "${_sourceFileType${_language}}" /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly)
+			else()
+				# return as a flag string
+				set (_flags "${_sourceFileType${_language}} /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly")
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1600,8 +1654,8 @@
 				set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
 			endif()
 		endif()
-	elseif (_compilerID MATCHES "GNU|Clang")
-		# GCC / Clang options used
+	elseif (_compilerID MATCHES "GNU")
+		# GCC options used
 		# -x specify the source language
 		# -c compile but do not link
 		# -o place output in file
@@ -1611,10 +1665,51 @@
 		set (_xLanguage_CXX "c++-header")
 		if (_flags)
 			# append to list
-			list (APPEND _flags "-x" "${_xLanguage_${_language}}" "-c" "${_prefixFile}" -o "${_pchFile}")
+			list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
 		else()
 			# return as a flag string
 			set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+		endif()
+	elseif (_compilerID MATCHES "Clang")
+		if (UNIX)
+			# Clang options used
+			# -x specify the source language
+			# -c compile but do not link
+			# -o place output in file
+			# -fno-pch-timestamp disable inclusion of timestamp in precompiled headers (clang 4.0.0+)
+			set (_xLanguage_C "c-header")
+			set (_xLanguage_CXX "c++-header")
+			if (_flags)
+				# append to list
+				list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
+				if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
+					list (APPEND _flags -Xclang -fno-pch-timestamp)
+				endif()
+			else()
+				# return as a flag string
+				set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+				if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
+					set (_flags "${_flags} -Xclang -fno-pch-timestamp")
+				endif()
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /Yc creates a precompiled header file
+			# /Fp specifies precompiled header binary file name
+			# /FI forces inclusion of file
+			# /Zs syntax check only
+			# /TC treat all files named on the command line as C source files
+			# /TP treat all files named on the command line as C++ source files
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags "${_sourceFileType${_language}}"
+						"/Yc${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}" /Zs "${_hostFile}")
+			else()
+				# return as a flag string
+				set (_flags "/Yc\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1657,20 +1752,28 @@
 			get_filename_component(_pchName "${_pchFile}" NAME)
 			set (_xLanguage_C "c-header")
 			set (_xLanguage_CXX "c++-header")
+			set (_pchSuppressMessages FALSE)
+			if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
+				set(_pchSuppressMessages TRUE)
+			endif()
 			if (_flags)
 				# append to list
 				if ("${_language}" STREQUAL "CXX")
 					list (APPEND _flags -Kc++)
 				endif()
-				list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}")
+				list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-create "${_pchName}" -fsyntax-only "${_hostFile}")
 				if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
-					list (APPEND _flags "-Wpch-messages")
+					if (NOT _pchSuppressMessages)
+						list (APPEND _flags -Wpch-messages)
+					endif()
 				endif()
 			else()
 				# return as a flag string
 				set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"")
 				if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
-					set (_flags "${_flags} -Wpch-messages")
+					if (NOT _pchSuppressMessages)
+						set (_flags "${_flags} -Wpch-messages")
+					endif()
 				endif()
 			endif()
 		endif()
@@ -1721,23 +1824,46 @@
 		# note: ccache requires the -include flag to be used in order to process precompiled header correctly
 		if (_flags)
 			# append to list
-			list (APPEND _flags "-Winvalid-pch" "-include" "${_prefixFile}")
+			list (APPEND _flags -Winvalid-pch -include "${_prefixFile}")
 		else()
 			# return as a flag string
 			set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
 		endif()
 	elseif (_compilerID MATCHES "Clang")
-		# Clang options used
-		# -include process include file as the first line of the primary source file
-		# -include-pch include precompiled header file
-		# -Qunused-arguments don't emit warning for unused driver arguments
-		# note: ccache requires the -include flag to be used in order to process precompiled header correctly
-		if (_flags)
-			# append to list
-			list (APPEND _flags "-Qunused-arguments" "-include" "${_prefixFile}")
-		else()
-			# return as a flag string
-			set (_flags "-Qunused-arguments -include \"${_prefixFile}\"")
+		if (UNIX)
+			# Clang options used
+			# -include process include file as the first line of the primary source file
+			# note: ccache requires the -include flag to be used in order to process precompiled header correctly
+			if (_flags)
+				# append to list
+				list (APPEND _flags -include "${_prefixFile}")
+			else()
+				# return as a flag string
+				set (_flags "-include \"${_prefixFile}\"")
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /Yu uses a precompiled header file during build
+			# /Fp specifies precompiled header binary file name
+			# /FI forces inclusion of file
+			if (_pchFile)
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/Yu${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}")
+				else()
+					# return as a flag string
+					set (_flags "/Yu\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+				endif()
+			else()
+				# no precompiled header, force inclusion of prefix header
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/FI${_prefixFile}")
+				else()
+					# return as a flag string
+					set (_flags "/FI\"${_prefixFile}\"")
+				endif()
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1781,24 +1907,32 @@
 			if (_pchFile)
 				get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
 				get_filename_component(_pchName "${_pchFile}" NAME)
+				set (_pchSuppressMessages FALSE)
+				if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
+					set(_pchSuppressMessages TRUE)
+				endif()
 				if (_flags)
 					# append to list
-					list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}")
+					list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-use "${_pchName}")
 					if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
-						list (APPEND _flags "-Wpch-messages")
+						if (NOT _pchSuppressMessages)
+							list (APPEND _flags -Wpch-messages)
+						endif()
 					endif()
 				else()
 					# return as a flag string
 					set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"")
 					if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
-						set (_flags "${_flags} -Wpch-messages")
+						if (NOT _pchSuppressMessages)
+							set (_flags "${_flags} -Wpch-messages")
+						endif()
 					endif()
 				endif()
 			else()
 				# no precompiled header, force inclusion of prefix header
 				if (_flags)
 					# append to list
-					list (APPEND _flags "-include" "${_prefixFile}")
+					list (APPEND _flags -include "${_prefixFile}")
 				else()
 					# return as a flag string
 					set (_flags "-include \"${_prefixFile}\"")
@@ -1836,9 +1970,17 @@
 	if (COTIRE_VERBOSE)
 		message (STATUS "execute_process: ${_cmd}")
 	endif()
-	if (_option_COMPILER_ID MATCHES "MSVC")
+	if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
 		# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
 		unset (ENV{VS_UNICODE_OUTPUT})
+	elseif (_option_COMPILER_ID MATCHES "Clang" AND _option_COMPILER_VERSION VERSION_LESS "4.0.0")
+		if (_option_COMPILER_LAUNCHER MATCHES "ccache" OR
+			_option_COMPILER_EXECUTABLE MATCHES "ccache")
+			# Newer versions of Clang embed a compilation timestamp into the precompiled header binary,
+			# which results in "file has been modified since the precompiled header was built" errors if ccache is used.
+			# We work around the problem by disabling ccache upon pre-compiling the prefix header.
+			set (ENV{CCACHE_DISABLE} "true")
+		endif()
 	endif()
 	execute_process(
 		COMMAND ${_cmd}
@@ -1853,7 +1995,7 @@
 	set (_unsupportedCompiler
 		"Precompiled headers not supported for ${_language} compiler ${CMAKE_${_language}_COMPILER_ID}")
 	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
-		# supported since Visual Studio C++ 6.0
+		# PCH supported since Visual Studio C++ 6.0
 		# and CMake does not support an earlier version
 		set (${_msgVar} "" PARENT_SCOPE)
 	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
@@ -1864,8 +2006,16 @@
 			set (${_msgVar} "" PARENT_SCOPE)
 		endif()
 	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
-		# all Clang versions have PCH support
-		set (${_msgVar} "" PARENT_SCOPE)
+		if (UNIX)
+			# all Unix Clang versions have PCH support
+			set (${_msgVar} "" PARENT_SCOPE)
+		elseif (WIN32)
+			# only clang-cl is supported under Windows
+			get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE)
+			if (NOT _compilerName MATCHES "cl$")
+				set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE)
+			endif()
+		endif()
 	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
 		# Intel PCH support requires version >= 8.0.0
 		if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
@@ -1876,19 +2026,25 @@
 	else()
 		set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
 	endif()
+	# check if ccache is used as a compiler launcher
 	get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
-	if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
+	get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" REALPATH)
+	if (_realCompilerExe MATCHES "ccache" OR _launcher MATCHES "ccache")
+		# verify that ccache configuration is compatible with precompiled headers
+		# always check environment variable CCACHE_SLOPPINESS, because earlier versions of ccache
+		# do not report the "sloppiness" setting correctly upon printing ccache configuration
 		if (DEFINED ENV{CCACHE_SLOPPINESS})
-			if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
+			if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR
+				NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
 				set (${_msgVar}
 					"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
 					PARENT_SCOPE)
 			endif()
 		else()
-			if (_launcher MATCHES "ccache")
-				get_filename_component(_ccacheExe "${_launcher}" REALPATH)
+			if (_realCompilerExe MATCHES "ccache")
+				set (_ccacheExe "${_realCompilerExe}")
 			else()
-				get_filename_component(_ccacheExe "${CMAKE_${_language}_COMPILER}" REALPATH)
+				set (_ccacheExe "${_launcher}")
 			endif()
 			execute_process(
 				COMMAND "${_ccacheExe}" "--print-config"
@@ -1896,9 +2052,10 @@
 				RESULT_VARIABLE _result
 				OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
 				ERROR_QUIET)
-			if (_result OR NOT
-				_ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR NOT
-				_ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
+			if (_result)
+				set (${_msgVar} "ccache configuration cannot be determined." PARENT_SCOPE)
+			elseif (NOT _ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR
+				NOT _ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
 				set (${_msgVar}
 					"ccache requires configuration setting \"sloppiness\" to be set to \"pch_defines,time_macros\"."
 					PARENT_SCOPE)
@@ -2191,7 +2348,7 @@
 		XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
 		CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
 		CMAKE_${_language}_COMPILER_LAUNCHER CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
-		CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_${_language}_SEP
+		CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_SEP_${_language}
 		CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
 		CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
 		CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
@@ -2224,8 +2381,9 @@

 function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
 	set (_sourceFiles ${ARGN})
-	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-		# for Visual Studio and Intel, we attach the precompiled header compilation to the host file
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+		# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
 		# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
 		if (_sourceFiles)
 			set (_flags "")
@@ -2270,8 +2428,9 @@
 endfunction()

 function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
-	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-		# for Visual Studio and Intel, we include the precompiled header in all but the host file
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+		# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
 		# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
 		set (_sourceFiles ${ARGN})
 		list (LENGTH _sourceFiles _numberOfSourceFiles)
@@ -2417,9 +2576,10 @@
 		# if this is a single-language target without any excluded files
 		if (_wholeTarget)
 			set (_language "${_languages}")
-			# for Visual Studio and Intel, precompiled header inclusion is always done on the source file level
+			# for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
 			# see cotire_setup_pch_file_inclusion
-			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
+				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
 				get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
 				if (_prefixFile)
 					get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
@@ -2454,7 +2614,8 @@
 			set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_objectDependsPaths})
 		endif()
 		if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-			# unity file compilation results in potentially huge object file, thus use /bigobj by default unter MSVC and Windows Intel
+			# unity file compilation results in potentially huge object file,
+			# thus use /bigobj by default unter cl.exe and Windows Intel
 			set_property (SOURCE "${_unityFile}" APPEND_STRING PROPERTY COMPILE_FLAGS "/bigobj")
 		endif()
 		cotire_set_cmd_to_prologue(_unityCmd)
@@ -2659,6 +2820,9 @@
 			set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build ${_excludedStr}.")
 		else()
 			set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build.")
+		endif()
+		if (_disableMsg)
+			set (_targetMsg "${_targetMsg} ${_disableMsg}")
 		endif()
 	else()
 		if (_excludedStr)
@@ -2749,6 +2913,20 @@
 			set (_targetUsePCH FALSE)
 		endif()
 	endif()
+	if (_targetAddSCU)
+		# disable unity builds if automatic Qt processing is used
+		get_target_property(_targetAutoMoc ${_target} AUTOMOC)
+		get_target_property(_targetAutoUic ${_target} AUTOUIC)
+		get_target_property(_targetAutoRcc ${_target} AUTORCC)
+		if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
+			if (_disableMsg)
+				set (_disableMsg "${_disableMsg} Target uses automatic CMake Qt processing.")
+			else()
+				set (_disableMsg "Target uses automatic CMake Qt processing.")
+			endif()
+			set (_targetAddSCU FALSE)
+		endif()
+	endif()
 	set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER ${_targetUsePCH})
 	set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD ${_targetAddSCU})
 	cotire_make_target_message(${_target} "${_targetLanguages}" "${_disableMsg}" _targetMsg ${_allExcludedSourceFiles})
@@ -2776,7 +2954,11 @@
 	set (_sourceFiles ${ARGN})
 	get_target_property(_maxIncludes ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
 	if (_maxIncludes MATCHES "(-j|--parallel|--jobs) ?([0-9]*)")
-		set (_numberOfThreads "${CMAKE_MATCH_2}")
+		if (DEFINED CMAKE_MATCH_2)
+			set (_numberOfThreads "${CMAKE_MATCH_2}")
+		else()
+			set (_numberOfThreads "")
+		endif()
 		if (NOT _numberOfThreads)
 			# use all available cores
 			ProcessorCount(_numberOfThreads)
@@ -2889,8 +3071,9 @@
 		set (_dependsFiles "")
 		foreach (_language ${_languages})
 			set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE)
-			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-				# Visual Studio and Intel only create precompiled header as a side effect
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
+				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+				# MSVC, Intel and clang-cl only create precompiled header as a side effect
 				list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER)
 			endif()
 			cotire_get_first_set_property_value(_dependsFile TARGET ${_target} ${_props})
@@ -2938,6 +3121,7 @@
 			list (APPEND _unityTargetSources ${_unityFiles})
 		endif()
 	endforeach()
+	# handle object libraries which are part of the target's sources
 	get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
 	if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$")
 		cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles})
@@ -2982,16 +3166,6 @@
 	# determine unity target sources
 	set (_unityTargetSources "")
 	cotire_collect_unity_target_sources(${_target} "${_languages}" _unityTargetSources)
-	# handle automatic Qt processing
-	get_target_property(_targetAutoMoc ${_target} AUTOMOC)
-	get_target_property(_targetAutoUic ${_target} AUTOUIC)
-	get_target_property(_targetAutoRcc ${_target} AUTORCC)
-	if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
-		# if the original target sources are subject to CMake's automatic Qt processing,
-		# also include implicitly generated <targetname>_automoc.cpp file
-		list (APPEND _unityTargetSources "${_target}_automoc.cpp")
-		set_property (SOURCE "${_target}_automoc.cpp" PROPERTY GENERATED TRUE)
-	endif()
 	# prevent AUTOMOC, AUTOUIC and AUTORCC properties from being set when the unity target is created
 	set (CMAKE_AUTOMOC OFF)
 	set (CMAKE_AUTOUIC OFF)
@@ -3004,17 +3178,6 @@
 		add_executable(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
 	else()
 		add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
-	endif()
-	if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
-		# depend on original target's automoc target, if it exists
-		if (TARGET ${_target}_automoc)
-			add_dependencies(${_unityTargetName} ${_target}_automoc)
-		endif()
-	else()
-		if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
-			# depend on the original target's implicity generated <targetname>_automoc target
-			add_dependencies(${_unityTargetName} ${_target}_automoc)
-		endif()
 	endif()
 	# copy output location properties
 	set (_outputDirProperties
@@ -3027,8 +3190,8 @@
 			set (_outputDir "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
 		else()
 			# append relative COTIRE_UNITY_OUTPUT_DIRECTORY to target's actual output directory
-			cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
-			cotire_resolve_config_properites("${_configurations}" _properties ${_outputDirProperties})
+			cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
+			cotire_resolve_config_properties("${_configurations}" _properties ${_outputDirProperties})
 			foreach (_property ${_properties})
 				get_property(_outputDir TARGET ${_target} PROPERTY ${_property})
 				if (_outputDir)
@@ -3048,11 +3211,11 @@
 				RUNTIME_OUTPUT_DIRECTORY "${_outputDir}")
 		endif()
 	else()
-		cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 			${_outputDirProperties})
 	endif()
 	# copy output name
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_<CONFIG>
 		LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_<CONFIG>
 		OUTPUT_NAME OUTPUT_NAME_<CONFIG>
@@ -3060,7 +3223,7 @@
 		PREFIX <CONFIG>_POSTFIX SUFFIX
 		IMPORT_PREFIX IMPORT_SUFFIX)
 	# copy compile stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		COMPILE_DEFINITIONS COMPILE_DEFINITIONS_<CONFIG>
 		COMPILE_FLAGS COMPILE_OPTIONS
 		Fortran_FORMAT Fortran_MODULE_DIRECTORY
@@ -3072,12 +3235,12 @@
 		C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN
 		C_CLANG_TIDY CXX_CLANG_TIDY)
 	# copy compile features
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED
 		CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED
 		COMPILE_FEATURES)
 	# copy interface stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN
 		COMPATIBLE_INTERFACE_STRING
 		INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS
@@ -3085,8 +3248,9 @@
 		INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
 		INTERFACE_AUTOUIC_OPTIONS NO_SYSTEM_FROM_IMPORTED)
 	# copy link stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
-		BUILD_WITH_INSTALL_RPATH INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		BUILD_WITH_INSTALL_RPATH BUILD_WITH_INSTALL_NAME_DIR
+		INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
 		LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED
 		LINK_FLAGS LINK_FLAGS_<CONFIG>
 		LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_<CONFIG>
@@ -3094,18 +3258,18 @@
 		LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
 		STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
 		NO_SONAME SOVERSION VERSION
-		LINK_WHAT_YOU_USE)
+		LINK_WHAT_YOU_USE BUILD_RPATH)
 	# copy cmake stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
 	# copy Apple platform specific stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
 		MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
 		OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST
-		IOS_INSTALL_COMBINED)
+		IOS_INSTALL_COMBINED XCODE_EXPLICIT_FILE_TYPE XCODE_PRODUCT_TYPE)
 	# copy Windows platform specific stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		GNUtoMS
 		COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
 		COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
@@ -3119,15 +3283,19 @@
 		VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
 		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS
 		DEPLOYMENT_REMOTE_DIRECTORY VS_CONFIGURATION_TYPE
-		VS_SDK_REFERENCES)
+		VS_SDK_REFERENCES VS_USER_PROPS VS_DEBUGGER_WORKING_DIRECTORY)
 	# copy Android platform specific stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		ANDROID_API ANDROID_API_MIN ANDROID_GUI
 		ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES
 		ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR
 		ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES
 		ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH
 		ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE)
+	# copy CUDA platform specific stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		CUDA_PTX_COMPILATION CUDA_SEPARABLE_COMPILATION CUDA_RESOLVE_DEVICE_SYMBOLS
+		CUDA_EXTENSIONS CUDA_STANDARD CUDA_STANDARD_REQUIRED)
 	# use output name from original target
 	get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
 	if (NOT _targetOutputName)
@@ -3139,6 +3307,13 @@
 		set_property(TARGET ${_unityTargetName} PROPERTY DEFINE_SYMBOL "${_defineSymbol}")
 		if ("${_targetType}" STREQUAL "EXECUTABLE")
 			set_property(TARGET ${_unityTargetName} PROPERTY ENABLE_EXPORTS TRUE)
+		endif()
+	endif()
+	# enable parallel compilation for MSVC
+	if (MSVC AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+		list (LENGTH _unityTargetSources _numberOfUnityTargetSources)
+		if (_numberOfUnityTargetSources GREATER 1)
+			set_property(TARGET ${_unityTargetName} APPEND PROPERTY COMPILE_OPTIONS "/MP")
 		endif()
 	endif()
 	cotire_init_target(${_unityTargetName})
@@ -3297,6 +3472,13 @@
 				set_target_properties(${_unityTargetName} PROPERTIES INTERFACE_LINK_LIBRARIES "${_unityLinkInterfaceLibraries}")
 				if (COTIRE_DEBUG)
 					message (STATUS "unity target ${_unityTargetName} interface link libraries: ${_unityLinkInterfaceLibraries}")
+				endif()
+			endif()
+			get_target_property(_manualDependencies ${_target} MANUALLY_ADDED_DEPENDENCIES)
+			if (_manualDependencies)
+				cotire_map_libraries("${_linkLibrariesStrategy}" _unityManualDependencies ${_manualDependencies})
+				if (_unityManualDependencies)
+					add_dependencies("${_unityTargetName}" ${_unityManualDependencies})
 				endif()
 			endif()
 		endif()
@@ -3595,7 +3777,7 @@
 	set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING
 		"Ignore sources with the listed file extensions from the generated unity source.")

-	set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "3" CACHE STRING
+	set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "2" CACHE STRING
 		"Minimum number of sources in target required to enable use of precompiled header.")

 	if (NOT DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT)
@@ -3694,7 +3876,7 @@
 		FULL_DOCS
 			"The variable can be set to an integer > 0."
 			"If a target contains less than that number of source files, cotire will not enable the use of the precompiled header for the target."
-			"If not defined, defaults to 3."
+			"If not defined, defaults to 2."
 	)

 	define_property(


Enable AVX512 for Embree only if OSPRAY_BUILD_ENABLE_KNL

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -84,6 +84,7 @@
     # additional Embree include directory
     LIST(APPEND EMBREE_INCLUDE_DIRECTORIES ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon)

+    SET(OSPRAY_EMBREE_ENABLE_AVX512 false)
     IF (OSPRAY_BUILD_ISA STREQUAL "ALL")
       # ------------------------------------------------------------------
       # in 'all' mode, we have a list of multiple targets for ispc,
@@ -94,8 +95,10 @@
       SET(OSPRAY_EMBREE_ENABLE_SSE  true)
       SET(OSPRAY_EMBREE_ENABLE_AVX  true)
       SET(OSPRAY_EMBREE_ENABLE_AVX2 true)
-      SET(OSPRAY_EMBREE_ENABLE_AVX512 true)
-      SET(OSPRAY_ISPC_TARGET_LIST sse4 avx avx2 avx512knl-i32x16)
+      IF (OSPRAY_BUILD_ENABLE_KNL)
+        SET(OSPRAY_EMBREE_ENABLE_AVX512 true)
+        SET(OSPRAY_ISPC_TARGET_LIST sse4 avx avx2 avx512knl-i32x16)
+      ENDIF()

     ELSEIF (OSPRAY_BUILD_ISA STREQUAL "AVX512")
       # ------------------------------------------------------------------


adding avx512 to autoselect target list for ispc

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -95,6 +95,7 @@
       SET(OSPRAY_EMBREE_ENABLE_AVX2 true)
 			IF (OSPRAY_ISPC_KNL_NATIVE)
 				SET(OSPRAY_EMBREE_ENABLE_AVX512 true)
+				SET(OSPRAY_ISPC_TARGET_LIST sse4 avx avx2 knl-avx512)
 			ENDIF()

     ELSEIF (OSPRAY_BUILD_ISA STREQUAL "AVX512")


Add -mfma to -mavx2 for clang, and add AVX2 declaration for Zen in DYNAMIC_ARCH builds

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -197,14 +197,14 @@
   if (${TARGET} STREQUAL SKYLAKEX AND NOT NO_AVX512)
     set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=skylake-avx512")
   endif()
-  if (${TARGET} STREQUAL HASWELL AND NOT NO_AVX2)
+  if ((${TARGET} STREQUAL HASWELL OR ${TARGET} STREQUAL ZEN) AND NOT NO_AVX2)
     if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
       execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
       if (${GCC_VERSION} VERSION_GREATER 4.7 OR ${GCC_VERSION} VERSION_EQUAL 4.7)
         set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
       endif()
     elseif (${CMAKE_C_COMPILER_ID} STREQUAL "CLANG")
-      set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
+      set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2 -mfma")
     endif()
   endif()
   if (DEFINED HAVE_AVX)


By default the modules will not be enabled.

--- itk-module.cmake
+++ itk-module.cmake
@@ -2,6 +2,13 @@
 # re-used it for documentation here
 get_filename_component( MY_CURENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
 file( READ "${MY_CURENT_DIR}/README" DOCUMENTATION )
+
+
+# ITK version 4.5 changed it from EXCLUDE_FROM_ALL to EXCLUDE_FROM_DEFAULT
+set( _EXCLUDE "EXCLUDE_FROM_ALL" )
+if (NOT "${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_MINOR_PATCH}" VERSION_LESS "4.5")
+  set( _EXCLUDE "EXCLUDE_FROM_DEFAULT" )
+endif()

 # itk_module() defines the module dependencies in ExternalTemplate
 # ExternalTemplate depends on ITKCommon
@@ -19,5 +26,5 @@
     ITKMetaIO
   DESCRIPTION
     "${DOCUMENTATION}"
-  EXCLUDE_FROM_ALL
+  ${_EXCLUDE}
 )


[cmake] Add InstrProfilingWriter to libclang_rt on Darwin

llvmBufferWriter and a few related symbols were missing from libclang_rt
on Darwin (PR26002). This should fix the problem.

Patch by Dan Peebles!

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -282,7 +282,8 @@

   set(PROFILE_SOURCES ../profile/InstrProfiling
                       ../profile/InstrProfilingBuffer
-                      ../profile/InstrProfilingPlatformDarwin)
+                      ../profile/InstrProfilingPlatformDarwin
+		      ../profile/InstrProfilingWriter)
   foreach (os ${ARGN})
     list_union(DARWIN_BUILTIN_ARCHS DARWIN_${os}_ARCHS BUILTIN_SUPPORTED_ARCH)
     foreach (arch ${DARWIN_BUILTIN_ARCHS})


Bumped version number

Bumped version number

--- conf/LiboroVersion.cmake
+++ conf/LiboroVersion.cmake
@@ -2,6 +2,6 @@
 # This file is the official location of the current liboro version number.
 # Please do not add extra numerals in this file or change its formatting.

-SET(CPACK_PACKAGE_VERSION_MAJOR "0")
-SET(CPACK_PACKAGE_VERSION_MINOR "7")
-SET(CPACK_PACKAGE_VERSION_PATCH "10")
+SET(CPACK_PACKAGE_VERSION_MAJOR "1")
+SET(CPACK_PACKAGE_VERSION_MINOR "0")
+SET(CPACK_PACKAGE_VERSION_PATCH "0")


[CMAKE] Fix FindBerkeleyDB suffix paths

[CMAKE] Fix FindBerkeleyDB suffix paths

Summary:
The FindBerkeleyDB module builds a combination of component and version
to search for the associated library, but use the same combination for
the suffix paths. However the suffix paths are always based on the name
`db` (not `db_cxx`) and can cause the search to fail on some systems.

Test Plan:
  cmake -GNinja ..
  ninja

Run the Gitian builds.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5446

--- cmake/modules/FindBerkeleyDB.cmake
+++ cmake/modules/FindBerkeleyDB.cmake
@@ -132,27 +132,36 @@

 include(ExternalLibraryHelper)

-macro(_BerkeleyDB_find_component COMPONENT_NAME LIB_NAME)
-	# Different systems sometimes have a version in the lib name...
-	# and some have a dash or underscore before the versions.
-	# Generate all combinations from the separators "" (none), ".", "-" and "_".
-	generate_versions_variants(
-		_lib_variants
-		${LIB_NAME}
-		"${BerkeleyDB_VERSION_MAJOR}"
-		"${BerkeleyDB_VERSION_MINOR}"
-	)
+# Different systems sometimes have a version in the lib name...
+# and some have a dash or underscore before the versions.
+# Generate all combinations from the separators "" (none), ".", "-" and "_".
+generate_versions_variants(
+	_db_variants
+	db
+	"${BerkeleyDB_VERSION_MAJOR}"
+	"${BerkeleyDB_VERSION_MINOR}"
+)

-	find_component(BerkeleyDB ${COMPONENT_NAME}
-		NAMES ${_lib_variants}
-		HINTS ${BREW_HINT}
-		PATH_SUFFIXES ${_lib_variants}
-		INCLUDE_DIRS ${BerkeleyDB_INCLUDE_DIRS}
-	)
-endmacro()
+find_component(BerkeleyDB C
+	NAMES ${_db_variants}
+	HINTS ${BREW_HINT}
+	PATH_SUFFIXES ${_db_variants}
+	INCLUDE_DIRS ${BerkeleyDB_INCLUDE_DIRS}
+)

-_BerkeleyDB_find_component(C db)
-_BerkeleyDB_find_component(CXX db_cxx)
+generate_versions_variants(
+	_db_cxx_variants
+	db_cxx
+	"${BerkeleyDB_VERSION_MAJOR}"
+	"${BerkeleyDB_VERSION_MINOR}"
+)
+
+find_component(BerkeleyDB CXX
+	NAMES ${_db_cxx_variants}
+	HINTS ${BREW_HINT}
+	PATH_SUFFIXES ${_db_variants}
+	INCLUDE_DIRS ${BerkeleyDB_INCLUDE_DIRS}
+)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(BerkeleyDB


[CMake] Remove use of LLDB_PATH_TO_CMARK_BUILD

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -7,7 +7,6 @@

   file(TO_CMAKE_PATH "${LLDB_PATH_TO_LLVM_BUILD}" LLDB_PATH_TO_LLVM_BUILD)
   file(TO_CMAKE_PATH "${LLDB_PATH_TO_CLANG_BUILD}" LLDB_PATH_TO_CLANG_BUILD)
-  file(TO_CMAKE_PATH "${LLDB_PATH_TO_CMARK_BUILD}" LLDB_PATH_TO_CMARK_BUILD)
   file(TO_CMAKE_PATH "${LLDB_PATH_TO_SWIFT_BUILD}" LLDB_PATH_TO_SWIFT_BUILD)

   file(TO_CMAKE_PATH "${LLDB_PATH_TO_CLANG_SOURCE}" LLDB_PATH_TO_CLANG_SOURCE)
@@ -102,9 +101,6 @@
   get_filename_component(PATH_TO_SWIFT_BUILD ${LLDB_PATH_TO_SWIFT_BUILD}
                          ABSOLUTE)

-  get_filename_component(PATH_TO_CMARK_BUILD ${LLDB_PATH_TO_CMARK_BUILD}
-                         ABSOLUTE)
-
   # These variables are used by add_llvm_library.
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)


OpenCV: add BUILD_WITH_STATIC_CRT=OFF

OpenCV: add BUILD_WITH_STATIC_CRT=OFF

Fix issue #177

--- cmake/projects/OpenCV/hunter.cmake
+++ cmake/projects/OpenCV/hunter.cmake
@@ -133,6 +133,7 @@
         BUILD_TESTS=OFF
         BUILD_opencv_apps=OFF
         INSTALL_PYTHON_EXAMPLES=OFF
+        BUILD_WITH_STATIC_CRT=OFF # Fix https://github.com/ruslo/hunter/issues/177
         ${_ios_args}
         # Find packages in Hunter (instead of building from OpenCV sources)
         BUILD_ZLIB=OFF


BUG: add libGLX to the list of possible system dependencies in packaging

--- Packaging/PackageGlobals.cmake
+++ Packaging/PackageGlobals.cmake
@@ -105,6 +105,7 @@
   libXxf86vm.so*
   libdrm.so.2
   libGL.so*
+  libGLX.so*
   libGLU.so*
   libXrender.so*
   libSM.so*


updated cotire

updated cotire

--- modules/cotire.cmake
+++ modules/cotire.cmake
@@ -43,7 +43,7 @@
 endif()

 set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.8.0")
+set (COTIRE_CMAKE_MODULE_VERSION "1.8.1")

 # activate select policies
 if (POLICY CMP0025)
@@ -931,9 +931,9 @@
 					list (FIND ${_systemIncludesVar} "${_include}" _index)
 				endif()
 				if (_index GREATER -1)
+					# Pass -isystem as a separated flag, not as "-isystem <include_dir>".
 					string(STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _include_system_flag)
 					list (APPEND ${_cmdVar} "${_include_system_flag}" "${_include}")
-
 				else()
 					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
 				endif()
@@ -1070,10 +1070,10 @@
 		set (${_headerIsIgnoredVar} TRUE)
 	elseif (IS_DIRECTORY "${_headerFile}")
 		set (${_headerIsIgnoredVar} TRUE)
-	elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed" AND "${_headerFile}" MATCHES "\\.h$")
-		# heuristic: ignore C headers with embedded parent directory references or "-fixed" or "_fixed" in path
+	elseif ("${_headerFile}" MATCHES "\\.\\.|[_-]fixed")
+		# heuristic: ignore headers with embedded parent directory references or "-fixed" or "_fixed" in path
 		# these often stem from using GCC #include_next tricks, which may break the precompiled header compilation
-		# with the error message "error: no include path in which to search for header.h"
+		# with the error message "error: no include path in which to search for header"
 		set (${_headerIsIgnoredVar} TRUE)
 	else()
 		set (${_headerIsIgnoredVar} FALSE)
@@ -1632,7 +1632,6 @@
 		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
 		file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
 		file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
-		string (REGEX REPLACE "\\.[^.]*$" ".obj" _objFileNative "${_hostFileNative}")
 		# cl.exe options used
 		# /Yc creates a precompiled header file
 		# /Fp specifies precompiled header binary file name
@@ -1640,16 +1639,13 @@
 		# /TC treat all files named on the command line as C source files
 		# /TP treat all files named on the command line as C++ source files
 		# /Zs syntax check only
-		# /c stop compilation after creating an object file
-		# /Fo specifies object file name
 		# /Zm precompiled header memory allocation scaling factor
 		set (_sourceFileTypeC "/TC")
 		set (_sourceFileTypeCXX "/TP")
 		if (_flags)
 			# append to list
 			list (APPEND _flags /nologo "${_sourceFileType${_language}}"
-				"/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /c "/Fo${_objFileNative}"
-				"${_hostFileNative}")
+				"/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
 			if (COTIRE_PCH_MEMORY_SCALING_FACTOR)
 				list (APPEND _flags "/Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
 			endif()
@@ -2387,8 +2383,8 @@

 function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
 	set (_sourceFiles ${ARGN})
-	if ((CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
-			(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang")) AND NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
 		# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
 		# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
 		if (_sourceFiles)
@@ -2420,16 +2416,9 @@
 			if (COTIRE_DEBUG)
 				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} ${_realCompilerExe} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
 			endif()
-			set (_outputFiles "")
-			list (APPEND _outputFiles "${_pchFile}")
 			set_property (SOURCE "${_pchFile}" PROPERTY GENERATED TRUE)
-			if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
-				string (REGEX REPLACE "\\.[^.]*$" ".obj" _hostObjFile "${_hostFile}")
-				list (APPEND _outputFiles "${_hostObjFile}")
-				set_property (SOURCE "${_hostObjFile}" PROPERTY GENERATED TRUE)
-			endif()
 			add_custom_command(
-				OUTPUT ${_outputFiles}
+				OUTPUT "${_pchFile}"
 				COMMAND ${_cmds}
 				DEPENDS "${_prefixFile}" "${_realCompilerExe}"
 				IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
@@ -2441,8 +2430,8 @@
 endfunction()

 function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
-	if ((CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
-			(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang")) AND NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
 		# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
 		# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
 		set (_sourceFiles ${ARGN})
@@ -2589,9 +2578,9 @@
 		# if this is a single-language target without any excluded files
 		if (_wholeTarget)
 			set (_language "${_languages}")
-			# for Intel and clang-cl, precompiled header inclusion is always done on the source file level
+			# for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
 			# see cotire_setup_pch_file_inclusion
-			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "Intel" AND NOT
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
 				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
 				get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
 				if (_prefixFile)
@@ -3041,16 +3030,6 @@
 		if (_targetUsePCH)
 			cotire_make_pch_file_path(${_language} ${_target} _pchFile)
 			if (_pchFile)
-				if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC" AND "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
-					# use stub file to link in precompiled header
-					string (REGEX REPLACE "\\.[^.]*$" "_stub.cxx" _stubFile "${_prefixFile}")
-					file (WRITE "${_stubFile}" "#include \"${_prefixFile}\"")
-					list (INSERT _sourceFiles 0 "${_stubFile}")
-					string (REGEX REPLACE "\\.[^.]*$" ".obj" _stubObjFile "${_stubFile}")
-					set_property (SOURCE "${_stubObjFile}" PROPERTY GENERATED TRUE)
-					target_sources (${_target} PRIVATE "${_stubObjFile}")
-					set_property(TARGET ${_target} PROPERTY COTIRE_${_language}_STUB_OBJECT "${_stubObjFile}")
-				endif()
 				# first file in _sourceFiles is passed as the host file
 				cotire_setup_pch_file_compilation(
 					${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_pchFile}" ${_sourceFiles})
@@ -3139,11 +3118,6 @@
 			cotire_filter_language_source_files(${_language} ${_target} _sourceFiles _excludedSources _cotiredSources ${_targetSourceFiles})
 			if (_sourceFiles OR _cotiredSources)
 				list (REMOVE_ITEM _unityTargetSources ${_sourceFiles} ${_cotiredSources})
-			endif()
-			if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC" AND "${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
-				# remove pch stub object file
-				get_property(_stubObjFile TARGET ${_target} PROPERTY COTIRE_${_language}_STUB_OBJECT)
-				list (REMOVE_ITEM _unityTargetSources "${_stubObjFile}")
 			endif()
 			# add unity source files instead
 			list (APPEND _unityTargetSources ${_unityFiles})


expand tabs for coding policy

expand tabs for coding policy

--- indra/cmake/LLSharedLibs.cmake
+++ indra/cmake/LLSharedLibs.cmake
@@ -42,13 +42,13 @@
   # Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
   set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
   if(NOT WINDOWS)
-	get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
-	get_filename_component(DSO_FILE ${DSO_PATH} NAME)
-	if(DARWIN)
-	  set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
-	else(DARWIN)
-	  set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
-	endif(DARWIN)
+    get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
+    get_filename_component(DSO_FILE ${DSO_PATH} NAME)
+    if(DARWIN)
+      set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)
+    else(DARWIN)
+      set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR})
+    endif(DARWIN)

       # *TODO - maybe make this a symbolic link? -brad
       add_custom_command(


glew use script XP_USE_LATEST_GLEW adjustments

issue https://github.com/smanders/externpro/issues/199#issuecomment-411205364

--- projects/use/usexp-glew-config.cmake
+++ projects/use/usexp-glew-config.cmake
@@ -8,10 +8,10 @@
 get_filename_component(XP_ROOTDIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE)
 get_filename_component(XP_ROOTDIR ${XP_ROOTDIR} ABSOLUTE) # remove relative parts
 string(TOUPPER ${prj} PRJ)
-if(WIN32 AND NOT DEFINED XP_USE_LATEST_GLEW)
+if(NOT WIN32)
+  set(XP_USE_LATEST_GLEW ON)
+elseif(WIN32 AND NOT DEFINED XP_USE_LATEST_GLEW)
   option(XP_USE_LATEST_GLEW "build with glew @GLEW_BLDVER@ instead of pre-built @GLEW_MSWVER@" OFF)
-else()
-  set(XP_USE_LATEST_GLEW ON)
 endif()
 if(XP_USE_LATEST_GLEW)
   set(glewVer @GLEW_BLDVER@)


help finding quatlib on OSCAR

help finding quatlib on OSCAR

--- plugins/VRPN/cmake/Findquatlib.cmake
+++ plugins/VRPN/cmake/Findquatlib.cmake
@@ -18,7 +18,8 @@
 if(TARGET quat)
 	# Look for the header file.
 	find_path(QUATLIB_INCLUDE_DIR NAMES quat.h
-			PATHS ${quatlib_SOURCE_DIR})
+	  HINTS ENV CPATH
+	  PATHS ${quatlib_SOURCE_DIR})

 	set(QUATLIB_LIBRARY "quat")

@@ -55,6 +56,7 @@
 		quat.h
 		HINTS
 		"${QUATLIB_ROOT_DIR}"
+		ENV CPATH
 		PATH_SUFFIXES
 		include
 		PATHS


Enabled all warnings on MSVC and marked them as errors.

--- cmake/CMakeCompiler.cmake
+++ cmake/CMakeCompiler.cmake
@@ -3,15 +3,11 @@
 macro(setup_default_compiler_flags _project_name)
 	if(MSVC)
 		# Replace some default compiler switches and add new ones
-		STRING(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})		# Disable RTTI
-		STRING(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})	# Bump warnings to W4
+		STRING(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})			# Disable RTTI
+		STRING(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})		# Bump warnings to W4
 		target_compile_options(${_project_name} PRIVATE /Zi)				# Add debug info
 		target_compile_options(${_project_name} PRIVATE /Oi)				# Generate intrinsic functions
-
-		# Disable some warnings
-		target_compile_options(${_project_name} PRIVATE /wd4100)			# unreferenced formal parameter
-		target_compile_options(${_project_name} PRIVATE /wd4324)			# structure was padded due to alignment specified
-		target_compile_options(${_project_name} PRIVATE /wd4127)			# conditional expression is constant
+		target_compile_options(${_project_name} PRIVATE /WX)				# Treat warnings as errors

 		if(MSVC_VERSION GREATER 1900)
 			# VS2017 and above


Use c++1y if available

Use c++1y if available

--- cmake/CompilerCheck.cmake
+++ cmake/CompilerCheck.cmake
@@ -3,9 +3,12 @@
 set(TEMP_DIR "${CMAKE_BINARY_DIR}/temp")

 # C++0x / C++11
+CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)
 CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
 CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
-if (COMPILER_SUPPORTS_CXX11)
+if (COMPILER_SUPPORTS_CXX1Y)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
+elseif (COMPILER_SUPPORTS_CXX11)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 elseif(COMPILER_SUPPORTS_CXX0X)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")


Use cmake/Hunter/config.cmake to add custom versions

--- cmake/Hunter/config.cmake
+++ cmake/Hunter/config.cmake
@@ -1 +1,4 @@
-hunter_config(Boost VERSION 1.57.0) # 1.58.0 issue https://svn.boost.org/trac/boost/ticket/11410
+# 1.58.0 issue https://svn.boost.org/trac/boost/ticket/11410
+# 1.57.0-1.56.0 Doesn't work on Linux (GCC, c++11)
+hunter_config(Boost VERSION 1.55.0-patched-3)
+hunter_config(Sober VERSION ${HUNTER_Sober_VERSION} CMAKE_ARGS SOBER_RELAX_WARNINGS=ON)


fix inference_lib_dist deps

fix inference_lib_dist deps

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -56,24 +56,28 @@
 copy(eigen3_lib
   SRCS ${EIGEN_INCLUDE_DIR}/Eigen/Core ${EIGEN_INCLUDE_DIR}/Eigen/src ${EIGEN_INCLUDE_DIR}/unsupported/Eigen
   DSTS ${dst_dir}/Eigen ${dst_dir}/Eigen ${dst_dir}/unsupported
+  DEPS eigen3
 )

 set(dst_dir "${FLUID_INSTALL_DIR}/third_party/install/gflags")
 copy(gflags_lib
   SRCS ${GFLAGS_INCLUDE_DIR} ${GFLAGS_LIBRARIES}
   DSTS ${dst_dir} ${dst_dir}/lib
+  DEPS gflags
 )

 set(dst_dir "${FLUID_INSTALL_DIR}/third_party/install/glog")
 copy(glog_lib
   SRCS ${GLOG_INCLUDE_DIR} ${GLOG_LIBRARIES}
   DSTS ${dst_dir} ${dst_dir}/lib
+  DEPS glog
 )

 set(dst_dir "${FLUID_INSTALL_DIR}/third_party/boost/")
 copy(boost_lib
   SRCS ${BOOST_INCLUDE_DIR}/boost
   DSTS ${dst_dir}
+  DEPS boost
 )

 if(NOT PROTOBUF_FOUND)
@@ -81,6 +85,7 @@
     copy(protobuf_lib
       SRCS ${PROTOBUF_INCLUDE_DIR} ${PROTOBUF_LIBRARY}
       DSTS ${dst_dir} ${dst_dir}/lib
+      DEPS extern_protobuf
     )
 endif()

@@ -89,12 +94,14 @@
     copy(openblas_lib
       SRCS ${CBLAS_INSTALL_DIR}/lib ${CBLAS_INSTALL_DIR}/include
       DSTS ${dst_dir} ${dst_dir}
+      DEPS extern_openblas
     )
 elseif (WITH_MKLML)
     set(dst_dir "${FLUID_INSTALL_DIR}/third_party/install/mklml")
     copy(mklml_lib
       SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR}
       DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir}
+      DEPS mklml
     )
 endif()

@@ -103,6 +110,7 @@
   copy(mkldnn_lib
     SRCS ${MKLDNN_INC_DIR} ${MKLDNN_SHARED_LIB}
     DSTS ${dst_dir} ${dst_dir}/lib
+    DEPS mkldnn
   )
 endif()

@@ -110,17 +118,20 @@
   set(dst_dir "${FLUID_INSTALL_DIR}/third_party/install/snappy")
   copy(snappy_lib
     SRCS ${SNAPPY_INCLUDE_DIR} ${SNAPPY_LIBRARIES}
-    DSTS ${dst_dir} ${dst_dir}/lib)
+    DSTS ${dst_dir} ${dst_dir}/lib
+    DEPS snappy)

   set(dst_dir "${FLUID_INSTALL_DIR}/third_party/install/snappystream")
   copy(snappystream_lib
     SRCS ${SNAPPYSTREAM_INCLUDE_DIR} ${SNAPPYSTREAM_LIBRARIES}
-    DSTS ${dst_dir} ${dst_dir}/lib)
+    DSTS ${dst_dir} ${dst_dir}/lib
+    DEPS snappystream)

   set(dst_dir "${FLUID_INSTALL_DIR}/third_party/install/zlib")
   copy(zlib_lib
     SRCS ${ZLIB_INCLUDE_DIR} ${ZLIB_LIBRARIES}
-    DSTS ${dst_dir} ${dst_dir}/lib)
+    DSTS ${dst_dir} ${dst_dir}/lib
+    DEPS zlib)
 endif()

 # paddle fluid module


COMP: Support if(... IN_LIST...) with CMake old projects

If a project with cmake_minimum_required(VERSION 3.0) (e.g. CTK)
find_packages ITK that includes RTK built with CUDA, then
if(... IN_LIST ...) in FindCUDA_wrap.cmake is not supported.

We do not want to enforce Foo to have the same miminum version as RTK.
Foo could add policy but find_package(ITK) creates a new policy scope that prevents Foo from
ignores policies added by Foo.


include(hunter_cmake_args)

--- cmake/projects/jsoncpp/hunter.cmake
+++ cmake/projects/jsoncpp/hunter.cmake
@@ -6,6 +6,7 @@
 include(hunter_add_version)
 include(hunter_download)
 include(hunter_pick_scheme)
+include(hunter_cmake_args)

 # List of versions here...
 hunter_add_version(


Removed a warning from CMmake 2.4 output.

--- cmake_modules/ExpectedFailure.cmake
+++ cmake_modules/ExpectedFailure.cmake
@@ -10,9 +10,9 @@
   get_test_property ("${testname}" WILL_FAIL willfail)
   if (willfail)
     set (willfail 0)
-  else ()
+  else (willfail)
     set (willfail 1)
-  endif ()
+  endif (willfail)
   set_tests_properties ("${testname}" PROPERTIES WILL_FAIL ${willfail})

   # Also store the name and bug ID of this test in our output file


Move clause inside so only affects Xcode 7+

--- standard/StandardProject.cmake
+++ standard/StandardProject.cmake
@@ -115,10 +115,10 @@
       endif()
       if(_developer_sdk_version)
         set(CMAKE_OSX_SYSROOT "macosx${_developer_sdk_version}" CACHE STRING "Mac OS X build environment" FORCE)
+        if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+          set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Mac OS X deployment target" FORCE)
+        endif()
       endif()
-    endif()
-    if(_developer_sdk_version AND NOT CMAKE_OSX_DEPLOYMENT_TARGET)
-      set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Mac OS X deployment target" FORCE)
     endif()
   endif()


Remove inconsistent double-pound

Remove inconsistent double-pound

--- standard/StandardProject.cmake
+++ standard/StandardProject.cmake
@@ -128,7 +128,7 @@
 endfunction()

 function(standard_project_postinit)
-  ##Post-initialization steps. All of these depend on project() having been called.
+  #Post-initialization steps. All of these depend on project() having been called.
   include(CTest)

   if(CMAKE_COMPILER_IS_GNUCC)


Fixed bug reported in Issue (#273)

Fixed bug reported in Issue (#273)

--- rosserial_arduino/arduino-cmake/cmake/Platform/Arduino.cmake
+++ rosserial_arduino/arduino-cmake/cmake/Platform/Arduino.cmake
@@ -283,6 +283,7 @@
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 #=============================================================================#
 cmake_minimum_required(VERSION 2.8.5)
+cmake_policy(SET CMP0054 NEW)
 include(CMakeParseArguments)


Do not use SYSTEM Python by default in "All" confiuration

--- CMake/BuildConfigurations/All.cmake
+++ CMake/BuildConfigurations/All.cmake
@@ -14,6 +14,7 @@
   OpenCL
   SYSTEM_Boost
   Boost_LIBRARIES
+  SYSTEM_PYTHON
   SOFA_PLUGINS
   SOFA_PLUGINS_DIR
   SUPERBUILD


Issue #51: Try to force OpenCV not to default to using VTK.

--- CMake/ExternalProjects/OpenCV.cmake
+++ CMake/ExternalProjects/OpenCV.cmake
@@ -52,6 +52,7 @@
     -DWITH_OPENNI:BOOL=OFF
     -DWITH_OPENNI2:BOOL=OFF
     -DWITH_OPENVX:BOOL=OFF
+    -DWITH_VTK:BOOL=OFF
     -DENABLE_PRECOMPILED_HEADERS:BOOL=OFF
     -DOPENCV_PYTHON_SKIP_DETECTION:BOOL=ON
   )


Looks like I broke Android builds on nearly all platforms. This should fix it up.

--HG--
branch : v1-9

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -11,10 +11,18 @@

 # Default build output paths
 if (NOT OGRE_ARCHIVE_OUTPUT)
-  set(OGRE_ARCHIVE_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
+  if(APPLE AND NOT OGRE_BUILD_PLATFORM_ANDROID)
+    set(OGRE_ARCHIVE_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
+  else()
+    set(OGRE_ARCHIVE_OUTPUT ${OGRE_BINARY_DIR}/lib)
+  endif()
 endif ()
 if (NOT OGRE_LIBRARY_OUTPUT)
-  set(OGRE_LIBRARY_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
+  if(APPLE AND NOT OGRE_BUILD_PLATFORM_ANDROID)
+    set(OGRE_LIBRARY_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
+  else()
+    set(OGRE_LIBRARY_OUTPUT ${OGRE_BINARY_DIR}/lib)
+  endif()
 endif ()
 if (NOT OGRE_RUNTIME_OUTPUT)
   set(OGRE_RUNTIME_OUTPUT ${OGRE_BINARY_DIR}/bin)


Fixing iree_cc_unified_library debug output file name aliasing. (#9999)

For any generator that can handle multiple configurations (MSVC,
ninja with `-GNinja Multi-Config`, etc) the `$<CONFIG>` generator
expression must be included in the file name.

Docs:
https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html#custom-commands

--- build_tools/cmake/iree_cc_library.cmake
+++ build_tools/cmake/iree_cc_library.cmake
@@ -318,7 +318,7 @@
   set(_LIBS "$<REMOVE_DUPLICATES:$<GENEX_EVAL:$<TARGET_PROPERTY:${_RULE_ROOT},INTERFACE_IREE_TRANSITIVE_OBJECT_LIBS>>>")

   # For debugging, write out evaluated objects to a file.
-  file(GENERATE OUTPUT "${_RULE_NAME}.contents.txt" CONTENT
+  file(GENERATE OUTPUT "${_RULE_NAME}.$<CONFIG>.contents.txt" CONTENT
     "OBJECTS:\n${_OBJECTS}\n\nLIBS:\n${_LIBS}\n")
   if(_RULE_SHARED)
     add_library(${_NAME} SHARED ${_OBJECTS})


[CMake] Passthrough CFLAGS when checking the compiler-rt path

This is needed when cross-compiling for a different target since
CFLAGS may contain additional flags like -resource-dir which
change the location in which compiler-rt builtins are found.

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

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

--- cmake/Modules/HandleCompilerRT.cmake
+++ cmake/Modules/HandleCompilerRT.cmake
@@ -4,6 +4,9 @@
   if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET)
     list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}")
   endif()
+  get_property(SANITIZER_CXX_FLAGS CACHE CMAKE_CXX_FLAGS PROPERTY VALUE)
+  string(REPLACE " " ";" SANITIZER_CXX_FLAGS "${SANITIZER_CXX_FLAGS}")
+  list(APPEND CLANG_COMMAND ${SANITIZER_CXX_FLAGS})
   execute_process(
       COMMAND ${CLANG_COMMAND}
       RESULT_VARIABLE HAD_ERROR


[cmake] Gut out bad methods in WintermuteMacros.

--- cmake/Modules/WintermuteMacros.cmake
+++ cmake/Modules/WintermuteMacros.cmake
@@ -60,27 +60,6 @@
       debug ${WINTERMUTE_TEST_LIBRARIES})
   ENDIF()

-  #TARGET_LINK_LIBRARIES(${_target}
-    #general ${WINTERMUTE_LIBRARIES})
+  TARGET_LINK_LIBRARIES(${_target}
+    general ${WINTERMUTE_LIBRARIES})
 ENDMACRO(wintermute_link_libraries _target)
-
-#==============================================================================
-#== @macro wintermute_define_plugin
-#== @param TARGET The target of the plugin.
-#== @param SOURCES The sources for this plugin.
-#== @param INCLUDE_DIRECTORIES The extra includes for this plugin.
-#== @param LIBRARIES The extra libraries for this plugin.
-#==============================================================================
-#macro(wintermute_define_plugin)
-  #set(options )
-  #set(oneValueArgs TARGET)
-  #set(nValueArgs SOURCES INCLUDE_DIRECTORIES)
-
-  #cmake_parse_arguments(wdp "${options}" "${oneValueArgs}" "${nValueArgs}" ${ARGN})
-
-  #add_library(${wdp_TARGET} SHARED ${wdp_SOURCES})
-  #target_link_libraries(${wdp_TARGET} wintermute-core ${wdp_LIBRARIES})
-  #target_include_directories(${wdp_TARGET} PUBLIC ${wdp_INCLUDE_DIRECTORIES})
-  #wintermute_link_libraries(${wdp_TARGET})
-  #wintermute_add_target_properties(${wdp_TARGET})
-#endmacro(wintermute_define_plugin)


Do not depend on processor type to enable ccache

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -90,11 +90,7 @@
 ROOT_BUILD_OPTION(builtin_xxhash OFF "Build included xxHash library")
 ROOT_BUILD_OPTION(builtin_zlib OFF "Build included libz, or use system libz")
 ROOT_BUILD_OPTION(castor ON "CASTOR support, requires libshift from CASTOR >= 1.5.2")
-if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SIZEOF_VOID_P EQUAL 4)
-  ROOT_BUILD_OPTION(ccache ON "Enable ccache usage for speeding up builds")
-else()
-  ROOT_BUILD_OPTION(ccache OFF "Enable ccache usage for speeding up builds")
-endif()
+ROOT_BUILD_OPTION(ccache ON "Enable ccache usage for speeding up builds")
 ROOT_BUILD_OPTION(cefweb OFF "Chromium Embedded Framework web-based display")
 ROOT_BUILD_OPTION(clad ON "Enable clad, the cling automatic differentiation plugin.")
 ROOT_BUILD_OPTION(cling ON "Enable new CLING C++ interpreter")


[cmake] For macos_native, also ignore /opt/homebrew. From Fons!

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -449,7 +449,7 @@
 if(macos_native)
   if(APPLE)
     set(CMAKE_IGNORE_PATH)
-    foreach(_prefix /sw /opt/local /usr/local) # Fink installs in /sw, and MacPort in /opt/local and Brew in /usr/local
+    foreach(_prefix /sw /opt/local /usr/local /opt/homebrew) # Fink installs in /sw, and MacPort in /opt/local and Brew in /usr/local (x86-64) and /opt/homebrew (arm64)
       list(APPEND CMAKE_IGNORE_PATH ${_prefix}/bin ${_prefix}/include ${_prefix}/lib)
     endforeach()
     if(CMAKE_VERSION VERSION_GREATER 3.15)


STYLE: Update template dashboard script to use VS2008 and Qt 4.8.7 as a default

--- CMake/DashboardTemplate.cmake
+++ CMake/DashboardTemplate.cmake
@@ -12,7 +12,7 @@
 #     'glxinfo | grep OpenGL' to obtain GPU details.
 ####################################################################################

-cmake_minimum_required(VERSION 2.8.10)
+cmake_minimum_required(VERSION 3.0)

 # You could invoke the script with the following syntax:
 #  ctest -S /path/to/<scriptname>.cmake -C <CTEST_BUILD_CONFIGURATION> -V
@@ -26,6 +26,8 @@
     set(${var} "${defaultvalue}")
   endif()
 endmacro()
+
+set(CTEST_PROJECT_NAME VesselView)

 #-----------------------------------------------------------------------------
 # Repository
@@ -52,7 +54,6 @@
 #-----------------------------------------------------------------------------
 # Dashboard properties
 #-----------------------------------------------------------------------------
-set(CTEST_PROJECT_NAME "VesselView")

 # Path where to pull and build the sources.
 # E.g. ${CTEST_SCRIPT_DIRECTORY}, C:/Work/Dashboards
@@ -63,35 +64,37 @@

 # Name of the machine that will appear on CDash
 # E.g. mymachine.kitware, mymachine.dkfz, ...
-set(CTEST_SITE "melcor.kitware")
+set(CTEST_SITE "machinename.kitware")

 # Operating system of the machine
-# E.g. Linux, Windows, Darwin...
-set(MY_OPERATING_SYSTEM "Linux")
+# E.g. Linux, Windows, Darwin
+set(MY_OPERATING_SYSTEM "Windows")

 # Compiler to use to compile the project.
-# E.g. GCC-4.7, VS2008Express...
-setOnlyIfNotDefined(MY_COMPILER "GCC-4.7")
+# E.g.  GCC-4.7, VS2008, VS2010
+setOnlyIfNotDefined(MY_COMPILER "VS2008")

 # Bitness of the compiler to use. It can be different than the machine.
 # E.g. 64, 32
 setOnlyIfNotDefined(MY_BITNESS "64")

 # Generator to use when configuring the CMake project.
-# E.g. Unix Makefiles, Visual Studio 9 Win32
-setOnlyIfNotDefined(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+# E.g. Unix Makefiles, Visual Studio 9 Win64, Visual Studio 10 Win64
+setOnlyIfNotDefined(CTEST_CMAKE_GENERATOR "Visual Studio 9 Win64")

 # Build configuration
-# E.g. Release, RelWithDebInfo, Debug
+# E.g. Release, Debug
 setOnlyIfNotDefined(CTEST_BUILD_CONFIGURATION "Release")

 # Qt version to use when compiling the project.
 # E.g. 4.7.4, 4.8.5
-setOnlyIfNotDefined(MY_QT_VERSION "4.7.4")
+setOnlyIfNotDefined(MY_QT_VERSION "4.8.7")

 # Path of the qmake executable
-# E.g. /usr/bin/qmake, C:/work/Qt/qt-${MY_QT_VERSION}-debug-32bit-vs2008/bin/qmake.exe
-setOnlyIfNotDefined(QT_QMAKE_EXECUTABLE "/usr/bin/qmake")
+# E.g. C:/D/Support/qt-${MY_QT_VERSION}-${MY_BITNESS}-vs2008-rel/bin/qmake.exe
+string(TOLOWER ${CTEST_BUILD_CONFIGURATION} qt_build_type)
+string(SUBSTRING ${qt_build_type} 0 3 qt_short_build_type) # rel or deb
+setOnlyIfNotDefined(QT_QMAKE_EXECUTABLE "C:/D/Support/qt-${MY_QT_VERSION}-${MY_BITNESS}-vs2008-${qt_short_build_type}/bin/qmake.exe")

 #-----------------------------------------------------------------------------
 # Dashboard options
@@ -106,7 +109,7 @@

 # Build flags to pass to the generator.
 # E.g. -j2, -j8, ""
-setOnlyIfNotDefined(CTEST_BUILD_FLAGS "-j2")
+setOnlyIfNotDefined(CTEST_BUILD_FLAGS "")

 # Each dashboard script should specify a unique ID per CTEST_DASHBOARD_ROOT.
 # It means the following directories will be created:
@@ -134,13 +137,13 @@
 #-----------------------------------------------------------------------------
 find_program(CTEST_SVN_COMMAND NAMES svn)
 find_program(CTEST_GIT_COMMAND NAMES git)
-find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
+find_program(CTEST_COVERAGE_COMMAND NAMES gcov llvm-cov)
 find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)

 #-----------------------------------------------------------------------------
 # Additional CMakeCache options
 #-----------------------------------------------------------------------------
-setOnlyIfNotDefined(ADDITIONNAL_CMAKECACHE_OPTION "")
+setOnlyIfNotDefined(ADDITIONAL_CMAKECACHE_OPTION "")

 #-----------------------------------------------------------------------------
 # Build Name


Clarify comment in EIGEN_ALIGNEMT cmake option

--- CMake/SurgSimBuildFlags.cmake
+++ CMake/SurgSimBuildFlags.cmake
@@ -134,7 +134,7 @@
 	set(DEFAULT_EIGEN_ALIGNMENT ON)
 endif()

-option(EIGEN_ALIGNMENT "Enable alignment of vectors in Eigen" ${DEFAULT_EIGEN_ALIGNMENT})
+option(EIGEN_ALIGNMENT "Enable alignment in Eigen" ${DEFAULT_EIGEN_ALIGNMENT})
 mark_as_advanced(EIGEN_ALIGNMENT)
 if(NOT EIGEN_ALIGNMENT)
 	add_definitions( -DEIGEN_DONT_ALIGN )


Fix bug that prevented mac os x builds from running in the build directory

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

--- CMake/hoomd/HOOMDMacros.cmake
+++ CMake/hoomd/HOOMDMacros.cmake
@@ -4,6 +4,6 @@
 add_custom_command(TARGET ${target} POST_BUILD
                           COMMAND install_name_tool ARGS -change @rpath/libcudart.dylib ${CUDA_CUDART_LIBRARY} ${_target_exe})
 add_custom_command(TARGET ${target} POST_BUILD
-                          COMMAND install_name_tool ARGS -change @rpath/libcufft.dylib ${CUDA_CUDART_EMU_LIBRARY} ${_target_exe})
+                          COMMAND install_name_tool ARGS -change @rpath/libcufft.dylib ${CUDA_cufft_LIBRARY} ${_target_exe})
 endif (ENABLE_CUDA AND APPLE)
 endmacro(fix_cudart_rpath)


msys2: fix ffmpeg pluging compilation error due to spurious stdint related includes

--- CMakeModules/FindFFmpeg.cmake
+++ CMakeModules/FindFFmpeg.cmake
@@ -96,7 +96,7 @@
 SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")

 # find stdint.h
-IF(WIN32)
+IF(MSVC)

     FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h
         PATHS


cmake: Fix warning on OSX

cmake: Fix warning on OSX

--- cmake/Modules/DefineCMakeDefaults.cmake
+++ cmake/Modules/DefineCMakeDefaults.cmake
@@ -28,3 +28,9 @@

 # Create the compile command database for clang by default
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+if (APPLE)
+    set(CMAKE_MACOSX_RPATH ON)
+    set(CMAKE_SKIP_BUILD_RPATH  FALSE)
+    set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+endif(APPLE)


cmake: Add MemorySanitizer build type

cmake: Add MemorySanitizer build type

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -23,6 +23,18 @@
     set(CMAKE_EXEC_LINKER_FLAGS_ADDRESSSANITIZER "-fsanitize=address"
         CACHE STRING "Flags used by the linker during ADDRESSSANITIZER builds.")

+    # Activate with: -DCMAKE_BUILD_TYPE=MemorySanitizer
+    set(CMAKE_C_FLAGS_MEMORYSANITIZER "-g -O2 -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer"
+        CACHE STRING "Flags used by the C compiler during MEMORYSANITIZER builds.")
+    set(CMAKE_CXX_FLAGS_MEMORYSANITIZER "-g -O2 -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer"
+        CACHE STRING "Flags used by the CXX compiler during MEMORYSANITIZER builds.")
+    set(CMAKE_SHARED_LINKER_FLAGS_MEMORYSANITIZER "-fsanitize=memory"
+        CACHE STRING "Flags used by the linker during the creation of shared libraries during MEMORYSANITIZER builds.")
+    set(CMAKE_MODULE_LINKER_FLAGS_MEMORYSANITIZER "-fsanitize=memory"
+        CACHE STRING "Flags used by the linker during the creation of shared libraries during MEMORYSANITIZER builds.")
+    set(CMAKE_EXEC_LINKER_FLAGS_MEMORYSANITIZER "-fsanitize=memory"
+        CACHE STRING "Flags used by the linker during MEMORYSANITIZER builds.")
+
     # Activate with: -DCMAKE_BUILD_TYPE=UndefinedSanitizer
     set(CMAKE_C_FLAGS_UNDEFINEDSANITIZER "-g -O1 -fsanitize=undefined -fsanitize=null -fsanitize=alignment -fno-sanitize-recover"
         CACHE STRING "Flags used by the C compiler during UNDEFINEDSANITIZER builds.")


Use full libc

Use full libc

--- cmake/arm-none-eabi-gcc.toolchain.cmake
+++ cmake/arm-none-eabi-gcc.toolchain.cmake
@@ -5,4 +5,4 @@

 set(CMAKE_C_FLAGS_INIT "-mcpu=cortex-m4")
 set(CMAKE_CXX_FLAGS_INIT "-mcpu=cortex-m4")
-set(CMAKE_EXE_LINKER_FLAGS_INIT "-specs=nano.specs -specs=rdimon.specs")
+set(CMAKE_EXE_LINKER_FLAGS_INIT "-specs=rdimon.specs")


cmake: compiler: gcc: Add no_strict_aliasing flag

This commit adds the `no_strict_aliasing` flag, which disables
the strict aliasing rule, for the GCC compiler and its derivatives.

Signed-off-by: Stephanos Ioannidis <dc76e9f0c0006e8f919e0c515c66dbba3982f785@stephanos.io>

--- cmake/compiler/gcc/compiler_flags.cmake
+++ cmake/compiler/gcc/compiler_flags.cmake
@@ -129,6 +129,9 @@
 set_property(TARGET compiler-cpp PROPERTY dialect_cpp2b "-std=c++2b"
   "-Wno-register" "-Wno-volatile")

+# Flag for disabling strict aliasing rule in C and C++
+set_compiler_property(PROPERTY no_strict_aliasing -fno-strict-aliasing)
+
 # Disable exceptions flag in C++
 set_property(TARGET compiler-cpp PROPERTY no_exceptions "-fno-exceptions")


Add another path for FindTBB

Add another path for FindTBB

--- components/ospcommon/cmake/FindTBB.cmake
+++ components/ospcommon/cmake/FindTBB.cmake
@@ -102,6 +102,7 @@
       ${PROJECT_SOURCE_DIR}/tbb
       /opt/intel/composerxe/tbb
       /opt/intel/compilers_and_libraries/tbb
+      /opt/intel/tbb
   )

   IF (APPLE)


Separate library namelinks into devel component

--- components/ospcommon/cmake/macros.cmake
+++ components/ospcommon/cmake/macros.cmake
@@ -184,10 +184,25 @@
   INSTALL(TARGETS ${name}
     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
       COMPONENT ${component}
+      NAMELINK_SKIP
     # on Windows put the dlls into bin
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
       COMPONENT ${component}
     # ... and the import lib into the devel package
+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+      COMPONENT devel
+  )
+
+  # Install the namelink in the devel component. This command also includes the
+  # RUNTIME and ARCHIVE components a second time to prevent an "install TARGETS
+  # given no ARCHIVE DESTINATION for static library target" error. Installing
+  # these components twice doesn't hurt anything.
+  INSTALL(TARGETS ${name}
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+      COMPONENT devel
+      NAMELINK_ONLY
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+      COMPONENT ${component}
     ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
       COMPONENT devel
   )


iOS: set CMAKE_SYSTEM_NAME (for CMAKE_CROSSCOMPILING)

[skip ci]

--- os/iphone.cmake
+++ os/iphone.cmake
@@ -147,3 +147,9 @@

 # Introduced in iOS 9.0
 set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE NO)
+
+# This will set CMAKE_CROSSCOMPILING to TRUE.
+# CMAKE_CROSSCOMPILING needed for try_run:
+# * https://cmake.org/cmake/help/latest/command/try_run.html#behavior-when-cross-compiling
+# (used in CURL)
+set(CMAKE_SYSTEM_NAME "Darwin")