summaryrefslogtreecommitdiff
path: root/Source/cmAddDependenciesCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-07-12 09:14:31 +0200
committerStephen Kelly <steveire@gmail.com>2013-08-02 15:21:00 +0200
commit370bf554151a1b272baf62a0ce9823cf9995116e (patch)
tree8f0a75a9894691c2b56588c3be4b090bf07a1558 /Source/cmAddDependenciesCommand.cxx
parentb341bf2178e3923636735ae1df53a33e5857df7d (diff)
downloadcmake-370bf554151a1b272baf62a0ce9823cf9995116e.tar.gz
Add the ALIAS target concept for libraries and executables.
* The ALIAS name must match a validity regex. * Executables and libraries may be aliased. * An ALIAS acts immutable. It can not be used as the lhs of target_link_libraries or other commands. * An ALIAS can be used with add_custom_command, add_custom_target, and add_test in the same way regular targets can. * The target of an ALIAS can be retrieved with the ALIASED_TARGET target property. * An ALIAS does not appear in the generated buildsystem. It is kept separate from cmMakefile::Targets for that reason. * A target may have multiple aliases. * An ALIAS target may not itself have an alias. * An IMPORTED target may not have an alias. * An ALIAS may not be exported or imported.
Diffstat (limited to 'Source/cmAddDependenciesCommand.cxx')
-rw-r--r--Source/cmAddDependenciesCommand.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index 04a304e391..e4d7f7f1ec 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -24,6 +24,13 @@ bool cmAddDependenciesCommand
}
std::string target_name = args[0];
+ if(this->Makefile->IsAlias(target_name.c_str()))
+ {
+ cmOStringStream e;
+ e << "Cannot add target-level dependencies to alias target \""
+ << target_name << "\".\n";
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ }
if(cmTarget* target = this->Makefile->FindTargetToUse(target_name.c_str()))
{
std::vector<std::string>::const_iterator s = args.begin();