Bump to a newer version of cotire

Bump to a newer version of cotire

--- 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.8")
+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)
@@ -450,22 +466,21 @@
 		endforeach()
 	endif()
 	# handle language standard properties
-	if (_target)
-		get_target_property(_targetLanguageStandard ${_target} ${_language}_STANDARD)
-		get_target_property(_targetLanguageExtensions ${_target} ${_language}_EXTENSIONS)
-		get_target_property(_targetLanguageStandardRequired ${_target} ${_language}_STANDARD_REQUIRED)
-		if (_targetLanguageExtensions)
-			if (CMAKE_${_language}${_targetLanguageExtensions}_EXTENSION_COMPILE_OPTION)
-				list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageExtensions}_EXTENSION_COMPILE_OPTION}")
-			endif()
-		elseif (_targetLanguageStandard)
-			if (_targetLanguageStandardRequired)
-				if (CMAKE_${_language}${_targetLanguageStandard}_STANDARD_COMPILE_OPTION)
-					list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_STANDARD_COMPILE_OPTION}")
-				endif()
-			else()
-				if (CMAKE_${_language}${_targetLanguageStandard}_EXTENSION_COMPILE_OPTION)
-					list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_EXTENSION_COMPILE_OPTION}")
+	if (CMAKE_${_language}_STANDARD_DEFAULT)
+		# used compiler supports language standard levels
+		if (_target)
+			get_target_property(_targetLanguageStandard ${_target} ${_language}_STANDARD)
+			if (_targetLanguageStandard)
+				set (_type "EXTENSION")
+				get_property(_isSet TARGET ${_target} PROPERTY ${_language}_EXTENSIONS SET)
+				if (_isSet)
+					get_target_property(_targetUseLanguageExtensions ${_target} ${_language}_EXTENSIONS)
+					if (NOT _targetUseLanguageExtensions)
+						set (_type "STANDARD")
+					endif()
+				endif()
+				if (CMAKE_${_language}${_targetLanguageStandard}_${_type}_COMPILE_OPTION)
+					list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_${_type}_COMPILE_OPTION}")
 				endif()
 			endif()
 		endif()
@@ -574,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
@@ -628,6 +643,25 @@
 	if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
 		list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
 	endif()
+	if (WIN32 AND NOT MINGW)
+		# convert Windows paths in include directories to CMake paths
+		if (_includeDirs)
+			set (_paths "")
+			foreach (_dir ${_includeDirs})
+				file (TO_CMAKE_PATH "${_dir}" _path)
+				list (APPEND _paths "${_path}")
+			endforeach()
+			set (_includeDirs ${_paths})
+		endif()
+		if (_systemIncludeDirs)
+			set (_paths "")
+			foreach (_dir ${_systemIncludeDirs})
+				file (TO_CMAKE_PATH "${_dir}" _path)
+				list (APPEND _paths "${_path}")
+			endforeach()
+			set (_systemIncludeDirs ${_paths})
+		endif()
+	endif()
 	if (COTIRE_DEBUG AND _includeDirs)
 		message (STATUS "Target ${_target} include dirs: ${_includeDirs}")
 	endif()
@@ -685,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)
@@ -693,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})
@@ -841,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")
@@ -857,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")
@@ -884,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()
@@ -1052,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()
@@ -1184,7 +1223,7 @@

 function (cotire_scan_includes _includesVar)
 	set(_options "")
-	set(_oneValueArgs COMPILER_ID COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_VERSION LANGUAGE UNPARSED_LINES)
+	set(_oneValueArgs COMPILER_ID COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_VERSION LANGUAGE UNPARSED_LINES SCAN_RESULT)
 	set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES
 		IGNORE_PATH INCLUDE_PATH IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH COMPILER_LAUNCHER)
 	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
@@ -1215,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()
@@ -1256,6 +1303,9 @@
 	set (${_includesVar} ${_includes} PARENT_SCOPE)
 	if (_option_UNPARSED_LINES)
 		set (${_option_UNPARSED_LINES} ${_unparsedLines} PARENT_SCOPE)
+	endif()
+	if (_option_SCAN_RESULT)
+		set (${_option_SCAN_RESULT} ${_result} PARENT_SCOPE)
 	endif()
 endfunction()

@@ -1444,18 +1494,24 @@
 		INCLUDE_PATH ${_option_INCLUDE_PATH}
 		IGNORE_EXTENSIONS ${_option_IGNORE_EXTENSIONS}
 		INCLUDE_PRIORITY_PATH ${_option_INCLUDE_PRIORITY_PATH}
-		UNPARSED_LINES _unparsedLines)
+		UNPARSED_LINES _unparsedLines
+		SCAN_RESULT _scanResult)
 	cotire_generate_unity_source("${_prefixFile}"
 		PROLOGUE ${_prologue} EPILOGUE ${_epilogue} LANGUAGE "${_option_LANGUAGE}" ${_selectedHeaders})
 	set (_unparsedLinesFile "${_prefixFile}.log")
 	if (_unparsedLines)
-		if (COTIRE_VERBOSE OR NOT _selectedHeaders)
+		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)
@@ -1485,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
@@ -1495,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)
@@ -1578,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
@@ -1589,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)
@@ -1635,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()
@@ -1699,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)
@@ -1759,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}\"")
@@ -1814,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}
@@ -1831,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")
@@ -1842,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")
@@ -1854,12 +2026,40 @@
 	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")
-		if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros|pch_defines")
-			set (${_msgVar}
-				"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
-				PARENT_SCOPE)
+	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")
+				set (${_msgVar}
+					"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
+					PARENT_SCOPE)
+			endif()
+		else()
+			if (_realCompilerExe MATCHES "ccache")
+				set (_ccacheExe "${_realCompilerExe}")
+			else()
+				set (_ccacheExe "${_launcher}")
+			endif()
+			execute_process(
+				COMMAND "${_ccacheExe}" "--print-config"
+				WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+				RESULT_VARIABLE _result
+				OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
+				ERROR_QUIET)
+			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)
+			endif()
 		endif()
 	endif()
 	if (APPLE)
@@ -2148,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
@@ -2181,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 "")
@@ -2206,14 +2407,18 @@
 			else()
 				file (RELATIVE_PATH _pchFileLogPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
 			endif()
+			# make precompiled header compilation depend on the actual compiler executable used to force
+			# re-compilation when the compiler executable is updated. This prevents "created by a different GCC executable"
+			# warnings when the precompiled header is included.
+			get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
 			if (COTIRE_DEBUG)
-				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
+				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} ${_realCompilerExe} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
 			endif()
 			set_property (SOURCE "${_pchFile}" PROPERTY GENERATED TRUE)
 			add_custom_command(
 				OUTPUT "${_pchFile}"
 				COMMAND ${_cmds}
-				DEPENDS "${_prefixFile}"
+				DEPENDS "${_prefixFile}" "${_realCompilerExe}"
 				IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
 				WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 				COMMENT "Building ${_language} precompiled header ${_pchFileLogPath}"
@@ -2223,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)
@@ -2370,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)
@@ -2407,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)
@@ -2445,8 +2653,12 @@
 	cotire_set_cmd_to_prologue(_prefixCmd)
 	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" ${_unityFiles})
 	set_property (SOURCE "${_prefixFile}" PROPERTY GENERATED TRUE)
+	# make prefix header generation depend on the actual compiler executable used to force
+	# re-generation when the compiler executable is updated. This prevents "file not found"
+	# errors for compiler version specific system header files.
+	get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
 	if (COTIRE_DEBUG)
-		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources}")
+		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources} ${_realCompilerExe}")
 	endif()
 	if (MSVC_IDE)
 		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileLogPath)
@@ -2478,7 +2690,7 @@
 	add_custom_command(
 		OUTPUT "${_prefixFile}" "${_prefixFile}.log"
 		COMMAND ${_prefixCmd}
-		DEPENDS ${_unityFiles} ${_dependencySources}
+		DEPENDS ${_unityFiles} ${_dependencySources} "${_realCompilerExe}"
 		COMMENT "${_comment}"
 		WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 		VERBATIM)
@@ -2608,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)
@@ -2639,10 +2854,12 @@
 			set (${_targetLanguagesVar} "" PARENT_SCOPE)
 			return()
 		endif()
-		if (_targetUsePCH AND "${_language}" MATCHES "^C|CXX$" AND NOT "${CMAKE_${_language}_COMPILER_ID}" STREQUAL "")
-			cotire_check_precompiled_header_support("${_language}" "${_target}" _disableMsg)
-			if (_disableMsg)
-				set (_targetUsePCH FALSE)
+		if (_targetUsePCH AND "${_language}" MATCHES "^C|CXX$" AND DEFINED CMAKE_${_language}_COMPILER_ID)
+			if (CMAKE_${_language}_COMPILER_ID)
+				cotire_check_precompiled_header_support("${_language}" "${_target}" _disableMsg)
+				if (_disableMsg)
+					set (_targetUsePCH FALSE)
+				endif()
 			endif()
 		endif()
 		set (_sourceFiles "")
@@ -2696,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})
@@ -2723,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)
@@ -2836,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})
@@ -2855,6 +3091,16 @@
 		# for other generators, we add the "clean all" target to clean up the precompiled header
 		cotire_setup_clean_all_target()
 	endif()
+endfunction()
+
+function (cotire_filter_object_libraries _target _objectLibrariesVar)
+	set (_objectLibraries "")
+	foreach (_source ${ARGN})
+		if (_source MATCHES "^\\$<TARGET_OBJECTS:.+>$")
+			list (APPEND _objectLibraries "${_source}")
+		endif()
+	endforeach()
+	set (${_objectLibrariesVar} ${_objectLibraries} PARENT_SCOPE)
 endfunction()

 function (cotire_collect_unity_target_sources _target _languages _unityTargetSourcesVar)
@@ -2875,6 +3121,16 @@
 			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})
