summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-07-05 15:31:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-07-05 15:31:17 (GMT)
commit326ebdf12a59e7a115d7326299eb6be54316f34e (patch)
treec8a86b423727fd8036b70af3adfd67b7745404ba /Source
parentca733cdf4532a4a3d05b82c49a5f2fbf994149de (diff)
parent0d7114987c78085df6449e93bdda8a1749862025 (diff)
downloadCMake-326ebdf12a59e7a115d7326299eb6be54316f34e.zip
CMake-326ebdf12a59e7a115d7326299eb6be54316f34e.tar.gz
CMake-326ebdf12a59e7a115d7326299eb6be54316f34e.tar.bz2
Merge topic 'revert-subdirectory-linking'
0d7114987c Revert "target_link_libraries: Allow use with targets in other directories" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2191
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 73f9a2e..1bbcf46 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -365,7 +365,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (this->CurrentProcessingState != ProcessingKeywordLinkInterface &&
this->CurrentProcessingState != ProcessingPlainLinkInterface) {
- // Find target on the LHS locally
+ // Assure that the target on the LHS was created in the current directory.
cmTarget* t =
this->Makefile->FindLocalNonAliasTarget(this->Target->GetName());
if (!t) {
@@ -378,18 +378,11 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
}
}
}
-
- // If no local target has been found, find it in the global scope
- if (!t) {
- t = this->Makefile->GetGlobalGenerator()->FindTarget(
- this->Target->GetName(), true);
- }
-
if (!t) {
std::ostringstream e;
e << "Attempt to add link library \"" << lib << "\" to target \""
<< this->Target->GetName()
- << "\" which does not exist or is an alias target.";
+ << "\" which is not built in this directory.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}