diff options
author | Brad King <brad.king@kitware.com> | 2013-10-22 13:07:40 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-22 13:07:40 (GMT) |
commit | 0d9e8b1ab9ff8c99700093ba76a4339e3f199350 (patch) | |
tree | 7813e3052d482c4a59b2296e9c3b60e780b73da0 /Source/cmTarget.cxx | |
parent | d8fe9f9de7f6a2dd08329565b0b03d4b5d3cdf29 (diff) | |
parent | f063c45589e83bf8e4ef61f49b17084debf085a2 (diff) | |
download | CMake-0d9e8b1ab9ff8c99700093ba76a4339e3f199350.zip CMake-0d9e8b1ab9ff8c99700093ba76a4339e3f199350.tar.gz CMake-0d9e8b1ab9ff8c99700093ba76a4339e3f199350.tar.bz2 |
Merge topic 'double-colon-is-imported'
f063c45 Consider targets with double colons to be IMPORTED or ALIAS targets.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6e5e0ff..126cdbd 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -5505,6 +5505,46 @@ void cmTarget::ComputeLinkImplementation(const char* config, { continue; } + cmTarget *tgt = this->Makefile->FindTargetToUse(li->c_str()); + + if(!tgt && std::string(item).find("::") != std::string::npos) + { + bool noMessage = false; + cmake::MessageType messageType = cmake::FATAL_ERROR; + cmOStringStream e; + switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028)) + { + case cmPolicies::WARN: + { + e << (this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0028)) << "\n"; + messageType = cmake::AUTHOR_WARNING; + } + break; + case cmPolicies::OLD: + noMessage = true; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + // Issue the fatal message. + break; + } + + if(!noMessage) + { + e << "Target \"" << this->GetName() << "\" links to target \"" << item + << "\" but the target was not found. Perhaps a find_package() " + "call is missing for an IMPORTED target, or a ALIAS target is " + "missing?"; + this->Makefile->GetCMakeInstance()->IssueMessage(messageType, + e.str(), + this->GetBacktrace()); + if (messageType == cmake::FATAL_ERROR) + { + return; + } + } + } // The entry is meant for this configuration. impl.Libraries.push_back(item); } |