+		if (_objectLibraries)
+			cotire_map_libraries("${_linkLibrariesStrategy}" _unityObjectLibraries ${_objectLibraries})
+			list (REMOVE_ITEM _unityTargetSources ${_objectLibraries})
+			list (APPEND _unityTargetSources ${_unityObjectLibraries})
+		endif()
+	endif()
 	set (${_unityTargetSourcesVar} ${_unityTargetSources} PARENT_SCOPE)
 endfunction()

@@ -2910,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)
@@ -2932,10 +3178,6 @@
 		add_executable(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
 	else()
 		add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
-	endif()
-	if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
-		# depend on the original target's implicity generated <targetname>_automoc target
-		add_dependencies(${_unityTargetName} ${_target}_automoc)
 	endif()
 	# copy output location properties
 	set (_outputDirProperties
@@ -2948,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)
@@ -2969,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>
@@ -2981,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
@@ -2990,14 +3232,15 @@
 		POSITION_INDEPENDENT_CODE
 		C_COMPILER_LAUNCHER CXX_COMPILER_LAUNCHER
 		C_INCLUDE_WHAT_YOU_USE CXX_INCLUDE_WHAT_YOU_USE
-		C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN)
+		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
@@ -3005,26 +3248,28 @@
 		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>
 		LINK_INTERFACE_MULTIPLICITY LINK_INTERFACE_MULTIPLICITY_<CONFIG>
 		LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
 		STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
-		NO_SONAME SOVERSION VERSION)
+		NO_SONAME SOVERSION VERSION
+		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>
@@ -3036,15 +3281,21 @@
 		VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER
 		VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
 		VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
-		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS)
+		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS
+		DEPLOYMENT_REMOTE_DIRECTORY VS_CONFIGURATION_TYPE
+		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)
@@ -3056,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})
@@ -3151,9 +3409,15 @@
 		if (_library MATCHES "^\\$<LINK_ONLY:(.+)>$")
 			set (_libraryName "${CMAKE_MATCH_1}")
 			set (_linkOnly TRUE)
+			set (_objectLibrary FALSE)
+		elseif (_library MATCHES "^\\$<TARGET_OBJECTS:(.+)>$")
+			set (_libraryName "${CMAKE_MATCH_1}")
+			set (_linkOnly FALSE)
+			set (_objectLibrary TRUE)
 		else()
 			set (_libraryName "${_library}")
 			set (_linkOnly FALSE)
+			set (_objectLibrary FALSE)
 		endif()
 		if ("${_strategy}" MATCHES "COPY_UNITY")
 			cotire_is_target_supported(${_libraryName} _isSupported)
@@ -3163,6 +3427,8 @@
 				if (TARGET "${_libraryUnityTargetName}")
 					if (_linkOnly)
 						list (APPEND _mappedLibraries "$<LINK_ONLY:${_libraryUnityTargetName}>")
+					elseif (_objectLibrary)
+						list (APPEND _mappedLibraries "$<TARGET_OBJECTS:${_libraryUnityTargetName}>")
 					else()
 						list (APPEND _mappedLibraries "${_libraryUnityTargetName}")
 					endif()
@@ -3206,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()
@@ -3504,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)
@@ -3603,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(


Fix luajit build on FreeBSD

Fix luajit build on FreeBSD

Luajit comes with a custome buildsystem. Fixed passing custom
CC; it bites on FreeBSD since we are currently unable to build
with default CC (gh-786).

--- cmake/luajit.cmake
+++ cmake/luajit.cmake
@@ -170,6 +170,7 @@
         CFLAGS=""
         CXXFLAGS=""
         XCFLAGS="${luajit_xcflags}"
+        CC="${luajit_host_cc}"
         HOST_CC="${luajit_host_cc}"
         TARGET_CC="${luajit_target_cc}"
         CCOPT="${luajit_copt}")


MDEV-6854 Typo in cmake/plugin.cmake

MDEV-6854 Typo in cmake/plugin.cmake

--- cmake/plugin.cmake
+++ cmake/plugin.cmake
@@ -65,7 +65,7 @@
   ENDIF()

   IF(WITH_${plugin}_STORAGE_ENGINE
-    OR WITH_{$plugin}
+    OR WITH_${plugin}
     OR WITH_ALL
     OR WITH_MAX
     AND NOT WITHOUT_${plugin}_STORAGE_ENGINE


Modified CMake SLEPc finder

Modified CMake SLEPc finder

--- tools/CMake/FindSLEPc.cmake
+++ tools/CMake/FindSLEPc.cmake
@@ -1,23 +1,25 @@
+set(SLEPC_DIR $ENV{SLEPC_DIR})
+message("*** SLEPC_DIR = ${SLEPC_DIR}")

-message("*** SLEPC_DIR = ${SLEPC_DIR}")
-
-SET(SLEPC_INCLUDE_DIR_A "${SLEPC_DIR}/${SLEPC_ARCH}/include")
-SET(SLEPC_INCLUDE_DIR   "${SLEPC_DIR}/include")
-SET(SLEPC_LIB_DIR       "${SLEPC_DIR}/${SLEPC_ARCH}/lib")

-FIND_LIBRARY(SLEPC_LIB_SLEPC     slepc
-             HINTS ${SLEPC_DIR}/${SLEPC_ARCH}/lib)
+set(SLEPC_INCLUDE_DIR_A "${SLEPC_DIR}/${PETSC_ARCH}/include")
+set(SLEPC_INCLUDE_DIR   "${SLEPC_DIR}/include")
+set(SLEPC_LIB_DIR       "${SLEPC_DIR}/${PETSC_ARCH}/lib")

-message( "*** SLEPc directory : ${SLEPC_DIR} ${SLEPC_LIB_SLEPC}"  )
+message(" lib dir = ${SLEPC_DIR}/${PETSC_ARCH}/lib")
+find_library(SLEPC_LIB_SLEPC     slepc
+             HINTS ${SLEPC_DIR}/${PETSC_ARCH}/lib)
+
+message(${SLEPC_LIB_SLEPC})

 if (SLEPC_DIR AND SLEPC_LIB_SLEPC )
-  SET(SLEPC_LIBRARIES ${SLEPC_LIB_SLEPC} CACHE STRING "SLEPc libraries" FORCE)
+  set(SLEPC_LIBRARIES ${SLEPC_LIB_SLEPC} CACHE STRING "SLEPc libraries" FORCE)
   set(HAVE_SLEPC 1)
   set(SLEPC_FOUND ON)
   message( "-- Found SLEPc: ${SLEPC_LIBRARIES}" )
   set(SLEPC_INCLUDES ${SLEPC_INCLUDE_DIR} ${SLEPC_INCLUDE_DIR_A} CACHE STRING "SLEPc include path" FORCE)
   mark_as_advanced( SLEPC_DIR SLEPC_LIB_SLEPC SLEPC_INCLUDES SLEPC_LIBRARIES )
 else()
-  message( "-- SLEPc not found!" )
+  message(FATAL_ERROR "SLEPc not found!" )
 endif()


ADD_CUSTOM_TARGET_COMMNAD: replace NO_FORCE target to <target>_no_force

--- Modules/ManageTarget.cmake
+++ Modules/ManageTarget.cmake
@@ -14,14 +14,14 @@
 #
 #     If you also want a target that run only if output files
 #     do not exist or outdated. Specify "NO_FORCE".
-#     The target for that will be "<target>/make".
+#     The target for that will be "<target>_no_force".
 #
 #     * Parameters:
 #       + target: target for this command
 #       + OUTPUT file1, file2 ... : Files to be outputted by this command
 #       + ALL: (Optional) The target is built with target 'all'
-#       + NO_FORCE: (Optional) Produce a target that run only if output files
-#         do not exist or outdated.
+#       + NO_FORCE: (Optional) Produce a target that run only if
+#         output files do not exist or outdated.
 #       + command1 ... : Command to be run.
 #         The rest arguments are same with  ADD_CUSTOM_TARGET.
 #
@@ -47,7 +47,7 @@
 	    )

 	IF(DEFINED _opt_NO_FORCE)
-	    ADD_CUSTOM_TARGET(${target}/no_force
+	    ADD_CUSTOM_TARGET(${target}_no_force
 		DEPENDS ${_opt_OUTPUT}
 		)
 	ENDIF(DEFINED _opt_NO_FORCE)


QtExt needs boost include directory because sdk-remote needs it.

	* build-aux/cmake/modules/QtExt.cmake: Find boost.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/QtExt.cmake
+++ build-aux/cmake/modules/QtExt.cmake
@@ -22,6 +22,11 @@
 # sdk-remote
 find_package(SdkRemote REQUIRED)

+# Boost
+set(Boost_USE_STATIC_LIBS ON)
+set(Boost_USE_MULTITHREAD OFF)
+find_package(Boost 1.34.1)
+
 # QScintilla2
 if(WITH_QURBI_EDITOR)
   find_package(QScintilla2 REQUIRED)


Will now use longest available match (should be specific device)

--- drivers/CMSIS/cmsis.cmake
+++ drivers/CMSIS/cmsis.cmake
@@ -11,6 +11,7 @@
 	)

 set(STARTUP_BASE ${DEVICE_BASE}/Source/Templates/gcc)
+set(CURRENT_LEN 0)

 # Find startup file
 if(EXISTS ${DEVICE_BASE}/Source/Templates/gcc/startup_${DEVICE_L}.s)
@@ -27,7 +28,11 @@
         #message("TEST: ${TEST_FILE} FILE: ${FILE} AGAINST: startup_${DEVICE_L}.s")
         string(REGEX MATCH "^(${TEST_FILE})" TEST_MATCH "startup_${DEVICE_L}.s")
         if(TEST_MATCH)
-            set(STARTUP_FILE ${STARTUP_BASE}/${FILE})
+            string(LENGTH ${FILE} FILE_LEN)
+            if(${FILE_LEN} GREATER ${CURRENT_LEN}})
+                set(STARTUP_FILE ${STARTUP_BASE}/${FILE})
+                string(LENGTH ${FILE} CURRENT_LEN)
+            endif()
         endif()
     endforeach(FILE)


