summaryrefslogtreecommitdiffstats
path: root/Source/cmAddExecutableCommand.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-22 14:24:59 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-05-22 14:24:59 (GMT)
commit4878c009057cf410fff98d8450e1e7cd2b3072ae (patch)
treea7ef13ec8a302e2530ec1a1fe5edda141fa9896e /Source/cmAddExecutableCommand.cxx
parent6be930f0cfca31d62c3dc498b3fc9e756acca710 (diff)
downloadCMake-4878c009057cf410fff98d8450e1e7cd2b3072ae.zip
CMake-4878c009057cf410fff98d8450e1e7cd2b3072ae.tar.gz
CMake-4878c009057cf410fff98d8450e1e7cd2b3072ae.tar.bz2
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
Diffstat (limited to 'Source/cmAddExecutableCommand.cxx')
-rw-r--r--Source/cmAddExecutableCommand.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index e791a82..ad2044c 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -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())
{