From e015e103709fe12c57bd94207002eafa53733088 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Sun, 9 Jul 2006 13:18:15 -0400 Subject: [PATCH] ENH: Pass -C flag to cmake to generate the apropriate build command --- Source/cmBuildCommand.cxx | 8 +++++++- Source/cmCTest.cxx | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 405b463d5..fd3760c5e 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -31,10 +31,16 @@ bool cmBuildCommand::InitialPass(std::vector const& args) const char* cacheValue = this->Makefile->GetDefinition(define); 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() ->GetGlobalGenerator()->GenerateBuildCommand (makeprogram.c_str(), this->Makefile->GetProjectName(), 0, - 0, "Release", true, false); + 0, configType.c_str(), true, false); if(cacheValue) { diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e7fc7e049..6ec234e42 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1336,6 +1336,12 @@ int cmCTest::Run(std::vectorconst& args, std::string* output) i++; this->ConfigType = args[i]; 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"))