diff options
Diffstat (limited to 'Source/CTest/cmCTestConfigureCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestConfigureCommand.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index 1ad4e24..9a668bc 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -89,6 +89,16 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() return 0; } + const std::string cmakelists_file = source_dir + "/CMakeLists.txt"; + if ( !cmSystemTools::FileExists(cmakelists_file.c_str()) ) + { + cmOStringStream e; + e << "CMakeLists.txt file does not exist [" + << cmakelists_file << "]"; + this->SetError(e.str().c_str()); + return 0; + } + bool multiConfig = false; bool cmakeBuildTypeInOptions = false; @@ -122,7 +132,8 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() } } - if (!multiConfig && !cmakeBuildTypeInOptions) + if (!multiConfig && !cmakeBuildTypeInOptions && + !this->CTest->GetConfigType().empty()) { cmakeConfigureCommand += " \"-DCMAKE_BUILD_TYPE:STRING="; cmakeConfigureCommand += this->CTest->GetConfigType(); |