summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio8Generator.cxx
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-13 17:44:37 (GMT)
committerDaniel Eiband <daniel.eiband@brainlab.com>2019-09-16 18:45:41 (GMT)
commit7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d (patch)
treefed5733ab7c5219c0f5377a2b3fcb2674ac27b55 /Source/cmGlobalVisualStudio8Generator.cxx
parent1ac4e0ef1b29affc9e4f2cd86c4fc8c2252f2ab2 (diff)
downloadCMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.zip
CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.tar.gz
CMake-7f3ecbe7d7210667770d3212e2bfdb0c701cdc5d.tar.bz2
cmCustomCommandLine: Provide command line make functions
Reduce boilerplate necessary to create custom command lines by introducing and applying cmMakeCommandLine and cmMakeSingleCommandLine functions.
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx22
1 files changed, 6 insertions, 16 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 18ff9ac..255739d 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -3,6 +3,7 @@
#include "cmGlobalVisualStudio8Generator.h"
#include "cmCustomCommand.h"
+#include "cmCustomCommandLines.h"
#include "cmDocumentationEntry.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
@@ -146,12 +147,8 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
// Add a custom prebuild target to run the VerifyGlobs script.
cmake* cm = this->GetCMakeInstance();
if (cm->DoWriteGlobVerifyTarget()) {
- cmCustomCommandLine verifyCommandLine;
- verifyCommandLine.push_back(cmSystemTools::GetCMakeCommand());
- verifyCommandLine.push_back("-P");
- verifyCommandLine.push_back(cm->GetGlobVerifyScript());
- cmCustomCommandLines verifyCommandLines;
- verifyCommandLines.push_back(verifyCommandLine);
+ cmCustomCommandLines verifyCommandLines = cmMakeSingleCommandLine(
+ { cmSystemTools::GetCMakeCommand(), "-P", cm->GetGlobVerifyScript() });
std::vector<std::string> byproducts;
byproducts.push_back(cm->GetGlobVerifyStamp());
@@ -173,20 +170,13 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
listFiles.erase(new_end, listFiles.end());
// Create a rule to re-run CMake.
- cmCustomCommandLine commandLine;
- commandLine.push_back(cmSystemTools::GetCMakeCommand());
std::string argS = cmStrCat("-S", lg->GetSourceDirectory());
- commandLine.push_back(argS);
std::string argB = cmStrCat("-B", lg->GetBinaryDirectory());
- commandLine.push_back(argB);
- commandLine.push_back("--check-stamp-list");
- commandLine.push_back(stampList.c_str());
- commandLine.push_back("--vs-solution-file");
std::string const sln =
lg->GetBinaryDirectory() + "/" + lg->GetProjectName() + ".sln";
- commandLine.push_back(sln);
- cmCustomCommandLines commandLines;
- commandLines.push_back(commandLine);
+ cmCustomCommandLines commandLines = cmMakeSingleCommandLine(
+ { cmSystemTools::GetCMakeCommand(), argS, argB, "--check-stamp-list",
+ stampList, "--vs-solution-file", sln });
// Add the rule. Note that we cannot use the CMakeLists.txt
// file as the main dependency because it would get