Fix for issue #5041 - improve error messages that may occur during ctest_build and ctest_configure.
The improved text gives very clear information when either the CMakeLists.txt or CTestConfig.cmake file is missing. Hopefully, it makes it easier for those poor future souls who encounter these messages to solve their problems quickly.
This commit is contained in:
parent
47bd8637ab
commit
b0d5fa0bc7
|
@ -144,10 +144,17 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmOStringStream ostr;
|
cmOStringStream ostr;
|
||||||
ostr << "CTEST_BUILD_COMMAND or CTEST_CMAKE_GENERATOR not specified. "
|
ostr << "has no project to build. If this is a "
|
||||||
"Please specify the CTEST_CMAKE_GENERATOR and CTEST_PROJECT_NAME if "
|
"\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR "
|
||||||
"this is a CMake project, or specify the CTEST_BUILD_COMMAND for "
|
"and CTEST_PROJECT_NAME are set."
|
||||||
"cmake or any other project.";
|
"\n"
|
||||||
|
"CTEST_PROJECT_NAME is usually set in CTestConfig.cmake. Verify "
|
||||||
|
"that CTestConfig.cmake exists, or CTEST_PROJECT_NAME "
|
||||||
|
"is set in the script, or PROJECT_NAME is passed as an argument "
|
||||||
|
"to ctest_build."
|
||||||
|
"\n"
|
||||||
|
"Alternatively, set CTEST_BUILD_COMMAND to build the project "
|
||||||
|
"with a custom command line.";
|
||||||
this->SetError(ostr.str().c_str());
|
this->SetError(ostr.str().c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,16 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
|
||||||
return 0;
|
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 multiConfig = false;
|
||||||
bool cmakeBuildTypeInOptions = false;
|
bool cmakeBuildTypeInOptions = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue