summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2017-02-09 15:12:10 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2017-02-14 21:28:07 (GMT)
commit1ba91291e3237e5535a46c6ff1bce6a33d298a76 (patch)
treedb163ae2e44d0e9f8ab6cb6238bd8128b677eaea /Source/cmGlobalGenerator.cxx
parentf7b9bf41c5386dfc38b7a722f75b0e23a02d542b (diff)
downloadCMake-1ba91291e3237e5535a46c6ff1bce6a33d298a76.zip
CMake-1ba91291e3237e5535a46c6ff1bce6a33d298a76.tar.gz
CMake-1ba91291e3237e5535a46c6ff1bce6a33d298a76.tar.bz2
Add policy CMP0068 separate install_name and RPATH settings on macOS
BUILD_WITH_INSTALL_RPATH, SKIP_BUILD_RPATH, CMAKE_SKIP_RPATH and CMAKE_SKIP_INSTALL_RPATH no longer any effect on the install name of a target on macOS. Fixes: #16589
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f118250..b6b7d9e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1194,6 +1194,11 @@ void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target)
this->CMP0042WarnTargets.insert(target);
}
+void cmGlobalGenerator::AddCMP0068WarnTarget(const std::string& target)
+{
+ this->CMP0068WarnTargets.insert(target);
+}
+
bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const
{
// If the property is not enabled then okay.
@@ -1235,6 +1240,8 @@ bool cmGlobalGenerator::Compute()
// clear targets to issue warning CMP0042 for
this->CMP0042WarnTargets.clear();
+ // clear targets to issue warning CMP0068 for
+ this->CMP0068WarnTargets.clear();
// Check whether this generator is allowed to run.
if (!this->CheckALLOW_DUPLICATE_CUSTOM_TARGETS()) {
@@ -1366,6 +1373,24 @@ void cmGlobalGenerator::Generate()
this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
+ if (!this->CMP0068WarnTargets.empty()) {
+ std::ostringstream w;
+ /* clang-format off */
+ w <<
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0068) << "\n"
+ "For compatibility with older versions of CMake, the install_name "
+ "fields for the following targets are still affected by RPATH "
+ "settings:\n"
+ ;
+ /* clang-format on */
+ for (std::set<std::string>::iterator iter =
+ this->CMP0068WarnTargets.begin();
+ iter != this->CMP0068WarnTargets.end(); ++iter) {
+ w << " " << *iter << "\n";
+ }
+ this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ }
+
this->CMakeInstance->UpdateProgress("Generating done", -1);
}