Tweak CPack config.

Tweak CPack config.

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[ ] Bugfix
[ ] New Feature
[x] Cleanup
[ ] Optimization
[ ] Documentation

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -7,6 +7,7 @@
 set(CPACK_PACKAGE_VENDOR "Eyescale")
 set(CPACK_PACKAGE_CONTACT "Stefan Eilemann <eile@eyescale.ch>")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Parallel Rendering Framework")
+set(CPACK_PACKAGE_DESCRIPTION_FILE ${Equalizer_SOURCE_DIR}/RELNOTES.txt)
 set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
 set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
 set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
@@ -52,13 +53,19 @@
 set(CPACK_COMPONENT_VMMLIB_DESCRIPTION
   "vmmlib is a vector and matrix math library implemented using C++ templates, thus making it very easy to integrate into other libraries and programs.")

+set(CPACK_RPM_PACKAGE_LICENSE "LGPL, BSD")
+set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries/Parallel")
 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-system-dev, libboost-regex-dev, libboost-date-time-dev, bison, flex, libx11-dev")

+if(EQ_REVISION)
+  set(CPACK_RPM_PACKAGE_RELEASE ${EQ_REVISION})
+endif()
 if(MSVC)
   set(CPACK_GENERATOR NSIS)
-  set(CPACK_NSIS_PACKAGE_NAME "Equalizer")
-  set(CPACK_NSIS_DISPLAY_NAME "Equalizer Parallel Rendering Framework")
 endif(MSVC)
+if(APPLE)
+  set(CPACK_GENERATOR PackageMaker)
+endif(APPLE)

 include(InstallRequiredSystemLibraries)
 include(CPack)


Add tar.gz package type

Add tar.gz package type

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -1,5 +1,6 @@
 set(CPACK_GENERATOR
     ZIP
+    TGZ
     DEB
     RPM
     )
@@ -21,8 +22,6 @@
 set(CPACK_CMAKE_GENERATOR "Unix Makefiles")
 set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)

-
-
 # Debian Specific
 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://6xq.net/pianobar/")
 set(CPACK_DEBIAN_cmake_PACKAGE_DEPENDS "TODO")


Simplify detection of using 64-bit ids

Simplify detection of using 64-bit ids

Change-Id: I44ff28702400b83b9c1b7ff43aeeb8a608514172

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -3,22 +3,13 @@
 # Get and build itk

 # Determine if we need to set to use 64BITS_IDS for windows64
-include(CheckTypeSize)
-check_type_size(size_t SITK_SIZEOF_SIZE_T)
-check_type_size(long SITK_SIZEOF_LONG)
-
-set(_ITK_USE_64BITS_IDS_DEFAULT OFF)
-if(SITK_SIZEOF_SIZE_T EQUAL 8
-    AND NOT SITK_SIZEOF_LONG EQUAL 8 )
-  set(_ITK_USE_64BITS_IDS_DEFAULT ON)
+if(CMAKE_CL_64)
+  option(ITK_USE_64BITS_IDS "When ON, ITK will use 64 bits integers to
+index pixels. This is needed for managing images larger than 4Gb in
+some platforms."
+    ON)
+  mark_as_advanced(ITK_USE_64BITS_IDS)
 endif()
-
-option(ITK_USE_64BITS_IDS "When ON, ITK will use 64 bits integers to
- index pixels. This is needed for managing images larger than 4Gb in
- some platforms."
-  ${_ITK_USE_64BITS_IDS_DEFAULT})
-mark_as_advanced(ITK_USE_64BITS_IDS)
-

 get_cmake_property( _varNames VARIABLES )


ffmpeg: update 3.4.6

ffmpeg: update 3.4.6

libvpx: 1.8.0

--- 3rdparty/ffmpeg/ffmpeg.cmake
+++ 3rdparty/ffmpeg/ffmpeg.cmake
@@ -1,8 +1,8 @@
-# Binaries branch name: ffmpeg/3.4_20181103
-# Binaries were created for OpenCV: c6d2f0399a706028f476f3d08358ea787503020d
-ocv_update(FFMPEG_BINARIES_COMMIT "fe71c0ad807fdc33c2178e48e488f1e9b177c39a")
-ocv_update(FFMPEG_FILE_HASH_BIN32 "41b81bb9a50cabd4bea385f7b50a069a")
-ocv_update(FFMPEG_FILE_HASH_BIN64 "a9ea7dbbc8e5afd08e00e223a831b578")
+# Binaries branch name: ffmpeg/3.4_20190612
+# Binaries were created for OpenCV: 1c661e754812d3423e8c15ccb9cdab57fc122c44
+ocv_update(FFMPEG_BINARIES_COMMIT "d284fd09e76966e95f08e1ac3a1a28b227447501")
+ocv_update(FFMPEG_FILE_HASH_BIN32 "a7032bf6cc1cb010dc055f352277792c")
+ocv_update(FFMPEG_FILE_HASH_BIN64 "40d1a38b83a0413a3fcf9df1044fff2a")
 ocv_update(FFMPEG_FILE_HASH_CMAKE "3b90f67f4b429e77d3da36698cef700c")

 function(download_win_ffmpeg script_var)


Must set the OGRE_MEDIA_DIR_* to an absolute path for build folder versions

--HG--
branch : v1-7
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-7%401895

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -142,6 +142,8 @@

 # CREATE CONFIG FILES - BUILD DIR VERSIONS
+set(OGRE_MEDIA_DIR_REL "${OGRE_SOURCE_DIR}/Samples/media")
+set(OGRE_MEDIA_DIR_DBG "${OGRE_SOURCE_DIR}/Samples/media")
 if (WIN32)
   set(OGRE_PLUGIN_DIR_REL ".")
   set(OGRE_PLUGIN_DIR_DBG ".")


Update FindGLFW.cmake

Update FindGLFW.cmake

Removed "Horde3D" prefix to "FORCE_DOWNLOAD_GLFW" CMake flag name.

--- CMake/Modules/FindGLFW.cmake
+++ CMake/Modules/FindGLFW.cmake
@@ -41,7 +41,7 @@

 SET(GLFW_FOUND FALSE)

-IF(NOT GLFW_LIBRARY OR HORDE3D_FORCE_DOWNLOAD_GLFW)
+IF(NOT GLFW_LIBRARY OR FORCE_DOWNLOAD_GLFW)
     # If not found, try to build with local sources.
     # It uses CMake's "ExternalProject_Add" target.
     MESSAGE(STATUS "Preparing external GLFW project")


ctkMacroBuildLib - Fix test checking for existence of the PythonQtDecorator file

--- CMake/ctkMacroBuildLib.cmake
+++ CMake/ctkMacroBuildLib.cmake
@@ -108,8 +108,8 @@
   IF(CTK_WRAP_PYTHONQT_LIGHT AND NOT ${MY_DISABLE_WRAP_PYTHONQT})
     # Does a header having the expected filename exists ?
     STRING(REGEX REPLACE "^CTK" "ctk" lib_name_lc_ctk ${lib_name})
-    SET(decorator_header_filename ${lib_name_lc_ctk}PythonQtDecorator.h)
-    IF(EXISTS ${decorator_header_filename})
+    SET(decorator_header_filename ${lib_name_lc_ctk}PythonQtDecorators.h)
+    IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${decorator_header_filename})
       LIST(APPEND my_EXTRA_PYTHON_LIBRARIES ${PYTHON_LIBRARY} ${PYTHONQT_LIBRARIES})
       # Should we link against VTK
       IF(CTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK)


- fix an issue with the version being set twice

--- CMakeModules/FindEXPAT.cmake
+++ CMakeModules/FindEXPAT.cmake
@@ -97,19 +97,22 @@
 file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
      REGEX "^#[\t ]*define[\t ]+XML_(MAJOR|MINOR|MICRO)_VERSION[\t ]+[0-9]+$")

-unset(EXPAT_VERSION)
+unset(EXPAT_VERSION CACHE)
+set(_STARTED FALSE)
 foreach(VPART MAJOR MINOR MICRO)
     foreach(VLINE ${expat_version_str})
         if(VLINE MATCHES "^#[\t ]*define[\t ]+XML_${VPART}_VERSION[\t ]+([0-9]+)$")
             set(EXPAT_VERSION_PART "${CMAKE_MATCH_1}")
-            if(EXPAT_VERSION)
+            if(_STARTED)
                 string(APPEND EXPAT_VERSION ".${EXPAT_VERSION_PART}")
             else()
                 set(EXPAT_VERSION "${EXPAT_VERSION_PART}")
+                set(_STARTED TRUE)
             endif()
         endif()
     endforeach()
 endforeach()
+unset(_STARTED)
 endif ()


Build Lua as shared

Build Lua as shared

--- CMakeModules/build_lua.cmake
+++ CMakeModules/build_lua.cmake
@@ -33,8 +33,8 @@
     -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-    -DBUILD_SHARED_LIBS=OFF
-    -DLUA_BUILD_AS_DLL=OFF
+    -DBUILD_SHARED_LIBS=ON
+    -DLUA_BUILD_AS_DLL=ON
     ${byproducts}
     )


fixing libdir for arpack-ng

fixing libdir for arpack-ng

Former-commit-id: 9a3b0398a0fe75b452e712be48520fadaaf5e3f3

--- cmake-modules/Fetch_Arpack-ng.cmake
+++ cmake-modules/Fetch_Arpack-ng.cmake
@@ -67,6 +67,7 @@
             BUILD_IN_SOURCE 1
             CMAKE_ARGS
             -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+            -DCMAKE_INSTALL_LIBDIR:PATH=lib
             -DCMAKE_INSTALL_MESSAGE=NEVER #Avoid unnecessary output to console
             -DCMAKE_C_FLAGS=-w -m64
             -DCMAKE_Fortran_FLAGS=-w -m64


