ENH: Pass -C flag to cmake to generate the apropriate build command
This commit is contained in:
parent
8f4f1c8507
commit
e015e10370
|
@ -31,10 +31,16 @@ bool cmBuildCommand::InitialPass(std::vector<std::string> const& args)
|
||||||
const char* cacheValue
|
const char* cacheValue
|
||||||
= this->Makefile->GetDefinition(define);
|
= this->Makefile->GetDefinition(define);
|
||||||
std::string makeprogram = args[1];
|
std::string makeprogram = args[1];
|
||||||
|
std::string configType = "Release";
|
||||||
|
const char* cfg = getenv("CMAKE_CONFIG_TYPE");
|
||||||
|
if ( cfg )
|
||||||
|
{
|
||||||
|
configType = cfg;
|
||||||
|
}
|
||||||
std::string makecommand = this->Makefile->GetLocalGenerator()
|
std::string makecommand = this->Makefile->GetLocalGenerator()
|
||||||
->GetGlobalGenerator()->GenerateBuildCommand
|
->GetGlobalGenerator()->GenerateBuildCommand
|
||||||
(makeprogram.c_str(), this->Makefile->GetProjectName(), 0,
|
(makeprogram.c_str(), this->Makefile->GetProjectName(), 0,
|
||||||
0, "Release", true, false);
|
0, configType.c_str(), true, false);
|
||||||
|
|
||||||
if(cacheValue)
|
if(cacheValue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1336,6 +1336,12 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
|
||||||
i++;
|
i++;
|
||||||
this->ConfigType = args[i];
|
this->ConfigType = args[i];
|
||||||
cmSystemTools::ReplaceString(this->ConfigType, ".\\", "");
|
cmSystemTools::ReplaceString(this->ConfigType, ".\\", "");
|
||||||
|
if ( !this->ConfigType.empty() )
|
||||||
|
{
|
||||||
|
std::string confTypeEnv
|
||||||
|
= "CMAKE_CONFIG_TYPE=" + this->ConfigType;
|
||||||
|
cmSystemTools::PutEnv(confTypeEnv.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this->CheckArgument(arg, "--debug"))
|
if(this->CheckArgument(arg, "--debug"))
|
||||||
|
|
Loading…
Reference in New Issue