mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 15:10:20 -06:00
ENH: add the IMPORT keyword to ADD_EXECUTABLE(), which generates an
"imported" executable target. This can then be used e.g. with ADD_CUSTOM_COMMAND() to generate stuff. It adds a second container for "imported" targets, and FindTarget() now takes an additional argument bool useImportedTargets to specify whether you also want to search in the imported targets or only in the "normal" targets. Alex
This commit is contained in:
@@ -32,6 +32,7 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
|
||||
bool use_win32 = false;
|
||||
bool use_macbundle = false;
|
||||
bool excludeFromAll = false;
|
||||
bool importTarget = false;
|
||||
while ( s != args.end() )
|
||||
{
|
||||
if (*s == "WIN32")
|
||||
@@ -49,11 +50,22 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
|
||||
++s;
|
||||
excludeFromAll = true;
|
||||
}
|
||||
else if(*s == "IMPORT")
|
||||
{
|
||||
++s;
|
||||
importTarget = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (importTarget)
|
||||
{
|
||||
cmTarget* target = this->Makefile->AddNewTarget(cmTarget::EXECUTABLE, exename.c_str(), true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (s == args.end())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user