fixed eigsolver test linking

fixed eigsolver test linking

Former-commit-id: 583d83decd1abeeb2dcab007ac4f964cd4ed8058

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -28,19 +28,10 @@
     set(HDF5_WANT_VERSION 1.10)
 endif()

-if(NOT HDF5_ROOT)
-    set(HDF5_ROOT $ENV{HDF5_ROOT})
-endif()
+set(HDF5_ROOT ${HDF5_ROOT} $ENV{ROOT} $ENV{HOME}/.conda $ENV{HOME}/anaconda3 $ENV{HOME}/miniconda3)

-
-
-if(HDF5_REQUIRED)
-    find_package(HDF5 ${HDF5_WANT_VERSION} COMPONENTS C HL REQUIRED)
-else()
-    find_package(HDF5 ${HDF5_WANT_VERSION} COMPONENTS C HL)
-endif()
-
+#find_package(HDF5 ${HDF5_WANT_VERSION} COMPONENTS C HL PATHS ${HDF5_ROOT} $ENV{ROOT} $ENV{HOME}/.conda $ENV{HOME}/anaconda3)
 if(NOT HDF5_FOUND)
 find_file(HDF5_C_COMPILER_EXECUTABLE        NAMES h5cc  PATHS $ENV{PATH} /usr/bin /usr/local/bin $ENV{HOME}/.conda/bin  $ENV{HOME}/anaconda3/bin)
 find_file(HDF5_CXX_COMPILER_EXECUTABLE      NAMES h5c++ PATHS $ENV{PATH} /usr/bin /usr/local/bin $ENV{HOME}/.conda/bin  $ENV{HOME}/anaconda3/bin)


eds-I#94 - Remove -Wabi from the default C++ warning flags

Related to https://gitlab.gnome.org/GNOME/evolution-data-server/issues/94

--- cmake/modules/SetupBuildFlags.cmake
+++ cmake/modules/SetupBuildFlags.cmake
@@ -56,7 +56,6 @@

 	list(APPEND proposed_cxx_flags
 		${proposed_flags}
-		-Wabi
 		-Wnoexcept
 	)


[cmake] bullet only needed by mechanics

[cmake] bullet only needed by mechanics

--- cmake/siconos_find_common_dep.cmake
+++ cmake/siconos_find_common_dep.cmake
@@ -122,7 +122,7 @@
 # --- Bullet ---
 SET(BULLET_PATHS "")
 IF(WITH_BULLET)
-  COMPILE_WITH(Bullet REQUIRED)
+  COMPILE_WITH(Bullet REQUIRED ONLY mechanics)
   IF(BULLET_FOUND)
     SET(SICONOS_HAVE_BULLET TRUE)
     MESSAGE( STATUS " Bullet include dirs : ${BULLET_INCLUDE_DIRS}" )


Minor change to message

Minor change to message

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -31,7 +31,7 @@
   STRING(REGEX REPLACE "[\r\n]" " " EXTRA_COMPILER_FLAGS "${EXTRA_COMPILER_FLAGS}")
   set_target_properties(${APP_NAME} PROPERTIES
     COMPILE_FLAGS "${EXTRA_COMPILER_FLAGS}")
-  message("WARNING: Using additional flags from ${SOURCE_DIR}/flags.txt: ${EXTRA_COMPILER_FLAGS}")
+  message("NOTE: Using additional flags from ${SOURCE_DIR}/flags.txt: ${EXTRA_COMPILER_FLAGS}")
 endif()

 message("Target: ${APP_NAME}")


Fix value for APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID

--- flags/data-sections.cmake
+++ flags/data-sections.cmake
@@ -15,4 +15,4 @@

 # There is no macro to detect this flags on toolchain calculation so we must
 # mark this toolchain explicitly.
-list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "function-sections")
+list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "data-sections")


fixed: use debug postfix only on windows

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

--- CMake/BuildFunctions.cmake
+++ CMake/BuildFunctions.cmake
@@ -698,11 +698,17 @@

     INCLUDE_DIRECTORIES(${${PROJECT_NAME}_INC})

+    SET(_OSG_DEBUG_POSTFIX "")
+
+    IF(WIN32)
+        SET(_OSG_DEBUG_POSTFIX DEBUG_POSTFIX "D")
+    ENDIF(WIN32)
+
     SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
         DEFINE_SYMBOL ${PROJ_DEFINE}
         VERSION ${OSG_VERSION}
         SOVERSION ${OSG_VERSION}
-        DEBUG_POSTFIX "D"
+        ${_OSG_DEBUG_POSTFIX}
         DEBUGOPT_POSTFIX "DO"
         RELEASENOOPT_POSTFIX "RN")


COMP: Fixed Boost binary directory.

