summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-27 14:40:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-07-27 14:40:56 (GMT)
commit11cf196fd2c8eca6427cf65755895641c60fe1fe (patch)
treed7d04a830582f818954f7bc094316165f9d1910e /Tests/RunCMake
parent097a302da0e829c83e28ec42737ce5285ec000fd (diff)
parent22bd2673889ac1ba49e8842959065068826f9368 (diff)
downloadCMake-11cf196fd2c8eca6427cf65755895641c60fe1fe.zip
CMake-11cf196fd2c8eca6427cf65755895641c60fe1fe.tar.gz
CMake-11cf196fd2c8eca6427cf65755895641c60fe1fe.tar.bz2
Merge topic 'EXCLUDE_FROM_ALL-genex'
22bd267388 Help: Add release note for EXCLUDE_FROM_ALL genex support 807c8aa9f0 Tests: Simplify RunCMake.ExcludeFromAll single-config case 36743436cf Tests: Fix RunCMake.ExcludeFromAll test program warning 99c131c5a3 cmGlobalGenerator: Fix spelling of EXCLUDE_FROM_ALL in error message Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5049
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt2
-rw-r--r--Tests/RunCMake/ExcludeFromAll/main.c1
-rw-r--r--Tests/RunCMake/ExcludeFromAll/single-config.cmake10
4 files changed, 6 insertions, 9 deletions
diff --git a/Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake b/Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake
index 25201e4..2b4fc89 100644
--- a/Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake
@@ -9,7 +9,7 @@ function(run_single_config_test label config exclude_from_all_value expectation)
-DCMAKE_BUILD_TYPE=${config}
-DTOOL_EXCLUDE_FROM_ALL=${exclude_from_all_value})
set(RunCMake_TEST_NO_CLEAN 1)
- include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+ include(${RunCMake_TEST_BINARY_DIR}/target_files_${config}.cmake)
run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config ${config})
endfunction()
diff --git a/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt b/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt
index eee5278..6dc785f 100644
--- a/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt
+++ b/Tests/RunCMake/ExcludeFromAll/error-on-mixed-config-stderr.txt
@@ -1,3 +1,3 @@
CMake Error in CMakeLists.txt:
- The EXCLUDED_FROM_ALL property of target "release_only_tool" varies by
+ The EXCLUDE_FROM_ALL property of target "release_only_tool" varies by
configuration. This is not supported by the "[^"]+"
diff --git a/Tests/RunCMake/ExcludeFromAll/main.c b/Tests/RunCMake/ExcludeFromAll/main.c
index 5047a34..f8b643a 100644
--- a/Tests/RunCMake/ExcludeFromAll/main.c
+++ b/Tests/RunCMake/ExcludeFromAll/main.c
@@ -1,3 +1,4 @@
int main()
{
+ return 0;
}
diff --git a/Tests/RunCMake/ExcludeFromAll/single-config.cmake b/Tests/RunCMake/ExcludeFromAll/single-config.cmake
index 71a9f06..aa49c21 100644
--- a/Tests/RunCMake/ExcludeFromAll/single-config.cmake
+++ b/Tests/RunCMake/ExcludeFromAll/single-config.cmake
@@ -2,10 +2,6 @@ enable_language(C)
add_executable(tool main.c)
set_property(TARGET tool PROPERTY EXCLUDE_FROM_ALL "${TOOL_EXCLUDE_FROM_ALL}")
-include(../NinjaMultiConfig/Common.cmake)
-set(orig_CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES})
-if("${CMAKE_CONFIGURATION_TYPES}" STREQUAL "")
- set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
-endif()
-generate_output_files(tool)
-set(CMAKE_CONFIGURATION_TYPES ${orig_CMAKE_CONFIGURATION_TYPES})
+file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/target_files_$<CONFIG>.cmake" CONTENT [[
+set(TARGET_FILE_tool_$<CONFIG> [==[$<TARGET_FILE:tool>]==])
+]])