diff options
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index d7fcaa5..ba20dfc 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1546,14 +1546,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i, i < args.size() - 1) { 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()); - } + this->SetConfigType(args[i].c_str()); } if(this->CheckArgument(arg, "--debug")) @@ -1848,7 +1841,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output) #ifdef CMAKE_INTDIR if(this->ConfigType.size() == 0) { - this->ConfigType = CMAKE_INTDIR; + this->SetConfigType(CMAKE_INTDIR); } #endif @@ -2293,6 +2286,16 @@ void cmCTest::AddCTestConfigurationOverwrite(const char* encstr) } //---------------------------------------------------------------------- +void cmCTest::SetConfigType(const char* ct) +{ + this->ConfigType = ct?ct:""; + cmSystemTools::ReplaceString(this->ConfigType, ".\\", ""); + std::string confTypeEnv + = "CMAKE_CONFIG_TYPE=" + this->ConfigType; + cmSystemTools::PutEnv(confTypeEnv.c_str()); +} + +//---------------------------------------------------------------------- bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, const char* dconfig, const char* cmake_var) { |