COMP: Fixed Boost binary directory.

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -44,7 +44,8 @@

     ExternalProject_Add(${proj}
       SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
-      BINARY_DIR ${proj}-build
+      # Boost needs in-source builds
+      BINARY_DIR ${proj}-src
       PREFIX ${proj}-cmake
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/boost_1_45_0.tar.bz2
       URL_MD5 d405c606354789d0426bc07bea617e58


(CMAKE) Add build_library function in project.cmake to split big projects into several libs.

--- backends/cmake/project.cmake
+++ backends/cmake/project.cmake
@@ -126,4 +126,21 @@

 endfunction(build_project)

+function (build_library library_name)
+	if (NOT mcu)
+		show_available_mcus()
+		message(FATAL_ERROR "No MCU selected ! Use -Dmcu=")
+		return()
+	endif(NOT mcu)

+	list(REMOVE_AT ARGV 0)
+	set(source_files ${ARGV})
+
+	add_library(${library_name} ${source_files})
+
+	#TODO: process automaticaly
+	set_target_properties(${library_name} PROPERTIES COMPILE_FLAGS ${${MCU}_COMPILE_FLAGS})
+
+endfunction(build_library)
+
+


Tiny bits of cleanup in OIS lib installation for Apple platforms.

--HG--
branch : v1-9

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -115,18 +115,10 @@
 		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
 	  endif ()
 	elseif(APPLE)
-	  if (EXISTS ${OGRE_DEP_DIR}/lib/debug/libOIS.a)
-	        install(FILES
-	          ${OGRE_DEP_DIR}/lib/debug/libOIS.a
-	          DESTINATION lib/debug CONFIGURATIONS Debug
-	        )
-	  endif ()
-	  if (EXISTS ${OGRE_DEP_DIR}/lib/release/libOIS.a)
-	        install(FILES
-	          ${OGRE_DEP_DIR}/lib/release/libOIS.a
-	          DESTINATION lib/release CONFIGURATIONS Release RelWithDebInfo MinSizeRel None ""
-	        )
-	  endif ()
+        install(FILES
+          ${OGRE_DEP_DIR}/lib/$(PLATFORM_NAME)/$(CONFIGURATION)/libOIS.a
+          DESTINATION lib/$(PLATFORM_NAME)/$(CONFIGURATION)
+        )
 	endif ()
 	  endif ()

@@ -291,7 +283,7 @@
       copy_release(libGLESv2.dll)
     endif ()

-  elseif(APPLE)
+  elseif(APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
     # copy the required libs and frameworks to the build directory (configure_file is the only copy-like op I found in CMake)
     copy_debug(libOIS.a)
     copy_release(libOIS.a)


Add new search path for iOS SDK thanks to Xcode 4.3

--HG--
branch : v1-8

--- CMake/Packages/FindiOSSDK.cmake
+++ CMake/Packages/FindiOSSDK.cmake
@@ -9,7 +9,7 @@
 # construct search paths
 set(iOSSDK_PREFIX_PATH ${iOSSDK_HOME} $ENV{iOSSDK_HOME}
   ${OGRE_HOME} $ENV{OGRE_HOME})
-create_search_paths(/Developer/Platforms)
+create_search_paths(/Developer/Platforms /Applications/Xcode.app/Contents/Developer/Platforms)
 # redo search if prefix path changed
 clear_if_changed(iOSSDK_PREFIX_PATH
   iOSSDK_LIBRARY_FWK
@@ -25,7 +25,7 @@

 #findpkg_framework(UIKit)

-find_path(iOSSDK_INCLUDE_DIR iPhoneOS.platform /Developer/Platforms)
+find_path(iOSSDK_INCLUDE_DIR iPhoneOS.platform /Developer/Platforms /Applications/Xcode.app/Contents/Developer/Platforms)

 if (iOSSDK_INCLUDE_DIR)
   unset(iOSSDK_INCLUDE_DIR)


re-enable NVIDIA build

re-enable NVIDIA build

--- CMake/hoomd/HOOMDHIPSetup.cmake
+++ CMake/hoomd/HOOMDHIPSetup.cmake
@@ -100,8 +100,10 @@

     ENABLE_LANGUAGE(CUDA)

-    # reduce link time (no device linking)
-    set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -fno-gpu-rdc")
+    if (HIP_FOUND)
+        # reduce link time (no device linking)
+        set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -fno-gpu-rdc")
+    endif()

     if(NOT TARGET HIP::hip)
         add_library(HIP::hip INTERFACE IMPORTED)


try strequal

try strequal

--- CMake/hoomd/HOOMDMPISetup.cmake
+++ CMake/hoomd/HOOMDMPISetup.cmake
@@ -67,12 +67,12 @@
 # https://gitlab.kitware.com/cmake/cmake/merge_requests/2529/diffs

 if (CMAKE_VERSION VERSION_LESS 3.12.0 AND ENABLE_HIP)
-    string(REPLACE "-pthread" "$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<HIP_PLATFORM:nvcc>>:-Xcompiler>;-pthread"
+    string(REPLACE "-pthread" "$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<STREQUAL:${HIP_PLATFORM},nvcc>>:-Xcompiler>;-pthread"
       _MPI_C_COMPILE_OPTIONS "${MPI_C_COMPILE_OPTIONS}")
     set_property(TARGET MPI::MPI_C PROPERTY INTERFACE_COMPILE_OPTIONS "${_MPI_C_COMPILE_OPTIONS}")
     unset(_MPI_C_COMPILE_OPTIONS)

-    string(REPLACE "-pthread" "$<$<AND:$<COMPILE_LANGUAGE:CUDA><$<HIP_PLATFORM:nvcc>>:-Xcompiler>;-pthread"
+    string(REPLACE "-pthread" "$<$<AND:$<COMPILE_LANGUAGE:CUDA><$<STREQUAL:${HIP_PLATFORM},nvcc>>:-Xcompiler>;-pthread"
       _MPI_CXX_COMPILE_OPTIONS "${MPI_CXX_COMPILE_OPTIONS}")
     set_property(TARGET MPI::MPI_CXX PROPERTY INTERFACE_COMPILE_OPTIONS "${_MPI_CXX_COMPILE_OPTIONS}")
     message(STATUS "_MPI_CXX_COMPILE_OPTIONS: ${_MPI_CXX_COMPILE_OPTIONS}")


* cmake: use sbindir variable for journald service;

--- data/systemd/journald.service.cmake
+++ data/systemd/journald.service.cmake
@@ -14,7 +14,7 @@
 Before=sysinit.target

 [Service]
-ExecStart=@CMAKE_INSTALL_PREFIX@/sbin/journald
+ExecStart=@sbindir@/journald
 Restart=always
 RestartSec=0
 NotifyAccess=all


COMP: Removed test until the bug is fixed.

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -32,7 +32,7 @@

    # ------------------ Navigation Tool Management Tests -------------------
    mitkNavigationToolStorageTest.cpp
-   mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
+   #mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
    mitkNavigationToolTest.cpp
    mitkNavigationToolReaderAndWriterTest.cpp
    # -----------------------------------------------------------------------
@@ -46,4 +46,4 @@
   mitkNDIAuroraHardwareTest.cpp
   mitkNDIPolarisHardwareTest.cpp
   mitkClaronTrackingDeviceHardwareTest.cpp
-)+)


add WORKING_DIRECTORY to ament_add_nose_test

--- ament_cmake_nose/cmake/ament_add_nose_test.cmake
+++ ament_cmake_nose/cmake/ament_add_nose_test.cmake
@@ -23,8 +23,12 @@
 # :param path: the path to a file or folder where ``nosetests``
 #   should be invoked on
 # :type path: string
-# :param TIMEOUT: the test timeout in seconds, default: 60
+# :param TIMEOUT: the test timeout in seconds,
+#   default defined by ``ament_add_test()``
 # :type TIMEOUT: integer
+# :param WORKING_DIRECTORY: the working directory for invoking the
+#   command in, default defined by ``ament_add_test()``
+# :type WORKING_DIRECTORY: string
 # :param ENV: list of env vars to set; listed as ``VAR=value``
 # :type ENV: list of strings
 # :param APPEND_ENV: list of env vars to append if already set, otherwise set;
@@ -46,7 +50,7 @@
 function(_ament_add_nose_test testname path)
   cmake_parse_arguments(ARG
     ""
-    "TIMEOUT"
+    "TIMEOUT;WORKING_DIRECTORY"
     "APPEND_ENV;APPEND_LIBRARY_DIRS;ENV"
     ${ARGN})
   if(ARG_UNPARSED_ARGUMENTS)
@@ -85,6 +89,9 @@
   if(ARG_TIMEOUT)
     set(ARG_TIMEOUT "TIMEOUT" "${ARG_TIMEOUT}")
   endif()
+  if(ARG_WORKING_DIRECTORY)
+    set(ARG_WORKING_DIRECTORY "WORKING_DIRECTORY" "${ARG_WORKING_DIRECTORY}")
+  endif()

   ament_add_test(
     "${testname}"
@@ -95,7 +102,7 @@
     ${ARG_APPEND_ENV}
     ${ARG_APPEND_LIBRARY_DIRS}
     ${ARG_TIMEOUT}
-    WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+    ${ARG_WORKING_DIRECTORY}
   )
   set_tests_properties(
     "${testname}"


geotiff: build_wx() after set wx ON

geotiff: build_wx() after set wx ON

--- projects/geotiff.cmake
+++ projects/geotiff.cmake
@@ -30,13 +30,13 @@
   if(NOT (XP_DEFAULT OR XP_PRO_GEOTIFF))
     return()
   endif()
-  build_wx() # determine gtk version
   set(wxver 31) # specify the wx version to build geotiff against
   if(NOT (XP_DEFAULT OR XP_PRO_WX${wxver}))
     message(STATUS "geotiff.cmake: requires wx${wxver}")
     set(XP_PRO_WX${wxver} ON CACHE BOOL "include wx${wxver}" FORCE)
     xpPatchProject(${PRO_WX${wxver}})
   endif()
+  build_wx() # determine gtk version
   build_wxv(VER ${wxver} TARGETS wxTgts INCDIR wxInc)
   xpGetArgValue(${PRO_GEOTIFF} ARG NAME VALUE NAME)
   xpGetArgValue(${PRO_GEOTIFF} ARG VER VALUE VER)


[packaging] Prevent binary files from being tagged as documentaiton

That's critical since yum is configured to do not install documentation
files on Docker images of CentOS.

(cherry picked from commit f6753662b57ec7673ecad378725da290b1c234e7)

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -11,11 +11,6 @@
 %define _docdir            %{_datadir}/doc
 %define logdir             %{_localstatedir}/log
 %define flexisip_logdir    %{logdir}/flexisip
-
-# Hack: force _mandir to its default value because cmake-builder re-define it
-# on rpmbuild invokation with a bad value.
-# Remove this hack once Flexisip is based on Linphone SDK >= 4.4
-%define _mandir            %{_datarootdir}/man

 # to be compliant with RedHat which changed epoch to 1 for an unknown reason
 %define epoch     1


build: Clean up the find-module for rt

build: Clean up the find-module for rt

--- cmake/Findrt.cmake
+++ cmake/Findrt.cmake
@@ -23,11 +23,13 @@
 set (_rt_test_source ${CMAKE_CURRENT_LIST_DIR}/code_tests/rt_test.cc)

 # Try to compile without the library first.
-try_compile (_rt_test_nil
+try_compile (rt_NO_EXPLICIT_LINK
   ${CMAKE_CURRENT_BINARY_DIR}
   SOURCES ${_rt_test_source})

-if (NOT _rt_test_nil)
+if (rt_NO_EXPLICIT_LINK)
+  set (rt_FOUND yes)
+else ()
   # The `rt` library is required.

   try_compile (_rt_test
@@ -37,24 +39,19 @@

   if (_rt_test)
     set (rt_LIBRARY_NAME rt)
+    set (rt_LIBRARIES -l${rt_LIBRARY_NAME})
   endif ()
+
+  include (FindPackageHandleStandardArgs)
+
+  find_package_handle_standard_args (rt
+    REQUIRED_VARS rt_LIBRARIES)
 endif ()
-
-if (_rt_test_nil OR rt_LIBRARY_NAME)
-  set (rt_FOUND ON)
-  set (rt_LIBRARIES -l${rt_LIBRARY_NAME})
-endif ()
-
-find_package_handle_standard_args (rt
-  FOUND_VAR rt_FOUND
-  REQUIRED_VARS rt_LIBRARY_NAME)

 if (rt_FOUND AND NOT (TARGET rt::rt))
   add_library (rt::rt INTERFACE IMPORTED)

   set_target_properties (rt::rt
     PROPERTIES
-      INTERFACE_LINK_LIBRARIES ${rt_LIBRARIES})
+      INTERFACE_LINK_LIBRARIES "${rt_LIBRARIES}")
 endif ()
-
-mark_as_advanced (rt_LIBRARY_NAME)


Fixed copy&paste error in Linking.cmake

Fixed copy&paste error in Linking.cmake

--- indra/cmake/Linking.cmake
+++ indra/cmake/Linking.cmake
@@ -37,7 +37,7 @@

 # <FS:Ansariel> Changed for Firestorm
 #if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_AVX" AND NOT STREQUAL "ReleaseFS" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_open")
+if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_AVX" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_open")
 # </FS:Ansariel> Changed for Firestorm
   # When we're building something other than Release, append the
   # packages/lib/release directory to deal with autobuild packages that don't
@@ -46,7 +46,7 @@

 # <FS:Ansariel> Changed for Firestorm
 #endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_AVX" AND NOT STREQUAL "ReleaseFS" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_open")
+endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_AVX" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_open")
 # </FS:Ansariel> Changed for Firestorm

 link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})


Adapt to from-source-builds on Linux

Adapt to from-source-builds on Linux

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -33,17 +33,17 @@
     /usr/local
     /sw
     /opt/local
-    /opt/local-release
-    /opt/local-debug

     # authors prefered choice for development
-    /build
-    /build-release
-    /build-debug
+    $ENV{GLFW_DIR}
+    $ENV{GLFW_DIR}/build
+    $ENV{GLFW_DIR}/build-release
+    $ENV{GLFW_DIR}/build-debug

     PATH_SUFFIXES
     /lib
     /lib64
+    /src # for from-source builds

     DOC "The GLFW library")


Exclude extern source files from lcov report.

--- cmake/FindLcov.cmake
+++ cmake/FindLcov.cmake
@@ -79,14 +79,16 @@
 endif (NOT CPPFILT_BIN STREQUAL "")

 # enable no-external flag for lcov, if available.
