summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
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 /Source/cmGlobalGenerator.cxx
parent1a1b737c99ac0bd0d555fde2fadf77f08516a4ea (diff)
downloadCMake-6557382dcffef8ed6b11394cb65775d82f1c0aa7.zip
CMake-6557382dcffef8ed6b11394cb65775d82f1c0aa7.tar.gz
CMake-6557382dcffef8ed6b11394cb65775d82f1c0aa7.tar.bz2
stringapi: Use strings for program paths
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx31
1 files changed, 19 insertions, 12 deletions
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,