summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/guide/tutorial/index.rst6
-rw-r--r--Help/manual/ctest.1.rst9
-rw-r--r--Help/variable/CMAKE_CFG_INTDIR.rst7
-rw-r--r--Modules/CMakeSwiftInformation.cmake5
-rw-r--r--Modules/Compiler/Clang.cmake2
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake2
-rw-r--r--Modules/ExternalProject.cmake2
-rw-r--r--Modules/FindCUDA.cmake6
-rw-r--r--Modules/FindGLEW.cmake2
-rw-r--r--Modules/FindPkgConfig.cmake6
-rw-r--r--Modules/FindPython/Support.cmake157
-rw-r--r--Modules/Platform/Windows-Clang.cmake2
-rw-r--r--Modules/Platform/Windows-Embarcadero.cmake2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx80
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h12
-rw-r--r--Source/CTest/cmCTestRunTest.cxx10
-rw-r--r--Source/CTest/cmCTestRunTest.h2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx1
-rw-r--r--Source/CTest/cmCTestTestHandler.h1
-rw-r--r--Source/cmAddDependenciesCommand.cxx2
-rw-r--r--Source/cmComputeComponentGraph.cxx2
-rw-r--r--Source/cmComputeLinkDepends.cxx6
-rw-r--r--Source/cmComputeTargetDepends.cxx37
-rw-r--r--Source/cmComputeTargetDepends.h4
-rw-r--r--Source/cmGeneratorTarget.cxx31
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGlobalGenerator.cxx2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx10
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx7
-rw-r--r--Source/cmGlobalVisualStudio71Generator.h7
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h3
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx7
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
-rw-r--r--Source/cmGraphAdjacencyList.h6
-rw-r--r--Source/cmGraphVizWriter.cxx2
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.cxx2
-rw-r--r--Source/cmLinkItem.cxx15
-rw-r--r--Source/cmLinkItem.h5
-rw-r--r--Source/cmLinkItemGraphVisitor.cxx2
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx4
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx4
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx4
-rw-r--r--Source/cmQtAutoGenInitializer.cxx15
-rw-r--r--Source/cmTarget.cxx22
-rw-r--r--Source/cmTarget.h5
-rw-r--r--Source/cmTargetDepend.h4
-rw-r--r--Source/kwsys/SystemTools.cxx15
-rw-r--r--Source/kwsys/Terminal.c1
-rw-r--r--Source/kwsys/testSystemTools.cxx9
-rw-r--r--Tests/CFBundleTest/VerifyResult.cmake2
-rw-r--r--Tests/CMakeLists.txt23
-rw-r--r--Tests/CustComDepend/CMakeLists.txt4
-rw-r--r--Tests/ExternalProject/CMakeLists.txt12
-rw-r--r--Tests/Qt4Autogen/CMakeLists.txt2
-rw-r--r--Tests/Qt5Autogen/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt12
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt9
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt19
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/FrameworkDependencyAutogen.cmake20
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake7
62 files changed, 468 insertions, 202 deletions
diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst
index 96f0486..a844cbf 100644
--- a/Help/guide/tutorial/index.rst
+++ b/Help/guide/tutorial/index.rst
@@ -183,7 +183,7 @@ last few lines of the top-level ``CMakeLists.txt`` file should now look like:
)
Now let us make the MathFunctions library optional. While for the tutorial
-there really isn’t any need to do so, for larger projects this is a common
+there really isn't any need to do so, for larger projects this is a common
occurrence. The first step is to add an option to the top-level
``CMakeLists.txt`` file.
@@ -918,8 +918,8 @@ subbdirectories. The layout will look like:
.. code-block:: none
- Step12
- └── debug
- └── release
+ - debug
+ - release
Now we need to setup debug and release builds. We can use
:variable:`CMAKE_BUILD_TYPE` to set the configuration type:
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 2bfaafe..6503f0e 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -1331,6 +1331,15 @@ the running machine. This allows CTest to internally keep track of which
resources are in use and which are free, scheduling tests in a way that
prevents them from trying to claim resources that are not available.
+When the resource allocation feature is used, CTest will not oversubscribe
+resources. For example, if a resource has 8 slots, CTest will not run tests
+that collectively use more than 8 slots at a time. This has the effect of
+limiting how many tests can run at any given time, even if a high ``-j``
+argument is used, if those tests all use some slots from the same resource.
+In addition, it means that a single test that uses more of a resource than is
+available on a machine will not run at all (and will be reported as
+``Not Run``).
+
A common use case for this feature is for tests that require the use of a GPU.
Multiple tests can simultaneously allocate memory from a GPU, but if too many
tests try to do this at once, some of them will fail to allocate, resulting in
diff --git a/Help/variable/CMAKE_CFG_INTDIR.rst b/Help/variable/CMAKE_CFG_INTDIR.rst
index af82f75..842654e 100644
--- a/Help/variable/CMAKE_CFG_INTDIR.rst
+++ b/Help/variable/CMAKE_CFG_INTDIR.rst
@@ -16,6 +16,13 @@ Example values:
$(Configuration) = Visual Studio 10
$(CONFIGURATION) = Xcode
. = Make-based tools
+ . = Ninja
+ ${CONFIGURATION} = Ninja Multi-Config
+
+Note that this variable only has limited support on
+:generator:`Ninja Multi-Config`. It is recommended that you use the
+``$<CONFIG>`` :manual:`generator expression <cmake-generator-expressions(7)>`
+instead.
Since these values are evaluated by the native build system, this
variable is suitable only for use in command lines that will be
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 848934c..ba242ec 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -29,6 +29,11 @@ endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ")
set(CMAKE_SHARED_LIBRARY_RUNTIME_Swift_FLAG_SEP ":")
+
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
+ set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG "-Xlinker -rpath -Xlinker ")
+ set(CMAKE_EXECUTABLE_RUNTIME_Swift_FLAG_SEP ":")
+ endif()
endif()
set(CMAKE_Swift_COMPILE_OPTIONS_TARGET "-target ")
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index 5cc9328..f65916f 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -101,7 +101,7 @@ else()
if (NOT CMAKE_GENERATOR MATCHES "Xcode")
set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
endif()
- set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE>)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>)
set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>)
endmacro()
endif()
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index a786fb9..1f4d54d 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -82,7 +82,7 @@ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0)
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0")
- set(CMAKE_CUDA_RESPONSE_FILE_LINK_FLAG "--options-file ")
+ set(CMAKE_CUDA_RESPONSE_FILE_DEVICE_LINK_FLAG "--options-file ")
set(CMAKE_CUDA_RESPONSE_FILE_FLAG "--options-file ")
endif()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index c69a2ee..5bac0d8 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1096,7 +1096,7 @@ function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git
list(APPEND git_clone_options --progress)
endif()
foreach(config IN LISTS git_config)
- list(APPEND git_clone_options --config ${config})
+ list(APPEND git_clone_options --config \"${config}\")
endforeach()
if(NOT ${git_remote_name} STREQUAL "origin")
list(APPEND git_clone_options --origin \"${git_remote_name}\")
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 0e2f551..e1af2d6 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -929,7 +929,11 @@ set(CUDA_LIBRARIES)
if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY)
- list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS})
+ list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY})
+ if (TARGET Threads::Threads)
+ list(APPEND CUDA_LIBRARIES Threads::Threads)
+ endif()
+ list(APPEND CUDA_LIBRARIES ${CMAKE_DL_LIBS})
if (CUDA_rt_LIBRARY)
list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY})
endif()
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index bd69819..27ffa13 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -10,7 +10,7 @@ Find the OpenGL Extension Wrangler Library (GLEW)
Input Variables
^^^^^^^^^^^^^^^
-The following variables may be set to influence this module’s behavior:
+The following variables may be set to influence this module's behavior:
``GLEW_USE_STATIC_LIBS``
to find and create :prop_tgt:`IMPORTED` target for static linkage.
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index f4b6ea1..c79f20f 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -20,6 +20,10 @@ following variables will also be set:
#]========================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
+cmake_policy(SET CMP0057 NEW) # if IN_LIST
+
### Common stuff ####
set(PKG_CONFIG_VERSION 1)
@@ -770,3 +774,5 @@ Variables Affecting Behavior
### Local Variables:
### mode: cmake
### End:
+
+cmake_policy(POP)
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 889d407..0f52008 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -52,6 +52,48 @@ macro (_PYTHON_DISPLAY_FAILURE _PYTHON_MSG)
endmacro()
+function (_PYTHON_MARK_AS_INTERNAL)
+ foreach (var IN LISTS ARGV)
+ if (DEFINED CACHE{${var}})
+ set_property (CACHE ${var} PROPERTY TYPE INTERNAL)
+ endif()
+ endforeach()
+endfunction()
+
+
+macro (_PYTHON_SELECT_LIBRARY_CONFIGURATIONS _PYTHON_BASENAME)
+ if(NOT DEFINED ${_PYTHON_BASENAME}_LIBRARY_RELEASE)
+ set(${_PYTHON_BASENAME}_LIBRARY_RELEASE "${_PYTHON_BASENAME}_LIBRARY_RELEASE-NOTFOUND")
+ endif()
+ if(NOT DEFINED ${_PYTHON_BASENAME}_LIBRARY_DEBUG)
+ set(${_PYTHON_BASENAME}_LIBRARY_DEBUG "${_PYTHON_BASENAME}_LIBRARY_DEBUG-NOTFOUND")
+ endif()
+
+ get_property(_PYTHON_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if (${_PYTHON_BASENAME}_LIBRARY_DEBUG AND ${_PYTHON_BASENAME}_LIBRARY_RELEASE AND
+ NOT ${_PYTHON_BASENAME}_LIBRARY_DEBUG STREQUAL ${_PYTHON_BASENAME}_LIBRARY_RELEASE AND
+ (_PYTHON_isMultiConfig OR CMAKE_BUILD_TYPE))
+ # if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
+ # single-config generators, set optimized and debug libraries
+ set (${_PYTHON_BASENAME}_LIBRARY "")
+ foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_RELEASE )
+ list( APPEND ${_PYTHON_BASENAME}_LIBRARY optimized "${_PYTHON_libname}" )
+ endforeach()
+ foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_DEBUG )
+ list( APPEND ${_PYTHON_BASENAME}_LIBRARY debug "${_PYTHON_libname}" )
+ endforeach()
+ elseif (${_PYTHON_BASENAME}_LIBRARY_RELEASE)
+ set (${_PYTHON_BASENAME}_LIBRARY "${${_PYTHON_BASENAME}_LIBRARY_RELEASE}")
+ elseif (${_PYTHON_BASENAME}_LIBRARY_DEBUG)
+ set (${_PYTHON_BASENAME}_LIBRARY "${${_PYTHON_BASENAME}_LIBRARY_DEBUG}")
+ else()
+ set (${_PYTHON_BASENAME}_LIBRARY "${_PYTHON_BASENAME}_LIBRARY-NOTFOUND")
+ endif()
+
+ set (${_PYTHON_BASENAME}_LIBRARIES "${${_PYTHON_BASENAME}_LIBRARY}")
+endmacro()
+
+
macro (_PYTHON_FIND_FRAMEWORKS)
set (${_PYTHON_PREFIX}_FRAMEWORKS)
if (CMAKE_HOST_APPLE OR APPLE)
@@ -439,7 +481,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
if (_PVI_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_EXECUTABLE}")
# interpreter does not exist anymore
set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot find the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
@@ -458,7 +500,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
if (NOT abi IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
# incompatible ABI
set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong ABI for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
endif()
@@ -476,12 +518,12 @@ function (_PYTHON_VALIDATE_INTERPRETER)
if (result)
# interpreter is not usable
set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
else()
if (_PVI_EXACT AND NOT version VERSION_EQUAL expected_version)
# interpreter has wrong version
set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
else()
# check that version is OK
string(REGEX REPLACE "^([0-9]+)\." "\\1" major_version "${version}")
@@ -489,7 +531,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
if (NOT major_version VERSION_EQUAL expected_major_version
OR NOT version VERSION_GREATER_EQUAL expected_version)
set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
endif()
endif()
endif()
@@ -513,7 +555,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
else()
set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong major version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
endif()
- set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
endif()
@@ -535,7 +577,7 @@ function (_PYTHON_VALIDATE_INTERPRETER)
else()
set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong architecture for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
endif()
- set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
return()
endif()
endif()
@@ -560,7 +602,7 @@ function (_PYTHON_VALIDATE_COMPILER expected_version)
if (_PVC_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_COMPILER}")
# Compiler does not exist anymore
set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot find the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "_${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
return()
endif()
@@ -591,7 +633,7 @@ function (_PYTHON_VALIDATE_COMPILER expected_version)
else()
set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
endif()
- set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "_${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
endif()
endfunction()
@@ -611,11 +653,11 @@ function (_PYTHON_VALIDATE_LIBRARY)
if (_PVL_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
# library does not exist anymore
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
if (WIN32)
- set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_DEBUG PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_DEBUG PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND")
endif()
- set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
return()
endif()
@@ -625,28 +667,30 @@ function (_PYTHON_VALIDATE_LIBRARY)
if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT lib_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
# incompatible ABI
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong ABI for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
else()
if (expected_version)
if ((_PVL_EXACT AND NOT lib_VERSION VERSION_EQUAL expected_version) OR (lib_VERSION VERSION_LESS expected_version))
# library has wrong version
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
endif()
else()
if (NOT lib_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
# library has wrong major version
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong major version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
endif()
endif()
endif()
if (NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
if (WIN32)
- set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_DEBUG PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_DEBUG PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND")
endif()
- set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
+ unset (_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE CACHE)
+ unset (_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG CACHE)
+ set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
endif()
endfunction()
@@ -666,7 +710,7 @@ function (_PYTHON_VALIDATE_INCLUDE_DIR)
if (_PVID_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
# include file does not exist anymore
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
return()
endif()
@@ -676,19 +720,19 @@ function (_PYTHON_VALIDATE_INCLUDE_DIR)
if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT inc_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
# incompatible ABI
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong ABI for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
else()
if (expected_version)
if ((_PVID_EXACT AND NOT inc_VERSION VERSION_EQUAL expected_version) OR (inc_VERSION VERSION_LESS expected_version))
# include dir has wrong version
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
endif()
else()
if (NOT inc_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
# include dir has wrong major version
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong major version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
endif()
endif()
endif()
@@ -1368,9 +1412,9 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
endif()
- mark_as_advanced (_${_PYTHON_PREFIX}_EXECUTABLE
- _${_PYTHON_PREFIX}_INTERPRETER_PROPERTIES
- _${_PYTHON_PREFIX}_INTERPRETER_SIGNATURE)
+ _python_mark_as_internal (_${_PYTHON_PREFIX}_EXECUTABLE
+ _${_PYTHON_PREFIX}_INTERPRETER_PROPERTIES
+ _${_PYTHON_PREFIX}_INTERPRETER_SIGNATURE)
endif()
@@ -1563,8 +1607,8 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
unset (${_PYTHON_PREFIX}_COMPILER_ID)
endif()
- mark_as_advanced (_${_PYTHON_PREFIX}_COMPILER
- _${_PYTHON_PREFIX}_COMPILER_SIGNATURE)
+ _python_mark_as_internal (_${_PYTHON_PREFIX}_COMPILER
+ _${_PYTHON_PREFIX}_COMPILER_SIGNATURE)
endif()
@@ -1573,9 +1617,9 @@ endif()
if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
AND NOT ${_PYTHON_PREFIX}_INTERPRETER_ID STREQUAL "IronPython")
list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS _${_PYTHON_PREFIX}_LIBRARY_RELEASE
- ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
+ _${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
_${_PYTHON_PREFIX}_LIBRARY_DEBUG
- ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG
+ _${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG
_${_PYTHON_PREFIX}_INCLUDE_DIR)
if (${_PYTHON_PREFIX}_FIND_REQUIRED_Development)
list (APPEND _${_PYTHON_PREFIX}_REQUIRED_VARS ${_PYTHON_PREFIX}_LIBRARIES
@@ -1586,10 +1630,10 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
# compute development signature and check validity of definition
string (MD5 __${_PYTHON_PREFIX}_DEVELOPMENT_SIGNATURE "${_${_PYTHON_PREFIX}_SIGNATURE}:${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}:${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
if (WIN32 AND NOT DEFINED _${_PYTHON_PREFIX}_LIBRARY_DEBUG)
- set (_${_PYTHON_PREFIX}_LIBRARY_DEBUG "_${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND" CACHE INTERNAL "")
+ set (_${_PYTHON_PREFIX}_LIBRARY_DEBUG "${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND" CACHE INTERNAL "")
endif()
if (NOT DEFINED _${_PYTHON_PREFIX}_INCLUDE_DIR)
- set (_${_PYTHON_PREFIX}_INCLUDE_DIR "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND" CACHE INTERNAL "")
+ set (_${_PYTHON_PREFIX}_INCLUDE_DIR "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND" CACHE INTERNAL "")
endif()
if (__${_PYTHON_PREFIX}_DEVELOPMENT_SIGNATURE STREQUAL _${_PYTHON_PREFIX}_DEVELOPMENT_SIGNATURE)
# check version validity
@@ -2034,11 +2078,11 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
# finalize library version information
_python_get_version (LIBRARY PREFIX _${_PYTHON_PREFIX}_)
- set (${_PYTHON_PREFIX}_LIBRARY_RELEASE "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}" CACHE FILEPATH "Path to a library." FORCE)
+ set (${_PYTHON_PREFIX}_LIBRARY_RELEASE "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE AND NOT EXISTS "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
endif()
set (_${_PYTHON_PREFIX}_HINTS "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR)
@@ -2060,7 +2104,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
_python_get_names (_${_PYTHON_PREFIX}_LIB_NAMES VERSION ${_${_PYTHON_PREFIX}_VERSION} WIN32 POSIX LIBRARY)
get_filename_component (_${_PYTHON_PREFIX}_PATH "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}" DIRECTORY)
get_filename_component (_${_PYTHON_PREFIX}_PATH2 "${_${_PYTHON_PREFIX}_PATH}" DIRECTORY)
- _python_find_runtime_library (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
+ _python_find_runtime_library (_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
NAMES ${_${_PYTHON_PREFIX}_LIB_NAMES}
NAMES_PER_DIR
HINTS "${_${_PYTHON_PREFIX}_PATH}" "${_${_PYTHON_PREFIX}_PATH2}" ${_${_PYTHON_PREFIX}_HINTS}
@@ -2070,7 +2114,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
_python_get_names (_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG VERSION ${_${_PYTHON_PREFIX}_VERSION} WIN32 DEBUG)
get_filename_component (_${_PYTHON_PREFIX}_PATH "${_${_PYTHON_PREFIX}_LIBRARY_DEBUG}" DIRECTORY)
get_filename_component (_${_PYTHON_PREFIX}_PATH2 "${_${_PYTHON_PREFIX}_PATH}" DIRECTORY)
- _python_find_runtime_library (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG
+ _python_find_runtime_library (_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG
NAMES ${_${_PYTHON_PREFIX}_LIB_NAMES_DEBUG}
NAMES_PER_DIR
HINTS "${_${_PYTHON_PREFIX}_PATH}" "${_${_PYTHON_PREFIX}_PATH2}" ${_${_PYTHON_PREFIX}_HINTS}
@@ -2171,7 +2215,7 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
if (_${_PYTHON_PREFIX}_INCLUDE_DIR AND NOT EXISTS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
endif()
if (_${_PYTHON_PREFIX}_INCLUDE_DIR)
@@ -2193,27 +2237,29 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
endif()
# define public variables
- set (${_PYTHON_PREFIX}_LIBRARY_DEBUG "${_${_PYTHON_PREFIX}_LIBRARY_DEBUG}" CACHE FILEPATH "Path to a library." FORCE)
-
- include (${CMAKE_CURRENT_LIST_DIR}/../SelectLibraryConfigurations.cmake)
- select_library_configurations (${_PYTHON_PREFIX})
- if (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE)
- set (${_PYTHON_PREFIX}_RUNTIME_LIBRARY "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE}")
- elseif (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG)
- set (${_PYTHON_PREFIX}_RUNTIME_LIBRARY "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG}")
+ set (${_PYTHON_PREFIX}_LIBRARY_DEBUG "${_${_PYTHON_PREFIX}_LIBRARY_DEBUG}")
+ _python_select_library_configurations (${_PYTHON_PREFIX})
+
+ set (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE "${_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE}")
+ set (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG "${_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG}")
+
+ if (_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE)
+ set (${_PYTHON_PREFIX}_RUNTIME_LIBRARY "${_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE}")
+ elseif (_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG)
+ set (${_PYTHON_PREFIX}_RUNTIME_LIBRARY "${_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG}")
else()
set (${_PYTHON_PREFIX}_RUNTIME_LIBRARY "${_PYTHON_PREFIX}_RUNTIME_LIBRARY-NOTFOUND")
endif()
_python_set_library_dirs (${_PYTHON_PREFIX}_LIBRARY_DIRS
- ${_PYTHON_PREFIX}_LIBRARY_RELEASE ${_PYTHON_PREFIX}_LIBRARY_DEBUG)
+ _${_PYTHON_PREFIX}_LIBRARY_RELEASE _${_PYTHON_PREFIX}_LIBRARY_DEBUG)
if (UNIX)
- if (${_PYTHON_PREFIX}_LIBRARY_RELEASE MATCHES "${CMAKE_SHARED_LIBRARY_SUFFIX}$")
+ if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE MATCHES "${CMAKE_SHARED_LIBRARY_SUFFIX}$")
set (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DIRS ${${_PYTHON_PREFIX}_LIBRARY_DIRS})
endif()
else()
_python_set_library_dirs (${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DIRS
- ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG)
+ _${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE _${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG)
endif()
if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE AND _${_PYTHON_PREFIX}_INCLUDE_DIR)
@@ -2252,13 +2298,13 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
set (CMAKE_FIND_LIBRARY_SUFFIXES ${_${_PYTHON_PREFIX}_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
- mark_as_advanced (_${_PYTHON_PREFIX}_LIBRARY_RELEASE
- _${_PYTHON_PREFIX}_LIBRARY_DEBUG
- ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
- ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG
- _${_PYTHON_PREFIX}_INCLUDE_DIR
- _${_PYTHON_PREFIX}_CONFIG
- _${_PYTHON_PREFIX}_DEVELOPMENT_SIGNATURE)
+ _python_mark_as_internal (_${_PYTHON_PREFIX}_LIBRARY_RELEASE
+ _${_PYTHON_PREFIX}_LIBRARY_DEBUG
+ _${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
+ _${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG
+ _${_PYTHON_PREFIX}_INCLUDE_DIR
+ _${_PYTHON_PREFIX}_CONFIG
+ _${_PYTHON_PREFIX}_DEVELOPMENT_SIGNATURE)
endif()
if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Interpreter_FOUND)
@@ -2301,7 +2347,7 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
if(_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR AND NOT EXISTS "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
set (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}\"")
- set_property (CACHE _${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR-NOTFOUND")
+ set_property (CACHE _${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR PROPERTY VALUE "${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR-NOTFOUND")
endif()
if (_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
@@ -2330,7 +2376,8 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
unset (_${_PYTHON_PREFIX}_NUMPY_SIGNATURE CACHE)
endif()
- mark_as_advanced (_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
+ _python_mark_as_internal (_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR
+ _${_PYTHON_PREFIX}_NUMPY_SIGNATURE)
endif()
# final validation
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 7fd5e49..dc8dd6f 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -86,7 +86,7 @@ macro(__windows_compiler_clang_gnu lang)
set(CMAKE_PCH_EXTENSION .pch)
set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
- set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE>)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>)
set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>)
unset(__ADDED_FLAGS)
diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake
index 370b56e..0c24739 100644
--- a/Modules/Platform/Windows-Embarcadero.cmake
+++ b/Modules/Platform/Windows-Embarcadero.cmake
@@ -122,7 +122,7 @@ macro(__embarcadero_language lang)
# Precompile Headers
if (EMBARCADERO)
set(CMAKE_PCH_EXTENSION .pch)
- set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE>)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>)
set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>)
endif()
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 37679b9..2192843 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -196,8 +196,40 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
// working directory because FinishTestProcess() will try to unlock them
this->LockResources(test);
- if (!this->TestsHaveSufficientResources[test]) {
- testRun->StartFailure("Insufficient resources");
+ if (!this->ResourceAllocationErrors[test].empty()) {
+ std::ostringstream e;
+ e << "Insufficient resources for test " << this->Properties[test]->Name
+ << ":\n\n";
+ for (auto const& it : this->ResourceAllocationErrors[test]) {
+ switch (it.second) {
+ case ResourceAllocationError::NoResourceType:
+ e << " Test requested resources of type '" << it.first
+ << "' which does not exist\n";
+ break;
+
+ case ResourceAllocationError::InsufficientResources:
+ e << " Test requested resources of type '" << it.first
+ << "' in the following amounts:\n";
+ for (auto const& group : this->Properties[test]->ResourceGroups) {
+ for (auto const& requirement : group) {
+ if (requirement.ResourceType == it.first) {
+ e << " " << requirement.SlotsNeeded
+ << (requirement.SlotsNeeded == 1 ? " slot\n" : " slots\n");
+ }
+ }
+ }
+ e << " but only the following units were available:\n";
+ for (auto const& res :
+ this->ResourceAllocator.GetResources().at(it.first)) {
+ e << " '" << res.first << "': " << res.second.Total
+ << (res.second.Total == 1 ? " slot\n" : " slots\n");
+ }
+ break;
+ }
+ e << "\n";
+ }
+ e << "Resource spec file:\n\n " << this->TestHandler->ResourceSpecFile;
+ testRun->StartFailure(e.str(), "Insufficient resources");
this->FinishTestProcess(testRun, false);
return false;
}
@@ -205,8 +237,9 @@ bool cmCTestMultiProcessHandler::StartTestProcess(int test)
cmWorkingDirectory workdir(this->Properties[test]->Directory);
if (workdir.Failed()) {
testRun->StartFailure("Failed to change working directory to " +
- this->Properties[test]->Directory + " : " +
- std::strerror(workdir.GetLastResult()));
+ this->Properties[test]->Directory + " : " +
+ std::strerror(workdir.GetLastResult()),
+ "Failed to change working directory");
} else {
if (testRun->StartTest(this->Completed, this->Total)) {
// Ownership of 'testRun' has moved to another structure.
@@ -249,7 +282,8 @@ bool cmCTestMultiProcessHandler::AllocateResources(int index)
bool cmCTestMultiProcessHandler::TryAllocateResources(
int index,
- std::map<std::string, std::vector<cmCTestBinPackerAllocation>>& allocations)
+ std::map<std::string, std::vector<cmCTestBinPackerAllocation>>& allocations,
+ std::map<std::string, ResourceAllocationError>* errors)
{
allocations.clear();
@@ -264,18 +298,28 @@ bool cmCTestMultiProcessHandler::TryAllocateResources(
++processIndex;
}
+ bool result = true;
auto const& availableResources = this->ResourceAllocator.GetResources();
for (auto& it : allocations) {
if (!availableResources.count(it.first)) {
- return false;
- }
- if (!cmAllocateCTestResourcesRoundRobin(availableResources.at(it.first),
- it.second)) {
- return false;
+ if (errors) {
+ (*errors)[it.first] = ResourceAllocationError::NoResourceType;
+ result = false;
+ } else {
+ return false;
+ }
+ } else if (!cmAllocateCTestResourcesRoundRobin(
+ availableResources.at(it.first), it.second)) {
+ if (errors) {
+ (*errors)[it.first] = ResourceAllocationError::InsufficientResources;
+ result = false;
+ } else {
+ return false;
+ }
}
}
- return true;
+ return result;
}
void cmCTestMultiProcessHandler::DeallocateResources(int index)
@@ -316,11 +360,13 @@ bool cmCTestMultiProcessHandler::AllResourcesAvailable()
void cmCTestMultiProcessHandler::CheckResourcesAvailable()
{
- for (auto test : this->SortedTests) {
- std::map<std::string, std::vector<cmCTestBinPackerAllocation>> allocations;
- this->TestsHaveSufficientResources[test] =
- !this->TestHandler->UseResourceSpec ||
- this->TryAllocateResources(test, allocations);
+ if (this->TestHandler->UseResourceSpec) {
+ for (auto test : this->SortedTests) {
+ std::map<std::string, std::vector<cmCTestBinPackerAllocation>>
+ allocations;
+ this->TryAllocateResources(test, allocations,
+ &this->ResourceAllocationErrors[test]);
+ }
}
}
@@ -407,7 +453,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
}
// Allocate resources
- if (this->TestsHaveSufficientResources[test] &&
+ if (this->ResourceAllocationErrors[test].empty() &&
!this->AllocateResources(test)) {
this->DeallocateResources(test);
return false;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 4837401..5b429d4 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -143,11 +143,18 @@ protected:
void LockResources(int index);
void UnlockResources(int index);
+ enum class ResourceAllocationError
+ {
+ NoResourceType,
+ InsufficientResources,
+ };
+
bool AllocateResources(int index);
bool TryAllocateResources(
int index,
std::map<std::string, std::vector<cmCTestBinPackerAllocation>>&
- allocations);
+ allocations,
+ std::map<std::string, ResourceAllocationError>* errors = nullptr);
void DeallocateResources(int index);
bool AllResourcesAvailable();
@@ -174,7 +181,8 @@ protected:
std::map<int,
std::vector<std::map<std::string, std::vector<ResourceAllocation>>>>
AllocatedResources;
- std::map<int, bool> TestsHaveSufficientResources;
+ std::map<int, std::map<std::string, ResourceAllocationError>>
+ ResourceAllocationErrors;
cmCTestResourceAllocator ResourceAllocator;
std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults;
size_t ParallelLevel; // max number of process that can be run at once
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index cc5de43..ec54960 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -324,8 +324,9 @@ bool cmCTestRunTest::StartAgain(size_t completed)
cmWorkingDirectory workdir(this->TestProperties->Directory);
if (workdir.Failed()) {
this->StartFailure("Failed to change working directory to " +
- this->TestProperties->Directory + " : " +
- std::strerror(workdir.GetLastResult()));
+ this->TestProperties->Directory + " : " +
+ std::strerror(workdir.GetLastResult()),
+ "Failed to change working directory");
return true;
}
@@ -381,7 +382,8 @@ void cmCTestRunTest::MemCheckPostProcess()
handler->PostProcessTest(this->TestResult, this->Index);
}
-void cmCTestRunTest::StartFailure(std::string const& output)
+void cmCTestRunTest::StartFailure(std::string const& output,
+ std::string const& detail)
{
// Still need to log the Start message so the test summary records our
// attempt to start this test
@@ -404,7 +406,7 @@ void cmCTestRunTest::StartFailure(std::string const& output)
this->TestResult.ExecutionTime = cmDuration::zero();
this->TestResult.CompressOutput = false;
this->TestResult.ReturnValue = -1;
- this->TestResult.CompletionStatus = "Failed to start";
+ this->TestResult.CompletionStatus = detail;
this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
this->TestResult.TestCount = this->TestProperties->Index;
this->TestResult.Name = this->TestProperties->Name;
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 7eeaebd..4988839 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -76,7 +76,7 @@ public:
bool StartAgain(size_t completed);
- void StartFailure(std::string const& output);
+ void StartFailure(std::string const& output, std::string const& detail);
cmCTest* GetCTest() const { return this->CTest; }
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 78c68be..4f324ea 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -548,6 +548,7 @@ bool cmCTestTestHandler::ProcessOptions()
val = this->GetOption("ResourceSpecFile");
if (val) {
this->UseResourceSpec = true;
+ this->ResourceSpecFile = val;
auto result = this->ResourceSpec.ReadFromJSONFile(val);
if (result != cmCTestResourceSpec::ReadFileResult::READ_OK) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 55237f9..b1c8755 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -338,6 +338,7 @@ private:
bool UseResourceSpec;
cmCTestResourceSpec ResourceSpec;
+ std::string ResourceSpecFile;
void GenerateRegressionImages(cmXMLWriter& xml, const std::string& dart);
cmsys::RegularExpression DartStuff1;
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index b1fc893..2d55a5a 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -29,7 +29,7 @@ bool cmAddDependenciesCommand(std::vector<std::string> const& args,
// skip over target_name
for (std::string const& arg : cmMakeRange(args).advance(1)) {
- target->AddUtility(arg, &mf);
+ target->AddUtility(arg, false, &mf);
}
} else {
mf.IssueMessage(
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx
index af257ee..81cd878 100644
--- a/Source/cmComputeComponentGraph.cxx
+++ b/Source/cmComputeComponentGraph.cxx
@@ -123,7 +123,7 @@ void cmComputeComponentGraph::TransferEdges()
// We do not attempt to combine duplicate edges, but instead
// store the inter-component edges with suitable multiplicity.
this->ComponentGraph[i_component].emplace_back(
- j_component, ni.IsStrong(), ni.GetBacktrace());
+ j_component, ni.IsStrong(), ni.IsCross(), ni.GetBacktrace());
}
}
}
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index ccef9c8..e9bf5a5 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -412,7 +412,7 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
// This shared library dependency must follow the item that listed
// it.
this->EntryConstraintGraph[dep.DependerIndex].emplace_back(
- index, true, cmListFileBacktrace());
+ index, true, false, cmListFileBacktrace());
// Target items may have their own dependencies.
if (entry.Target) {
@@ -514,7 +514,7 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index,
// The dependee must come after the depender.
if (depender_index >= 0) {
this->EntryConstraintGraph[depender_index].emplace_back(
- dependee_index, false, cmListFileBacktrace());
+ dependee_index, false, false, cmListFileBacktrace());
} else {
// This is a direct dependency of the target being linked.
this->OriginalEntries.push_back(dependee_index);
@@ -587,7 +587,7 @@ void cmComputeLinkDepends::InferDependencies()
cmGraphEdgeList& edges = this->EntryConstraintGraph[depender_index];
edges.reserve(edges.size() + common.size());
for (auto const& c : common) {
- edges.emplace_back(c, true, cmListFileBacktrace());
+ edges.emplace_back(c, true, false, cmListFileBacktrace());
}
}
}
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 58ec53a..a98a608 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -151,6 +151,7 @@ void cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t,
cmGeneratorTarget const* dep = this->Targets[ni];
auto di = deps.insert(dep).first;
di->SetType(ni.IsStrong());
+ di->SetCross(ni.IsCross());
di->SetBacktrace(ni.GetBacktrace());
}
}
@@ -217,7 +218,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
return;
}
const_cast<cmGeneratorTarget*>(depender)->Target->AddUtility(
- objLib);
+ objLib, false);
}
}
}
@@ -225,11 +226,12 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
cmLinkImplementation const* impl = depender->GetLinkImplementation(it);
// A target should not depend on itself.
- emitted.insert(cmLinkItem(depender, cmListFileBacktrace()));
+ emitted.insert(cmLinkItem(depender, false, cmListFileBacktrace()));
+ emitted.insert(cmLinkItem(depender, true, cmListFileBacktrace()));
for (cmLinkImplItem const& lib : impl->Libraries) {
// Don't emit the same library twice for this target.
if (emitted.insert(lib).second) {
- this->AddTargetDepend(depender_index, lib, true);
+ this->AddTargetDepend(depender_index, lib, true, false);
this->AddInterfaceDepends(depender_index, lib, it, emitted);
}
}
@@ -241,11 +243,12 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
std::set<cmLinkItem> const& tutils = depender->GetUtilityItems();
std::set<cmLinkItem> emitted;
// A target should not depend on itself.
- emitted.insert(cmLinkItem(depender, cmListFileBacktrace()));
+ emitted.insert(cmLinkItem(depender, false, cmListFileBacktrace()));
+ emitted.insert(cmLinkItem(depender, true, cmListFileBacktrace()));
for (cmLinkItem const& litem : tutils) {
// Don't emit the same utility twice for this target.
if (emitted.insert(litem).second) {
- this->AddTargetDepend(depender_index, litem, false);
+ this->AddTargetDepend(depender_index, litem, false, litem.Cross);
}
}
}
@@ -267,7 +270,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(
// code in the project that caused this dependency to be added.
cmLinkItem libBT = lib;
libBT.Backtrace = dependee_backtrace;
- this->AddTargetDepend(depender_index, libBT, true);
+ this->AddTargetDepend(depender_index, libBT, true, false);
this->AddInterfaceDepends(depender_index, libBT, config, emitted);
}
}
@@ -290,7 +293,8 @@ void cmComputeTargetDepends::AddInterfaceDepends(
if (dependee) {
// A target should not depend on itself.
- emitted.insert(cmLinkItem(depender, cmListFileBacktrace()));
+ emitted.insert(cmLinkItem(depender, false, cmListFileBacktrace()));
+ emitted.insert(cmLinkItem(depender, true, cmListFileBacktrace()));
this->AddInterfaceDepends(depender_index, dependee,
dependee_name.Backtrace, config, emitted);
}
@@ -298,7 +302,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(
void cmComputeTargetDepends::AddTargetDepend(int depender_index,
cmLinkItem const& dependee_name,
- bool linking)
+ bool linking, bool cross)
{
// Get the depender.
cmGeneratorTarget const* depender = this->Targets[depender_index];
@@ -343,13 +347,13 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
if (dependee) {
this->AddTargetDepend(depender_index, dependee, dependee_name.Backtrace,
- linking);
+ linking, cross);
}
}
void cmComputeTargetDepends::AddTargetDepend(
int depender_index, cmGeneratorTarget const* dependee,
- cmListFileBacktrace const& dependee_backtrace, bool linking)
+ cmListFileBacktrace const& dependee_backtrace, bool linking, bool cross)
{
if (dependee->IsImported() ||
dependee->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
@@ -359,7 +363,7 @@ void cmComputeTargetDepends::AddTargetDepend(
for (cmLinkItem const& i : utils) {
if (cmGeneratorTarget const* transitive_dependee = i.Target) {
this->AddTargetDepend(depender_index, transitive_dependee, i.Backtrace,
- false);
+ false, i.Cross);
}
}
} else {
@@ -371,7 +375,7 @@ void cmComputeTargetDepends::AddTargetDepend(
// Add this entry to the dependency graph.
this->InitialGraph[depender_index].emplace_back(dependee_index, !linking,
- dependee_backtrace);
+ cross, dependee_backtrace);
}
}
@@ -505,7 +509,8 @@ bool cmComputeTargetDepends::IntraComponent(std::vector<int> const& cmap,
for (cmGraphEdge const& edge : el) {
int j = edge;
if (cmap[j] == c && edge.IsStrong()) {
- this->FinalGraph[i].emplace_back(j, true, edge.GetBacktrace());
+ this->FinalGraph[i].emplace_back(j, true, edge.IsCross(),
+ edge.GetBacktrace());
if (!this->IntraComponent(cmap, c, j, head, emitted, visited)) {
return false;
}
@@ -514,7 +519,8 @@ bool cmComputeTargetDepends::IntraComponent(std::vector<int> const& cmap,
// Prepend to a linear linked-list of intra-component edges.
if (*head >= 0) {
- this->FinalGraph[i].emplace_back(*head, false, cmListFileBacktrace());
+ this->FinalGraph[i].emplace_back(*head, false, false,
+ cmListFileBacktrace());
} else {
this->ComponentTail[c] = i;
}
@@ -564,7 +570,8 @@ bool cmComputeTargetDepends::ComputeFinalDepends(
int dependee_component = ni;
int dependee_component_head = this->ComponentHead[dependee_component];
this->FinalGraph[depender_component_tail].emplace_back(
- dependee_component_head, ni.IsStrong(), ni.GetBacktrace());
+ dependee_component_head, ni.IsStrong(), ni.IsCross(),
+ ni.GetBacktrace());
}
}
return true;
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index d8060ae..e0d625f 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -46,10 +46,10 @@ private:
void CollectDepends();
void CollectTargetDepends(int depender_index);
void AddTargetDepend(int depender_index, cmLinkItem const& dependee_name,
- bool linking);
+ bool linking, bool cross);
void AddTargetDepend(int depender_index, cmGeneratorTarget const* dependee,
cmListFileBacktrace const& dependee_backtrace,
- bool linking);
+ bool linking, bool cross);
bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
void AddInterfaceDepends(int depender_index, cmLinkItem const& dependee_name,
const std::string& config,
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index ad8c19e..ba2e314 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -979,13 +979,15 @@ std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
{
if (!this->UtilityItemsDone) {
this->UtilityItemsDone = true;
- std::set<BT<std::string>> const& utilities = this->GetUtilities();
- for (BT<std::string> const& i : utilities) {
+ std::set<BT<std::pair<std::string, bool>>> const& utilities =
+ this->GetUtilities();
+ for (BT<std::pair<std::string, bool>> const& i : utilities) {
if (cmGeneratorTarget* gt =
- this->LocalGenerator->FindGeneratorTargetToUse(i.Value)) {
- this->UtilityItems.insert(cmLinkItem(gt, i.Backtrace));
+ this->LocalGenerator->FindGeneratorTargetToUse(i.Value.first)) {
+ this->UtilityItems.insert(cmLinkItem(gt, i.Value.second, i.Backtrace));
} else {
- this->UtilityItems.insert(cmLinkItem(i.Value, i.Backtrace));
+ this->UtilityItems.insert(
+ cmLinkItem(i.Value.first, i.Value.second, i.Backtrace));
}
}
}
@@ -2183,7 +2185,8 @@ cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
return this->Target->GetBacktrace();
}
-const std::set<BT<std::string>>& cmGeneratorTarget::GetUtilities() const
+const std::set<BT<std::pair<std::string, bool>>>&
+cmGeneratorTarget::GetUtilities() const
{
return this->Target->GetUtilities();
}
@@ -2732,7 +2735,7 @@ void cmTargetTraceDependencies::FollowName(std::string const& name)
if (cmTarget* t = i->second.Target) {
// The name is a byproduct of a utility target or a PRE_BUILD, PRE_LINK, or
// POST_BUILD command.
- this->GeneratorTarget->Target->AddUtility(t->GetName());
+ this->GeneratorTarget->Target->AddUtility(t->GetName(), false);
}
if (cmSourceFile* sf = i->second.Source) {
// For now only follow the dependency if the source file is not a
@@ -2787,14 +2790,14 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
depLocation = cmSystemTools::CollapseFullPath(depLocation);
tLocation = cmSystemTools::CollapseFullPath(tLocation);
if (depLocation == tLocation) {
- this->GeneratorTarget->Target->AddUtility(util);
+ this->GeneratorTarget->Target->AddUtility(util, false);
return true;
}
}
} else {
// The original name of the dependency was not a full path. It
// must name a target, so add the target-level dependency.
- this->GeneratorTarget->Target->AddUtility(util);
+ this->GeneratorTarget->Target->AddUtility(util, false);
return true;
}
}
@@ -2822,7 +2825,7 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc)
// this project. Add the target-level dependency to make
// sure the executable is up to date before this custom
// command possibly runs.
- this->GeneratorTarget->Target->AddUtility(command);
+ this->GeneratorTarget->Target->AddUtility(command, true);
}
}
@@ -2837,7 +2840,7 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc)
}
for (cmGeneratorTarget* target : targets) {
- this->GeneratorTarget->Target->AddUtility(target->GetName());
+ this->GeneratorTarget->Target->AddUtility(target->GetName(), true);
}
// Queue the custom command dependencies.
@@ -6694,7 +6697,7 @@ cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name,
TargetOrString resolved = this->ResolveTargetReference(name, lg);
if (!resolved.Target) {
- return cmLinkItem(resolved.String, bt);
+ return cmLinkItem(resolved.String, false, bt);
}
// Check deprecation, issue message with `bt` backtrace.
@@ -6715,10 +6718,10 @@ cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name,
// within the project.
if (resolved.Target->GetType() == cmStateEnums::EXECUTABLE &&
!resolved.Target->IsExecutableWithExports()) {
- return cmLinkItem(resolved.Target->GetName(), bt);
+ return cmLinkItem(resolved.Target->GetName(), false, bt);
}
- return cmLinkItem(resolved.Target, bt);
+ return cmLinkItem(resolved.Target, false, bt);
}
std::string cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index b647b25..d81bb3d 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -291,7 +291,7 @@ public:
cmListFileBacktrace GetBacktrace() const;
- std::set<BT<std::string>> const& GetUtilities() const;
+ std::set<BT<std::pair<std::string, bool>>> const& GetUtilities() const;
bool LinkLanguagePropagatesToDependents() const
{
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 7ddeb99..ff6ad9d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2689,7 +2689,7 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(GlobalTargetInfo const& gti,
target.SetProperty("EchoString", gti.Message);
}
for (std::string const& d : gti.Depends) {
- target.AddUtility(d);
+ target.AddUtility(d, false);
}
// Organize in the "predefined targets" folder:
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 35421b6..b1e26b2 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1125,10 +1125,11 @@ void cmGlobalNinjaGenerator::AppendTargetDepends(
{
if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
// These depend only on other CMake-provided targets, e.g. "all".
- for (BT<std::string> const& util : target->GetUtilities()) {
+ for (BT<std::pair<std::string, bool>> const& util :
+ target->GetUtilities()) {
std::string d =
target->GetLocalGenerator()->GetCurrentBinaryDirectory() + "/" +
- util.Value;
+ util.Value.first;
outputs.push_back(this->BuildAlias(this->ConvertToNinjaPath(d), config));
}
} else {
@@ -1138,10 +1139,7 @@ void cmGlobalNinjaGenerator::AppendTargetDepends(
if (targetDep->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
continue;
}
- // For some reason, object libraries show up as "utility" dependencies
- // even though they're used for linking. Treat them as link dependencies.
- if (targetDep.IsUtil() &&
- targetDep->GetType() != cmStateEnums::OBJECT_LIBRARY) {
+ if (targetDep.IsCross()) {
this->AppendTargetOutputs(targetDep, outs, fileConfig, depends);
} else {
this->AppendTargetOutputs(targetDep, outs, config, depends);
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index ec1380b..d0aec61 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -157,7 +157,8 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends(
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio71Generator::WriteExternalProject(
std::ostream& fout, const std::string& name, const std::string& location,
- const char* typeGuid, const std::set<BT<std::string>>& depends)
+ const char* typeGuid,
+ const std::set<BT<std::pair<std::string, bool>>>& depends)
{
fout << "Project(\"{"
<< (typeGuid ? typeGuid : this->ExternalProjectType(location))
@@ -169,8 +170,8 @@ void cmGlobalVisualStudio71Generator::WriteExternalProject(
// project instead of in the global section
if (!depends.empty()) {
fout << "\tProjectSection(ProjectDependencies) = postProject\n";
- for (BT<std::string> const& it : depends) {
- std::string const& dep = it.Value;
+ for (BT<std::pair<std::string, bool>> const& it : depends) {
+ std::string const& dep = it.Value.first;
if (!dep.empty()) {
fout << "\t\t{" << this->GetGUID(dep) << "} = {" << this->GetGUID(dep)
<< "}\n";
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index 61a2f6f..7eadaf3 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -32,9 +32,10 @@ protected:
cmGeneratorTarget const& target, std::vector<std::string> const& configs,
const std::set<std::string>& configsPartOfDefaultBuild,
const std::string& platformMapping = "") override;
- void WriteExternalProject(std::ostream& fout, const std::string& name,
- const std::string& path, const char* typeGuid,
- const std::set<BT<std::string>>& depends) override;
+ void WriteExternalProject(
+ std::ostream& fout, const std::string& name, const std::string& path,
+ const char* typeGuid,
+ const std::set<BT<std::pair<std::string, bool>>>& depends) override;
// Folders are not supported by VS 7.1.
bool UseFolderProperty() const override { return false; }
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 699f091..6cc1cf8 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -143,7 +143,8 @@ protected:
virtual void WriteExternalProject(
std::ostream& fout, const std::string& name, const std::string& path,
- const char* typeGuid, const std::set<BT<std::string>>& dependencies) = 0;
+ const char* typeGuid,
+ const std::set<BT<std::pair<std::string, bool>>>& dependencies) = 0;
std::string ConvertToSolutionPath(const std::string& path);
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index c0551f7..1c62fbd 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -211,7 +211,7 @@ void cmGlobalVisualStudio8Generator::AddExtraIDETargets()
// All targets depend on the build-system check target.
for (const auto& ti : tgts) {
if (ti->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
- ti->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
+ ti->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false);
}
}
}
@@ -325,9 +325,10 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
cmGeneratorTarget* target)
{
// Look for utility dependencies that magically link.
- for (BT<std::string> const& ui : target->GetUtilities()) {
+ for (BT<std::pair<std::string, bool>> const& ui : target->GetUtilities()) {
if (cmGeneratorTarget* depTarget =
- target->GetLocalGenerator()->FindGeneratorTargetToUse(ui.Value)) {
+ target->GetLocalGenerator()->FindGeneratorTargetToUse(
+ ui.Value.first)) {
if (depTarget->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
depTarget->GetProperty("EXTERNAL_MSPROJECT")) {
// This utility dependency names an external .vcproj target.
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 012a77c..1ec1559 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -219,7 +219,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
continue;
}
if (!this->IsExcluded(gen[0], tgt.get())) {
- allBuild->AddUtility(tgt->GetName());
+ allBuild->AddUtility(tgt->GetName(), false);
}
}
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 7ec4e65..c48a376 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -552,7 +552,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
if (regenerate &&
(target->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET)) {
- target->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
+ target->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false);
}
// make all exe, shared libs and modules
@@ -571,7 +571,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
}
if (!this->IsExcluded(gens[0], target.get())) {
- allbuild->AddUtility(target->GetName());
+ allbuild->AddUtility(target->GetName(), false);
}
}
}
diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h
index 5ed6af4..4e1f128 100644
--- a/Source/cmGraphAdjacencyList.h
+++ b/Source/cmGraphAdjacencyList.h
@@ -18,9 +18,10 @@
class cmGraphEdge
{
public:
- cmGraphEdge(int n, bool s, cmListFileBacktrace bt)
+ cmGraphEdge(int n, bool s, bool c, cmListFileBacktrace bt)
: Dest(n)
, Strong(s)
+ , Cross(c)
, Backtrace(std::move(bt))
{
}
@@ -28,11 +29,14 @@ public:
bool IsStrong() const { return this->Strong; }
+ bool IsCross() const { return this->Cross; }
+
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
private:
int Dest;
bool Strong;
+ bool Cross;
cmListFileBacktrace Backtrace;
};
struct cmGraphEdgeList : public std::vector<cmGraphEdge>
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index f48789a..1b77678 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -289,7 +289,7 @@ void cmGraphVizWriter::Write()
}
for (auto const gt : sortedGeneratorTargets) {
- auto item = cmLinkItem(gt, gt->GetBacktrace());
+ auto item = cmLinkItem(gt, false, gt->GetBacktrace());
this->VisitItem(item);
}
}
diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx
index 86a0921..5b532ce 100644
--- a/Source/cmIncludeExternalMSProjectCommand.cxx
+++ b/Source/cmIncludeExternalMSProjectCommand.cxx
@@ -97,7 +97,7 @@ bool cmIncludeExternalMSProjectCommand(std::vector<std::string> const& args,
target->SetProperty("VS_PLATFORM_MAPPING", platformMapping);
for (std::string const& d : depends) {
- target->AddUtility(d);
+ target->AddUtility(d, false);
}
}
#endif
diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx
index 91eb183..4e50d70 100644
--- a/Source/cmLinkItem.cxx
+++ b/Source/cmLinkItem.cxx
@@ -8,14 +8,17 @@
cmLinkItem::cmLinkItem() = default;
-cmLinkItem::cmLinkItem(std::string n, cmListFileBacktrace bt)
+cmLinkItem::cmLinkItem(std::string n, bool c, cmListFileBacktrace bt)
: String(std::move(n))
+ , Cross(c)
, Backtrace(std::move(bt))
{
}
-cmLinkItem::cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace bt)
+cmLinkItem::cmLinkItem(cmGeneratorTarget const* t, bool c,
+ cmListFileBacktrace bt)
: Target(t)
+ , Cross(c)
, Backtrace(std::move(bt))
{
}
@@ -39,12 +42,16 @@ bool operator<(cmLinkItem const& l, cmLinkItem const& r)
return false;
}
// Order among strings.
- return l.String < r.String;
+ if (l.String < r.String) {
+ return true;
+ }
+ // Order among cross-config.
+ return l.Cross < r.Cross;
}
bool operator==(cmLinkItem const& l, cmLinkItem const& r)
{
- return l.Target == r.Target && l.String == r.String;
+ return l.Target == r.Target && l.String == r.String && l.Cross == r.Cross;
}
std::ostream& operator<<(std::ostream& os, cmLinkItem const& item)
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index 2d9378b..0ea25c0 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -24,10 +24,11 @@ class cmLinkItem
public:
cmLinkItem();
- cmLinkItem(std::string s, cmListFileBacktrace bt);
- cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace bt);
+ cmLinkItem(std::string s, bool c, cmListFileBacktrace bt);
+ cmLinkItem(cmGeneratorTarget const* t, bool c, cmListFileBacktrace bt);
std::string const& AsStr() const;
cmGeneratorTarget const* Target = nullptr;
+ bool Cross = false;
cmListFileBacktrace Backtrace;
friend bool operator<(cmLinkItem const& l, cmLinkItem const& r);
friend bool operator==(cmLinkItem const& l, cmLinkItem const& r);
diff --git a/Source/cmLinkItemGraphVisitor.cxx b/Source/cmLinkItemGraphVisitor.cxx
index ab2cf9e..acc23c8 100644
--- a/Source/cmLinkItemGraphVisitor.cxx
+++ b/Source/cmLinkItemGraphVisitor.cxx
@@ -127,7 +127,7 @@ void cmLinkItemGraphVisitor::GetDependencies(cmGeneratorTarget const& target,
for (auto const& lib : objectLibraries) {
auto const& name = lib->GetName();
if (dependencies.find(name) == dependencies.cend()) {
- auto objectItem = cmLinkItem(lib, lib->GetBacktrace());
+ auto objectItem = cmLinkItem(lib, false, lib->GetBacktrace());
dependencies[name] = Dependency(DependencyType::Object, objectItem);
}
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index d037b93..63c6680 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1579,8 +1579,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
text = "Running external command ...";
}
depends.reserve(gt->GetUtilities().size());
- for (BT<std::string> const& u : gt->GetUtilities()) {
- depends.push_back(u.Value);
+ for (BT<std::pair<std::string, bool>> const& u : gt->GetUtilities()) {
+ depends.push_back(u.Value.first);
}
this->AppendEcho(commands, text,
cmLocalUnixMakefileGenerator3::EchoGlobal);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index ff79a17..0a6da91 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -197,7 +197,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(
// build response file name
std::string responseFlag = this->GetMakefile()->GetSafeDefinition(
- "CMAKE_CUDA_RESPONSE_FILE_LINK_FLAG");
+ "CMAKE_CUDA_RESPONSE_FILE_DEVICE_LINK_FLAG");
if (!useResponseFile || responseFlag.empty()) {
vars.Objects = "$in";
@@ -311,7 +311,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
if (flag) {
responseFlag = flag;
- } else if (this->TargetLinkLanguage(config) != "CUDA") {
+ } else {
responseFlag = "@";
}
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index db5a8ba..7a6cb42 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -180,7 +180,7 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
if (it != GlobalAutoGenTargets_.end()) {
cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
if (target != nullptr) {
- target->Target->AddUtility(targetName, localGen->GetMakefile());
+ target->Target->AddUtility(targetName, false, localGen->GetMakefile());
}
}
}
@@ -192,7 +192,7 @@ void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
if (it != GlobalAutoRccTargets_.end()) {
cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
if (target != nullptr) {
- target->Target->AddUtility(targetName, localGen->GetMakefile());
+ target->Target->AddUtility(targetName, false, localGen->GetMakefile());
}
}
}
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 43e159c..629367d 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1125,7 +1125,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
if (usePRE_BUILD) {
// Add additional autogen target dependencies to origin target
for (cmTarget* depTarget : this->AutogenTarget.DependTargets) {
- this->GenTarget->Target->AddUtility(depTarget->GetName(),
+ this->GenTarget->Target->AddUtility(depTarget->GetName(), false,
this->Makefile);
}
@@ -1229,14 +1229,15 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
// Forward origin utilities to autogen target
if (this->AutogenTarget.DependOrigin) {
- for (BT<std::string> const& depName : this->GenTarget->GetUtilities()) {
- autogenTarget->AddUtility(depName.Value, this->Makefile);
+ for (BT<std::pair<std::string, bool>> const& depName :
+ this->GenTarget->GetUtilities()) {
+ autogenTarget->AddUtility(depName.Value.first, false, this->Makefile);
}
}
if (!useNinjaDepfile) {
// Add additional autogen target dependencies to autogen target
for (cmTarget* depTarget : this->AutogenTarget.DependTargets) {
- autogenTarget->AddUtility(depTarget->GetName(), this->Makefile);
+ autogenTarget->AddUtility(depTarget->GetName(), false, this->Makefile);
}
}
@@ -1246,7 +1247,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
}
// Add autogen target to the origin target dependencies
- this->GenTarget->Target->AddUtility(this->AutogenTarget.Name,
+ this->GenTarget->Target->AddUtility(this->AutogenTarget.Name, false,
this->Makefile);
// Add autogen target to the global autogen target dependencies
@@ -1317,12 +1318,12 @@ bool cmQtAutoGenInitializer::InitRccTargets()
autoRccTarget->SetProperty("FOLDER", this->TargetsFolder);
}
if (!this->Rcc.ExecutableTargetName.empty()) {
- autoRccTarget->AddUtility(this->Rcc.ExecutableTargetName,
+ autoRccTarget->AddUtility(this->Rcc.ExecutableTargetName, false,
this->Makefile);
}
}
// Add autogen target to the origin target dependencies
- this->GenTarget->Target->AddUtility(ccName, this->Makefile);
+ this->GenTarget->Target->AddUtility(ccName, false, this->Makefile);
// Add autogen target to the global autogen target dependencies
if (this->Rcc.GlobalTarget) {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d0b6f10..97d7fce 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -178,7 +178,7 @@ public:
bool ImportedGloballyVisible;
bool BuildInterfaceIncludesAppended;
bool PerConfig;
- std::set<BT<std::string>> Utilities;
+ std::set<BT<std::pair<std::string, bool>>> Utilities;
std::vector<cmCustomCommand> PreBuildCommands;
std::vector<cmCustomCommand> PreLinkCommands;
std::vector<cmCustomCommand> PostBuildCommands;
@@ -583,13 +583,14 @@ cmGlobalGenerator* cmTarget::GetGlobalGenerator() const
return impl->Makefile->GetGlobalGenerator();
}
-void cmTarget::AddUtility(std::string const& name, cmMakefile* mf)
+void cmTarget::AddUtility(std::string const& name, bool cross, cmMakefile* mf)
{
- impl->Utilities.insert(
- BT<std::string>(name, mf ? mf->GetBacktrace() : cmListFileBacktrace()));
+ impl->Utilities.insert(BT<std::pair<std::string, bool>>(
+ { name, cross }, mf ? mf->GetBacktrace() : cmListFileBacktrace()));
}
-std::set<BT<std::string>> const& cmTarget::GetUtilities() const
+std::set<BT<std::pair<std::string, bool>>> const& cmTarget::GetUtilities()
+ const
{
return impl->Utilities;
}
@@ -1293,7 +1294,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->SetProperty("COMPILE_PDB_NAME",
reusedTarget->GetProperty("COMPILE_PDB_NAME"));
- this->AddUtility(reusedFrom, impl->Makefile);
+ this->AddUtility(reusedFrom, false, impl->Makefile);
} else {
impl->Properties.SetProperty(prop, value);
}
@@ -1720,7 +1721,14 @@ const char* cmTarget::GetProperty(const std::string& prop) const
}
static std::string output;
- output = cmJoin(impl->Utilities, ";");
+ static std::vector<std::string> utilities;
+ utilities.resize(impl->Utilities.size());
+ std::transform(
+ impl->Utilities.cbegin(), impl->Utilities.cend(), utilities.begin(),
+ [](const BT<std::pair<std::string, bool>>& item) -> std::string {
+ return item.Value.first;
+ });
+ output = cmJoin(utilities, ";");
return output.c_str();
}
if (prop == propPRECOMPILE_HEADERS) {
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index d4cca23..286933b 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -156,9 +156,10 @@ public:
* name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
* commands. It is not a full path nor does it have an extension.
*/
- void AddUtility(std::string const& name, cmMakefile* mf = nullptr);
+ void AddUtility(std::string const& name, bool cross,
+ cmMakefile* mf = nullptr);
//! Get the utilities used by this target
- std::set<BT<std::string>> const& GetUtilities() const;
+ std::set<BT<std::pair<std::string, bool>>> const& GetUtilities() const;
//! Set/Get a property of this target file
void SetProperty(const std::string& prop, const char* value);
diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h
index 4ca78fa..5452cc7 100644
--- a/Source/cmTargetDepend.h
+++ b/Source/cmTargetDepend.h
@@ -19,6 +19,7 @@ class cmTargetDepend
// mutable members to achieve a map with set syntax.
mutable bool Link;
mutable bool Util;
+ mutable bool Cross;
mutable cmListFileBacktrace Backtrace;
public:
@@ -26,6 +27,7 @@ public:
: Target(t)
, Link(false)
, Util(false)
+ , Cross(false)
{
}
operator cmGeneratorTarget const*() const { return this->Target; }
@@ -43,12 +45,14 @@ public:
this->Link = true;
}
}
+ void SetCross(bool cross) const { this->Cross = cross; }
void SetBacktrace(cmListFileBacktrace const& bt) const
{
this->Backtrace = bt;
}
bool IsLink() const { return this->Link; }
bool IsUtil() const { return this->Util; }
+ bool IsCross() const { return this->Cross; }
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
};
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 39873e6..d27081b 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2186,12 +2186,15 @@ bool SystemTools::CopyFileIfDifferent(const std::string& source,
// FilesDiffer does not handle file to directory compare
if (SystemTools::FileIsDirectory(destination)) {
const std::string new_destination = FileInDir(source, destination);
- return SystemTools::CopyFileIfDifferent(source, new_destination);
- }
- // source and destination are files so do a copy if they
- // are different
- if (SystemTools::FilesDiffer(source, destination)) {
- return SystemTools::CopyFileAlways(source, destination);
+ if (!SystemTools::ComparePath(new_destination, destination)) {
+ return SystemTools::CopyFileIfDifferent(source, new_destination);
+ }
+ } else {
+ // source and destination are files so do a copy if they
+ // are different
+ if (SystemTools::FilesDiffer(source, destination)) {
+ return SystemTools::CopyFileAlways(source, destination);
+ }
}
// at this point the files must be the same so return true
return true;
diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c
index c9515ee..4d1b46c 100644
--- a/Source/kwsys/Terminal.c
+++ b/Source/kwsys/Terminal.c
@@ -146,6 +146,7 @@ static const char* kwsysTerminalVT100Names[] = { "Eterm",
"screen-bce",
"screen-w",
"screen.linux",
+ "st-256color",
"tmux",
"tmux-256color",
"vt100",
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 1f3a15b..3f6eeb8 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -1074,6 +1074,15 @@ static bool CheckCopyFileIfDifferent()
}
}
+ if (!kwsys::SystemTools::MakeDirectory("dir_a") ||
+ !kwsys::SystemTools::MakeDirectory("dir_b")) {
+ return false;
+ }
+
+ if (!kwsys::SystemTools::CopyFileIfDifferent("dir_a/", "dir_b")) {
+ ret = false;
+ }
+
return ret;
}
diff --git a/Tests/CFBundleTest/VerifyResult.cmake b/Tests/CFBundleTest/VerifyResult.cmake
index e637bb1..ac14e5d 100644
--- a/Tests/CFBundleTest/VerifyResult.cmake
+++ b/Tests/CFBundleTest/VerifyResult.cmake
@@ -14,7 +14,7 @@ message(STATUS "CTEST_CONFIGURATION_TYPE='${CTEST_CONFIGURATION_TYPE}'")
message(STATUS "dir='${dir}'")
message(STATUS "gen='${gen}'")
-if(gen STREQUAL "Xcode")
+if(gen MATCHES "^(Xcode$|Ninja Multi-Config$)")
set(expected_filename "${dir}/${CTEST_CONFIGURATION_TYPE}/CFBundleTest.plugin/Contents/MacOS/CFBundleTest")
else()
set(expected_filename "${dir}/CFBundleTest.plugin/Contents/MacOS/CFBundleTest")
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6fad175..33c7514 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -3423,17 +3423,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400)
endif()
- # If this is not an in-source build, provide a target to wipe out
- # all the test build directories.
- if(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
- configure_file(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
- ${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY)
- add_custom_target(test_clean
- COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
- COMMENT "Removing test build directories."
- )
- endif()
-
# Define a set of "contract" tests, each activated by a cache entry
# named "CMake_TEST_CONTRACT_<project>". For each Contract test,
# the project should provide a directory with a CMakeLists.txt file
@@ -3508,4 +3497,16 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_subdirectory(CMakeTests)
endif()
+
+ # If this is not an in-source build, provide a target to wipe out
+ # all the test build directories. This must come at the end after
+ # all the above logic has finished adding to TEST_BUILD_DIRS
+ if(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt")
+ configure_file(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in
+ ${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY)
+ add_custom_target(test_clean
+ COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake
+ COMMENT "Removing test build directories."
+ )
+ endif()
endif()
diff --git a/Tests/CustComDepend/CMakeLists.txt b/Tests/CustComDepend/CMakeLists.txt
index 46276b2..777cdcc 100644
--- a/Tests/CustComDepend/CMakeLists.txt
+++ b/Tests/CustComDepend/CMakeLists.txt
@@ -6,9 +6,9 @@ set(EXECUTABLE_OUTPUT_PATH ${CustComDepend_BINARY_DIR}/bin)
add_executable(foo foo.cxx)
add_custom_command(
OUTPUT ${CustComDepend_BINARY_DIR}/bar.c
- COMMAND ${CustComDepend_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/foo
+ COMMAND $<TARGET_FILE:foo>
${CustComDepend_BINARY_DIR}/bar.c
- DEPENDS ${CustComDepend_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/foo
+ DEPENDS $<TARGET_FILE:foo>
)
add_library(bar SHARED ${CustComDepend_BINARY_DIR}/bar.c)
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index ef81169..450e7e5 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -380,7 +380,9 @@ if(do_git_tests)
set(proj TutorialStep1-GIT-config)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
- GIT_CONFIG core.eol=lf core.autocrlf=input
+ GIT_CONFIG core.eol=lf
+ core.autocrlf=input
+ "http.extraheader=AUTHORIZATION: bearer --unsupportedOption"
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
@@ -661,11 +663,19 @@ if(do_git_tests)
add_test(TutorialStep1-GIT-bytag
"${binary_base}/TutorialStep1-GIT-bytag/Tutorial" 99)
+ add_test(TutorialStep1-GIT-bytag-withsubmodules
+ "${binary_base}/TutorialStep1-GIT-bytag-withsubmodules/Tutorial" 99)
+
add_test(TutorialStep1-GIT-shallow-master
"${binary_base}/TutorialStep1-GIT-shallow-master/Tutorial" 98)
add_test(TutorialStep1-GIT-master
"${binary_base}/TutorialStep1-GIT-master/Tutorial" 98)
+
+ if(NOT git_version VERSION_LESS 1.7.7)
+ add_test(TutorialStep1-GIT-config
+ "${binary_base}/TutorialStep1-GIT-config/Tutorial" 98)
+ endif()
endif()
diff --git a/Tests/Qt4Autogen/CMakeLists.txt b/Tests/Qt4Autogen/CMakeLists.txt
index 68b885b..e7f1ae3 100644
--- a/Tests/Qt4Autogen/CMakeLists.txt
+++ b/Tests/Qt4Autogen/CMakeLists.txt
@@ -7,3 +7,5 @@ ADD_AUTOGEN_TEST(DefinesTest)
# Common tests
include("../QtAutogen/Tests.cmake")
+
+set(TEST_BUILD_DIRS "${TEST_BUILD_DIRS}" PARENT_SCOPE)
diff --git a/Tests/Qt5Autogen/CMakeLists.txt b/Tests/Qt5Autogen/CMakeLists.txt
index 49d33cc..df4927a 100644
--- a/Tests/Qt5Autogen/CMakeLists.txt
+++ b/Tests/Qt5Autogen/CMakeLists.txt
@@ -4,3 +4,5 @@ include("../QtAutogen/TestMacros.cmake")
# Common tests
include("../QtAutogen/Tests.cmake")
+
+set(TEST_BUILD_DIRS "${TEST_BUILD_DIRS}" PARENT_SCOPE)
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt
index 41df5af..91d7ef9 100644
--- a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt
@@ -1,4 +1,14 @@
-^Insufficient resources
+^Insufficient resources for test Test1:
+
+ Test requested resources of type 'fluxcapacitors' in the following amounts:
+ 200 slots
+ but only the following units were available:
+ 'outatime': 121 slots
+
+Resource spec file:
+
+ [^
+]*/Tests/RunCMake/CTestResourceAllocation/resspec.json
CMake Error at [^
]*/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res/test\.cmake:[0-9]+ \(message\):
Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt
index 6c2f554..5c75a3d 100644
--- a/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt
@@ -1,4 +1,11 @@
-^Insufficient resources
+^Insufficient resources for test Test1:
+
+ Test requested resources of type 'terminators' which does not exist
+
+Resource spec file:
+
+ [^
+]*/Tests/RunCMake/CTestResourceAllocation/resspec.json
CMake Error at [^
]*/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res/test\.cmake:[0-9]+ \(message\):
Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt
index 82dfdef..4902a19 100644
--- a/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt
@@ -1,4 +1,21 @@
-^Insufficient resources
+^Insufficient resources for test Test1:
+
+ Test requested resources of type 'widgets' in the following amounts:
+ 12 slots
+ but only the following units were available:
+ '0': 4 slots
+ '1': 2 slots
+ '2': 4 slots
+ '3': 8 slots
+ '4': 1 slot
+ '5': 1 slot
+ '6': 1 slot
+ '7': 1 slot
+
+Resource spec file:
+
+ [^
+]*/Tests/RunCMake/CTestResourceAllocation/resspec.json
CMake Error at [^
]*/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res/test\.cmake:[0-9]+ \(message\):
Tests did not pass$
diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake
index 82db6b7..6b2721c 100644
--- a/Tests/RunCMake/Make/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Make/RunCMakeTest.cmake
@@ -26,10 +26,13 @@ function(run_VerboseBuild)
endif()
run_cmake_command(VerboseBuild-build ${CMAKE_COMMAND} --build . -v --clean-first)
unset(RunCMake-stdout-file)
+ set(_backup_lang "$ENV{LANG}")
if(MAKE_IS_GNU)
set(RunCMake-stdout-file VerboseBuild-nowork-gnu-stdout.txt)
+ set(ENV{LANG} "C")
endif()
run_cmake_command(VerboseBuild-nowork ${CMAKE_COMMAND} --build . --verbose)
+ set(ENV{LANG} "${_backup_lang}")
endfunction()
run_VerboseBuild()
diff --git a/Tests/RunCMake/NinjaMultiConfig/FrameworkDependencyAutogen.cmake b/Tests/RunCMake/NinjaMultiConfig/FrameworkDependencyAutogen.cmake
new file mode 100644
index 0000000..75e21b9
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/FrameworkDependencyAutogen.cmake
@@ -0,0 +1,20 @@
+enable_language(C)
+
+set(CMAKE_LINK_DEPENDS_NO_SHARED ON)
+
+set(QT_VERSION_MAJOR 6)
+set(fake_moc_path "${CMAKE_CURRENT_BINARY_DIR}/fake_moc")
+file(WRITE "${fake_moc_path}" "")
+
+add_library(test1 SHARED simplelib.c)
+add_library(test2 SHARED empty.c)
+target_link_libraries(test2 test1)
+
+set_target_properties(test1 test2 PROPERTIES
+ FRAMEWORK ON
+ AUTOMOC ON
+ AUTOMOC_EXECUTABLE "${fake_moc_path}"
+ )
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(test1 test2)
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 9058b11..a608e9e 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -198,6 +198,13 @@ unset(RunCMake_TEST_OPTIONS)
include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
run_cmake_build(Framework framework Debug all)
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/FrameworkDependencyAutogen-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_NMC_CROSS_CONFIGS=all")
+run_cmake_configure(FrameworkDependencyAutogen)
+unset(RunCMake_TEST_OPTIONS)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(FrameworkDependencyAutogen framework Release test2:Debug)
+
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandGenerator-build)
set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo;-DCMAKE_NMC_CROSS_CONFIGS=all")
run_cmake_configure(CustomCommandGenerator)