summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-24 22:38:55 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:38 (GMT)
commit6557382dcffef8ed6b11394cb65775d82f1c0aa7 (patch)
treedf6ca4b09a1eabc6dc4033c8d640ada1ddc8623c
parent1a1b737c99ac0bd0d555fde2fadf77f08516a4ea (diff)
downloadCMake-6557382dcffef8ed6b11394cb65775d82f1c0aa7.zip
CMake-6557382dcffef8ed6b11394cb65775d82f1c0aa7.tar.gz
CMake-6557382dcffef8ed6b11394cb65775d82f1c0aa7.tar.bz2
stringapi: Use strings for program paths
-rw-r--r--Source/cmBuildCommand.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx31
-rw-r--r--Source/cmGlobalGenerator.h8
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx2
-rw-r--r--Source/cmGlobalNinjaGenerator.h2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio6Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.h2
-rw-r--r--Source/cmake.cxx2
16 files changed, 38 insertions, 31 deletions
diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index d8e1a2c..780ffa8 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -107,7 +107,7 @@ bool cmBuildCommand
std::string makecommand = this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->GenerateCMakeBuildCommand(target, configuration,
- 0, true);
+ "", true);
this->Makefile->AddDefinition(variable, makecommand.c_str());
@@ -137,7 +137,7 @@ bool cmBuildCommand
std::string makecommand = this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->GenerateCMakeBuildCommand("", configType.c_str(),
- 0, true);
+ "", true);
if(cacheValue)
{
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 5dee5d7..faed66a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -89,19 +89,25 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts)
return false;
}
-std::string cmGlobalGenerator::SelectMakeProgram(const char* makeProgram,
- std::string makeDefault) const
+std::string cmGlobalGenerator::SelectMakeProgram(
+ const std::string& inMakeProgram,
+ const std::string& makeDefault) const
{
- if(cmSystemTools::IsOff(makeProgram))
+ std::string makeProgram = inMakeProgram;
+ if(cmSystemTools::IsOff(makeProgram.c_str()))
{
- makeProgram =
+ const char* makeProgramCSTR =
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
- if(cmSystemTools::IsOff(makeProgram))
+ if(cmSystemTools::IsOff(makeProgramCSTR))
{
- makeProgram = makeDefault.c_str();
+ makeProgram = makeDefault;
}
- if(cmSystemTools::IsOff(makeProgram) &&
- !(makeProgram && *makeProgram))
+ else
+ {
+ makeProgram = makeProgramCSTR;
+ }
+ if(cmSystemTools::IsOff(makeProgram.c_str()) &&
+ !makeProgram.empty())
{
makeProgram = "CMAKE_MAKE_PROGRAM-NOTFOUND";
}
@@ -1660,13 +1666,14 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir,
mf->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
return this->Build(srcdir,bindir,projectName,
newTarget.c_str(),
- output,0,config,false,fast,
+ output,"",config,false,fast,
this->TryCompileTimeout);
}
void cmGlobalGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const char*, const std::string&,
- const std::string&, const std::string&, const std::string&, bool,
+ std::vector<std::string>& makeCommand, const std::string&,
+ const std::string&, const std::string&, const std::string&,
+ const std::string&, bool,
std::vector<std::string> const&)
{
makeCommand.push_back(
@@ -1677,7 +1684,7 @@ int cmGlobalGenerator::Build(
const std::string&, const std::string& bindir,
const std::string& projectName, const std::string& target,
std::string *output,
- const char *makeCommandCSTR,
+ const std::string& makeCommandCSTR,
const std::string& config,
bool clean, bool fast,
double timeout,
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 38dc63a..91e71a8 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -120,7 +120,7 @@ public:
int Build(const std::string& srcdir, const std::string& bindir,
const std::string& projectName, const std::string& targetName,
std::string *output,
- const char *makeProgram, const std::string& config,
+ const std::string& makeProgram, const std::string& config,
bool clean, bool fast,
double timeout,
cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE,
@@ -129,7 +129,7 @@ public:
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>()
@@ -345,8 +345,8 @@ protected:
cmTarget const*> > AutogensType;
void CreateQtAutoGeneratorsTargets(AutogensType& autogens);
- std::string SelectMakeProgram(const char* makeProgram,
- std::string makeDefault = "") const;
+ std::string SelectMakeProgram(const std::string& makeProgram,
+ const std::string& makeDefault = "") const;
// Fill the ProjectMap, this must be called after LocalGenerators
// has been populated.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 73a6245..785b902 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -551,7 +551,7 @@ bool cmGlobalNinjaGenerator::UsingMinGW = false;
// cmGlobalGenerator::Build()
void cmGlobalNinjaGenerator
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& /*projectName*/,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 2467af9..7725cf3 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -193,7 +193,7 @@ public:
/// Overloaded methods. @see cmGlobalGenerator::GenerateBuildCommand()
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 08a1c62..d41cee6 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -565,7 +565,7 @@ cmGlobalUnixMakefileGenerator3
//----------------------------------------------------------------------------
void cmGlobalUnixMakefileGenerator3
::GenerateBuildCommand(std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& /*projectName*/,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index ea2b6c0..8115176 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -109,7 +109,7 @@ public:
// change the build command for speed
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 2dc658e..840e888 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -312,7 +312,7 @@ std::string cmGlobalVisualStudio10Generator::FindDevEnvCommand()
//----------------------------------------------------------------------------
void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index d3ad69e..999a9d5 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -35,7 +35,7 @@ public:
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 3a51fce..7397bbb 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -116,7 +116,7 @@ std::string cmGlobalVisualStudio6Generator::FindMSDevCommand()
void
cmGlobalVisualStudio6Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 14046f0..2797e11 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -54,7 +54,7 @@ public:
*/
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 03772dd..320b440 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -186,7 +186,7 @@ const char* cmGlobalVisualStudio7Generator::ExternalProjectType(
//----------------------------------------------------------------------------
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 9ab0462..0d2e410 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -62,7 +62,7 @@ public:
*/
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 30bded5..30a2a1e 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -261,7 +261,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
void
cmGlobalXCodeGenerator::GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& /*projectDir*/,
const std::string& targetName,
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 54c6f96..93315ba 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -55,7 +55,7 @@ public:
*/
virtual void GenerateBuildCommand(
std::vector<std::string>& makeCommand,
- const char* makeProgram,
+ const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
const std::string& targetName,
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index abe27a5..ab12411 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2672,7 +2672,7 @@ int cmake::Build(const std::string& dir,
return gen->Build("", dir.c_str(),
projName.c_str(), target.c_str(),
&output,
- 0,
+ "",
config.c_str(), clean, false, 0,
cmSystemTools::OUTPUT_PASSTHROUGH,
nativeOptions);