|
|
@@ -3091,14 +3091,38 @@ void processLinkDirectories(
|
|
|
for (std::string& entryDirectory : entryDirectories) {
|
|
|
if (!cmSystemTools::FileIsFullPath(entryDirectory)) {
|
|
|
std::ostringstream e;
|
|
|
+ bool noMessage = false;
|
|
|
+ cmake::MessageType messageType = cmake::FATAL_ERROR;
|
|
|
if (!targetName.empty()) {
|
|
|
/* clang-format off */
|
|
|
e << "Target \"" << targetName << "\" contains relative "
|
|
|
"path in its INTERFACE_LINK_DIRECTORIES:\n"
|
|
|
" \"" << entryDirectory << "\"";
|
|
|
/* clang-format on */
|
|
|
- tgt->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, e.str());
|
|
|
- return;
|
|
|
+ } else {
|
|
|
+ switch (tgt->GetPolicyStatusCMP0081()) {
|
|
|
+ case cmPolicies::WARN: {
|
|
|
+ e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0081) << "\n";
|
|
|
+ messageType = cmake::AUTHOR_WARNING;
|
|
|
+ } break;
|
|
|
+ case cmPolicies::OLD:
|
|
|
+ noMessage = true;
|
|
|
+ break;
|
|
|
+ case cmPolicies::REQUIRED_IF_USED:
|
|
|
+ case cmPolicies::REQUIRED_ALWAYS:
|
|
|
+ case cmPolicies::NEW:
|
|
|
+ // Issue the fatal message.
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ e << "Found relative path while evaluating link directories of "
|
|
|
+ "\""
|
|
|
+ << tgt->GetName() << "\":\n \"" << entryDirectory << "\"\n";
|
|
|
+ }
|
|
|
+ if (!noMessage) {
|
|
|
+ tgt->GetLocalGenerator()->IssueMessage(messageType, e.str());
|
|
|
+ if (messageType == cmake::FATAL_ERROR) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|