summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestBuildAndTestHandler.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-05 19:14:13 (GMT)
committerBrad King <brad.king@kitware.com>2014-09-05 19:18:21 (GMT)
commit8d332091702f34fd1e6c1554f137ac6d85b15dc8 (patch)
tree40dbc7fe62f956230bac68faa359078466a3be69 /Source/CTest/cmCTestBuildAndTestHandler.cxx
parentb97736a23d5d83eb65b6ee0b0429ada9fb331c12 (diff)
downloadCMake-8d332091702f34fd1e6c1554f137ac6d85b15dc8.zip
CMake-8d332091702f34fd1e6c1554f137ac6d85b15dc8.tar.gz
CMake-8d332091702f34fd1e6c1554f137ac6d85b15dc8.tar.bz2
CTest: Add options to set generator platform
The ctest_configure command already reads the CTEST_CMAKE_GENERATOR variable to get the value for the cmake -G option. Read new variable CTEST_CMAKE_GENERATOR_PLATFORM to pass on as CMAKE_GENERATOR_PLATFORM. The "ctest --build-and-test" mode already has "--build-generator" to specify the -G option to CMake. Add a "--build-generator-platform" option to specify a value to pass on as CMAKE_GENERATOR_PLATFORM.
Diffstat (limited to 'Source/CTest/cmCTestBuildAndTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 627832c..ece4697 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -68,6 +68,12 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
generator += this->BuildGenerator;
args.push_back(generator);
}
+ if(!this->BuildGeneratorPlatform.empty())
+ {
+ std::string platform = "-DCMAKE_GENERATOR_PLATFORM=";
+ platform += this->BuildGeneratorPlatform;
+ args.push_back(platform);
+ }
if(this->BuildGeneratorToolset.size())
{
std::string toolset = "-T";
@@ -246,6 +252,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
// Make the generator available for the Build call below.
cm.SetGlobalGenerator(cm.CreateGlobalGenerator(
this->BuildGenerator));
+ cm.SetGeneratorPlatform(this->BuildGeneratorPlatform);
cm.SetGeneratorToolset(this->BuildGeneratorToolset);
// Load the cache to make CMAKE_MAKE_PROGRAM available.
@@ -490,6 +497,12 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
idx++;
this->BuildGenerator = allArgs[idx];
}
+ if(currentArg == "--build-generator-platform" &&
+ idx < allArgs.size() - 1)
+ {
+ idx++;
+ this->BuildGeneratorPlatform = allArgs[idx];
+ }
if(currentArg == "--build-generator-toolset" &&
idx < allArgs.size() - 1)
{