summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--Help/prop_tgt/LANG_LINKER_LAUNCHER.rst5
-rw-r--r--Help/release/dev/lang-linker-launcher-genex.rst5
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCommonTargetGenerator.cxx21
-rw-r--r--Source/cmCommonTargetGenerator.h2
-rw-r--r--Source/cmDependsFortran.cxx18
-rw-r--r--Source/cmDependsFortran.h2
-rw-r--r--Source/cmExportFileGenerator.cxx4
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx9
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h1
-rw-r--r--Source/cmGeneratorExpressionNode.cxx9
-rw-r--r--Source/cmGeneratorTarget.cxx9
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx7
-rw-r--r--Source/cmMakefile.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx9
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
-rw-r--r--Source/cmTarget.cxx761
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-IMPORTED-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0111/CMP0111-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/C-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/CXX-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/Fortran-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/HIP-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/HIP-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/HIP-launch-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/ISPC-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/ISPC-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-launch-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies-stderr.txt10
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target-stderr.txt10
-rw-r--r--Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-OLD-stderr.txt13
-rw-r--r--Tests/RunCMake/ExternalProject/Steps-CMP0114-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/LinkerLauncher/C-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/LinkerLauncher/C-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/LinkerLauncher/CXX-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/LinkerLauncher/CXX-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/LinkerLauncher/OBJC-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/LinkerLauncher/OBJC-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/LinkerLauncher/OBJCXX-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/LinkerLauncher/OBJCXX-launch-env-Build-stdout.txt2
-rw-r--r--Tests/RunCMake/LinkerLauncher/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/Make/CMP0113-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-AlphaNumeric-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-BracketArgument-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-EscapedSpecialChars-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-FormerInvalidSpecialChars-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-FormerInvalidSpecialCharsMC-stderr.txt11
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-LeadingAndTrailingWhitespace-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-OtherSpecialChars-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-Quote-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-Semicolon-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-Space-stderr.txt10
-rw-r--r--Tests/RunCMake/add_test/CMP0110-OLD-ValidSpecialChars-stderr.txt10
-rw-r--r--Tests/RunCMake/find_program/CMP0109-OLD-stderr.txt10
-rw-r--r--Utilities/Doxygen/CMakeLists.txt2
-rw-r--r--Utilities/Sphinx/CMakeLists.txt2
69 files changed, 746 insertions, 380 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d11b4cd..ce11311 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-cmake_minimum_required(VERSION 3.13...3.24 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake)
diff --git a/Help/prop_tgt/LANG_LINKER_LAUNCHER.rst b/Help/prop_tgt/LANG_LINKER_LAUNCHER.rst
index f6ca5ad..d39ec20 100644
--- a/Help/prop_tgt/LANG_LINKER_LAUNCHER.rst
+++ b/Help/prop_tgt/LANG_LINKER_LAUNCHER.rst
@@ -14,3 +14,8 @@ arguments to the tool. This is useful for tools such as static analyzers.
This property is initialized by the value of the
:variable:`CMAKE_<LANG>_LINKER_LAUNCHER` variable if it is set when a target is
created.
+
+.. versionadded:: 3.27
+
+ The property value may use
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/release/dev/lang-linker-launcher-genex.rst b/Help/release/dev/lang-linker-launcher-genex.rst
new file mode 100644
index 0000000..b6494eb
--- /dev/null
+++ b/Help/release/dev/lang-linker-launcher-genex.rst
@@ -0,0 +1,5 @@
+lang-linker-launcher-genex
+--------------------------
+
+* The :prop_tgt:`<LANG>_LINKER_LAUNCHER` target property now supports
+ :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 06cfa54..9c3331e 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 26)
-set(CMake_VERSION_PATCH 20230202)
+set(CMake_VERSION_PATCH 20230203)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 5fe6756..a63c162 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -6,7 +6,12 @@
#include <sstream>
#include <utility>
+#include <cm/string_view>
+#include <cmext/string_view>
+
#include "cmComputeLinkInformation.h"
+#include "cmGeneratorExpression.h"
+#include "cmGeneratorExpressionDAGChecker.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalCommonGenerator.h"
#include "cmGlobalGenerator.h"
@@ -157,7 +162,7 @@ std::string cmCommonTargetGenerator::GetIncludes(std::string const& l,
}
std::vector<std::string> cmCommonTargetGenerator::GetLinkedTargetDirectories(
- const std::string& config) const
+ const std::string& lang, const std::string& config) const
{
std::vector<std::string> dirs;
std::set<cmGeneratorTarget const*> emitted;
@@ -172,6 +177,8 @@ std::vector<std::string> cmCommonTargetGenerator::GetLinkedTargetDirectories(
// Target->GetLinkInformation already processed their
// link interface and they don't have any output themselves.
&& linkee->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
+ ((lang == "CXX"_s && linkee->HaveCxx20ModuleSources()) ||
+ (lang == "Fortran"_s && linkee->HaveFortranSources(config))) &&
emitted.insert(linkee).second) {
cmLocalGenerator* lg = linkee->GetLocalGenerator();
std::string di = cmStrCat(lg->GetCurrentBinaryDirectory(), '/',
@@ -283,11 +290,17 @@ std::string cmCommonTargetGenerator::GetLinkerLauncher(
const std::string& config)
{
std::string lang = this->GeneratorTarget->GetLinkerLanguage(config);
- cmValue launcherProp =
- this->GeneratorTarget->GetProperty(lang + "_LINKER_LAUNCHER");
+ std::string propName = lang + "_LINKER_LAUNCHER";
+ cmValue launcherProp = this->GeneratorTarget->GetProperty(propName);
if (cmNonempty(launcherProp)) {
+ cmGeneratorExpressionDAGChecker dagChecker(this->GeneratorTarget, propName,
+ nullptr, nullptr);
+ std::string evaluatedLinklauncher = cmGeneratorExpression::Evaluate(
+ *launcherProp, this->LocalCommonGenerator, config, this->GeneratorTarget,
+ &dagChecker, this->GeneratorTarget, lang);
// Convert ;-delimited list to single string
- std::vector<std::string> args = cmExpandedList(*launcherProp, true);
+ std::vector<std::string> args =
+ cmExpandedList(evaluatedLinklauncher, true);
if (!args.empty()) {
args[0] = this->LocalCommonGenerator->ConvertToOutputFormat(
args[0], cmOutputConverter::SHELL);
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index e8c5a19..2d23037 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -65,7 +65,7 @@ protected:
std::string GetAIXExports(std::string const& config);
std::vector<std::string> GetLinkedTargetDirectories(
- const std::string& config) const;
+ const std::string& lang, const std::string& config) const;
std::string ComputeTargetCompilePDB(const std::string& config) const;
std::string GetLinkerLauncher(const std::string& config);
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index ac93c90..718097f 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -150,7 +150,9 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
std::ostream& internalDepends)
{
// Prepare the module search process.
- this->LocateModules();
+ if (!this->LocateModules()) {
+ return false;
+ }
// Get the directory in which stamp files will be stored.
const std::string& stamp_dir = this->TargetDirectory;
@@ -216,7 +218,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
return true;
}
-void cmDependsFortran::LocateModules()
+bool cmDependsFortran::LocateModules()
{
// Collect the set of modules provided and required by all sources.
using ObjectInfoMap = cmDependsFortranInternals::ObjectInfoMap;
@@ -234,7 +236,7 @@ void cmDependsFortran::LocateModules()
// Short-circuit for simple targets.
if (this->Internal->TargetRequires.empty()) {
- return;
+ return true;
}
// Match modules provided by this target to those it requires.
@@ -243,15 +245,19 @@ void cmDependsFortran::LocateModules()
// Load information about other targets.
cmMakefile* mf = this->LocalGenerator->GetMakefile();
std::vector<std::string> infoFiles;
- mf->GetDefExpandList("CMAKE_TARGET_LINKED_INFO_FILES", infoFiles);
+ mf->GetDefExpandList("CMAKE_Fortran_TARGET_LINKED_INFO_FILES", infoFiles);
for (std::string const& i : infoFiles) {
std::string targetDir = cmSystemTools::GetFilenamePath(i);
std::string fname = targetDir + "/fortran.internal";
cmsys::ifstream fin(fname.c_str());
- if (fin) {
- this->MatchRemoteModules(fin, targetDir);
+ if (!fin) {
+ cmSystemTools::Error(cmStrCat("-E cmake_depends failed to open ", fname,
+ " for module information"));
+ return false;
}
+ this->MatchRemoteModules(fin, targetDir);
}
+ return true;
}
void cmDependsFortran::MatchLocalModules()
diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h
index a74db91..763f7bb 100644
--- a/Source/cmDependsFortran.h
+++ b/Source/cmDependsFortran.h
@@ -55,7 +55,7 @@ protected:
std::ostream& internalDepends) override;
// Find all the modules required by the target.
- void LocateModules();
+ bool LocateModules();
void MatchLocalModules();
void MatchRemoteModules(std::istream& fin, const std::string& stampDir);
void ConsiderModule(const std::string& name, const std::string& stampDir);
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index c8e2cb8..7f1afba 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -938,13 +938,13 @@ void cmExportFileGenerator::GeneratePolicyHeaderCode(std::ostream& os)
// Isolate the file policy level.
// Support CMake versions as far back as 2.6 but also support using NEW
- // policy settings for up to CMake 3.24 (this upper limit may be reviewed
+ // policy settings for up to CMake 3.25 (this upper limit may be reviewed
// and increased from time to time). This reduces the opportunity for CMake
// warnings when an older export file is later used with newer CMake
// versions.
/* clang-format off */
os << "cmake_policy(PUSH)\n"
- << "cmake_policy(VERSION 2.8.3...3.24)\n";
+ << "cmake_policy(VERSION 2.8.3...3.25)\n";
/* clang-format on */
}
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 6be5153..82a6c57 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -177,6 +177,15 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkOptionsExpression() const
return property == "LINK_OPTIONS"_s;
}
+bool cmGeneratorExpressionDAGChecker::EvaluatingLinkerLauncher() const
+{
+ cm::string_view property(this->Top()->Property);
+
+ return property.length() > cmStrLen("_LINKER_LAUNCHER") &&
+ property.substr(property.length() - cmStrLen("_LINKER_LAUNCHER")) ==
+ "_LINKER_LAUNCHER"_s;
+}
+
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(
cmGeneratorTarget const* tgt, ForGenex genex) const
{
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 55d131f..df1e005 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -70,6 +70,7 @@ struct cmGeneratorExpressionDAGChecker
bool EvaluatingCompileExpression() const;
bool EvaluatingLinkExpression() const;
bool EvaluatingLinkOptionsExpression() const;
+ bool EvaluatingLinkerLauncher() const;
enum class ForGenex
{
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 6595323..4c6dda9 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -1548,7 +1548,8 @@ static const struct LinkLanguageNode : public cmGeneratorExpressionNode
{
if (!context->HeadTarget || !dagChecker ||
!(dagChecker->EvaluatingLinkExpression() ||
- dagChecker->EvaluatingLinkLibraries())) {
+ dagChecker->EvaluatingLinkLibraries() ||
+ dagChecker->EvaluatingLinkerLauncher())) {
reportError(context, content->GetOriginalExpression(),
"$<LINK_LANGUAGE:...> may only be used with binary targets "
"to specify link libraries, link directories, link options "
@@ -1641,7 +1642,8 @@ static const struct LinkLanguageAndIdNode : public cmGeneratorExpressionNode
{
if (!context->HeadTarget || !dagChecker ||
!(dagChecker->EvaluatingLinkExpression() ||
- dagChecker->EvaluatingLinkLibraries())) {
+ dagChecker->EvaluatingLinkLibraries() ||
+ dagChecker->EvaluatingLinkerLauncher())) {
reportError(
context, content->GetOriginalExpression(),
"$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets "
@@ -2098,7 +2100,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (dagCheckerParent) {
if (dagCheckerParent->EvaluatingGenexExpression() ||
- dagCheckerParent->EvaluatingPICExpression()) {
+ dagCheckerParent->EvaluatingPICExpression() ||
+ dagCheckerParent->EvaluatingLinkerLauncher()) {
// No check required.
} else if (dagCheckerParent->EvaluatingLinkLibraries()) {
evaluatingLinkLibraries = true;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 30aa99b..5e352b2 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -8860,6 +8860,15 @@ std::string cmGeneratorTarget::GenerateHeaderSetVerificationFile(
return filename;
}
+bool cmGeneratorTarget::HaveFortranSources(std::string const& config) const
+{
+ auto sources = cmGeneratorTarget::GetSourceFiles(config);
+ return std::any_of(sources.begin(), sources.end(),
+ [](BT<cmSourceFile*> const& sf) -> bool {
+ return sf.Value->GetLanguage() == "Fortran"_s;
+ });
+}
+
bool cmGeneratorTarget::HaveCxx20ModuleSources() const
{
auto const& fs_names = this->Target->GetAllFileSetNames();
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index dd10c64..afd9da4 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -1225,6 +1225,8 @@ public:
cmGeneratorTarget const* t2) const;
};
+ bool HaveFortranSources(std::string const& config) const;
+
// C++20 module support queries.
/**
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index b80a06e..93aa30a 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -2537,8 +2537,13 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
cmStrCat(linked_target_dir, '/', arg_lang, "Modules.json");
Json::Value ltm;
cmsys::ifstream ltmf(ltmn.c_str(), std::ios::in | std::ios::binary);
+ if (!ltmf) {
+ cmSystemTools::Error(cmStrCat("-E cmake_ninja_dyndep failed to open ",
+ ltmn, " for module information"));
+ return false;
+ }
Json::Reader reader;
- if (ltmf && !reader.parse(ltmf, ltm, false)) {
+ if (!reader.parse(ltmf, ltm, false)) {
cmSystemTools::Error(cmStrCat("-E cmake_ninja_dyndep failed to parse ",
linked_target_dir,
reader.getFormattedErrorMessages()));
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d26f383..aef369e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4486,7 +4486,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
}
// Deprecate old policies.
- if (status == cmPolicies::OLD && id <= cmPolicies::CMP0108 &&
+ if (status == cmPolicies::OLD && id <= cmPolicies::CMP0114 &&
!(this->GetCMakeInstance()->GetIsInTryCompile() &&
(
// Policies set by cmCoreTryCompile::TryCompileCode.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 9df1af7..6612595 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1044,7 +1044,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
std::string const clauncher_prop = lang + "_COMPILER_LAUNCHER";
cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
std::string evaluatedClauncher = cmGeneratorExpression::Evaluate(
- *clauncher, this->LocalGenerator, config);
+ *clauncher, this->LocalGenerator, config, this->GeneratorTarget,
+ nullptr, this->GeneratorTarget, lang);
if (!evaluatedClauncher.empty()) {
compilerLauncher = evaluatedClauncher;
}
@@ -1494,11 +1495,11 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
/* clang-format off */
*this->InfoFileStream
<< "\n"
- << "# Targets to which this target links.\n"
- << "set(CMAKE_TARGET_LINKED_INFO_FILES\n";
+ "# Targets to which this target links which contain Fortran sources.\n"
+ "set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES\n";
/* clang-format on */
std::vector<std::string> dirs =
- this->GetLinkedTargetDirectories(this->GetConfigName());
+ this->GetLinkedTargetDirectories("Fortran", this->GetConfigName());
for (std::string const& d : dirs) {
*this->InfoFileStream << " \"" << d << "/DependInfo.cmake\"\n";
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 6887376..b77a363 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -886,7 +886,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
std::string const clauncher_prop = cmStrCat(lang, "_COMPILER_LAUNCHER");
cmValue clauncher = this->GeneratorTarget->GetProperty(clauncher_prop);
std::string evaluatedClauncher = cmGeneratorExpression::Evaluate(
- *clauncher, this->LocalGenerator, config);
+ *clauncher, this->LocalGenerator, config, this->GeneratorTarget, nullptr,
+ this->GeneratorTarget, lang);
if (!evaluatedClauncher.empty()) {
compilerLauncher = evaluatedClauncher;
}
@@ -1675,7 +1676,7 @@ void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang,
Json::Value& tdi_linked_target_dirs = tdi["linked-target-dirs"] =
Json::arrayValue;
- for (std::string const& l : this->GetLinkedTargetDirectories(config)) {
+ for (std::string const& l : this->GetLinkedTargetDirectories(lang, config)) {
tdi_linked_target_dirs.append(l);
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index debf593..e8d66cc 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4,7 +4,6 @@
#include <algorithm>
#include <cassert>
-#include <initializer_list>
#include <iterator>
#include <map>
#include <set>
@@ -273,6 +272,346 @@ struct UsageRequirementProperty
std::vector<BT<std::string>> Entries;
};
+
+struct TargetProperty
+{
+ enum class InitCondition
+ {
+ // Always initialize the property.
+ Always,
+ // Never initialize the property.
+ Never,
+ // Only initialize if the target can compile sources.
+ CanCompileSources,
+ // Only apply to Xcode generators.
+ NeedsXcode,
+ // Only apply to Xcode generators on targets that can compile sources.
+ NeedsXcodeAndCanCompileSources,
+ // Needs to be a "normal" target (any non-global, non-utility target).
+ NormalTarget,
+ // Any non-imported target.
+ NonImportedTarget,
+ // Needs to be a "normal" target (any non-global, non-utility target) that
+ // is not `IMPORTED`.
+ NormalNonImportedTarget,
+ // Needs to be a "normal" target with an artifact (no `INTERFACE`
+ // libraries).
+ TargetWithArtifact,
+ // Needs to be a "normal" target with an artifact that is not an
+ // executable.
+ NonExecutableWithArtifact,
+ // Needs to be a linkable library target (no `OBJECT` or `MODULE`
+ // libraries).
+ LinkableLibraryTarget,
+ // Needs to be an executable.
+ ExecutableTarget,
+ // Needs to be a target with meaningful symbol exports (`SHARED` or
+ // `EXECUTABLE`).
+ TargetWithSymbolExports,
+ // Targets with "commands" associated with them. Basically everything
+ // except global and `INTERFACE` targets.
+ TargetWithCommands,
+ };
+
+ enum class Repetition
+ {
+ Once,
+ PerConfig,
+ PerConfigPrefix,
+ };
+
+ TargetProperty(cm::static_string_view name)
+ : Name(name)
+ {
+ }
+
+ TargetProperty(cm::static_string_view name, cm::static_string_view dflt,
+ InitCondition init)
+ : Name(name)
+ , Default(dflt)
+ , InitConditional(init)
+ {
+ }
+
+ TargetProperty(cm::static_string_view name, InitCondition init)
+ : Name(name)
+ , InitConditional(init)
+ {
+ }
+
+ TargetProperty(cm::static_string_view name, InitCondition init,
+ Repetition repeat)
+ : Name(name)
+ , InitConditional(init)
+ , Repeat(repeat)
+ {
+ }
+
+ cm::static_string_view const Name;
+ cm::optional<cm::static_string_view> const Default = {};
+ InitCondition const InitConditional = InitCondition::Always;
+ Repetition const Repeat = Repetition::Once;
+};
+
+#define IC TargetProperty::InitCondition
+#define R TargetProperty::Repetition
+
+/* clang-format off */
+#define COMMON_LANGUAGE_PROPERTIES(lang) \
+ { #lang "_COMPILER_LAUNCHER"_s, IC::CanCompileSources }, \
+ { #lang "_STANDARD"_s, IC::CanCompileSources }, \
+ { #lang "_STANDARD_REQUIRED"_s, IC::CanCompileSources }, \
+ { #lang "_EXTENSIONS"_s, IC::CanCompileSources }, \
+ { #lang "_VISIBILITY_PRESET"_s, IC::CanCompileSources }
+/* clang-format on */
+
+TargetProperty const StaticTargetProperties[] = {
+ /* clang-format off */
+ // Compilation properties
+ { "COMPILE_WARNING_AS_ERROR"_s, IC::CanCompileSources },
+ { "INTERPROCEDURAL_OPTIMIZATION"_s, IC::CanCompileSources },
+ { "INTERPROCEDURAL_OPTIMIZATION_"_s, IC::TargetWithArtifact, R::PerConfig },
+ { "NO_SYSTEM_FROM_IMPORTED"_s, IC::CanCompileSources },
+ // Set to `True` for `SHARED` and `MODULE` targets.
+ { "POSITION_INDEPENDENT_CODE"_s, IC::CanCompileSources },
+ { "VISIBILITY_INLINES_HIDDEN"_s, IC::CanCompileSources },
+ // -- Features
+ // ---- PCH
+ { "DISABLE_PRECOMPILE_HEADERS"_s, IC::CanCompileSources },
+ { "PCH_WARN_INVALID"_s, "ON"_s, IC::CanCompileSources },
+ { "PCH_INSTANTIATE_TEMPLATES"_s, "ON"_s, IC::CanCompileSources },
+ // -- Platforms
+ // ---- Android
+ { "ANDROID_API"_s, IC::CanCompileSources },
+ { "ANDROID_API_MIN"_s, IC::CanCompileSources },
+ { "ANDROID_ARCH"_s, IC::CanCompileSources },
+ { "ANDROID_ASSETS_DIRECTORIES"_s, IC::CanCompileSources },
+ { "ANDROID_JAVA_SOURCE_DIR"_s, IC::CanCompileSources },
+ { "ANDROID_STL_TYPE"_s, IC::CanCompileSources },
+ // ---- macOS
+ { "OSX_ARCHITECTURES"_s, IC::CanCompileSources },
+ // ---- Windows
+ { "MSVC_DEBUG_INFORMATION_FORMAT"_s, IC::CanCompileSources },
+ { "MSVC_RUNTIME_LIBRARY"_s, IC::CanCompileSources },
+ { "VS_JUST_MY_CODE_DEBUGGING"_s, IC::CanCompileSources },
+ // ---- OpenWatcom
+ { "WATCOM_RUNTIME_LIBRARY"_s, IC::CanCompileSources },
+ // -- Language
+ // ---- C
+ COMMON_LANGUAGE_PROPERTIES(C),
+ // ---- C++
+ COMMON_LANGUAGE_PROPERTIES(CXX),
+ // ---- CSharp
+ { "DOTNET_SDK"_s, IC::NonImportedTarget },
+ { "DOTNET_TARGET_FRAMEWORK"_s, IC::TargetWithCommands },
+ { "DOTNET_TARGET_FRAMEWORK_VERSION"_s, IC::TargetWithCommands },
+ // ---- CUDA
+ COMMON_LANGUAGE_PROPERTIES(CUDA),
+ { "CUDA_SEPARABLE_COMPILATION"_s, IC::CanCompileSources },
+ { "CUDA_ARCHITECTURES"_s, IC::CanCompileSources },
+ // ---- Fortran
+ { "Fortran_FORMAT"_s, IC::CanCompileSources },
+ { "Fortran_MODULE_DIRECTORY"_s, IC::CanCompileSources },
+ { "Fortran_COMPILER_LAUNCHER"_s, IC::CanCompileSources },
+ { "Fortran_PREPRPOCESS"_s, IC::CanCompileSources },
+ { "Fortran_VISIBILITY_PRESET"_s, IC::CanCompileSources },
+ // ---- HIP
+ COMMON_LANGUAGE_PROPERTIES(HIP),
+ { "HIP_ARCHITECTURES"_s, IC::CanCompileSources },
+ // ---- ISPC
+ { "ISPC_COMPILER_LAUNCHER"_s, IC::CanCompileSources },
+ { "ISPC_HEADER_DIRECTORY"_s, IC::CanCompileSources },
+ { "ISPC_HEADER_SUFFIX"_s, "_ispc.h"_s, IC::CanCompileSources },
+ { "ISPC_INSTRUCTION_SETS"_s, IC::CanCompileSources },
+ // ---- Objective C
+ COMMON_LANGUAGE_PROPERTIES(OBJC),
+ // ---- Objective C++
+ COMMON_LANGUAGE_PROPERTIES(OBJCXX),
+ // ---- Swift
+ { "Swift_LANGUAGE_VERSION"_s, IC::CanCompileSources },
+ { "Swift_MODULE_DIRECTORY"_s, IC::CanCompileSources },
+ // ---- moc
+ { "AUTOMOC"_s, IC::CanCompileSources },
+ { "AUTOMOC_COMPILER_PREDEFINES"_s, IC::CanCompileSources },
+ { "AUTOMOC_MACRO_NAMES"_s, IC::CanCompileSources },
+ { "AUTOMOC_MOC_OPTIONS"_s, IC::CanCompileSources },
+ { "AUTOMOC_PATH_PREFIX"_s, IC::CanCompileSources },
+ // ---- uic
+ { "AUTOUIC"_s, IC::CanCompileSources },
+ { "AUTOUIC_OPTIONS"_s, IC::CanCompileSources },
+ { "AUTOUIC_SEARCH_PATHS"_s, IC::CanCompileSources },
+ // ---- rcc
+ { "AUTORCC"_s, IC::CanCompileSources },
+ { "AUTORCC_OPTIONS"_s, IC::CanCompileSources },
+
+ // Linking properties
+ { "ENABLE_EXPORTS"_s, IC::ExecutableTarget },
+ { "LINK_LIBRARIES_ONLY_TARGETS"_s, IC::NormalNonImportedTarget },
+ { "LINK_SEARCH_START_STATIC"_s, IC::CanCompileSources },
+ { "LINK_SEARCH_END_STATIC"_s, IC::CanCompileSources },
+ // Initialize per-configuration name postfix property from the variable only
+ // for non-executable targets. This preserves compatibility with previous
+ // CMake versions in which executables did not support this variable.
+ // Projects may still specify the property directly.
+ { "_POSTFIX"_s, IC::NonExecutableWithArtifact, R::PerConfigPrefix },
+ // -- Dependent library lookup
+ { "MACOSX_RPATH"_s, IC::CanCompileSources },
+ // ---- Build
+ { "BUILD_RPATH"_s, IC::CanCompileSources },
+ { "BUILD_RPATH_USE_ORIGIN"_s, IC::CanCompileSources },
+ { "SKIP_BUILD_RPATH"_s, "OFF"_s, IC::CanCompileSources },
+ { "BUILD_WITH_INSTALL_RPATH"_s, "OFF"_s, IC::CanCompileSources },
+ { "BUILD_WITH_INSTALL_NAME_DIR"_s, IC::CanCompileSources },
+ // ---- Install
+ { "INSTALL_NAME_DIR"_s, IC::CanCompileSources },
+ { "INSTALL_REMOVE_ENVIRONMENT_RPATH"_s, IC::CanCompileSources },
+ { "INSTALL_RPATH"_s, ""_s, IC::CanCompileSources },
+ { "INSTALL_RPATH_USE_LINK_PATH"_s, "OFF"_s, IC::CanCompileSources },
+ // -- Platforms
+ // ---- AIX
+ { "AIX_EXPORT_ALL_SYMBOLS"_s, IC::TargetWithSymbolExports },
+ // ---- Android
+ { "ANDROID_GUI"_s, IC::ExecutableTarget },
+ { "ANDROID_JAR_DIRECTORIES"_s, IC::CanCompileSources },
+ { "ANDROID_JAR_DEPENDENCIES"_s, IC::CanCompileSources },
+ { "ANDROID_NATIVE_LIB_DIRECTORIES"_s, IC::CanCompileSources },
+ { "ANDROID_NATIVE_LIB_DEPENDENCIES"_s, IC::CanCompileSources },
+ { "ANDROID_PROGUARD"_s, IC::CanCompileSources },
+ { "ANDROID_PROGUARD_CONFIG_PATH"_s, IC::CanCompileSources },
+ { "ANDROID_SECURE_PROPS_PATH"_s, IC::CanCompileSources },
+ // ---- iOS
+ { "IOS_INSTALL_COMBINED"_s, IC::CanCompileSources },
+ // ---- macOS
+ { "FRAMEWORK_MULTI_CONFIG_POSTFIX_"_s, IC::LinkableLibraryTarget, R::PerConfig },
+ // ---- Windows
+ { "GNUtoMS"_s, IC::CanCompileSources },
+ { "WIN32_EXECUTABLE"_s, IC::CanCompileSources },
+ { "WINDOWS_EXPORT_ALL_SYMBOLS"_s, IC::TargetWithSymbolExports },
+ // -- Languages
+ // ---- C
+ { "C_LINKER_LAUNCHER"_s, IC::CanCompileSources },
+ // ---- C++
+ { "CXX_LINKER_LAUNCHER"_s, IC::CanCompileSources },
+ // ---- CUDA
+ { "CUDA_RESOLVE_DEVICE_SYMBOLS"_s, IC::CanCompileSources },
+ { "CUDA_RUNTIME_LIBRARY"_s, IC::CanCompileSources },
+ // ---- HIP
+ { "HIP_RUNTIME_LIBRARY"_s, IC::CanCompileSources },
+ // ---- Objective C
+ { "OBJC_LINKER_LAUNCHER"_s, IC::CanCompileSources },
+ // ---- Objective C++
+ { "OBJCXX_LINKER_LAUNCHER"_s, IC::CanCompileSources },
+
+ // Static analysis
+ // -- C
+ { "C_CLANG_TIDY"_s, IC::CanCompileSources },
+ { "C_CLANG_TIDY_EXPORT_FIXES_DIR"_s, IC::CanCompileSources },
+ { "C_CPPLINT"_s, IC::CanCompileSources },
+ { "C_CPPCHECK"_s, IC::CanCompileSources },
+ { "C_INCLUDE_WHAT_YOU_USE"_s, IC::CanCompileSources },
+ // -- C++
+ { "CXX_CLANG_TIDY"_s, IC::CanCompileSources },
+ { "CXX_CLANG_TIDY_EXPORT_FIXES_DIR"_s, IC::CanCompileSources },
+ { "CXX_CPPLINT"_s, IC::CanCompileSources },
+ { "CXX_CPPCHECK"_s, IC::CanCompileSources },
+ { "CXX_INCLUDE_WHAT_YOU_USE"_s, IC::CanCompileSources },
+ // -- Objective C
+ { "OBJC_CLANG_TIDY"_s, IC::CanCompileSources },
+ { "OBJC_CLANG_TIDY_EXPORT_FIXES_DIR"_s, IC::CanCompileSources },
+ // -- Objective C++
+ { "OBJCXX_CLANG_TIDY"_s, IC::CanCompileSources },
+ { "OBJCXX_CLANG_TIDY_EXPORT_FIXES_DIR"_s, IC::CanCompileSources },
+ // -- Linking
+ { "LINK_WHAT_YOU_USE"_s, IC::CanCompileSources },
+
+ // Build graph properties
+ { "LINK_DEPENDS_NO_SHARED"_s, IC::CanCompileSources },
+ { "UNITY_BUILD"_s, IC::CanCompileSources },
+ { "UNITY_BUILD_UNIQUE_ID"_s, IC::CanCompileSources },
+ { "UNITY_BUILD_BATCH_SIZE"_s, "8"_s, IC::CanCompileSources },
+ { "UNITY_BUILD_MODE"_s, "BATCH"_s, IC::CanCompileSources },
+ { "OPTIMIZE_DEPENDENCIES"_s, IC::CanCompileSources },
+ { "VERIFY_INTERFACE_HEADER_SETS"_s },
+ // -- Android
+ { "ANDROID_ANT_ADDITIONAL_OPTIONS"_s, IC::CanCompileSources },
+ { "ANDROID_PROCESS_MAX"_s, IC::CanCompileSources },
+ { "ANDROID_SKIP_ANT_STEP"_s, IC::CanCompileSources },
+ // -- Autogen
+ { "AUTOGEN_ORIGIN_DEPENDS"_s, IC::CanCompileSources },
+ { "AUTOGEN_PARALLEL"_s, IC::CanCompileSources },
+ // -- moc
+ { "AUTOMOC_DEPEND_FILTERS"_s, IC::CanCompileSources },
+ // -- C++
+ { "CXX_SCAN_FOR_MODULES"_s, IC::CanCompileSources },
+ // -- Ninja
+ { "JOB_POOL_COMPILE"_s, IC::CanCompileSources },
+ { "JOB_POOL_LINK"_s, IC::CanCompileSources },
+ { "JOB_POOL_PRECOMPILE_HEADER"_s, IC::CanCompileSources },
+ // -- Visual Studio
+ { "VS_NO_COMPILE_BATCHING"_s, IC::CanCompileSources },
+
+ // Output location properties
+ { "ARCHIVE_OUTPUT_DIRECTORY"_s, IC::CanCompileSources },
+ { "ARCHIVE_OUTPUT_DIRECTORY_"_s, IC::TargetWithArtifact, R::PerConfig },
+ { "COMPILE_PDB_OUTPUT_DIRECTORY"_s, IC::CanCompileSources },
+ { "COMPILE_PDB_OUTPUT_DIRECTORY_"_s, IC::TargetWithArtifact, R::PerConfig },
+ { "LIBRARY_OUTPUT_DIRECTORY"_s, IC::CanCompileSources },
+ { "LIBRARY_OUTPUT_DIRECTORY_"_s, IC::TargetWithArtifact, R::PerConfig },
+ { "PDB_OUTPUT_DIRECTORY"_s, IC::CanCompileSources },
+ { "PDB_OUTPUT_DIRECTORY_"_s, IC::TargetWithArtifact, R::PerConfig },
+ { "RUNTIME_OUTPUT_DIRECTORY"_s, IC::CanCompileSources },
+ { "RUNTIME_OUTPUT_DIRECTORY_"_s, IC::TargetWithArtifact, R::PerConfig },
+
+ // macOS bundle properties
+ { "FRAMEWORK"_s, IC::CanCompileSources },
+ { "FRAMEWORK_MULTI_CONFIG_POSTFIX"_s, IC::CanCompileSources },
+ { "MACOSX_BUNDLE"_s, IC::CanCompileSources },
+
+ // Usage requirement properties
+ { "LINK_INTERFACE_LIBRARIES"_s, IC::CanCompileSources },
+ { "MAP_IMPORTED_CONFIG_"_s, IC::NormalTarget, R::PerConfig },
+
+ // Metadata
+ { "CROSSCOMPILING_EMULATOR"_s, IC::ExecutableTarget },
+ { "EXPORT_COMPILE_COMMANDS"_s, IC::CanCompileSources },
+ { "FOLDER"_s },
+
+ // Xcode properties
+ { "XCODE_GENERATE_SCHEME"_s, IC::NeedsXcode },
+
+#ifdef __APPLE__
+ { "XCODE_SCHEME_ADDRESS_SANITIZER"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_THREAD_SANITIZER"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_THREAD_SANITIZER_STOP"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_LAUNCH_CONFIGURATION"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_ENABLE_GPU_API_VALIDATION"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_WORKING_DIRECTORY"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_MALLOC_SCRIBBLE"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_MALLOC_GUARD_EDGES"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_GUARD_MALLOC"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_LAUNCH_MODE"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_ZOMBIE_OBJECTS"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_MALLOC_STACK"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_SCHEME_ENVIRONMENT"_s, IC::NeedsXcodeAndCanCompileSources },
+ { "XCODE_LINK_BUILD_PHASE_MODE"_s, "NONE"_s, IC::NeedsXcodeAndCanCompileSources },
+#endif
+ /* clang-format on */
+};
+
+#undef COMMON_LANGUAGE_PROPERTIES
+#undef IC
+#undef R
+
}
class cmTargetInternals
@@ -562,15 +901,6 @@ std::pair<bool, cmValue> UsageRequirementProperty::Read(
return { did_read, value };
}
-namespace {
-#define SETUP_COMMON_LANGUAGE_PROPERTIES(lang) \
- initProp(#lang "_COMPILER_LAUNCHER"); \
- initProp(#lang "_STANDARD"); \
- initProp(#lang "_STANDARD_REQUIRED"); \
- initProp(#lang "_EXTENSIONS"); \
- initProp(#lang "_VISIBILITY_PRESET")
-}
-
cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
Visibility vis, cmMakefile* mf, PerConfig perConfig)
: impl(cm::make_unique<cmTargetInternals>())
@@ -606,298 +936,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->impl->IsAndroid = (this->impl->Makefile->GetSafeDefinition(
"CMAKE_SYSTEM_NAME") == "Android");
- std::string defKey;
- defKey.reserve(128);
- defKey += "CMAKE_";
- auto initProp = [this, mf, &defKey](const std::string& property) {
- // Replace everything after "CMAKE_"
- defKey.replace(defKey.begin() + 6, defKey.end(), property);
- if (cmValue value = mf->GetDefinition(defKey)) {
- this->SetProperty(property, value);
- }
- };
- auto initPropValue = [this, mf, &defKey](const std::string& property,
- const char* default_value) {
- // Replace everything after "CMAKE_"
- defKey.replace(defKey.begin() + 6, defKey.end(), property);
- if (cmValue value = mf->GetDefinition(defKey)) {
- this->SetProperty(property, value);
- } else if (default_value) {
- this->SetProperty(property, default_value);
- }
- };
-
- // Setup default property values.
- if (this->CanCompileSources()) {
-
- // Compilation properties
- initProp("INTERPROCEDURAL_OPTIMIZATION");
- // initProp("INTERPROCEDURAL_OPTIMIZATION_<CONFIG>"); (per-config block)
- initProp("NO_SYSTEM_FROM_IMPORTED");
- initProp("VISIBILITY_INLINES_HIDDEN");
- initProp("COMPILE_WARNING_AS_ERROR");
- // -- Features
- // ---- PCH
- initProp("DISABLE_PRECOMPILE_HEADERS");
- initPropValue("PCH_WARN_INVALID", "ON");
- initPropValue("PCH_INSTANTIATE_TEMPLATES", "ON");
- // -- Platforms
- // ---- Android
- initProp("ANDROID_API");
- initProp("ANDROID_API_MIN");
- initProp("ANDROID_ARCH");
- initProp("ANDROID_ASSETS_DIRECTORIES");
- initProp("ANDROID_JAVA_SOURCE_DIR");
- initProp("ANDROID_STL_TYPE");
- // ---- macOS
- initProp("OSX_ARCHITECTURES");
- // ---- Windows
- initProp("MSVC_DEBUG_INFORMATION_FORMAT");
- initProp("MSVC_RUNTIME_LIBRARY");
- initProp("VS_JUST_MY_CODE_DEBUGGING");
- // ---- OpenWatcom
- initProp("WATCOM_RUNTIME_LIBRARY");
- // -- Language
- // ---- C
- SETUP_COMMON_LANGUAGE_PROPERTIES(C);
- // ---- C++
- SETUP_COMMON_LANGUAGE_PROPERTIES(CXX);
- // ---- CUDA
- SETUP_COMMON_LANGUAGE_PROPERTIES(CUDA);
- initProp("CUDA_SEPARABLE_COMPILATION");
- initProp("CUDA_ARCHITECTURES");
- // ---- Fortran
- initProp("Fortran_FORMAT");
- initProp("Fortran_MODULE_DIRECTORY");
- initProp("Fortran_COMPILER_LAUNCHER");
- initProp("Fortran_PREPROCESS");
- initProp("Fortran_VISIBILITY_PRESET");
- // ---- HIP
- SETUP_COMMON_LANGUAGE_PROPERTIES(HIP);
- initProp("HIP_ARCHITECTURES");
- // ---- ISPC
- initProp("ISPC_COMPILER_LAUNCHER");
- initProp("ISPC_HEADER_DIRECTORY");
- initPropValue("ISPC_HEADER_SUFFIX", "_ispc.h");
- initProp("ISPC_INSTRUCTION_SETS");
- // ---- Objective C
- SETUP_COMMON_LANGUAGE_PROPERTIES(OBJC);
- // ---- Objective C++
- SETUP_COMMON_LANGUAGE_PROPERTIES(OBJCXX);
- // ---- Swift
- initProp("Swift_LANGUAGE_VERSION");
- initProp("Swift_MODULE_DIRECTORY");
- // ---- moc
- initProp("AUTOMOC");
- initProp("AUTOMOC_COMPILER_PREDEFINES");
- initProp("AUTOMOC_MACRO_NAMES");
- initProp("AUTOMOC_MOC_OPTIONS");
- initProp("AUTOMOC_PATH_PREFIX");
- // ---- uic
- initProp("AUTOUIC");
- initProp("AUTOUIC_OPTIONS");
- initProp("AUTOUIC_SEARCH_PATHS");
- // ---- rcc
- initProp("AUTORCC");
- initProp("AUTORCC_OPTIONS");
-
- // Linking properties
- initProp("LINK_SEARCH_START_STATIC");
- initProp("LINK_SEARCH_END_STATIC");
- // -- Dependent library lookup
- initProp("MACOSX_RPATH");
- // ---- Build
- initProp("BUILD_RPATH");
- initProp("BUILD_RPATH_USE_ORIGIN");
- initPropValue("SKIP_BUILD_RPATH", "OFF");
- initPropValue("BUILD_WITH_INSTALL_RPATH", "OFF");
- initProp("BUILD_WITH_INSTALL_NAME_DIR");
- // ---- Install
- initProp("INSTALL_NAME_DIR");
- initProp("INSTALL_REMOVE_ENVIRONMENT_RPATH");
- initPropValue("INSTALL_RPATH", "");
- initPropValue("INSTALL_RPATH_USE_LINK_PATH", "OFF");
- // -- Platforms
- // ---- Android
- initProp("ANDROID_JAR_DIRECTORIES");
- initProp("ANDROID_JAR_DEPENDENCIES");
- initProp("ANDROID_NATIVE_LIB_DIRECTORIES");
- initProp("ANDROID_NATIVE_LIB_DEPENDENCIES");
- initProp("ANDROID_PROGUARD");
- initProp("ANDROID_PROGUARD_CONFIG_PATH");
- initProp("ANDROID_SECURE_PROPS_PATH");
- // ---- iOS
- initProp("IOS_INSTALL_COMBINED");
- // ---- Windows
- initProp("GNUtoMS");
- initProp("WIN32_EXECUTABLE");
- // -- Languages
- // ---- C
- initProp("C_LINKER_LAUNCHER");
- // ---- C++
- initProp("CXX_LINKER_LAUNCHER");
- // ---- CUDA
- initProp("CUDA_RESOLVE_DEVICE_SYMBOLS");
- initProp("CUDA_RUNTIME_LIBRARY");
- // ---- HIP
- initProp("HIP_RUNTIME_LIBRARY");
- // ---- Objective C
- initProp("OBJC_LINKER_LAUNCHER");
- // ---- Objective C++
- initProp("OBJCXX_LINKER_LAUNCHER");
-
- // Static analysis
- // -- C
- initProp("C_CLANG_TIDY");
- initProp("C_CLANG_TIDY_EXPORT_FIXES_DIR");
- initProp("C_CPPLINT");
- initProp("C_CPPCHECK");
- initProp("C_INCLUDE_WHAT_YOU_USE");
- // -- C++
- initProp("CXX_CLANG_TIDY");
- initProp("CXX_CLANG_TIDY_EXPORT_FIXES_DIR");
- initProp("CXX_CPPLINT");
- initProp("CXX_CPPCHECK");
- initProp("CXX_INCLUDE_WHAT_YOU_USE");
- // -- Objective C
- initProp("OBJC_CLANG_TIDY");
- initProp("OBJC_CLANG_TIDY_EXPORT_FIXES_DIR");
- // -- Objective C++
- initProp("OBJCXX_CLANG_TIDY");
- initProp("OBJCXX_CLANG_TIDY_EXPORT_FIXES_DIR");
- // -- Linking
- initProp("LINK_WHAT_YOU_USE");
-
- // Build graph properties
- initProp("LINK_DEPENDS_NO_SHARED");
- initProp("UNITY_BUILD");
- initProp("UNITY_BUILD_UNIQUE_ID");
- initPropValue("UNITY_BUILD_BATCH_SIZE", "8");
- initPropValue("UNITY_BUILD_MODE", "BATCH");
- initProp("OPTIMIZE_DEPENDENCIES");
- // -- Android
- initProp("ANDROID_ANT_ADDITIONAL_OPTIONS");
- initProp("ANDROID_PROCESS_MAX");
- initProp("ANDROID_SKIP_ANT_STEP");
- // -- Autogen
- initProp("AUTOGEN_ORIGIN_DEPENDS");
- initProp("AUTOGEN_PARALLEL");
- // -- moc
- initProp("AUTOMOC_DEPEND_FILTERS");
- // -- C++
- initProp("CXX_SCAN_FOR_MODULES");
- // -- Ninja
- initProp("JOB_POOL_COMPILE");
- initProp("JOB_POOL_LINK");
- initProp("JOB_POOL_PRECOMPILE_HEADER");
- // -- Visual Studio
- initProp("VS_NO_COMPILE_BATCHING");
-
- // Output location properties
- initProp("ARCHIVE_OUTPUT_DIRECTORY");
- initProp("LIBRARY_OUTPUT_DIRECTORY");
- initProp("RUNTIME_OUTPUT_DIRECTORY");
- initProp("PDB_OUTPUT_DIRECTORY");
- initProp("COMPILE_PDB_OUTPUT_DIRECTORY");
-
- // -- macOS bundle properties
- initProp("FRAMEWORK");
- initProp("FRAMEWORK_MULTI_CONFIG_POSTFIX");
- initProp("MACOSX_BUNDLE");
-
- // Usage requirement properties
- initProp("LINK_INTERFACE_LIBRARIES");
-
- // Metadata
- initProp("EXPORT_COMPILE_COMMANDS");
-
-#ifdef __APPLE__
- if (this->GetGlobalGenerator()->IsXcode()) {
- initProp("XCODE_SCHEME_ADDRESS_SANITIZER");
- initProp("XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN");
- initProp("XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING");
- initProp("XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE");
- initProp("XCODE_SCHEME_THREAD_SANITIZER");
- initProp("XCODE_SCHEME_THREAD_SANITIZER_STOP");
- initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER");
- initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP");
- initProp("XCODE_SCHEME_LAUNCH_CONFIGURATION");
- initProp("XCODE_SCHEME_ENABLE_GPU_API_VALIDATION");
- initProp("XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION");
- initProp("XCODE_SCHEME_WORKING_DIRECTORY");
- initProp("XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER");
- initProp("XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP");
- initProp("XCODE_SCHEME_MALLOC_SCRIBBLE");
- initProp("XCODE_SCHEME_MALLOC_GUARD_EDGES");
- initProp("XCODE_SCHEME_GUARD_MALLOC");
- initProp("XCODE_SCHEME_LAUNCH_MODE");
- initProp("XCODE_SCHEME_ZOMBIE_OBJECTS");
- initProp("XCODE_SCHEME_MALLOC_STACK");
- initProp("XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE");
- initProp("XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS");
- initProp("XCODE_SCHEME_ENVIRONMENT");
- initPropValue("XCODE_LINK_BUILD_PHASE_MODE", "NONE");
- }
-#endif
- }
-
- initProp("FOLDER");
- initProp("VERIFY_INTERFACE_HEADER_SETS");
-
- if (this->GetGlobalGenerator()->IsXcode()) {
- initProp("XCODE_GENERATE_SCHEME");
- }
-
- // Setup per-configuration property default values.
- if (this->GetType() != cmStateEnums::UTILITY &&
- this->GetType() != cmStateEnums::GLOBAL_TARGET) {
- static const auto configProps = {
- /* clang-format needs this comment to break after the opening brace */
- "ARCHIVE_OUTPUT_DIRECTORY_"_s, "LIBRARY_OUTPUT_DIRECTORY_"_s,
- "RUNTIME_OUTPUT_DIRECTORY_"_s, "PDB_OUTPUT_DIRECTORY_"_s,
- "COMPILE_PDB_OUTPUT_DIRECTORY_"_s, "MAP_IMPORTED_CONFIG_"_s,
- "INTERPROCEDURAL_OPTIMIZATION_"_s
- };
- // Collect the set of configuration types.
- std::vector<std::string> configNames =
- mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
- for (std::string const& configName : configNames) {
- std::string configUpper = cmSystemTools::UpperCase(configName);
- for (auto const& prop : configProps) {
- // Interface libraries have no output locations, so honor only
- // the configuration map.
- if (this->impl->TargetType == cmStateEnums::INTERFACE_LIBRARY &&
- prop != "MAP_IMPORTED_CONFIG_") {
- continue;
- }
- std::string property = cmStrCat(prop, configUpper);
- initProp(property);
- }
-
- // Initialize per-configuration name postfix property from the
- // variable only for non-executable targets. This preserves
- // compatibility with previous CMake versions in which executables
- // did not support this variable. Projects may still specify the
- // property directly.
- if (this->impl->TargetType != cmStateEnums::EXECUTABLE &&
- this->impl->TargetType != cmStateEnums::INTERFACE_LIBRARY) {
- std::string property =
- cmStrCat(cmSystemTools::UpperCase(configName), "_POSTFIX");
- initProp(property);
- }
-
- if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
- this->impl->TargetType == cmStateEnums::STATIC_LIBRARY) {
- std::string property = cmStrCat("FRAMEWORK_MULTI_CONFIG_POSTFIX_",
- cmSystemTools::UpperCase(configName));
- initProp(property);
- }
- }
- if (!this->IsImported()) {
- initProp("LINK_LIBRARIES_ONLY_TARGETS");
- }
- }
-
// Save the backtrace of target construction.
this->impl->Backtrace = this->impl->Makefile->GetBacktrace();
@@ -921,23 +959,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->impl->Makefile->GetLinkDirectoriesEntries());
}
- if (this->impl->TargetType == cmStateEnums::EXECUTABLE) {
- initProp("ANDROID_GUI");
- initProp("CROSSCOMPILING_EMULATOR");
- initProp("ENABLE_EXPORTS");
- }
- if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
- this->impl->TargetType == cmStateEnums::MODULE_LIBRARY) {
- this->SetProperty("POSITION_INDEPENDENT_CODE", "True");
- } else if (this->CanCompileSources()) {
- initProp("POSITION_INDEPENDENT_CODE");
- }
- if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
- this->impl->TargetType == cmStateEnums::EXECUTABLE) {
- initProp("AIX_EXPORT_ALL_SYMBOLS");
- initProp("WINDOWS_EXPORT_ALL_SYMBOLS");
- }
-
// Record current policies for later use.
this->impl->Makefile->RecordPolicies(this->impl->PolicyMap);
@@ -949,13 +970,105 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->impl->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW);
}
+ std::set<TargetProperty::InitCondition> metConditions;
+ metConditions.insert(TargetProperty::InitCondition::Always);
+ if (this->CanCompileSources()) {
+ metConditions.insert(TargetProperty::InitCondition::CanCompileSources);
+ }
+ if (this->GetGlobalGenerator()->IsXcode()) {
+ metConditions.insert(TargetProperty::InitCondition::NeedsXcode);
+ if (this->CanCompileSources()) {
+ metConditions.insert(
+ TargetProperty::InitCondition::NeedsXcodeAndCanCompileSources);
+ }
+ }
if (!this->IsImported()) {
- initProp("DOTNET_SDK");
+ metConditions.insert(TargetProperty::InitCondition::NonImportedTarget);
+ }
+ if (this->impl->TargetType != cmStateEnums::UTILITY &&
+ this->impl->TargetType != cmStateEnums::GLOBAL_TARGET) {
+ metConditions.insert(TargetProperty::InitCondition::NormalTarget);
+ if (!this->IsImported()) {
+ metConditions.insert(
+ TargetProperty::InitCondition::NormalNonImportedTarget);
+ }
+ if (this->impl->TargetType != cmStateEnums::INTERFACE_LIBRARY) {
+ metConditions.insert(TargetProperty::InitCondition::TargetWithArtifact);
+ if (this->impl->TargetType != cmStateEnums::EXECUTABLE) {
+ metConditions.insert(
+ TargetProperty::InitCondition::NonExecutableWithArtifact);
+ }
+ }
+ if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
+ this->impl->TargetType == cmStateEnums::STATIC_LIBRARY) {
+ metConditions.insert(
+ TargetProperty::InitCondition::LinkableLibraryTarget);
+ }
+ }
+ if (this->impl->TargetType == cmStateEnums::EXECUTABLE) {
+ metConditions.insert(TargetProperty::InitCondition::ExecutableTarget);
+ }
+ if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
+ this->impl->TargetType == cmStateEnums::EXECUTABLE) {
+ metConditions.insert(
+ TargetProperty::InitCondition::TargetWithSymbolExports);
}
-
if (this->impl->TargetType <= cmStateEnums::GLOBAL_TARGET) {
- initProp("DOTNET_TARGET_FRAMEWORK");
- initProp("DOTNET_TARGET_FRAMEWORK_VERSION");
+ metConditions.insert(TargetProperty::InitCondition::TargetWithCommands);
+ }
+
+ std::vector<std::string> configNames =
+ mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
+ for (auto& config : configNames) {
+ config = cmSystemTools::UpperCase(config);
+ }
+
+ std::string defKey;
+ defKey.reserve(128);
+ defKey += "CMAKE_";
+ auto initProperty = [this, mf, &defKey](const std::string& property,
+ const char* default_value) {
+ // Replace everything after "CMAKE_"
+ defKey.replace(defKey.begin() + 6, defKey.end(), property);
+ if (cmValue value = mf->GetDefinition(defKey)) {
+ this->SetProperty(property, value);
+ } else if (default_value) {
+ this->SetProperty(property, default_value);
+ }
+ };
+
+ std::string dflt_storage;
+ for (auto const& tp : StaticTargetProperties) {
+ // Ignore properties that we have not met the condition for.
+ if (!metConditions.count(tp.InitConditional)) {
+ continue;
+ }
+
+ const char* dflt = nullptr;
+ if (tp.Default) {
+ dflt_storage = std::string(*tp.Default);
+ dflt = dflt_storage.c_str();
+ }
+
+ if (tp.Repeat == TargetProperty::Repetition::Once) {
+ initProperty(std::string(tp.Name), dflt);
+ } else {
+ std::string propertyName;
+ for (auto const& configName : configNames) {
+ if (tp.Repeat == TargetProperty::Repetition::PerConfig) {
+ propertyName = cmStrCat(tp.Name, configName);
+ } else if (tp.Repeat == TargetProperty::Repetition::PerConfigPrefix) {
+ propertyName = cmStrCat(configName, tp.Name);
+ }
+ initProperty(propertyName, dflt);
+ }
+ }
+ }
+
+ // Clean up some property defaults.
+ if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
+ this->impl->TargetType == cmStateEnums::MODULE_LIBRARY) {
+ this->SetProperty("POSITION_INDEPENDENT_CODE", "True");
}
// check for "CMAKE_VS_GLOBALS" variable and set up target properties
@@ -972,7 +1085,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
if (assignment != std::string::npos) {
const std::string propName = vsGlobal + i.substr(0, assignment);
const std::string propValue = i.substr(assignment + 1);
- initPropValue(propName, propValue.c_str());
+ initProperty(propName, propValue.c_str());
}
}
}
diff --git a/Tests/RunCMake/CMP0026/CMP0026-IMPORTED-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-IMPORTED-stderr.txt
new file mode 100644
index 0000000..259eabd
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/CMP0026-IMPORTED-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0026-IMPORTED.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0111 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0111/CMP0111-OLD-stderr.txt b/Tests/RunCMake/CMP0111/CMP0111-OLD-stderr.txt
new file mode 100644
index 0000000..bf7fb08
--- /dev/null
+++ b/Tests/RunCMake/CMP0111/CMP0111-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0111-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0111 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt
index 3313e31..544b65f 100644
--- a/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=C.*
diff --git a/Tests/RunCMake/CompilerLauncher/C-launch-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/C-launch-env-Build-stdout.txt
index 3313e31..544b65f 100644
--- a/Tests/RunCMake/CompilerLauncher/C-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/C-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=C.*
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt
index 3313e31..a6e8b0a 100644
--- a/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=CUDA.*
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-launch-env-Build-stdout.txt
index 3313e31..a6e8b0a 100644
--- a/Tests/RunCMake/CompilerLauncher/CUDA-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=CUDA.*
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt
index 3313e31..082c7b5 100644
--- a/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=CXX.*
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-launch-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CXX-launch-env-Build-stdout.txt
index 3313e31..082c7b5 100644
--- a/Tests/RunCMake/CompilerLauncher/CXX-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/CXX-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=CXX.*
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt
index 3313e31..9f8c754 100644
--- a/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=Fortran.*
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-launch-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/Fortran-launch-env-Build-stdout.txt
index 3313e31..9f8c754 100644
--- a/Tests/RunCMake/CompilerLauncher/Fortran-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=Fortran.*
diff --git a/Tests/RunCMake/CompilerLauncher/HIP-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/HIP-env-Build-stdout.txt
index 3313e31..354e317 100644
--- a/Tests/RunCMake/CompilerLauncher/HIP-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/HIP-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=HIP.*
diff --git a/Tests/RunCMake/CompilerLauncher/HIP-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/HIP-env-launch-Build-stdout.txt
deleted file mode 100644
index 3313e31..0000000
--- a/Tests/RunCMake/CompilerLauncher/HIP-env-launch-Build-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
-.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/HIP-launch-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/HIP-launch-env-Build-stdout.txt
new file mode 100644
index 0000000..354e317
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/HIP-launch-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=HIP.*
diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/ISPC-env-Build-stdout.txt
index 3313e31..6b71839 100644
--- a/Tests/RunCMake/CompilerLauncher/ISPC-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/ISPC-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=ISPC.*
diff --git a/Tests/RunCMake/CompilerLauncher/ISPC-launch-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/ISPC-launch-env-Build-stdout.txt
index 3313e31..6b71839 100644
--- a/Tests/RunCMake/CompilerLauncher/ISPC-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/ISPC-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=ISPC.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt
index 3313e31..d2efd3d 100644
--- a/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=OBJC.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt
deleted file mode 100644
index 3313e31..0000000
--- a/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
-.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-launch-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-launch-env-Build-stdout.txt
new file mode 100644
index 0000000..d2efd3d
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-launch-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=OBJC.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt
index 3313e31..0082ab2 100644
--- a/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=OBJCXX.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt
deleted file mode 100644
index 3313e31..0000000
--- a/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
-.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env-Build-stdout.txt
new file mode 100644
index 0000000..0082ab2
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=OBJCXX.*
diff --git a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
index e6a2605..b051a19 100644
--- a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
@@ -18,7 +18,7 @@ endfunction()
function(run_compiler_launcher_env lang)
string(REGEX REPLACE "-.*" "" core_lang "${lang}")
# Use the noop genexp $<PATH:...> genexp to validate genexp support.
- set(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER} "$<PATH:CMAKE_PATH,${CMAKE_COMMAND}>;-E;env;USED_LAUNCHER=1")
+ set(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER} "$<PATH:CMAKE_PATH,${CMAKE_COMMAND}>;-E;env;USED_LAUNCHER=1;TARGET_NAME=$<TARGET_PROPERTY:NAME>;LANGUAGE=$<COMPILE_LANGUAGE>")
run_compiler_launcher(${lang})
unset(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER})
endfunction()
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies-stderr.txt b/Tests/RunCMake/ExternalProject/Add_StepDependencies-stderr.txt
new file mode 100644
index 0000000..650be64
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies-stderr.txt
@@ -0,0 +1,10 @@
+^(CMake Deprecation Warning at Add_StepDependencies.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0114 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\))?$
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target-stderr.txt b/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target-stderr.txt
new file mode 100644
index 0000000..c142541
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target-stderr.txt
@@ -0,0 +1,10 @@
+^(CMake Deprecation Warning at Add_StepDependencies_no_target.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0114 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\))?$
diff --git a/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-OLD-stderr.txt b/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-OLD-stderr.txt
index 2b0feb6..2428b8c 100644
--- a/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-OLD-stderr.txt
+++ b/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-OLD-stderr.txt
@@ -1,4 +1,15 @@
-^CMake Warning \(dev\) at [^
+^CMake Deprecation Warning at NO_DEPENDS-CMP0114-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0114 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Warning \(dev\) at [^
]*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
Using NO_DEPENDS for "configure" step might break parallel builds
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/ExternalProject/Steps-CMP0114-OLD-stderr.txt b/Tests/RunCMake/ExternalProject/Steps-CMP0114-OLD-stderr.txt
new file mode 100644
index 0000000..6dd7cb0
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Steps-CMP0114-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at Steps-CMP0114-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0114 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/LinkerLauncher/C-env-Build-stdout.txt b/Tests/RunCMake/LinkerLauncher/C-env-Build-stdout.txt
index 3313e31..544b65f 100644
--- a/Tests/RunCMake/LinkerLauncher/C-env-Build-stdout.txt
+++ b/Tests/RunCMake/LinkerLauncher/C-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=C.*
diff --git a/Tests/RunCMake/LinkerLauncher/C-launch-env-Build-stdout.txt b/Tests/RunCMake/LinkerLauncher/C-launch-env-Build-stdout.txt
index 3313e31..544b65f 100644
--- a/Tests/RunCMake/LinkerLauncher/C-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/LinkerLauncher/C-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=C.*
diff --git a/Tests/RunCMake/LinkerLauncher/CXX-env-Build-stdout.txt b/Tests/RunCMake/LinkerLauncher/CXX-env-Build-stdout.txt
index 3313e31..082c7b5 100644
--- a/Tests/RunCMake/LinkerLauncher/CXX-env-Build-stdout.txt
+++ b/Tests/RunCMake/LinkerLauncher/CXX-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=CXX.*
diff --git a/Tests/RunCMake/LinkerLauncher/CXX-launch-env-Build-stdout.txt b/Tests/RunCMake/LinkerLauncher/CXX-launch-env-Build-stdout.txt
index 3313e31..082c7b5 100644
--- a/Tests/RunCMake/LinkerLauncher/CXX-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/LinkerLauncher/CXX-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=CXX.*
diff --git a/Tests/RunCMake/LinkerLauncher/OBJC-env-Build-stdout.txt b/Tests/RunCMake/LinkerLauncher/OBJC-env-Build-stdout.txt
index 3313e31..d2efd3d 100644
--- a/Tests/RunCMake/LinkerLauncher/OBJC-env-Build-stdout.txt
+++ b/Tests/RunCMake/LinkerLauncher/OBJC-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=OBJC.*
diff --git a/Tests/RunCMake/LinkerLauncher/OBJC-launch-env-Build-stdout.txt b/Tests/RunCMake/LinkerLauncher/OBJC-launch-env-Build-stdout.txt
index 3313e31..d2efd3d 100644
--- a/Tests/RunCMake/LinkerLauncher/OBJC-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/LinkerLauncher/OBJC-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=OBJC.*
diff --git a/Tests/RunCMake/LinkerLauncher/OBJCXX-env-Build-stdout.txt b/Tests/RunCMake/LinkerLauncher/OBJCXX-env-Build-stdout.txt
index 3313e31..0082ab2 100644
--- a/Tests/RunCMake/LinkerLauncher/OBJCXX-env-Build-stdout.txt
+++ b/Tests/RunCMake/LinkerLauncher/OBJCXX-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=OBJCXX.*
diff --git a/Tests/RunCMake/LinkerLauncher/OBJCXX-launch-env-Build-stdout.txt b/Tests/RunCMake/LinkerLauncher/OBJCXX-launch-env-Build-stdout.txt
index 3313e31..0082ab2 100644
--- a/Tests/RunCMake/LinkerLauncher/OBJCXX-launch-env-Build-stdout.txt
+++ b/Tests/RunCMake/LinkerLauncher/OBJCXX-launch-env-Build-stdout.txt
@@ -1 +1 @@
-.*-E env USED_LAUNCHER=1.*
+.*-E env USED_LAUNCHER=1 TARGET_NAME=main LANGUAGE=OBJCXX.*
diff --git a/Tests/RunCMake/LinkerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/LinkerLauncher/RunCMakeTest.cmake
index 8f2bf63..025f367 100644
--- a/Tests/RunCMake/LinkerLauncher/RunCMakeTest.cmake
+++ b/Tests/RunCMake/LinkerLauncher/RunCMakeTest.cmake
@@ -17,7 +17,8 @@ endfunction()
function(run_linker_launcher_env lang)
string(REGEX REPLACE "-.*" "" core_lang "${lang}")
- set(ENV{CMAKE_${core_lang}_LINKER_LAUNCHER} "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
+ # Use the noop genexp $<PATH:...> genexp to validate genexp support.
+ set(ENV{CMAKE_${core_lang}_LINKER_LAUNCHER} "$<PATH:CMAKE_PATH,${CMAKE_COMMAND}>;-E;env;USED_LAUNCHER=1;TARGET_NAME=$<TARGET_PROPERTY:NAME>;LANGUAGE=$<LINK_LANGUAGE>")
run_linker_launcher(${lang})
unset(ENV{CMAKE_${core_lang}_LINKER_LAUNCHER})
endfunction()
diff --git a/Tests/RunCMake/Make/CMP0113-OLD-stderr.txt b/Tests/RunCMake/Make/CMP0113-OLD-stderr.txt
new file mode 100644
index 0000000..42742f7
--- /dev/null
+++ b/Tests/RunCMake/Make/CMP0113-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0113-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0113 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-AlphaNumeric-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-AlphaNumeric-stderr.txt
new file mode 100644
index 0000000..46b32d1
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-AlphaNumeric-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-AlphaNumeric.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-BracketArgument-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-BracketArgument-stderr.txt
new file mode 100644
index 0000000..906f318
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-BracketArgument-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-BracketArgument.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-EscapedSpecialChars-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-EscapedSpecialChars-stderr.txt
new file mode 100644
index 0000000..65818fa
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-EscapedSpecialChars-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-EscapedSpecialChars.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-FormerInvalidSpecialChars-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-FormerInvalidSpecialChars-stderr.txt
new file mode 100644
index 0000000..db88659
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-FormerInvalidSpecialChars-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-FormerInvalidSpecialChars.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-FormerInvalidSpecialCharsMC-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-FormerInvalidSpecialCharsMC-stderr.txt
new file mode 100644
index 0000000..42cc02a
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-FormerInvalidSpecialCharsMC-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Deprecation Warning at CMP0110-OLD-FormerInvalidSpecialChars.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMP0110-OLD-FormerInvalidSpecialCharsMC.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-LeadingAndTrailingWhitespace-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-LeadingAndTrailingWhitespace-stderr.txt
new file mode 100644
index 0000000..6a39db6
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-LeadingAndTrailingWhitespace-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-LeadingAndTrailingWhitespace.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-OtherSpecialChars-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-OtherSpecialChars-stderr.txt
new file mode 100644
index 0000000..d5dcada
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-OtherSpecialChars-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-OtherSpecialChars.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-Quote-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-Quote-stderr.txt
new file mode 100644
index 0000000..69cd304
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-Quote-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-Quote.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-Semicolon-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-Semicolon-stderr.txt
new file mode 100644
index 0000000..e601bfc
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-Semicolon-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-Semicolon.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-Space-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-Space-stderr.txt
new file mode 100644
index 0000000..618d2b1
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-Space-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-Space.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_test/CMP0110-OLD-ValidSpecialChars-stderr.txt b/Tests/RunCMake/add_test/CMP0110-OLD-ValidSpecialChars-stderr.txt
new file mode 100644
index 0000000..ad67c08
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMP0110-OLD-ValidSpecialChars-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0110-OLD-ValidSpecialChars.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0110 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/find_program/CMP0109-OLD-stderr.txt b/Tests/RunCMake/find_program/CMP0109-OLD-stderr.txt
new file mode 100644
index 0000000..fa767b9
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMP0109-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0109-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0109 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index b084dd5..fee21b6 100644
--- a/Utilities/Doxygen/CMakeLists.txt
+++ b/Utilities/Doxygen/CMakeLists.txt
@@ -3,7 +3,7 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeDeveloperReference_STANDALONE 1)
- cmake_minimum_required(VERSION 3.13...3.24 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index a9aa47d..bde6c6b 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -3,7 +3,7 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeHelp_STANDALONE 1)
- cmake_minimum_required(VERSION 3.13...3.24 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.13...3.25 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)