diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-02-24 22:38:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-08 18:05:38 (GMT) |
commit | 6557382dcffef8ed6b11394cb65775d82f1c0aa7 (patch) | |
tree | df6ca4b09a1eabc6dc4033c8d640ada1ddc8623c /Source/cmGlobalGenerator.cxx | |
parent | 1a1b737c99ac0bd0d555fde2fadf77f08516a4ea (diff) | |
download | CMake-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.cxx | 31 |
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, |