Browse Source

ctest_build: Do not require unnecessary [CTEST_]PROJECT_NAME value

Since commit v3.0.0-rc1~260^2~32 (ctest_build: Use "cmake --build"
to launch the native build tool, 2013-11-14) we no longer need to
use the project name in `ctest_build()`.

Fixes: #18612
pull/324/head
Regina Pfeifer 7 years ago
parent
commit
3125c47d27
  1. 4
      Help/command/ctest_build.rst
  2. 16
      Source/CTest/cmCTestBuildCommand.cxx

4
Help/command/ctest_build.rst

@ -50,9 +50,7 @@ The options are:
for an example.
``PROJECT_NAME <project-name>``
Set the name of the project to build. This should correspond
to the top-level call to the :command:`project` command.
If not specified the ``CTEST_PROJECT_NAME`` variable will be checked.
Ignored. This was once used but is no longer needed.
``TARGET <target-name>``
Specify the name of a target to build. If not specified the

16
Source/CTest/cmCTestBuildCommand.cxx

@ -53,10 +53,6 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
} else {
const char* cmakeGeneratorName =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR");
const char* cmakeProjectName =
(this->Values[ctb_PROJECT_NAME] && *this->Values[ctb_PROJECT_NAME])
? this->Values[ctb_PROJECT_NAME]
: this->Makefile->GetDefinition("CTEST_PROJECT_NAME");
// Build configuration is determined by: CONFIGURATION argument,
// or CTEST_BUILD_CONFIGURATION script variable, or
@ -81,8 +77,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
? this->Values[ctb_TARGET]
: this->Makefile->GetDefinition("CTEST_BUILD_TARGET");
if (cmakeGeneratorName && *cmakeGeneratorName && cmakeProjectName &&
*cmakeProjectName) {
if (cmakeGeneratorName && *cmakeGeneratorName) {
if (!cmakeBuildConfiguration) {
cmakeBuildConfiguration = "Release";
}
@ -132,14 +127,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
/* clang-format off */
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 "
"is set. Otherwise, set CTEST_BUILD_COMMAND to build the project "
"with a custom command line.";
/* clang-format on */
this->SetError(ostr.str());

Loading…
Cancel
Save