summaryrefslogtreecommitdiff
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2013-12-18 21:25:29 -0700
committerBrad King <brad.king@kitware.com>2014-01-02 13:41:49 -0500
commitd25ad482e978cbf5e4fcfa8b1dcc342ba93dcda0 (patch)
treef0a1f688356d4f346279bacc9203c467a5bb76ac /Source/cmGlobalGenerator.cxx
parent2a384e08cc0809fec75ebb20be585fb5a1bf591a (diff)
downloadcmake-d25ad482e978cbf5e4fcfa8b1dcc342ba93dcda0.tar.gz
OS X: Add CMP0042 to enable MACOSX_RPATH by default
Also adding documentation for CMAKE_MACOSX_RPATH, and improving documentation for MACOSX_RPATH.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index e6f3d94358..3ed612dd94 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1045,6 +1045,12 @@ cmGlobalGenerator::GetExportedTargetsFile(const std::string &filename) const
return it == this->BuildExportSets.end() ? 0 : it->second;
}
+//----------------------------------------------------------------------------
+void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target)
+{
+ this->CMP0042WarnTargets.insert(target);
+}
+
bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS()
{
// If the property is not enabled then okay.
@@ -1072,6 +1078,9 @@ void cmGlobalGenerator::Generate()
// Start with an empty vector:
this->FilesReplacedDuringGenerate.clear();
+ // clear targets to issue warning CMP0042 for
+ this->CMP0042WarnTargets.clear();
+
// Check whether this generator is allowed to run.
if(!this->CheckALLOW_DUPLICATE_CUSTOM_TARGETS())
{
@@ -1203,6 +1212,25 @@ void cmGlobalGenerator::Generate()
this->ExtraGenerator->Generate();
}
+ if(!this->CMP0042WarnTargets.empty())
+ {
+ cmOStringStream w;
+ w <<
+ (this->GetCMakeInstance()->GetPolicies()->
+ GetPolicyWarning(cmPolicies::CMP0042)) << "\n";
+ w << "MACOSX_RPATH is not specified for"
+ " the following targets:\n";
+ for(std::set<std::string>::iterator
+ iter = this->CMP0042WarnTargets.begin();
+ iter != this->CMP0042WarnTargets.end();
+ ++iter)
+ {
+ w << " " << *iter << "\n";
+ }
+ this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
+ cmListFileBacktrace());
+ }
+
this->CMakeInstance->UpdateProgress("Generating done", -1);
}