summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx15
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx10
2 files changed, 21 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 7a4d877..b984e85 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -144,10 +144,17 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
else
{
cmOStringStream ostr;
- ostr << "CTEST_BUILD_COMMAND or CTEST_CMAKE_GENERATOR not specified. "
- "Please specify the CTEST_CMAKE_GENERATOR and CTEST_PROJECT_NAME if "
- "this is a CMake project, or specify the CTEST_BUILD_COMMAND for "
- "cmake or any other project.";
+ ostr << "has no project to build. If this is a "
+ "\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR "
+ "and CTEST_PROJECT_NAME are set."
+ "\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());
return 0;
}
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index 1ad4e24..147173f 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;