-if (NOT LCOV_BIN STREQUAL "")
-	execute_process(COMMAND ${LCOV_BIN} --help OUTPUT_VARIABLE LCOV_HELP)
-	string(REGEX MATCH "external" LCOV_RES "${LCOV_HELP}")
-	if ("${LCOV_RES}" STREQUAL "")
-		set(LCOV_EXTERN_FLAG "")
-	else ()
-		set(LCOV_EXTERN_FLAG "--no-external")
-	endif ()
+if (GENINFO_BIN AND NOT DEFINED GENINFO_EXTERN_FLAG)
+	set(FLAG "")
+	execute_process(COMMAND ${GENINFO_BIN} --help OUTPUT_VARIABLE GENINFO_HELP)
+	string(REGEX MATCH "external" GENINFO_RES "${GENINFO_HELP}")
+	if (GENINFO_RES)
+		set(FLAG "--no-external")
+	endif ()
+
+	set(GENINFO_EXTERN_FLAG "${FLAG}"
+		CACHE STRING "Geninfo flag to exclude system sources.")
 endif ()

 # If Lcov was not found, exit module now.
@@ -117,9 +119,8 @@
 	)

 	add_custom_command(OUTPUT "${OUTFILE}"
-		COMMAND ${LCOV_BIN} --quiet -a ${OUTFILE}.raw ${LCOV_EXTERN_FLAG}
-			--base-directory ${PROJECT_SOURCE_DIR} --output-file ${OUTFILE}
-			${LCOV_EXTRA_FLAGS}
+		COMMAND ${LCOV_BIN} --quiet -a ${OUTFILE}.raw --output-file ${OUTFILE}
+			--base-directory ${PROJECT_SOURCE_DIR} ${LCOV_EXTRA_FLAGS}
 		DEPENDS ${OUTFILE}.raw
 		COMMENT "Post-processing ${FILE_REL}"
 	)
@@ -179,7 +180,7 @@
 		add_custom_command(OUTPUT ${OUTFILE} COMMAND ${GCOV_ENV} ${GENINFO_BIN}
 				--quiet --base-directory ${PROJECT_SOURCE_DIR} --initial
 				--gcov-tool ${GCOV_BIN} --output-filename ${OUTFILE}
-				${TDIR}/${FILE}.gcno
+				${GENINFO_EXTERN_FLAG} ${TDIR}/${FILE}.gcno
 			DEPENDS ${TNAME}
 			COMMENT "Capturing initial coverage data for ${FILE}"
 		)
@@ -266,7 +267,8 @@
 			COMMAND test -f "${TDIR}/${FILE}.gcda"
 				&& ${GCOV_ENV} ${GENINFO_BIN} --quiet --base-directory
 					${PROJECT_SOURCE_DIR} --gcov-tool ${GCOV_BIN}
-					--output-filename ${OUTFILE} ${TDIR}/${FILE}.gcda
+					--output-filename ${OUTFILE} ${GENINFO_EXTERN_FLAG}
+					${TDIR}/${FILE}.gcda
 				|| cp ${OUTFILE}.init ${OUTFILE}
 			DEPENDS ${TNAME} ${TNAME}-capture-init
 			COMMENT "Capturing coverage data for ${FILE}"


Fixed dependency list.

Fixed dependency list.

--- cmake/easytest.cmake
+++ cmake/easytest.cmake
@@ -20,7 +20,6 @@
 	COMPILE_FLAGS    # Flags for compiling the target.
 	COMPILE_INCLUDES # Directories to include for compiling target.
 	LINK             # Libraries to link on target.
-	LINKER_FLAGS     # Flags for linking the target.

 	RUN         # How to run the test.
 	ENVIRONMENT # Environment variables for running the test.
@@ -180,8 +179,9 @@
 	# COMPILE_INCLUDES may be a space delimited string.
 	string(REPLACE " " ";" EASYTEST_COMPILE_INCLUDES
 	               "${EASYTEST_COMPILE_INCLUDES}")
+	string(REPLACE " " ";" EASYTEST_DEPENDS "${EASYTEST_DEPENDS}")
+	string(REPLACE " " ";" EASYTEST_ENVIRONMENT "${EASYTEST_ENVIRONMENT}")
 	string(REPLACE " " ";" EASYTEST_LINK "${EASYTEST_LINK}")
-	string(REPLACE " " ";" EASYTEST_ENVIRONMENT "${EASYTEST_ENVIRONMENT}")
 endmacro ()


Build: allow -Werror to be disabled even on CI branches (#1471)

Slight reworking of -Werror logic to let the default behavior be
changed by setting a cmake variable. In particular, this allows us to
make a CI build disable -Werror when we need to.

Previously, having the "OSL_CI" env variable set trumped all else and
forced -Werror. Now it just contributes to the default behavior, but
setting `-DSTOP_ON_WARNING=OFF` and cmake config time can still
disable it.

Signed-off-by: Larry Gritz <f0a1ce6f80112d72f7276457fd261d671b827567@larrygritz.com>

--- src/cmake/compiler.cmake
+++ src/cmake/compiler.cmake
@@ -82,10 +82,14 @@
 ###########################################################################
 # Turn on more detailed warnings and optionally consider warnings as errors
 #
-if (${PROJECT_NAME}_SUPPORTED_RELEASE)
+if (NOT ${PROJECT_NAME}_SUPPORTED_RELEASE OR DEFINED ENV{${PROJECT_NAME}_CI})
+    # For development branches (i.e., not a supported release), or when
+    # running CI, default to treating all warnings as errors.
+    option (STOP_ON_WARNING "Stop building if there are any compiler warnings" ON)
+else ()
+    # For release branches not doing a CI build default to just printing
+    # warnings but not letting them stop the build.
     option (STOP_ON_WARNING "Stop building if there are any compiler warnings" OFF)
-else ()
-    option (STOP_ON_WARNING "Stop building if there are any compiler warnings" ON)
 endif()
 option (EXTRA_WARNINGS "Enable lots of extra pedantic warnings" OFF)
 if (NOT MSVC)
@@ -93,10 +97,8 @@
     if (EXTRA_WARNINGS)
         add_compile_options ("-Wextra")
     endif ()
-    if (STOP_ON_WARNING OR DEFINED ENV{${PROJECT_NAME}_CI})
+    if (STOP_ON_WARNING)
         add_compile_options ("-Werror")
-        # N.B. Force CI builds to use -Werror, even if STOP_ON_WARNING has
-        # been switched off by default, which we may do in release branches.
     endif ()
 endif ()


COMP: added missing mitkToFCameraMESAController.cpp to files.cmake

--- Modules/ToFHardware/files.cmake
+++ Modules/ToFHardware/files.cmake
@@ -72,6 +72,7 @@
 )
 ELSE()
 SET(CPP_FILES ${CPP_FILES}
+  mitkToFCameraMESAController.cpp
   mitkToFCameraMESASR4000ControllerStub.cpp
 )
 ENDIF(MITK_USE_TOF_MESASR4000)


Fixed QWT

Fixed QWT

--- cmake/FindQwt.cmake
+++ cmake/FindQwt.cmake
@@ -35,9 +35,10 @@
     HINTS
       /usr/include/qwt
       /usr/local/include/qwt
+      ${QWT_ROOT}/include/qwt
 )

-find_library( QWT_LIBRARIES NAMES qwt qwt-qt5 )
+find_library( QWT_LIBRARIES NAMES qwt qwt-qt5 HINTS ${QWT_ROOT}/lib )

 find_package_handle_standard_args(QWT REQUIRED_VARS QWT_LIBRARIES QWT_INCLUDE_DIRS)


Added Support for MSVC 2012

Added Support for MSVC 2012

--- cmake/Options.cmake
+++ cmake/Options.cmake
@@ -107,6 +107,8 @@
   include_directories(${TOPLEVEL_DIR}/include/msvc)
 elseif(MSVC_VERSION EQUAL 1600)
   set(COMPILER_MSVC 2010)
+elseif(MSVC_VERSION EQUAL 1700)
+  set(COMPILER_MSVC 2012)
 else()
   message(WARNING "Unsupported compiler")
   return()


Fixed hardcoded path for default locations

--- cmake/install.cmake
+++ cmake/install.cmake
@@ -45,8 +45,8 @@
 IF(UNIX)
   IF(INSTALL_LAYOUT MATCHES "RPM")
     SET(libmariadb_prefix "/usr")
-  ELSE()
-    SET(libmariadb_prefix "/usr/local")
+  ELSEIF(INSTALL_LAYOUT MATCHES "DEFAULT")
+    SET(libmariadb_prefix ${CMAKE_INSTALL_PREFIX})
   ENDIF()
 ENDIF()


