summaryrefslogtreecommitdiffstats
path: root/Source/cmIncludeExternalMSProjectCommand.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/cmIncludeExternalMSProjectCommand.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/cmIncludeExternalMSProjectCommand.cxx')
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx
index d4a74ba..53da366 100644
--- a/Source/cmIncludeExternalMSProjectCommand.cxx
+++ b/Source/cmIncludeExternalMSProjectCommand.cxx
@@ -50,10 +50,8 @@ bool cmIncludeExternalMSProjectCommand
cmSystemTools::ConvertToUnixSlashes(path);
// Create a target instance for this utility.
- cmTarget target;
- target.SetType(cmTarget::UTILITY, utility_name.c_str());
- target.SetProperty("EXCLUDE_FROM_ALL","FALSE");
- target.SetMakefile(this->Makefile);
+ cmTarget* target=this->Makefile->AddNewTarget(cmTarget::UTILITY, utility_name.c_str());
+ target->SetProperty("EXCLUDE_FROM_ALL","FALSE");
std::vector<std::string> no_outputs;
cmCustomCommandLines commandLines;
cmCustomCommandLine commandLine;
@@ -61,13 +59,7 @@ bool cmIncludeExternalMSProjectCommand
commandLine.push_back(path);
commandLines.push_back(commandLine);
cmCustomCommand cc(no_outputs, depends, commandLines, 0, 0);
- target.GetPostBuildCommands().push_back(cc);
-
- // Add the target to the set of targets.
- cmTargets::iterator it =
- this->Makefile->GetTargets()
- .insert(cmTargets::value_type(utility_name.c_str(),target)).first;
- this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->AddTarget(*it);
+ target->GetPostBuildCommands().push_back(cc);
}
#endif
return true;