summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-02-22 15:32:44 (GMT)
committerBrad King <brad.king@kitware.com>2005-02-22 15:32:44 (GMT)
commit39af9ee1e496db77849015541f687897ed819a56 (patch)
tree79bd7c1765408c80822dc9b87853bdac24704332 /Source/cmGlobalVisualStudio7Generator.cxx
parent4d30cb309cc0cd191e89a7969599b79dea111a08 (diff)
downloadCMake-39af9ee1e496db77849015541f687897ed819a56.zip
CMake-39af9ee1e496db77849015541f687897ed819a56.tar.gz
CMake-39af9ee1e496db77849015541f687897ed819a56.tar.bz2
ENH: Updated implementation of custom commands. Multiple command lines are now supported effectively allowing entire scripts to be written. Also removed extra variable expansions and cleaned up passing of commands through to the generators. The command and individual arguments are now kept separate all the way until the generator writes them out. This cleans up alot of escaping issues.
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx34
1 files changed, 20 insertions, 14 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 70a8c197..2fda9de 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -167,7 +167,8 @@ void cmGlobalVisualStudio7Generator::SetupTests()
// If the file doesn't exist, then ENABLE_TESTING hasn't been run
if (cmSystemTools::FileExists(fname.c_str()))
{
- std::vector<std::string> srcs;
+ const char* no_output = 0;
+ std::vector<std::string> no_depends;
std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
for(it = m_ProjectMap.begin(); it!= m_ProjectMap.end(); ++it)
{
@@ -176,7 +177,8 @@ void cmGlobalVisualStudio7Generator::SetupTests()
if(gen.size())
{
gen[0]->GetMakefile()->
- AddUtilityCommand("RUN_TESTS", ctest.c_str(), "-C $(IntDir)",false,srcs);
+ AddUtilityCommand("RUN_TESTS", false, no_output, no_depends,
+ ctest.c_str(), "-C", "$(IntDir)");
}
}
}
@@ -254,8 +256,9 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf)
void cmGlobalVisualStudio7Generator::Generate()
{
// add a special target that depends on ALL projects for easy build
- // of Debug only
- std::vector<std::string> srcs;
+ // of one configuration only.
+ const char* no_output = 0;
+ std::vector<std::string> no_depends;
std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
for(it = m_ProjectMap.begin(); it!= m_ProjectMap.end(); ++it)
{
@@ -264,12 +267,14 @@ void cmGlobalVisualStudio7Generator::Generate()
if(gen.size())
{
gen[0]->GetMakefile()->
- AddUtilityCommand("ALL_BUILD", "echo","\"Build all projects\"",false,srcs);
+ AddUtilityCommand("ALL_BUILD", false, no_output, no_depends,
+ "echo", "Build all projects");
std::string cmake_command =
m_LocalGenerators[0]->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND");
gen[0]->GetMakefile()->
- AddUtilityCommand("INSTALL", cmake_command.c_str(),
- "-DBUILD_TYPE=$(IntDir) -P cmake_install.cmake",false,srcs);
+ AddUtilityCommand("INSTALL", false, no_output, no_depends,
+ cmake_command.c_str(),
+ "-DBUILD_TYPE=$(IntDir)", "-P", "cmake_install.cmake");
}
}
@@ -394,11 +399,10 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
{
cmCustomCommand cc = l->second.GetPostBuildCommands()[0];
-
- std::string project_name = cc.GetCommand();
- std::string location = cc.GetArguments();
- this->WriteExternalProject(fout, project_name.c_str(),
- location.c_str(), cc.GetDepends());
+ const cmCustomCommandLines& cmds = cc.GetCommandLines();
+ std::string project = cmds[0][0];
+ std::string location = cmds[0][1];
+ this->WriteExternalProject(fout, project.c_str(), location.c_str(), cc.GetDepends());
}
else
{
@@ -481,7 +485,8 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
{
cmCustomCommand cc = l->second.GetPostBuildCommands()[0];
- std::string name = cc.GetCommand();
+ const cmCustomCommandLines& cmds = cc.GetCommandLines();
+ std::string name = cmds[0][0];
std::vector<std::string> depends = cc.GetDepends();
std::vector<std::string>::iterator iter;
int depcount = 0;
@@ -522,7 +527,8 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
if(strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
{
cmCustomCommand cc = l->second.GetPostBuildCommands()[0];
- std::string name = cc.GetCommand();
+ const cmCustomCommandLines& cmds = cc.GetCommandLines();
+ std::string name = cmds[0][0];
this->WriteProjectConfigurations(fout, name.c_str(), l->second.IsInAll());
}
else if ((l->second.GetType() != cmTarget::INSTALL_FILES)