diff options
author | Brad King <brad.king@kitware.com> | 2014-09-15 14:27:38 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-09-15 14:27:38 (GMT) |
commit | b234836637d97b2d9cc837829c485ec87e64c5ce (patch) | |
tree | 294c854c5146ac45b5598f7220c36a4a4c7b8b6e /Source | |
parent | 9edf6903e62f84a567db3938bb8fec3f19789545 (diff) | |
parent | be6a555d7ec9348575e3431bd6709f48dc959100 (diff) | |
download | CMake-b234836637d97b2d9cc837829c485ec87e64c5ce.zip CMake-b234836637d97b2d9cc837829c485ec87e64c5ce.tar.gz CMake-b234836637d97b2d9cc837829c485ec87e64c5ce.tar.bz2 |
Merge topic 'vs-generator-platform'
be6a555d Tests: Test setting a generator platform in a toolchain file
d506fee8 Tests: Use -A option to pass generator platform selection
11c9ddd6 ExternalProject: Use -A option to pass generator platform
29bd843e CTest: Use -A option to pass generator platform selection
eb7d8156 cmake: Add -A option to specify a generator platform
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestConfigureCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmake.cxx | 22 | ||||
-rw-r--r-- | Source/cmake.h | 1 |
4 files changed, 25 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index ece4697..41db042 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -70,7 +70,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, } if(!this->BuildGeneratorPlatform.empty()) { - std::string platform = "-DCMAKE_GENERATOR_PLATFORM="; + std::string platform = "-A"; platform += this->BuildGeneratorPlatform; args.push_back(platform); } diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index 8ab5037..ef62fd3 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -122,7 +122,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_PLATFORM"); if(cmakeGeneratorPlatform && *cmakeGeneratorPlatform) { - cmakeConfigureCommand += " \"-DCMAKE_GENERATOR_PLATFORM="; + cmakeConfigureCommand += " \"-A"; cmakeConfigureCommand += cmakeGeneratorPlatform; cmakeConfigureCommand += "\""; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c9c63c7..09d270d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -639,6 +639,7 @@ void cmake::SetArgs(const std::vector<std::string>& args, { bool directoriesSet = directoriesSetBefore; bool haveToolset = false; + bool havePlatform = false; for(unsigned int i=1; i < args.size(); ++i) { std::string arg = args[i]; @@ -767,6 +768,27 @@ void cmake::SetArgs(const std::vector<std::string>& args, "uninitialized variables.\n"; this->SetCheckSystemVars(true); } + else if(arg.find("-A",0) == 0) + { + std::string value = arg.substr(2); + if(value.size() == 0) + { + ++i; + if(i >= args.size()) + { + cmSystemTools::Error("No platform specified for -A"); + return; + } + value = args[i]; + } + if(havePlatform) + { + cmSystemTools::Error("Multiple -A options not allowed"); + return; + } + this->GeneratorPlatform = value; + havePlatform = true; + } else if(arg.find("-T",0) == 0) { std::string value = arg.substr(2); diff --git a/Source/cmake.h b/Source/cmake.h index 919fc24..60ffcd4 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -476,6 +476,7 @@ private: {"-U <globbing_expr>", "Remove matching entries from CMake cache."}, \ {"-G <generator-name>", "Specify a build system generator."},\ {"-T <toolset-name>", "Specify toolset name if supported by generator."}, \ + {"-A <platform-name>", "Specify platform name if supported by generator."}, \ {"-Wno-dev", "Suppress developer warnings."},\ {"-Wdev", "Enable developer warnings."} |