FindNumPy.cmake virtualenv problem fix (#112)

--- cmake/Modules/FindNumPy.cmake
+++ cmake/Modules/FindNumPy.cmake
@@ -7,7 +7,7 @@
 endif()

 if(PYTHON_EXECUTABLE)
-    execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
+    execute_process(COMMAND "python" "-c"
         "import numpy as n; print(n.get_include());"
         RESULT_VARIABLE NUMPY_RESULT
         OUTPUT_VARIABLE NUMPY_INCLUDE_DIRS


Use Python_Interpreter_FOUND instead of PYTHONINTERP_FOUND for new find Python module.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.cmake_minimum_required (VERSION 3.1)

-find_package(Python ${PREFERRED_PYTHON_VERSION})
+find_package(Python ${PREFERRED_PYTHON_VERSION} COMPONENTS Interpreter Development)

 find_program(VALGRIND_EXE NAMES ${PREFERRED_VALGRIND_NAMES} valgrind)
 find_program(GCOV_EXE NAMES ${PREFERRED_GCOV_NAMES} gcov)
@@ -20,10 +20,10 @@
 find_package(Doxygen)
 find_package(Sphinx)

-if(VALGRIND_EXE AND PYTHONINTERP_FOUND)
+if(VALGRIND_EXE AND Python_Interpreter_FOUND)
   set(VALGRIND_TESTING_AVAILABLE TRUE CACHE BOOL "Executables required to run valgrind testing are available.")
 endif()
-if(GCOV_EXE AND FIND_EXE AND PYTHONINTERP_FOUND)
+if(GCOV_EXE AND FIND_EXE AND Python_Interpreter_FOUND)
   set(COVERAGE_TESTING_AVAILABLE TRUE CACHE BOOL "Executables required to run the coverage testing are available.")
 endif()
 mark_as_advanced(VALGRIND_EXE VALGRIND_TESTING_AVAILABLE GCOV_EXE FIND_EXE COVERAGE_TESTING_AVAILABLE)


cmake/modules/FindVIGRA.cmake: Output VIGRA site-packages too.

--- cmake/modules/FindVIGRA.cmake
+++ cmake/modules/FindVIGRA.cmake
@@ -31,8 +31,9 @@
     SET( VIGRANUMPY_SITEPACKAGE_DIR ${VIGRA_VIGRANUMPYCORE_LIBRARY} CACHE PATH "Path to Vigra's vigranumpycore library.")

     MESSAGE(STATUS "Found VIGRA")
-    MESSAGE(STATUS "  > vigranumpy: ${VIGRA_VIGRANUMPYCORE_LIBRARY}")
-    MESSAGE(STATUS "  > includes:   ${VIGRA_INCLUDE_DIR}")
+    MESSAGE(STATUS "  > includes:                 ${VIGRA_INCLUDE_DIR}")
+    MESSAGE(STATUS "  > vigranumpy site-package:  ${VIGRANUMPY_SITEPACKAGE_DIR}")
+    MESSAGE(STATUS "  > vigranumpycore library:   ${VIGRA_VIGRANUMPYCORE_LIBRARY}")
 ENDIF()


[cmake] add -fno-strict-aliasing in the compilation of swig generated file

--- cmake/swig_python_tools.cmake
+++ cmake/swig_python_tools.cmake
@@ -105,7 +105,8 @@

   # WARNING ${swig_generated_file_fullname} is overriden
   set(${_name}_generated_file_fullname ${swig_generated_file_fullname})
-
+  set_source_files_properties( ${swig_generated_file_fullname}
+      PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing")
   # Set path for the library generated by swig for the current module --> siconos python package path
   set_property(TARGET ${SWIG_MODULE_${_name}_REAL_NAME} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${SICONOS_SWIG_ROOT_DIR}/${_path})
   message(" -- ${_name} generated (swig) file will be ${${_name}_generated_file_fullname}")


Adds some options for gabime/spdlog lookup

--- modules/LookUpspdlog.cmake
+++ modules/LookUpspdlog.cmake
@@ -1,7 +1,22 @@
-# Installs GBenchmark into build directory
+# Installs gabime/spdlog into build directory
+#
+# - GIT_REPOSITORY: defaults to origin gabime repo on github
+# - GIT_TAG: defaults to master
+
+if(spdlog_ARGUMENTS)
+  cmake_parse_arguments(spdlog "" "GIT_REPOSITORY;GIT_TAG" ""
+    ${spdlog_ARGUMENTS})
+endif()
+if(NOT spdlog_GIT_REPOSITORY)
+  set(spdlog_GIT_REPOSITORY https://github.com/gabime/spdlog.git)
+endif()
+if(NOT spdlog_GIT_TAG)
+  set(spdlog_GIT_TAG master)
+endif()
 ExternalProject_Add(
     Lookup-spdlog
-    GIT_REPOSITORY https://github.com/gabime/spdlog
+    GIT_REPOSITORY ${spdlog_GIT_REPOSITORY}
+    GIT_TAG ${spdlog_GIT_TAG}
     PREFIX "${EXTERNAL_ROOT}"
     # Force separate output paths for debug and release builds to allow easy
     # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands


Update fft2d.cmake (#11671)

Update fft2d.cmake (#11671)

The cmake fft2d library was installing to '(fft2d_INDTALL)' instead of the appropriate variable set by CMake. I suspect this was unintentional.

Changing the parentheses to curly brackets fixes this.

--- tensorflow/contrib/cmake/external/fft2d.cmake
+++ tensorflow/contrib/cmake/external/fft2d.cmake
@@ -45,7 +45,7 @@
       DOWNLOAD_DIR "${DOWNLOAD_LOCATION}"
       BUILD_IN_SOURCE 1
       PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/patches/fft2d/CMakeLists.txt ${fft2d_BUILD}/src/fft2d/CMakeLists.txt
-      INSTALL_DIR $(fft2d_INSTALL)
+      INSTALL_DIR ${fft2d_INSTALL}
       INSTALL_COMMAND echo
       BUILD_COMMAND $(MAKE))


Suppress the new -Wexpansion-to-defined to linux/gcc toolchain file

--- cmake-toolchains/linux.cmake
+++ cmake-toolchains/linux.cmake
@@ -43,12 +43,12 @@
 endif()

 # C++ flags
-set(CMAKE_CXX_FLAGS "-fPIC ${FIPS_LINUX_EXCEPTION_FLAGS} ${FIPS_LINUX_RTTI_FLAGS} ${FIPS_LINUX_MACH_FLAGS} -std=c++11 -pthread -fno-strict-aliasing -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers")
+set(CMAKE_CXX_FLAGS "-fPIC ${FIPS_LINUX_EXCEPTION_FLAGS} ${FIPS_LINUX_RTTI_FLAGS} ${FIPS_LINUX_MACH_FLAGS} -std=c++11 -pthread -fno-strict-aliasing -Wno-expansion-to-defined -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers")
 set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ftree-vectorize -ffast-math -DNDEBUG")
 set(CMAKE_CXX_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DFIPS_DEBUG=1 -ggdb")

 # C flags
-set(CMAKE_C_FLAGS "-fPIC ${FIPS_LINUX_MACH_FLAGS} -pthread -fno-strict-aliasing -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers")
+set(CMAKE_C_FLAGS "-fPIC ${FIPS_LINUX_MACH_FLAGS} -pthread -fno-strict-aliasing -Wno-multichar -Wall -Wextra -Wno-expansion-to-defined -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers")
 set(CMAKE_C_FLAGS_RELEASE "-O3 -ftree-vectorize -ffast-math -DNDEBUG")
 set(CMAKE_C_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DFIPS_DEBUG=1 -ggdb")


FindENet.cmake: Look for Enet not Flac

FindENet.cmake: Look for Enet not Flac

--- cmake/Modules/FindENet.cmake
+++ cmake/Modules/FindENet.cmake
@@ -3,7 +3,7 @@
 # All rights reserved.

 find_path(ENet_INCLUDE_DIR enet/enet.h)
-find_library(ENet_LIBRARY FLAC)
+find_library(ENet_LIBRARY enet)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(ENet DEFAULT_MSG ENet_INCLUDE_DIR ENet_LIBRARY)


Added host compiler check before CUDA detection. For not supported compilers CUDA will be disabled.

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -1,5 +1,10 @@
 if(${CMAKE_VERSION} VERSION_LESS "2.8.3")
   message(STATUS "WITH_CUDA flag requires CMake 2.8.3 or newer. CUDA support is disabled.")
+  return()
+endif()
+
+if (NOT MSVC AND NOT CMAKE_COMPILER_IS_GNUCXX OR MINGW)
+  message(STATUS "CUDA compilation was disabled (due to unsuppoted host compiler).")
   return()
 endif()


ENH: updating ITK superbuild version to Jan 29th nightly master

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -14,7 +14,7 @@
 set(proj ITK)  ## Use ITK convention of calling it ITK
 set(ITK_REPOSITORY git://itk.org/ITK.git)
 set(ITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.1)
-set(ITK_TAG_COMMAND GIT_TAG 1914ce858e8396768e692f07fc4c5fca31c603ea ) # Fri Jan 27 nightly-master
+set(ITK_TAG_COMMAND GIT_TAG 1e725da525ade3c18a91ec2cf6dbf7dcdefe149c ) # Tue Jan 31 nightly-master
 set(WrapITK_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/ITK-4.0/WrapITK)

 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_languages_cache}\n${ep_common_cache}" )


[cmake] don't use -static-libgcc/-static-libstdc++ on clang (not supported)

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -240,7 +240,7 @@
 		"-std=c++98" "-std=c++11" "-std=c++14" "-std=gnu++98" "-std=gnu++11" "-std=gnu++14"
 		)

-	if (NOT APPLE)
+	if (NOT CLANG)
 		axl_create_compiler_flag_setting (
 			GCC_FLAG_STATIC_LIBGCC
 			DESCRIPTION "Use static linkage to libgcc"
@@ -335,7 +335,10 @@
 		set (LINUX TRUE)
 	endif ()

-	if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+	if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+		set (CLANG TRUE)
+		set (GCC TRUE)
+	elseif (CMAKE_COMPILER_IS_GNUCXX)
 		set (GCC TRUE)
 	endif ()


Disable BUILD_TESTS for warpctc (#8210)

Disable BUILD_TESTS for warpctc (#8210)

* It will sightly faster compile and make warpctc compile
well on CUDA 9 and GCC 5.5

--- cmake/external/warpctc.cmake
+++ cmake/external/warpctc.cmake
@@ -52,6 +52,7 @@
                     -DWITH_TORCH=OFF
                     -DCMAKE_DISABLE_FIND_PACKAGE_Torch=ON
                     -DBUILD_SHARED=ON
+                    -DBUILD_TESTS=OFF
                     -DCMAKE_POSITION_INDEPENDENT_CODE=ON
                     -DCMAKE_BUILD_TYPE=${THIRD_PARTY_BUILD_TYPE}
                     ${EXTERNAL_OPTIONAL_ARGS}


Bug 867: forward the cmake generator when testing support for fortran. (was already fixed in the default branch)

--HG--
branch : 3.2

--- cmake/language_support.cmake
+++ cmake/language_support.cmake
@@ -33,7 +33,7 @@
   file(WRITE ${CMAKE_BINARY_DIR}/language_tests/${language}/CMakeLists.txt
     ${text})
   execute_process(
-    COMMAND ${CMAKE_COMMAND} .
+    COMMAND ${CMAKE_COMMAND} . -G "${CMAKE_GENERATOR}"
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
     RESULT_VARIABLE return_code
     OUTPUT_QUIET


build: remove `FRAMEWORK_DEPENDS` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -678,7 +678,6 @@
 #     [STATIC]
 #     [SDK sdk]
 #     [ARCHITECTURE architecture]
-#     [FRAMEWORK_DEPENDS dep1 ...]
 #     [FRAMEWORK_DEPENDS_WEAK dep1 ...]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
 #     [SWIFT_COMPILE_FLAGS flag1...]
@@ -704,9 +703,6 @@
 #
 # ARCHITECTURE
 #   Architecture to build for.
-#
-# FRAMEWORK_DEPENDS
-#   System frameworks this library depends on.
 #
 # FRAMEWORK_DEPENDS_WEAK
 #   System frameworks this library depends on that should be weakly-linked.
@@ -743,7 +739,6 @@
         SDK)
   set(SWIFTLIB_SINGLE_multiple_parameter_options
         FILE_DEPENDS
-        FRAMEWORK_DEPENDS
         FRAMEWORK_DEPENDS_WEAK
         GYB_SOURCES
         INCORPORATE_OBJECT_LIBRARIES
@@ -996,9 +991,6 @@
         ${LLVM_COMMON_DEPENDS})

   # Link against system frameworks.
-  foreach(FRAMEWORK ${SWIFTLIB_SINGLE_FRAMEWORK_DEPENDS})
-    target_link_libraries(${target} PUBLIC "-framework ${FRAMEWORK}")
-  endforeach()
   foreach(FRAMEWORK ${SWIFTLIB_SINGLE_FRAMEWORK_DEPENDS_WEAK})
     target_link_libraries(${target} PUBLIC "-weak_framework ${FRAMEWORK}")
   endforeach()


fix coverage on Mac

fix coverage on Mac

On Mac, the compiler is called AppleClang, not Clang so we have to use a
MATCHES instead of STREQUAL

--- cmake/modules/FindGcov.cmake
+++ cmake/modules/FindGcov.cmake
@@ -35,7 +35,7 @@
 			find_program(GCOV_BIN NAMES gcov-${GCC_VERSION} gcov
 				HINTS ${COMPILER_PATH})

-		elseif ("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Clang")
+               elseif ("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "Clang")
 			# Some distributions like Debian ship llvm-cov with the compiler
 			# version appended as llvm-cov-x.y. To find this binary we'll build
 			# the suggested binary name with the compiler version.


CMake: openmp: add a comment re OpenMP::OpenMP_CXX target.

--- cmake/src-dependencies.cmake
+++ cmake/src-dependencies.cmake
@@ -48,11 +48,14 @@
     message(STATUS "Looking for OpenMP - found")
     set(HAVE_OPENMP 1)

+    # FIXME: OpenMP::OpenMP_CXX target, and ${OpenMP_CXX_LIBRARIES} were both
+    # added in cmake-3.9. Until then, this is correct:
     if(NOT TARGET OpenMP::OpenMP_CXX)
       add_library(OpenMP::OpenMP_CXX INTERFACE IMPORTED)
       if(OpenMP_CXX_FLAGS)
         set_property(TARGET OpenMP::OpenMP_CXX PROPERTY INTERFACE_COMPILE_OPTIONS ${OpenMP_CXX_FLAGS})
         set_property(TARGET OpenMP::OpenMP_CXX PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS})
+        # Yes, both of them to the same value.
       endif()
     endif()


FindPHP5.cmake fixed

FindPHP5.cmake fixed

--- cmake_modules/FindPHP5.cmake
+++ cmake_modules/FindPHP5.cmake
@@ -80,7 +80,7 @@

 FIND_PROGRAM(PHP5_CONFIG_EXECUTABLE
-  NAMES php5-config php-config
+  NAMES php5-config php-config5 php-config
   PATHS
   /usr/bin
   /usr/local/bin
@@ -95,8 +95,11 @@

 EXECUTE_PROCESS(COMMAND ${PHP5_CONFIG_EXECUTABLE} --includes
    OUTPUT_VARIABLE PHP5_INCLUDES)
+
+
 STRING(REPLACE "-I" ";" PHP5_INCLUDES "${PHP5_INCLUDES}")
 STRING(REPLACE " " "" PHP5_INCLUDES "${PHP5_INCLUDES}")
+STRING(REPLACE "\n" "" PHP5_INCLUDES "${PHP5_INCLUDES}")
 LIST(GET PHP5_INCLUDES 0 PHP5_INCLUDE_DIR)

 set(PHP5_MAIN_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/main)


Properly pass moc flags, options to QT4/5_CREATE_MOC_COMMAND.

--- cmake/modules/FindQt.cmake
+++ cmake/modules/FindQt.cmake
@@ -72,10 +72,10 @@

 MACRO(QT_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
   IF(QT_VERSION_MAJOR MATCHES 4)
-    QT4_CREATE_MOC_COMMAND(${infile} ${outfile} ${moc_flags} ${moc_options})
+    QT4_CREATE_MOC_COMMAND(${infile} ${outfile} "${moc_flags}" "${moc_options}")
   ELSE(QT_VERSION_MAJOR MATCHES 4)
     IF(QT_VERSION_MAJOR MATCHES 5)
-      QT5_CREATE_MOC_COMMAND(${infile} ${outfile} ${moc_flags} ${moc_options})
+      QT5_CREATE_MOC_COMMAND(${infile} ${outfile} "${moc_flags}" "${moc_options}")
     ENDIF(QT_VERSION_MAJOR MATCHES 5)
   ENDIF(QT_VERSION_MAJOR MATCHES 4)
 ENDMACRO(QT_CREATE_MOC_COMMAND)


make nosetests --xunit-file argument an absolute path to work around nose bug 779 (fix #659)

--- cmake/test/nosetests.cmake
+++ cmake/test/nosetests.cmake
@@ -70,6 +70,8 @@
   string(REPLACE ":" "." output_file_name ${output_file_name})

   set(output_path ${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME})
+  # make --xunit-file argument an absolute path (https://github.com/nose-devs/nose/issues/779)
+  get_filename_component(output_path "${output_path}" ABSOLUTE)
   set(cmd "${CMAKE_COMMAND} -E make_directory ${output_path}")
   if(IS_DIRECTORY ${_path_name})
     set(tests "--where=${_path_name}")


Remove shared library suffix

Remove shared library suffix

--- cmake/Macro.cmake
+++ cmake/Macro.cmake
@@ -10,8 +10,6 @@
     if(BUILD_SHARED_LIBS)
         set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d)
         if(BULL_OS_WINDOWS)
-            # include the major version number in Windows shared library names (but not import library names)
-            set_target_properties(${target} PROPERTIES SUFFIX "-${CMAKE_SHARED_LIBRARY_SUFFIX}")
             # on Windows/gcc get rid of "lib" prefix for shared libraries,
             # and transform the ".dll.a" suffix into ".a" for import libraries
             set_target_properties(${target} PROPERTIES PREFIX "")


COMP: Length GTest discovery timeout

COMP: Length GTest discovery timeout

Avoid compilation errors due to timeout of GTests

Change-Id: Icf12c77cb43d70a1e91cb08625660a7ed2c36f9c

--- CMake/ITKModuleTest.cmake
+++ CMake/ITKModuleTest.cmake
@@ -242,9 +242,10 @@

   include(GoogleTest)

-  # CMake 3.10 added this method, to avoid configure time introspection
-  if(NOT CMAKE_CROSSCOMPILING AND COMMAND gtest_discover_tests)
-    gtest_discover_tests( ${exe} )
+  # CMake 3.10 added this method, to avoid configure time introspection.
+  # Verion 3.10.3 is needed for the DISCOVERY_TIMEOUT method
+  if(NOT CMAKE_CROSSCOMPILING AND NOT ${CMAKE_VERSION} VERSION_LESS "3.10.3" )
+    gtest_discover_tests( ${exe} DISCOVERY_TIMEOUT 15 )
   else()
     set(_skip_dependency)
     if( ITK_SKIP_GTEST_DEPENDANCY_AUTO_CHECK )


fixed: remove /_Debug from relnoopt as it does collide with /MD

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

--- CMake/SetupCompiler.cmake
+++ CMake/SetupCompiler.cmake
@@ -48,8 +48,8 @@
     STRING(REPLACE "/RTC1" "" OSG_CXX_FLAGS_RELEASENOOPT ${OSG_CXX_FLAGS_RELEASENOOPT})
     STRING(REPLACE "/RTC1" "" OSG_C_FLAGS_RELEASENOOPT   ${OSG_C_FLAGS_RELEASENOOPT})

-#    STRING(REPLACE "/D_DEBUG" "" OSG_CXX_FLAGS_RELEASENOOPT ${OSG_CXX_FLAGS_RELEASENOOPT})
-#    STRING(REPLACE "/D_DEBUG" "" OSG_C_FLAGS_RELEASENOOPT   ${OSG_C_FLAGS_RELEASENOOPT})
+    STRING(REPLACE "/D_DEBUG" "" OSG_CXX_FLAGS_RELEASENOOPT ${OSG_CXX_FLAGS_RELEASENOOPT})
+    STRING(REPLACE "/D_DEBUG" "" OSG_C_FLAGS_RELEASENOOPT   ${OSG_C_FLAGS_RELEASENOOPT})

     # Debug


Python init config used COPYONLY instead of ONLY.

The file vtkWrapperInit.data.in has a macro that must be expanded,
so it requires @ONLY instead of COPYONLY.

Change-Id: Id6a0c9ab101ecaaf53020a67bded3a1a78005f7f

--- CMake/vtkWrapPython.cmake
+++ CMake/vtkWrapPython.cmake
@@ -138,7 +138,7 @@
   configure_file(
     ${VTK_CMAKE_DIR}/vtkWrapperInit.data.in
     ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data
-    COPYONLY
+    @ONLY
     )

   add_custom_command(