summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Help/command/ctest_test.rst6
-rw-r--r--Help/manual/ctest.1.rst6
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst3
-rw-r--r--Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst3
-rw-r--r--Modules/CMakeFindBinUtils.cmake54
-rw-r--r--Modules/Compiler/GNU-C.cmake4
-rw-r--r--Modules/Compiler/IAR-FindBinUtils.cmake80
-rw-r--r--Modules/Compiler/IAR.cmake6
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/cmGeneratorExpressionNode.cxx9
-rw-r--r--Source/cmQtAutoGen.cxx36
-rw-r--r--Source/cmQtAutoGen.h3
-rw-r--r--Source/cmQtAutoGenInitializer.cxx81
-rw-r--r--Source/cmQtAutoGenInitializer.h2
-rw-r--r--Source/cmQtAutoGenerator.cxx37
-rw-r--r--Source/cmQtAutoGenerator.h2
-rw-r--r--Source/cmQtAutoMocUic.cxx20
-rw-r--r--Source/cmQtAutoUicHelpers.cxx25
-rw-r--r--Source/cmQtAutoUicHelpers.h20
-rw-r--r--Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in4
-rw-r--r--Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp4
-rw-r--r--Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/mainwindowsubdir.ui.in7
-rw-r--r--Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/subdircheck.cpp9
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-target-ninja-check.cmake37
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-all-ninja-check.cmake9
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-minsizerel-ninja-check.cmake6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-ninja-check.cmake9
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple.cmake2
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-all-in-release-graph-build-check.cmake6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-relwithdebinfo-in-release-graph-build-check.cmake6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAlias-all-ninja-check.cmake12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-build-check.cmake6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-relwithdebinfo-ninja-check.cmake9
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-clean-configs-ninja-check.cmake3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/empty_dbg.c0
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/empty_rel.c0
-rw-r--r--Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt16
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt3
47 files changed, 414 insertions, 202 deletions
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index 2104c47c62..89787d1332 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -155,12 +155,12 @@ The options are:
Store in the ``<result-var>`` variable -1 if there are any errors running
the command and prevent ctest from returning non-zero if an error occurs.
-``OUTPUT_JUNIT``
+``OUTPUT_JUNIT <file>``
.. versionadded:: 3.21
Write test results to ``<file>`` in JUnit XML format. If ``<file>`` is a
- relative path it will be placed in the build directory. If ``<file>>``
- already exists it will be overwritten. Note that the resulting JUnit XML
+ relative path, it will be placed in the build directory. If ``<file>``
+ already exists, it will be overwritten. Note that the resulting JUnit XML
file is **not** uploaded to CDash because it would be redundant with
CTest's ``Test.xml`` file.
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index ab819f94ef..03d8bf6c80 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -137,8 +137,10 @@ Options
``--output-junit <file>``
Write test results in JUnit format.
- This option tells CTest to write test results to a ``<file>`` JUnit XML file.
- If ``<file>`` already exists it will be overwritten.
+ This option tells CTest to write test results to ``<file>`` in JUnit XML
+ format. If ``<file>`` already exists, it will be overwritten. If using the
+ ``-S`` option to run a dashboard script, use the ``OUTPUT_JUNIT`` keyword
+ with the :command:`ctest_test` command instead.
``-N,--show-only[=<format>]``
Disable actual execution of tests.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
index 9f145c1a2a..7e7d431e6d 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
@@ -9,3 +9,6 @@ If a test's output contains the literal string "CTEST_FULL_OUTPUT",
the output will not be truncated and may exceed the maximum size.
.. include:: CTEST_CUSTOM_XXX.txt
+
+For controlling the output collection of passing tests, see
+:variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
index 71ecf52bfb..64367f9a36 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
@@ -9,3 +9,6 @@ If a test's output contains the literal string "CTEST_FULL_OUTPUT",
the output will not be truncated and may exceed the maximum size.
.. include:: CTEST_CUSTOM_XXX.txt
+
+For controlling the output collection of failing tests, see
+:variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE`.
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 3162ec57fa..f139ff4826 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -94,6 +94,53 @@ elseif("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^x(Open)?W
set(_CMAKE_AR_NAMES "wlib")
list(APPEND _CMAKE_TOOL_VARS LINKER AR)
+elseif("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^xIAR$")
+ # Small helper declaring an IAR tool (e.g. linker) to avoid repeating the same idiom every time
+ macro(__append_IAR_tool TOOL_VAR NAME)
+ set(_CMAKE_${TOOL_VAR}_NAMES "${NAME}" "${NAME}.exe")
+ list(APPEND _CMAKE_TOOL_VARS ${TOOL_VAR})
+ endmacro()
+
+ # Resolve hint path from an IAR compiler
+ function(__resolve_IAR_hints COMPILER RESULT)
+ get_filename_component(_CMAKE_IAR_HINT "${COMPILER}" REALPATH)
+ get_filename_component(_CMAKE_IAR_HINT "${_CMAKE_IAR_HINT}" DIRECTORY)
+ list(APPEND _IAR_HINTS "${_CMAKE_IAR_HINT}")
+
+ get_filename_component(_CMAKE_IAR_HINT "${COMPILER}" DIRECTORY)
+ list(APPEND _IAR_HINTS "${_CMAKE_IAR_HINT}")
+
+ set(${RESULT} "${_IAR_HINTS}" PARENT_SCOPE)
+ endfunction()
+
+ __resolve_IAR_hints("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" _CMAKE_TOOLCHAIN_LOCATION)
+ set(_CMAKE_IAR_ITOOLS "ARM" "RX" "RH850" "RL78" "RISCV" "STM8")
+ set(_CMAKE_IAR_XTOOLS "AVR" "MSP430" "V850" "8051")
+
+ if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" IN_LIST _CMAKE_IAR_ITOOLS)
+ string(TOLOWER "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" _CMAKE_IAR_LOWER_ARCHITECTURE_ID)
+
+ __append_IAR_tool(AR "iarchive")
+ __append_IAR_tool(LINKER "ilink${_CMAKE_IAR_LOWER_ARCHITECTURE_ID}")
+
+ __append_IAR_tool(IAR_ELFDUMP "ielfdump${_CMAKE_IAR_LOWER_ARCHITECTURE_ID}")
+ __append_IAR_tool(IAR_ELFTOOL "ielftool")
+ __append_IAR_tool(IAR_OBJMANIP "iobjmanip")
+ __append_IAR_tool(IAR_SYMEXPORT "isymexport")
+
+ unset(_CMAKE_IAR_LOWER_ARCHITECTURE_ID)
+
+ elseif("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" IN_LIST _CMAKE_IAR_XTOOLS)
+ __append_IAR_tool(AR "xar")
+ __append_IAR_tool(LINKER "xlink")
+
+ else()
+ message(FATAL_ERROR "Failed to find linker and librarian for ${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID} on ${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}.")
+ endif()
+
+ unset(_CMAKE_IAR_ITOOLS)
+ unset(_CMAKE_IAR_XTOOLS)
+
# in all other cases search for ar, ranlib, etc.
else()
if(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN)
@@ -186,3 +233,10 @@ unset(_CMAKE_TOOL_VARS)
unset(_CMAKE_TOOL_CACHED)
unset(_CMAKE_TOOL_NAME)
unset(_CMAKE_TOOL)
+
+if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^xIAR$")
+ # Set for backwards compatibility
+ set(CMAKE_IAR_ARCHIVE "${CMAKE_AR}" CACHE FILEPATH "The IAR archiver")
+ set(CMAKE_IAR_LINKER "${CMAKE_LINKER}" CACHE FILEPATH "The IAR ILINK linker")
+ mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_AR)
+endif()
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index 39e9c72c44..03e8d2b06d 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -42,8 +42,8 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
endif()
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.1)
- set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c23")
- set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu23")
+ set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x")
+ set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
endif()
__compiler_check_default_language_standard(C 3.4 90 5.0 11 8.1 17)
diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake
deleted file mode 100644
index 01f6d22590..0000000000
--- a/Modules/Compiler/IAR-FindBinUtils.cmake
+++ /dev/null
@@ -1,80 +0,0 @@
-if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
- message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
-endif()
-
-# Try to find tools in the same directory as the compiler itself
-get_filename_component(__iar_hint_1 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" REALPATH)
-get_filename_component(__iar_hint_1 "${__iar_hint_1}" DIRECTORY)
-
-get_filename_component(__iar_hint_2 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
-
-set(__iar_hints "${__iar_hint_1}" "${__iar_hint_2}")
-
-if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RX" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RH850" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RISCV" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "STM8")
-
- string(TOLOWER "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" _archid_lower)
-
- # Find linker
- find_program(CMAKE_IAR_LINKER
- NAMES ilink${_archid_lower} ilink${_archid_lower}.exe
- HINTS ${__iar_hints}
- DOC "The IAR ILINK linker")
- find_program(CMAKE_IAR_ARCHIVE
- NAMES iarchive iarchive.exe
- HINTS ${__iar_hints}
- DOC "The IAR archiver")
-
- # Find utility tools
- find_program(CMAKE_IAR_ELFTOOL
- NAMES ielftool ielftool.exe
- HINTS ${__iar_hints}
- DOC "The IAR ELF Tool")
- find_program(CMAKE_IAR_ELFDUMP
- NAMES ielfdump${_archid_lower} ielfdump${_archid_lower}.exe
- HINTS ${__iar_hints}
- DOC "The IAR ELF Dumper")
- find_program(CMAKE_IAR_OBJMANIP
- NAMES iobjmanip iobjmanip.exe
- HINTS ${__iar_hints}
- DOC "The IAR ELF Object Tool")
- find_program(CMAKE_IAR_SYMEXPORT
- NAMES isymexport
- HINTS ${__iar_hints}
- DOC "The IAR Absolute Symbol Exporter")
- mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_ARCHIVE CMAKE_IAR_ELFTOOL CMAKE_IAR_ELFDUMP CMAKE_IAR_OBJMANIP CMAKE_IAR_SYMEXPORT)
-
- set(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_CUSTOM_CODE
-"set(CMAKE_IAR_LINKER \"${CMAKE_IAR_LINKER}\")
-set(CMAKE_IAR_ARCHIVE \"${CMAKE_IAR_ARCHIVE}\")
-set(CMAKE_IAR_ELFTOOL \"${CMAKE_IAR_ELFTOOL}\")
-set(CMAKE_IAR_ELFDUMP \"${CMAKE_IAR_ELFDUMP}\")
-set(CMAKE_IAR_OBJMANIP \"${CMAKE_IAR_OBJMANIP}\")
-set(CMAKE_IAR_LINKER \"${CMAKE_IAR_LINKER}\")
-")
-
-elseif("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "V850" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051")
-
- # Find the "xlink" linker and "xar" archiver:
- find_program(CMAKE_IAR_LINKER
- NAMES xlink xlink.exe
- HINTS ${__iar_hints}
- DOC "The IAR XLINK linker")
- find_program(CMAKE_IAR_AR
- NAMES xar xar.exe
- HINTS ${__iar_hints}
- DOC "The IAR archiver")
- mark_as_advanced(CMAKE_IAR_LINKER CMAKE_IAR_AR)
-
- set(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_CUSTOM_CODE
-"set(CMAKE_IAR_LINKER \"${CMAKE_IAR_LINKER}\")
-set(CMAKE_IAR_AR \"${CMAKE_IAR_AR}\")
-")
-endif()
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index a6b436a117..2200a21a76 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -71,9 +71,6 @@ macro(__compiler_iar_ilink lang)
set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> <TARGET> --replace <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_FINISH "")
-
- set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
- set(CMAKE_AR "${CMAKE_IAR_ARCHIVE}" CACHE FILEPATH "The IAR archiver" FORCE)
endmacro()
macro(__compiler_iar_xlink lang)
@@ -109,7 +106,4 @@ macro(__compiler_iar_xlink lang)
set(CMAKE_${lang}_ARCHIVE_FINISH "")
set(CMAKE_LIBRARY_PATH_FLAG "-I")
-
- set(CMAKE_LINKER "${CMAKE_IAR_LINKER}" CACHE FILEPATH "The IAR linker" FORCE)
- set(CMAKE_AR "${CMAKE_IAR_AR}" CACHE FILEPATH "The IAR archiver" FORCE)
endmacro()
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 9a18184fd3..0142c07ecb 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -432,6 +432,8 @@ set(SRCS
cmQtAutoMocUic.h
cmQtAutoRcc.cxx
cmQtAutoRcc.h
+ cmQtAutoUicHelpers.cxx
+ cmQtAutoUicHelpers.h
cmRST.cxx
cmRST.h
cmRuntimeDependencyArchive.cxx
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index c608bf940d..217ebe5f9d 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1635,10 +1635,11 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
reportError(context, content->GetOriginalExpression(), e.str());
return std::string();
}
- if (!context->EvaluateForBuildsystem) {
- cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+ cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+ {
std::string reason;
- if (!gg->HasKnownObjectFileLocation(&reason)) {
+ if (!context->EvaluateForBuildsystem &&
+ !gg->HasKnownObjectFileLocation(&reason)) {
std::ostringstream e;
e << "The evaluation of the TARGET_OBJECTS generator expression "
"is only suitable for consumption by CMake (limited"
@@ -1664,7 +1665,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
gt->GetTargetObjectNames(context->Config, objects);
std::string obj_dir;
- if (context->EvaluateForBuildsystem) {
+ if (context->EvaluateForBuildsystem && !gg->SupportsCrossConfigs()) {
// Use object file directory with buildsystem placeholder.
obj_dir = gt->ObjectDirectory;
context->HadContextSensitiveCondition =
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index 57fcd2da76..898d862221 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -384,3 +384,39 @@ bool cmQtAutoGen::RccLister::list(std::string const& qrcFile,
}
return true;
}
+
+bool cmQtAutoGen::FileRead(std::string& content, std::string const& filename,
+ std::string* error)
+{
+ content.clear();
+ if (!cmSystemTools::FileExists(filename, true)) {
+ if (error != nullptr) {
+ *error = "Not a file.";
+ }
+ return false;
+ }
+
+ unsigned long const length = cmSystemTools::FileLength(filename);
+ cmsys::ifstream ifs(filename.c_str(), (std::ios::in | std::ios::binary));
+
+ // Use lambda to save destructor calls of ifs
+ return [&ifs, length, &content, error]() -> bool {
+ if (!ifs) {
+ if (error != nullptr) {
+ *error = "Opening the file for reading failed.";
+ }
+ return false;
+ }
+ content.reserve(length);
+ using IsIt = std::istreambuf_iterator<char>;
+ content.assign(IsIt{ ifs }, IsIt{});
+ if (!ifs) {
+ content.clear();
+ if (error != nullptr) {
+ *error = "Reading from the file failed.";
+ }
+ return false;
+ }
+ return true;
+ }();
+}
diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h
index 466a954a98..b9ae360291 100644
--- a/Source/cmQtAutoGen.h
+++ b/Source/cmQtAutoGen.h
@@ -100,6 +100,9 @@ public:
std::vector<std::string> const& newOpts,
bool isQt5);
+ static bool FileRead(std::string& content, std::string const& filename,
+ std::string* error = nullptr);
+
/** @class RccLister
* @brief Lists files in qrc resource files
*/
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 2894201c9b..6cc8328910 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -902,6 +902,13 @@ bool cmQtAutoGenInitializer::InitScanFiles()
// The reason is that their file names might be discovered from source files
// at generation time.
if (this->MocOrUicEnabled()) {
+ std::set<std::string> uicIncludes;
+ auto collectUicIncludes = [&](std::unique_ptr<cmSourceFile> const& sf) {
+ std::string content;
+ FileRead(content, sf->GetFullPath());
+ this->AutoUicHelpers.CollectUicIncludes(uicIncludes, content);
+ };
+
for (const auto& sf : this->Makefile->GetSourceFiles()) {
// sf->GetExtension() is only valid after sf->ResolveFullPath() ...
// Since we're iterating over source files that might be not in the
@@ -914,6 +921,10 @@ bool cmQtAutoGenInitializer::InitScanFiles()
std::string const& extLower =
cmSystemTools::LowerCase(sf->GetExtension());
+ bool const skipAutogen = sf->GetPropertyAsBool(kw.SKIP_AUTOGEN);
+ bool const skipUic =
+ (skipAutogen || sf->GetPropertyAsBool(kw.SKIP_AUTOUIC) ||
+ !this->Uic.Enabled);
if (cm->IsAHeaderExtension(extLower)) {
if (!cm::contains(this->AutogenTarget.Headers, sf.get())) {
auto muf = makeMUFile(sf.get(), fullPath, {}, false);
@@ -921,6 +932,9 @@ bool cmQtAutoGenInitializer::InitScanFiles()
addMUHeader(std::move(muf), extLower);
}
}
+ if (!skipUic && !sf->GetIsGenerated()) {
+ collectUicIncludes(sf);
+ }
} else if (cm->IsACLikeSourceExtension(extLower)) {
if (!cm::contains(this->AutogenTarget.Sources, sf.get())) {
auto muf = makeMUFile(sf.get(), fullPath, {}, false);
@@ -928,11 +942,11 @@ bool cmQtAutoGenInitializer::InitScanFiles()
addMUSource(std::move(muf));
}
}
+ if (!skipUic && !sf->GetIsGenerated()) {
+ collectUicIncludes(sf);
+ }
} else if (this->Uic.Enabled && (extLower == kw.ui)) {
// .ui file
- bool const skipAutogen = sf->GetPropertyAsBool(kw.SKIP_AUTOGEN);
- bool const skipUic =
- (skipAutogen || sf->GetPropertyAsBool(kw.SKIP_AUTOUIC));
if (!skipUic) {
// Check if the .ui file has uic options
std::string const uicOpts = sf->GetSafeProperty(kw.AUTOUIC_OPTIONS);
@@ -942,35 +956,22 @@ bool cmQtAutoGenInitializer::InitScanFiles()
this->Uic.UiFilesWithOptions.emplace_back(fullPath,
cmExpandedList(uicOpts));
}
-
- auto uiHeaderRelativePath = cmSystemTools::RelativePath(
- this->LocalGen->GetCurrentSourceDirectory(),
- cmSystemTools::GetFilenamePath(fullPath));
-
- // Avoid creating a path containing adjacent slashes
- if (!uiHeaderRelativePath.empty() &&
- uiHeaderRelativePath.back() != '/') {
- uiHeaderRelativePath += '/';
- }
-
- auto uiHeaderFilePath = cmStrCat(
- '/', uiHeaderRelativePath, "ui_"_s,
- cmSystemTools::GetFilenameWithoutLastExtension(fullPath), ".h"_s);
-
- ConfigString uiHeader;
- std::string uiHeaderGenex;
- this->ConfigFileNamesAndGenex(
- uiHeader, uiHeaderGenex, cmStrCat(this->Dir.Build, "/include"_s),
- uiHeaderFilePath);
-
- this->Uic.UiHeaders.emplace_back(
- std::make_pair(uiHeader, uiHeaderGenex));
} else {
// Register skipped .ui file
this->Uic.SkipUi.insert(fullPath);
}
}
}
+
+ for (const auto& include : uicIncludes) {
+ ConfigString uiHeader;
+ std::string uiHeaderGenex;
+ this->ConfigFileNamesAndGenex(uiHeader, uiHeaderGenex,
+ cmStrCat(this->Dir.Build, "/include"_s),
+ cmStrCat("/"_s, include));
+ this->Uic.UiHeaders.emplace_back(
+ std::make_pair(uiHeader, uiHeaderGenex));
+ }
}
// Process GENERATED sources and headers
@@ -1111,11 +1112,30 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
// Register info file as generated by CMake
this->Makefile->AddCMakeOutputFile(this->AutogenTarget.InfoFile);
+ // Determine whether to use a depfile for the AUTOGEN target.
+ const bool useNinjaDepfile = this->QtVersion >= IntegerVersion(5, 15) &&
+ this->GlobalGen->GetName().find("Ninja") != std::string::npos;
+
// Files provided by the autogen target
std::vector<std::string> autogenByproducts;
+ std::vector<std::string> timestampByproducts;
if (this->Moc.Enabled) {
this->AddGeneratedSource(this->Moc.CompilationFile, this->Moc, true);
- autogenByproducts.push_back(this->Moc.CompilationFileGenex);
+ if (useNinjaDepfile) {
+ if (this->MultiConfig) {
+ // Make all mocs_compilation_<CONFIG>.cpp files byproducts of the
+ // ${target}_autogen/timestamp custom command.
+ // We cannot just use Moc.CompilationFileGenex here, because that
+ // custom command runs cmake_autogen for each configuration.
+ for (const auto& p : this->Moc.CompilationFile.Config) {
+ timestampByproducts.push_back(p.second);
+ }
+ } else {
+ timestampByproducts.push_back(this->Moc.CompilationFileGenex);
+ }
+ } else {
+ autogenByproducts.push_back(this->Moc.CompilationFileGenex);
+ }
}
if (this->Uic.Enabled) {
@@ -1265,8 +1285,6 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
this->AutogenTarget.DependFiles.begin(),
this->AutogenTarget.DependFiles.end());
- const bool useNinjaDepfile = this->QtVersion >= IntegerVersion(5, 15) &&
- this->GlobalGen->GetName().find("Ninja") != std::string::npos;
if (useNinjaDepfile) {
// Create a custom command that generates a timestamp file and
// has a depfile assigned. The depfile is created by JobDepFilesMergeT.
@@ -1327,8 +1345,9 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
this->AddGeneratedSource(outputFile, this->Moc);
const std::string no_main_dependency;
this->LocalGen->AddCustomCommandToOutput(
- outputFile, dependencies, no_main_dependency, commandLines,
- autogenComment.c_str(), this->Dir.Work.c_str(),
+ { outputFile }, timestampByproducts, dependencies, no_main_dependency,
+ /*implicit_depends=*/{}, commandLines, autogenComment.c_str(),
+ this->Dir.Work.c_str(),
/*cmp0116=*/cmPolicies::NEW, /*replace=*/false,
/*escapeOldStyle=*/false,
/*uses_terminal=*/false,
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index e76817b9c4..3ec87d212d 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -17,6 +17,7 @@
#include "cmFilePathChecksum.h"
#include "cmQtAutoGen.h"
+#include "cmQtAutoUicHelpers.h"
class cmGeneratorTarget;
class cmGlobalGenerator;
@@ -170,6 +171,7 @@ private:
std::string ConfigDefault;
std::vector<std::string> ConfigsList;
std::string TargetsFolder;
+ cmQtAutoUicHelpers AutoUicHelpers;
/** Common directories. */
struct
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 568926e3c5..0c6b5e6dc5 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -121,43 +121,6 @@ bool cmQtAutoGenerator::MakeParentDirectory(std::string const& filename)
return success;
}
-bool cmQtAutoGenerator::FileRead(std::string& content,
- std::string const& filename,
- std::string* error)
-{
- content.clear();
- if (!cmSystemTools::FileExists(filename, true)) {
- if (error != nullptr) {
- *error = "Not a file.";
- }
- return false;
- }
-
- unsigned long const length = cmSystemTools::FileLength(filename);
- cmsys::ifstream ifs(filename.c_str(), (std::ios::in | std::ios::binary));
-
- // Use lambda to save destructor calls of ifs
- return [&ifs, length, &content, error]() -> bool {
- if (!ifs) {
- if (error != nullptr) {
- *error = "Opening the file for reading failed.";
- }
- return false;
- }
- content.reserve(length);
- using IsIt = std::istreambuf_iterator<char>;
- content.assign(IsIt{ ifs }, IsIt{});
- if (!ifs) {
- content.clear();
- if (error != nullptr) {
- *error = "Reading from the file failed.";
- }
- return false;
- }
- return true;
- }();
-}
-
bool cmQtAutoGenerator::FileWrite(std::string const& filename,
std::string const& content,
std::string* error)
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index 5c3a8adccb..66399d7e8a 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -70,8 +70,6 @@ public:
// -- File system methods
static bool MakeParentDirectory(std::string const& filename);
- static bool FileRead(std::string& content, std::string const& filename,
- std::string* error = nullptr);
static bool FileWrite(std::string const& filename,
std::string const& content,
std::string* error = nullptr);
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 2753fd57c0..86d54f9e1a 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -30,6 +30,7 @@
#include "cmGeneratedFileStream.h"
#include "cmQtAutoGen.h"
#include "cmQtAutoGenerator.h"
+#include "cmQtAutoUicHelpers.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmWorkerPool.h"
@@ -281,7 +282,7 @@ public:
std::vector<std::string> Options;
std::unordered_map<std::string, UiFile> UiFiles;
std::vector<std::string> SearchPaths;
- cmsys::RegularExpression RegExpInclude;
+ cmQtAutoUicHelpers AutoUicHelpers;
};
/** Uic shared variables. */
@@ -761,11 +762,7 @@ std::string cmQtAutoMocUicT::MocSettingsT::MacrosString() const
return res;
}
-cmQtAutoMocUicT::UicSettingsT::UicSettingsT()
-{
- this->RegExpInclude.compile("(^|\n)[ \t]*#[ \t]*include[ \t]+"
- "[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
-}
+cmQtAutoMocUicT::UicSettingsT::UicSettingsT() = default;
cmQtAutoMocUicT::UicSettingsT::~UicSettingsT() = default;
@@ -1056,16 +1053,7 @@ void cmQtAutoMocUicT::JobParseT::UicIncludes()
}
std::set<std::string> includes;
- {
- const char* contentChars = this->Content.c_str();
- cmsys::RegularExpression const& regExp = this->UicConst().RegExpInclude;
- cmsys::RegularExpressionMatch match;
- while (regExp.find(contentChars, match)) {
- includes.emplace(match.match(2));
- // Forward content pointer
- contentChars += match.end();
- }
- }
+ this->UicConst().AutoUicHelpers.CollectUicIncludes(includes, this->Content);
this->CreateKeys(this->FileHandle->ParseData->Uic.Include, includes,
UiUnderscoreLength);
}
diff --git a/Source/cmQtAutoUicHelpers.cxx b/Source/cmQtAutoUicHelpers.cxx
new file mode 100644
index 0000000000..751ae08575
--- /dev/null
+++ b/Source/cmQtAutoUicHelpers.cxx
@@ -0,0 +1,25 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmQtAutoUicHelpers.h"
+
+cmQtAutoUicHelpers::cmQtAutoUicHelpers()
+{
+ RegExpInclude.compile("(^|\n)[ \t]*#[ \t]*include[ \t]+"
+ "[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
+}
+
+void cmQtAutoUicHelpers::CollectUicIncludes(std::set<std::string>& includes,
+ const std::string& content) const
+{
+ if (content.find("ui_") == std::string::npos) {
+ return;
+ }
+
+ const char* contentChars = content.c_str();
+ cmsys::RegularExpressionMatch match;
+ while (this->RegExpInclude.find(contentChars, match)) {
+ includes.emplace(match.match(2));
+ // Forward content pointer
+ contentChars += match.end();
+ }
+}
diff --git a/Source/cmQtAutoUicHelpers.h b/Source/cmQtAutoUicHelpers.h
new file mode 100644
index 0000000000..6b09a31daa
--- /dev/null
+++ b/Source/cmQtAutoUicHelpers.h
@@ -0,0 +1,20 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#pragma once
+
+#include <set>
+#include <string>
+
+#include "cmsys/RegularExpression.hxx"
+
+class cmQtAutoUicHelpers
+{
+public:
+ cmQtAutoUicHelpers();
+ virtual ~cmQtAutoUicHelpers() = default;
+ void CollectUicIncludes(std::set<std::string>& includes,
+ const std::string& content) const;
+
+private:
+ cmsys::RegularExpression RegExpInclude;
+};
diff --git a/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt b/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt
index 1f636af451..a9ccece5d5 100644
--- a/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt
@@ -27,10 +27,12 @@ endmacro()
configure_file("${testProjectTemplateDir}/mocwidget.h" "${testProjectSrc}/mocwidget.h" COPYONLY)
configure_file("${testProjectTemplateDir}/main.cpp" "${testProjectSrc}/main.cpp" COPYONLY)
+configure_file("${testProjectTemplateDir}/subdir/subdircheck.cpp" "${testProjectSrc}/subdir/subdircheck.cpp" COPYONLY)
configure_file("${testProjectTemplateDir}/CMakeLists.txt.in" "${testProjectSrc}/CMakeLists.txt" @ONLY)
set(Num 1)
configure_file("${testProjectTemplateDir}/mainwindow.ui.in" "${testProjectSrc}/mainwindow.ui" @ONLY)
+configure_file("${testProjectTemplateDir}/subdir/mainwindowsubdir.ui.in" "${testProjectSrc}/subdir/mainwindowsubdir.ui" @ONLY)
if(CMAKE_GENERATOR_INSTANCE)
set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE=${CMAKE_GENERATOR_INSTANCE}")
@@ -94,6 +96,7 @@ sleep()
set(Num 2)
configure_file("${testProjectTemplateDir}/mainwindow.ui.in" "${testProjectSrc}/mainwindow.ui" @ONLY)
+configure_file("${testProjectTemplateDir}/subdir/mainwindowsubdir.ui.in" "${testProjectSrc}/subdir/mainwindowsubdir.ui" @ONLY)
rebuild(2)
execute_process(COMMAND "${testProjectBinDir}/${extra_bin_path}UicOnFileChange" RESULT_VARIABLE result)
diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in
index fa9dd6bee3..2a1998d10f 100644
--- a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in
+++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in
@@ -6,6 +6,8 @@ include("@CMAKE_CURRENT_LIST_DIR@/../AutogenGuiTest.cmake")
# Enable CMAKE_AUTOUIC for all targets
set(CMAKE_AUTOUIC ON)
-add_executable(UicOnFileChange main.cpp mainwindow.ui)
+add_executable(UicOnFileChange main.cpp mainwindow.ui
+ subdir/subdircheck.cpp subdir/mainwindowsubdir.ui
+)
target_include_directories(UicOnFileChange PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(UicOnFileChange ${QT_QTCORE_TARGET} ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp
index fd810fa247..3981268846 100644
--- a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp
+++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp
@@ -1,9 +1,11 @@
#include "ui_mainwindow.h"
+extern bool subdircheck();
+
int main(int argc, char* argv[])
{
MocWidget mw;
Ui::Widget mwUi;
mwUi.setupUi(&mw);
- return mw.objectName() == "Widget2" ? 0 : 1;
+ return mw.objectName() == "Widget2" && subdircheck() ? 0 : 1;
}
diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/mainwindowsubdir.ui.in b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/mainwindowsubdir.ui.in
new file mode 100644
index 0000000000..a6a31f6d42
--- /dev/null
+++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/mainwindowsubdir.ui.in
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WidgetSubdir</class>
+ <widget class="MocWidget" name="WidgetSubdir@Num@"/>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/subdircheck.cpp b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/subdircheck.cpp
new file mode 100644
index 0000000000..3b36a10df8
--- /dev/null
+++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/subdircheck.cpp
@@ -0,0 +1,9 @@
+#include "ui_mainwindowsubdir.h"
+
+bool subdircheck()
+{
+ MocWidget mw;
+ Ui::WidgetSubdir mwUi;
+ mwUi.setupUi(&mw);
+ return mw.objectName() == "WidgetSubdir2";
+}
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 559c8f7966..7c100eb1ea 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -101,6 +101,7 @@ run_cmake_build(Simple all-configs Release simplestatic:all)
run_ninja(Simple default-build-file build.ninja simpleexe)
run_cmake_build(Simple all-clean Release clean:all)
run_cmake_build(Simple debug-subdir Debug SimpleSubdir/all)
+run_ninja(Simple debug-in-release-graph-target build-Release.ninja simpleexe2:Debug)
run_ninja(Simple release-in-minsizerel-graph-subdir build-MinSizeRel.ninja SimpleSubdir/all:Release)
run_cmake_build(Simple all-subdir Release SimpleSubdir/all:all)
run_ninja(Simple minsizerel-top build-MinSizeRel.ninja all)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake
index de4505ccc0..0cb6ad2e53 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -14,6 +17,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
@@ -23,6 +29,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_MinSizeRel}
${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_FILE_simpleexe2_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe2_MinSizeRel}
+
${TARGET_FILE_simpleshared_MinSizeRel}
${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
@@ -32,6 +41,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_FILE_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+
${TARGET_FILE_simpleshared_RelWithDebInfo}
${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake
index c171e3d057..d27c1ca9be 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -18,6 +21,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
@@ -31,6 +37,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_MinSizeRel}
${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_FILE_simpleexe2_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe2_MinSizeRel}
+
${TARGET_FILE_simpleshared_MinSizeRel}
${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
@@ -44,6 +53,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_FILE_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+
${TARGET_FILE_simpleshared_RelWithDebInfo}
${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-target-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-target-ninja-check.cmake
new file mode 100644
index 0000000000..8de8fde9dd
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-target-ninja-check.cmake
@@ -0,0 +1,37 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe2_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake
index fe980fea67..d2cb8461f1 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -18,6 +21,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
@@ -27,6 +33,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_MinSizeRel}
${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_FILE_simpleexe2_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe2_MinSizeRel}
+
${TARGET_FILE_simpleshared_MinSizeRel}
${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
@@ -40,6 +49,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_FILE_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+
${TARGET_FILE_simpleshared_RelWithDebInfo}
${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake
index 6bb7773fd2..6a0190ffcb 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-all-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-all-ninja-check.cmake
index 4e6e654417..aec10eefcb 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-all-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-all-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -18,6 +21,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
@@ -31,6 +37,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_FILE_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+
${TARGET_FILE_simpleshared_RelWithDebInfo}
${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-minsizerel-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-minsizerel-ninja-check.cmake
index c09ae65b95..b46a708d82 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-minsizerel-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-minsizerel-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -18,6 +21,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-ninja-check.cmake
index 43213dd013..9d124cdb0f 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-clean-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -18,6 +21,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
@@ -31,6 +37,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_MinSizeRel}
${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_FILE_simpleexe2_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe2_MinSizeRel}
+
${TARGET_FILE_simpleshared_MinSizeRel}
${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake
index bf4be49271..496d722463 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -14,6 +17,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
@@ -23,6 +29,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_MinSizeRel}
${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_FILE_simpleexe2_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe2_MinSizeRel}
+
${TARGET_FILE_simpleshared_MinSizeRel}
${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
@@ -36,6 +45,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_FILE_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+
${TARGET_FILE_simpleshared_RelWithDebInfo}
${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake
index b6c77abf26..29c0187ed2 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -14,6 +17,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple.cmake
index 3f4ecbed24..e2d393b6fb 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Simple.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple.cmake
@@ -10,6 +10,6 @@ add_subdirectory(SimpleSubdir)
add_library(simplestatic STATIC simplelib.c)
include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
-generate_output_files(simpleexe simpleshared simplestatic simpleobj)
+generate_output_files(simpleexe simpleexe2 simpleshared simplestatic simpleobj)
file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(GENERATED_FILES [==[${CMAKE_BINARY_DIR}/empty.cmake]==])\n")
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-all-in-release-graph-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-all-in-release-graph-build-check.cmake
index fee5951c4e..67326d9c34 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-all-in-release-graph-build-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-all-in-release-graph-build-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -17,6 +20,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-relwithdebinfo-in-release-graph-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-relwithdebinfo-in-release-graph-build-check.cmake
index fee5951c4e..67326d9c34 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-relwithdebinfo-in-release-graph-build-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleCrossConfigs-all-relwithdebinfo-in-release-graph-build-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -17,6 +20,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAlias-all-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAlias-all-ninja-check.cmake
index c171e3d057..d27c1ca9be 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAlias-all-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAlias-all-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -18,6 +21,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
@@ -31,6 +37,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_MinSizeRel}
${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_FILE_simpleexe2_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe2_MinSizeRel}
+
${TARGET_FILE_simpleshared_MinSizeRel}
${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
@@ -44,6 +53,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_FILE_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+
${TARGET_FILE_simpleshared_RelWithDebInfo}
${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-build-check.cmake
index 8ffdd20b55..4e4ec82cf0 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-build-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-configs-build-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -17,6 +20,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-relwithdebinfo-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-relwithdebinfo-ninja-check.cmake
index 9e5baf91a9..b1789b01b0 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-relwithdebinfo-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-all-relwithdebinfo-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Debug}
${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_FILE_simpleexe2_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe2_Debug}
+
${TARGET_FILE_simpleshared_Debug}
${TARGET_LINKER_FILE_simpleshared_Debug}
${TARGET_OBJECT_FILES_simpleshared_Debug}
@@ -17,6 +20,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_Release}
${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_FILE_simpleexe2_Release}
+ ${TARGET_OBJECT_FILES_simpleexe2_Release}
+
${TARGET_FILE_simpleshared_Release}
${TARGET_LINKER_FILE_simpleshared_Release}
${TARGET_OBJECT_FILES_simpleshared_Release}
@@ -29,6 +35,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_FILE_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+
${TARGET_FILE_simpleshared_RelWithDebInfo}
${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-clean-configs-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-clean-configs-ninja-check.cmake
index 3829d3e525..9016cf4ac8 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-clean-configs-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleDefaultBuildAliasList-clean-configs-ninja-check.cmake
@@ -5,6 +5,9 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
${TARGET_FILE_simpleexe_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_FILE_simpleexe2_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe2_RelWithDebInfo}
+
${TARGET_FILE_simpleshared_RelWithDebInfo}
${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt
index 7e754a3b3e..d81f5ab6e9 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt
@@ -1,4 +1,8 @@
-add_library(simpleobj OBJECT ../empty.c)
-add_executable(simpleexe ../main.c $<TARGET_OBJECTS:simpleobj>)
+add_library(simpleobj OBJECT ../empty.c "$<$<CONFIG:Debug>:../empty_dbg.c>" "$<$<CONFIG:Release>:../empty_rel.c>")
add_library(simpleshared SHARED ../simplelib.c)
+
+add_executable(simpleexe ../main.c $<TARGET_OBJECTS:simpleobj>)
target_link_libraries(simpleexe PRIVATE simpleshared)
+
+add_executable(simpleexe2 ../main.c)
+target_link_libraries(simpleexe2 PRIVATE simpleshared $<TARGET_OBJECTS:simpleobj>)
diff --git a/Tests/RunCMake/NinjaMultiConfig/empty_dbg.c b/Tests/RunCMake/NinjaMultiConfig/empty_dbg.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/empty_dbg.c
diff --git a/Tests/RunCMake/NinjaMultiConfig/empty_rel.c b/Tests/RunCMake/NinjaMultiConfig/empty_rel.c
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/empty_rel.c
diff --git a/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt b/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt
index 69230b63f9..5c27b8af32 100644
--- a/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt
+++ b/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt
@@ -1,19 +1,7 @@
-^CMake Error at OwnSources.cmake:[0-9]+ \(add_library\):
+^(CMake Error at OwnSources.cmake:[0-9]+ \(add_library\):
The SOURCES of "A" use a generator expression that depends on the SOURCES
themselves.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
-+
-CMake Error at OwnSources.cmake:[0-9]+ \(add_library\):
- The SOURCES of "A" use a generator expression that depends on the SOURCES
- themselves.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
-+
-CMake Error at OwnSources.cmake:[0-9]+ \(add_library\):
- The SOURCES of "A" use a generator expression that depends on the SOURCES
- themselves.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
-+
++)+
CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index 41d14eae88..01c2222dc1 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.3)
+if(POLICY CMP0126)
+ cmake_policy(SET CMP0126 NEW)
+endif()
# NOTE: Force the Release mode configuration as there are some issues with the
# debug information handling on macOS on certain Xcode builds.