[Cmake-commits] CMake branch, next, updated. v3.0.2-5313-geb780b2
Brad King
brad.king at kitware.com
Fri Sep 12 10:50:52 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via eb780b229f7624be6f5bbd1ababd635a74ca3fea (commit)
via c9cad78fd01a6bb7beee682e6dd8cff1fe87d64f (commit)
via 47f32e1b8115bc0e8f3389a76186208f29cbc57d (commit)
via c39e89db6a9b0986f91a95ae383856043338bebe (commit)
via 7eccc3872b19c5988016aa3e43bed6b650c72972 (commit)
via 5a6c9ab4a8d64e6a2cde95edd29eeb3dfb9b5a30 (commit)
from 09063584ea6907bc6bbcb1b425af4a7d34a504ad (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb780b229f7624be6f5bbd1ababd635a74ca3fea
commit eb780b229f7624be6f5bbd1ababd635a74ca3fea
Merge: 0906358 c9cad78
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 12 10:50:50 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Sep 12 10:50:50 2014 -0400
Merge topic 'vs-generator-platform' into next
c9cad78f Tests: Test setting a generator platform in a toolchain file
47f32e1b Tests: Use -A option to pass generator platform selection
c39e89db ExternalProject: Use -A option to pass generator platform
7eccc387 CTest: Use -A option to pass generator platform selection
5a6c9ab4 cmake: Add -A option to specify a generator platform
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9cad78fd01a6bb7beee682e6dd8cff1fe87d64f
commit c9cad78fd01a6bb7beee682e6dd8cff1fe87d64f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 12 10:38:54 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 12 10:45:35 2014 -0400
Tests: Test setting a generator platform in a toolchain file
Teach the RunCMake.GeneratorPlatform test to cover setting
CMAKE_GENERATOR_PLATFORM in a file loaded by CMAKE_TOOLCHAIN_FILE.
diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatform-toolchain.cmake b/Tests/RunCMake/GeneratorPlatform/BadPlatform-toolchain.cmake
new file mode 100644
index 0000000..1c544b0
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/BadPlatform-toolchain.cmake
@@ -0,0 +1 @@
+set(CMAKE_GENERATOR_PLATFORM "Bad Platform")
diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-result.txt b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-stderr.txt b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-stderr.txt
new file mode 100644
index 0000000..e315714
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at CMakeLists.txt:[0-9]+ \(project\):
+ Generator
+
+ .*
+
+ does not support platform specification, but platform
+
+ Bad Platform
+
+ was specified.$
diff --git a/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain.cmake b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain.cmake
new file mode 100644
index 0000000..2fc38e5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/BadPlatformToolchain.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
index 76045f0..4d0a0a1 100644
--- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -16,3 +16,13 @@ set(RunCMake_GENERATOR_TOOLSET "")
set(RunCMake_TEST_OPTIONS -A "Extra Platform")
run_cmake(TwoPlatforms)
unset(RunCMake_TEST_OPTIONS)
+
+if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[0124])( 20[0-9][0-9])?$")
+ set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestPlatform-toolchain.cmake)
+ run_cmake(TestPlatformToolchain)
+ unset(RunCMake_TEST_OPTIONS)
+else()
+ set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/BadPlatform-toolchain.cmake)
+ run_cmake(BadPlatformToolchain)
+ unset(RunCMake_TEST_OPTIONS)
+endif()
diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake b/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake
new file mode 100644
index 0000000..763478c
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake
@@ -0,0 +1 @@
+set(CMAKE_GENERATOR_PLATFORM "Test Platform")
diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-result.txt b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt
new file mode 100644
index 0000000..b9bb3b2
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at TestPlatformToolchain.cmake:[0-9]+ \(message\):
+ CMAKE_GENERATOR_PLATFORM is "Test Platform" as expected.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at TestPlatformToolchain.cmake:[0-9]+ \(message\):
+ CMAKE_VS_PLATFORM_NAME is "Test Platform" as expected.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake
new file mode 100644
index 0000000..c4430a5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake
@@ -0,0 +1,16 @@
+if("x${CMAKE_GENERATOR_PLATFORM}" STREQUAL "xTest Platform")
+ message(SEND_ERROR "CMAKE_GENERATOR_PLATFORM is \"Test Platform\" as expected.")
+else()
+ message(FATAL_ERROR
+ "CMAKE_GENERATOR_PLATFORM is \"${CMAKE_GENERATOR_PLATFORM}\" "
+ "but should be \"Test Platform\"!")
+endif()
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ if("x${CMAKE_VS_PLATFORM_NAME}" STREQUAL "xTest Platform")
+ message(SEND_ERROR "CMAKE_VS_PLATFORM_NAME is \"Test Platform\" as expected.")
+ else()
+ message(FATAL_ERROR
+ "CMAKE_VS_PLATFORM_NAME is \"${CMAKE_VS_PLATFORM_NAME}\" "
+ "but should be \"Test Platform\"!")
+ endif()
+endif()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=47f32e1b8115bc0e8f3389a76186208f29cbc57d
commit 47f32e1b8115bc0e8f3389a76186208f29cbc57d
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 12 10:38:32 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 12 10:45:32 2014 -0400
Tests: Use -A option to pass generator platform selection
This is less verbose than defining CMAKE_GENERATOR_PLATFORM.
diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in
index f23f820..71bcb18 100644
--- a/Tests/CMakeBuildTest.cmake.in
+++ b/Tests/CMakeBuildTest.cmake.in
@@ -12,7 +12,7 @@ message("running: ${CMAKE_COMMAND}")
execute_process(COMMAND "${CMAKE_COMMAND}"
"@CMAKE_BUILD_TEST_SOURCE_DIR@"
"-G at CMAKE_GENERATOR@"
- "-DCMAKE_GENERATOR_PLATFORM=@CMAKE_GENERATOR_PLATFORM@"
+ -A "@CMAKE_GENERATOR_PLATFORM@"
-T "@CMAKE_GENERATOR_TOOLSET@"
WORKING_DIRECTORY "@CMAKE_BUILD_TEST_BINARY_DIR@"
RESULT_VARIABLE RESULT)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 0b4aef7..98e2e76 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1988,7 +1988,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
# A test for ctest_build() with targets in subdirectories
set(ctest_configure_options)
if(CMAKE_GENERATOR_PLATFORM)
- list(APPEND ctest_configure_options -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM})
+ list(APPEND ctest_configure_options -A ${CMAKE_GENERATOR_PLATFORM})
endif()
if(CMAKE_GENERATOR_TOOLSET)
list(APPEND ctest_configure_options -T ${CMAKE_GENERATOR_TOOLSET})
diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in
index 63c0d9e..8d3258b 100644
--- a/Tests/CMakeOnly/Test.cmake.in
+++ b/Tests/CMakeOnly/Test.cmake.in
@@ -9,7 +9,7 @@ file(MAKE_DIRECTORY "${binary_dir}")
execute_process(
COMMAND ${CMAKE_COMMAND} ${CMAKE_ARGS}
"${source_dir}" -G "@CMAKE_GENERATOR@"
- -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
+ -A "@CMAKE_GENERATOR_PLATFORM@"
-T "@CMAKE_GENERATOR_TOOLSET@"
WORKING_DIRECTORY "${binary_dir}"
RESULT_VARIABLE result
diff --git a/Tests/CTestConfig/dashboard.cmake.in b/Tests/CTestConfig/dashboard.cmake.in
index cb01744..143fe71 100644
--- a/Tests/CTestConfig/dashboard.cmake.in
+++ b/Tests/CTestConfig/dashboard.cmake.in
@@ -19,7 +19,7 @@ message("cmake initial configure")
execute_process(COMMAND ${CMAKE_COMMAND}
${arg}
-G "@CMAKE_GENERATOR@"
- -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
+ -A "@CMAKE_GENERATOR_PLATFORM@"
-T "@CMAKE_GENERATOR_TOOLSET@"
${CTEST_SOURCE_DIRECTORY}
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
index 51e768e..6c7bcfe 100644
--- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -13,7 +13,7 @@ macro(check_a_tag desired_tag resulting_sha fetch_expected)
# Configure
execute_process(COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR} -T "${CMAKE_GENERATOR_TOOLSET}"
- -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
+ -A "${CMAKE_GENERATOR_PLATFORM}"
-DTEST_GIT_TAG:STRING=${desired_tag}
${ExternalProjectUpdate_SOURCE_DIR}
WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}
diff --git a/Tests/FortranC/Flags.cmake.in b/Tests/FortranC/Flags.cmake.in
index 9504fec..2300fc6 100644
--- a/Tests/FortranC/Flags.cmake.in
+++ b/Tests/FortranC/Flags.cmake.in
@@ -15,7 +15,7 @@ set(COMMAND)
execute_process(
WORKING_DIRECTORY "${bld}"
COMMAND ${CMAKE_COMMAND} "${src}" -G "@CMAKE_GENERATOR@"
- "-DCMAKE_GENERATOR_PLATFORM=@CMAKE_GENERATOR_PLATFORM@"
+ -A "@CMAKE_GENERATOR_PLATFORM@"
-T "@CMAKE_GENERATOR_TOOLSET@"
"-DFortranC_TEST_FLAGS=1"
"-DCMAKE_C_COMPILER=${bld}/cc.sh"
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index 37dd4f2..73ea05a 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -20,7 +20,7 @@ make_directory("${LIB2_BINARY_DIR}")
# generate lib1
execute_process(
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
- -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
+ -A "${CMAKE_GENERATOR_PLATFORM}"
-T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib1"
WORKING_DIRECTORY ${LIB1_BINARY_DIR}
OUTPUT_VARIABLE OUT
@@ -31,7 +31,7 @@ message("CMAKE Ran with the following output:\n\"${OUT}\"")
# generate lib2
execute_process(
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
- -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
+ -A "${CMAKE_GENERATOR_PLATFORM}"
-T "${CMAKE_GENERATOR_TOOLSET}" "${VSExternalInclude_SOURCE_DIR}/Lib2"
WORKING_DIRECTORY ${LIB2_BINARY_DIR}
OUTPUT_VARIABLE OUT
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c39e89db6a9b0986f91a95ae383856043338bebe
commit c39e89db6a9b0986f91a95ae383856043338bebe
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 12 10:38:06 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 12 10:45:30 2014 -0400
ExternalProject: Use -A option to pass generator platform
This is less verbose than defining CMAKE_GENERATOR_PLATFORM.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 32703b2..79701ac 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1763,7 +1763,7 @@ function(_ep_add_configure_command name)
if(cmake_generator)
list(APPEND cmd "-G${cmake_generator}")
if(cmake_generator_platform)
- list(APPEND cmd "-DCMAKE_GENERATOR_PLATFORM=${cmake_generator_platform}")
+ list(APPEND cmd "-A${cmake_generator_platform}")
endif()
if(cmake_generator_toolset)
list(APPEND cmd "-T${cmake_generator_toolset}")
@@ -1778,7 +1778,7 @@ function(_ep_add_configure_command name)
message(FATAL_ERROR "Option CMAKE_GENERATOR_PLATFORM not allowed without CMAKE_GENERATOR.")
endif()
if(CMAKE_GENERATOR_PLATFORM)
- list(APPEND cmd "-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}")
+ list(APPEND cmd "-A${CMAKE_GENERATOR_PLATFORM}")
endif()
if(cmake_generator_toolset)
message(FATAL_ERROR "Option CMAKE_GENERATOR_TOOLSET not allowed without CMAKE_GENERATOR.")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7eccc3872b19c5988016aa3e43bed6b650c72972
commit 7eccc3872b19c5988016aa3e43bed6b650c72972
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 12 10:37:07 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 12 10:45:19 2014 -0400
CTest: Use -A option to pass generator platform selection
This is less verbose than defining CMAKE_GENERATOR_PLATFORM.
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 += "\"";
}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a6c9ab4a8d64e6a2cde95edd29eeb3dfb9b5a30
commit 5a6c9ab4a8d64e6a2cde95edd29eeb3dfb9b5a30
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 12 09:55:06 2014 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Sep 12 10:42:37 2014 -0400
cmake: Add -A option to specify a generator platform
Define the 'cmake -A' option to set CMAKE_GENERATOR_PLATFORM
without having to spell out the whole variable name. We choose
the name '-A' for "platform" because '-P' is already taken, and
in the common use case the "platform" is actually an architecture
(e.g. x64).
Teach the RunCMake test infrastructure to use -A to pass the generator
platform. Extend the RunCMake.GeneratorPlatform test with a case to
verify that the -A option cannot be repeated.
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index 2079c44..363d0aa 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -51,6 +51,17 @@
See native build system documentation for allowed toolset names.
+``-A <platform-name>``
+ Specify platform name if supported by generator.
+
+ Some CMake generators support a platform name to be given to the
+ native build system to choose a compiler or SDK. This is supported only on
+ specific generators::
+
+ Visual Studio >= 8
+
+ See native build system documentation for allowed platform names.
+
``-Wno-dev``
Suppress developer warnings.
diff --git a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
index 44d7fc4..5809b6a 100644
--- a/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
+++ b/Help/variable/CMAKE_GENERATOR_PLATFORM.rst
@@ -5,6 +5,8 @@ Generator-specific target platform name specified by user.
Some CMake generators support a target platform name to be given
to the native build system to choose a compiler toolchain.
+If the user specifies a toolset name (e.g. via the cmake -A option)
+the value will be available in this variable.
The value of this variable should never be modified by project code.
A toolchain file specified by the :variable:`CMAKE_TOOLCHAIN_FILE`
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."}
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
index 89cc712..76045f0 100644
--- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -10,3 +10,9 @@ else()
set(RunCMake_GENERATOR_PLATFORM "Bad Platform")
run_cmake(BadPlatform)
endif()
+
+set(RunCMake_GENERATOR_TOOLSET "")
+
+set(RunCMake_TEST_OPTIONS -A "Extra Platform")
+run_cmake(TwoPlatforms)
+unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-result.txt b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-stderr.txt b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-stderr.txt
new file mode 100644
index 0000000..90e4eca
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Multiple -A options not allowed
diff --git a/Tests/RunCMake/GeneratorPlatform/TwoPlatforms.cmake b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms.cmake
new file mode 100644
index 0000000..2fc38e5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorPlatform/TwoPlatforms.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index abc3e3d..56d69c8 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -53,7 +53,7 @@ function(run_cmake test)
execute_process(
COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}"
-G "${RunCMake_GENERATOR}"
- "-DCMAKE_GENERATOR_PLATFORM=${RunCMake_GENERATOR_PLATFORM}"
+ -A "${RunCMake_GENERATOR_PLATFORM}"
-T "${RunCMake_GENERATOR_TOOLSET}"
-DRunCMake_TEST=${test}
--no-warn-unused-cli
-----------------------------------------------------------------------
Summary of changes:
Help/manual/OPTIONS_BUILD.txt | 11 ++++++++++
Help/variable/CMAKE_GENERATOR_PLATFORM.rst | 2 ++
Modules/ExternalProject.cmake | 4 ++--
Source/CTest/cmCTestBuildAndTestHandler.cxx | 2 +-
Source/CTest/cmCTestConfigureCommand.cxx | 2 +-
Source/cmake.cxx | 22 ++++++++++++++++++++
Source/cmake.h | 1 +
Tests/CMakeBuildTest.cmake.in | 2 +-
Tests/CMakeLists.txt | 2 +-
Tests/CMakeOnly/Test.cmake.in | 2 +-
Tests/CTestConfig/dashboard.cmake.in | 2 +-
.../ExternalProjectUpdateTest.cmake | 2 +-
Tests/FortranC/Flags.cmake.in | 2 +-
.../GeneratorPlatform/BadPlatform-toolchain.cmake | 1 +
.../BadPlatformToolchain-result.txt} | 0
...-stderr.txt => BadPlatformToolchain-stderr.txt} | 0
...adPlatform.cmake => BadPlatformToolchain.cmake} | 0
.../RunCMake/GeneratorPlatform/RunCMakeTest.cmake | 16 ++++++++++++++
.../GeneratorPlatform/TestPlatform-toolchain.cmake | 1 +
.../TestPlatformToolchain-result.txt} | 0
.../TestPlatformToolchain-stderr.txt | 9 ++++++++
.../GeneratorPlatform/TestPlatformToolchain.cmake | 16 ++++++++++++++
.../TwoPlatforms-result.txt} | 0
.../GeneratorPlatform/TwoPlatforms-stderr.txt | 1 +
.../{BadPlatform.cmake => TwoPlatforms.cmake} | 0
Tests/RunCMake/RunCMake.cmake | 2 +-
Tests/VSExternalInclude/CMakeLists.txt | 4 ++--
27 files changed, 93 insertions(+), 13 deletions(-)
create mode 100644 Tests/RunCMake/GeneratorPlatform/BadPlatform-toolchain.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => GeneratorPlatform/BadPlatformToolchain-result.txt} (100%)
copy Tests/RunCMake/GeneratorPlatform/{BadPlatform-stderr.txt => BadPlatformToolchain-stderr.txt} (100%)
copy Tests/RunCMake/GeneratorPlatform/{BadPlatform.cmake => BadPlatformToolchain.cmake} (100%)
create mode 100644 Tests/RunCMake/GeneratorPlatform/TestPlatform-toolchain.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => GeneratorPlatform/TestPlatformToolchain-result.txt} (100%)
create mode 100644 Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain-stderr.txt
create mode 100644 Tests/RunCMake/GeneratorPlatform/TestPlatformToolchain.cmake
copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => GeneratorPlatform/TwoPlatforms-result.txt} (100%)
create mode 100644 Tests/RunCMake/GeneratorPlatform/TwoPlatforms-stderr.txt
copy Tests/RunCMake/GeneratorPlatform/{BadPlatform.cmake => TwoPlatforms.cmake} (100%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list