mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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.
This commit is contained in:
@@ -26,6 +26,11 @@ bool cmTargetPropCommandBase
|
||||
}
|
||||
|
||||
// Lookup the target for which libraries are specified.
|
||||
if (this->Makefile->IsAlias(args[0].c_str()))
|
||||
{
|
||||
this->SetError("can not be used on an ALIAS target.");
|
||||
return false;
|
||||
}
|
||||
this->Target =
|
||||
this->Makefile->GetCMakeInstance()
|
||||
->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
|
||||
|
||||
Reference in New Issue
Block a user