diff options
author | Brad King <brad.king@kitware.com> | 2013-11-14 15:14:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-18 16:30:49 (GMT) |
commit | 96966b5c804a95677e43e3938c52afbd42b5d48a (patch) | |
tree | e6ec04b9ecf297d615700df84f041d8d3f31bf87 /Source/CTest | |
parent | 91a021146c7a8eb256eca7bb3d9be3acfe3ce814 (diff) | |
download | CMake-96966b5c804a95677e43e3938c52afbd42b5d48a.zip CMake-96966b5c804a95677e43e3938c52afbd42b5d48a.tar.gz CMake-96966b5c804a95677e43e3938c52afbd42b5d48a.tar.bz2 |
ctest: Make the --build-makeprogram optional for --build-and-test
GenerateBuildCommand now knows how to lookup CMAKE_MAKE_PROGRAM or
choose a generator-provided default build tool. Therefore the
--build-makeprogram can now be optional and simply override the
default selection when provided.
Note that with --build-nocmake we now need to load the cache in order to
make the CMAKE_MAKE_PROGRAM entry available to GenerateBuildCommand.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 5e53dbe..807a7e8 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -18,6 +18,7 @@ #include "cmGlobalGenerator.h" #include <cmsys/Process.h> #include "cmCTestTestHandler.h" +#include "cmCacheManager.h" //---------------------------------------------------------------------- cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() @@ -184,14 +185,14 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) cmOStringStream out; // if the generator and make program are not specified then it is an error - if (!this->BuildGenerator.size() || !this->BuildMakeProgram.size()) + if (!this->BuildGenerator.size()) { if(outstring) { *outstring = - "--build-and-test requires that both the generator and makeprogram " - "be provided using the --build-generator and --build-makeprogram " - "command line options. "; + "--build-and-test requires that the generator " + "be provided using the --build-generator " + "command line option. "; } return 1; } @@ -238,9 +239,13 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) if(this->BuildNoCMake) { + // Make the generator available for the Build call below. cm.SetGlobalGenerator(cm.CreateGlobalGenerator( this->BuildGenerator.c_str())); cm.SetGeneratorToolset(this->BuildGeneratorToolset); + + // Load the cache to make CMAKE_MAKE_PROGRAM available. + cm.GetCacheManager()->LoadCache(this->BinaryDir.c_str()); } else { |