summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-15 14:27:38 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-09-15 14:27:38 (GMT)
commitb234836637d97b2d9cc837829c485ec87e64c5ce (patch)
tree294c854c5146ac45b5598f7220c36a4a4c7b8b6e /Source
parent9edf6903e62f84a567db3938bb8fec3f19789545 (diff)
parentbe6a555d7ec9348575e3431bd6709f48dc959100 (diff)
downloadCMake-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.cxx2
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx2
-rw-r--r--Source/cmake.cxx22
-rw-r--r--Source/cmake.h1
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."}