summaryrefslogtreecommitdiffstats
path: root/Source/cmIncludeExternalMSProjectCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-09-28 21:35:24 (GMT)
committerBrad King <brad.king@kitware.com>2006-09-28 21:35:24 (GMT)
commit1d2fd77ca5f7e77a47e84e3b13556e30fce1e162 (patch)
tree7b4f772ebf5ea10765011869c5b0156b4d41df9b /Source/cmIncludeExternalMSProjectCommand.cxx
parentbd6aaef0014229049a405ccb0bb96a23ffc6b133 (diff)
downloadCMake-1d2fd77ca5f7e77a47e84e3b13556e30fce1e162.zip
CMake-1d2fd77ca5f7e77a47e84e3b13556e30fce1e162.tar.gz
CMake-1d2fd77ca5f7e77a47e84e3b13556e30fce1e162.tar.bz2
BUG: Move hack from old cmMakefile::AddUtilityTarget to this command directly. There really needs to be a better way to represent external project targets.
Diffstat (limited to 'Source/cmIncludeExternalMSProjectCommand.cxx')
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.cxx30
1 files changed, 23 insertions, 7 deletions
diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx
index 143773a..f00d9c3 100644
--- a/Source/cmIncludeExternalMSProjectCommand.cxx
+++ b/Source/cmIncludeExternalMSProjectCommand.cxx
@@ -40,18 +40,34 @@ bool cmIncludeExternalMSProjectCommand
depends.push_back(args[i]);
}
}
-
+
+ // Hack together a utility target storing enough information
+ // to reproduce the target inclusion.
std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
utility_name += "_";
utility_name += args[0];
std::string path = args[1];
cmSystemTools::ConvertToUnixSlashes(path);
- const char* no_working_directory = 0;
- this->Makefile->AddUtilityCommand(utility_name.c_str(), true,
- depends,
- no_working_directory,
- args[0].c_str(), path.c_str());
-
+
+ // Create a target instance for this utility.
+ cmTarget target;
+ target.SetType(cmTarget::UTILITY, utility_name.c_str());
+ target.SetInAll(true);
+ target.SetMakefile(this->Makefile);
+ std::vector<std::string> no_outputs;
+ cmCustomCommandLines commandLines;
+ cmCustomCommandLine commandLine;
+ commandLine.push_back(args[0]);
+ 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);
}
#endif
return true;