summaryrefslogtreecommitdiffstats
path: root/Source/cmAddExecutableCommand.cxx
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2017-09-14 11:15:08 (GMT)
committerBrad King <brad.king@kitware.com>2017-10-26 13:11:04 (GMT)
commit494906a8a21f44e9233632d9be7f93ee3990aaaf (patch)
tree027746c20b4cc38e33f4ec9e30e295c2d89da23a /Source/cmAddExecutableCommand.cxx
parentfe4b25ec2fa09a50b6ffbfcf29e118afdfba0659 (diff)
downloadCMake-494906a8a21f44e9233632d9be7f93ee3990aaaf.zip
CMake-494906a8a21f44e9233632d9be7f93ee3990aaaf.tar.gz
CMake-494906a8a21f44e9233632d9be7f93ee3990aaaf.tar.bz2
Add support for IMPORTED GLOBAL targets to be aliased
Issue: #15569 Issue: #17197
Diffstat (limited to 'Source/cmAddExecutableCommand.cxx')
-rw-r--r--Source/cmAddExecutableCommand.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index 262e3a1..053e34c 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -140,8 +140,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args,
if (!aliasedTarget) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << exename << "\" because target \""
- << aliasedName << "\" does not already "
- "exist.";
+ << aliasedName << "\" does not already exist.";
this->SetError(e.str());
return false;
}
@@ -149,15 +148,15 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args,
if (type != cmStateEnums::EXECUTABLE) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << exename << "\" because target \""
- << aliasedName << "\" is not an "
- "executable.";
+ << aliasedName << "\" is not an executable.";
this->SetError(e.str());
return false;
}
- if (aliasedTarget->IsImported()) {
+ if (aliasedTarget->IsImported() &&
+ !aliasedTarget->IsImportedGloballyVisible()) {
std::ostringstream e;
e << "cannot create ALIAS target \"" << exename << "\" because target \""
- << aliasedName << "\" is IMPORTED.";
+ << aliasedName << "\" is imported but not globally visible.";
this->SetError(e.str());
return false;
}