stringapi: Use strings for program paths

This commit is contained in:
Ben Boeckel 2014-02-24 17:38:55 -05:00 committed by Brad King
parent 1a1b737c99
commit 6557382dcf
16 changed files with 38 additions and 31 deletions

View File

@ -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)
{

View File

@ -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,

View File

@ -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.

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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);