CMP0006: Remove support for OLD behavior

This commit is contained in:
Brad King
2024-11-07 14:39:08 -05:00
parent 03934f16fa
commit 5fd46699fc
3 changed files with 6 additions and 31 deletions

View File

@@ -1,6 +1,9 @@
CMP0006
-------
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
.. include:: REMOVED_PROLOGUE.txt
Installing :prop_tgt:`MACOSX_BUNDLE` targets requires a ``BUNDLE DESTINATION``.
This policy determines whether the :command:`install(TARGETS)` command must be
@@ -18,7 +21,5 @@ behavior for this policy is to produce an error if a bundle target is installed
without a ``BUNDLE DESTINATION``.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
.. include:: REMOVED_EPILOGUE.txt

View File

@@ -105,7 +105,6 @@ public:
bool MakeFilesFullPath(const char* modeName, const std::string& basePath,
const std::vector<std::string>& relFiles,
std::vector<std::string>& absFiles);
bool CheckCMP0006() const;
std::string GetDestination(const cmInstallCommandArguments* args,
const std::string& varName,
@@ -1017,13 +1016,6 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
if (!bundleArgs.GetDestination().empty()) {
bundleGenerator = CreateInstallTargetGenerator(
target, bundleArgs, false, helper.Makefile->GetBacktrace());
} else if (!runtimeArgs.GetDestination().empty()) {
if (helper.CheckCMP0006()) {
// For CMake 2.4 compatibility fallback to the RUNTIME
// properties.
bundleGenerator = CreateInstallTargetGenerator(
target, runtimeArgs, false, helper.Makefile->GetBacktrace());
}
}
if (!bundleGenerator) {
status.SetError(cmStrCat("TARGETS given no BUNDLE DESTINATION for "
@@ -2482,24 +2474,6 @@ bool Helper::MakeFilesFullPath(const char* modeName,
return true;
}
bool Helper::CheckCMP0006() const
{
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0006)) {
case cmPolicies::WARN:
this->Makefile->IssueMessage(
MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0006));
CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to allow compatibility
return true;
case cmPolicies::NEW:
// NEW behavior is to disallow compatibility
break;
}
return false;
}
std::string Helper::GetDestination(const cmInstallCommandArguments* args,
const std::string& varName,
const std::string& guess) const

View File

@@ -33,7 +33,7 @@ class cmMakefile;
6, 0, NEW) \
SELECT(POLICY, CMP0006, \
"Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.", \
2, 6, 0, WARN) \
2, 6, 0, NEW) \
SELECT(POLICY, CMP0007, "list command no longer ignores empty elements.", \
2, 6, 0, WARN) \
SELECT( \