diff options
author | Brad King <brad.king@kitware.com> | 2020-07-23 11:07:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-23 11:13:36 (GMT) |
commit | 807c8aa9f010ead006763f4c5343580d46eeb58e (patch) | |
tree | 97a24e70528ae9095b277342d437e68533eb91ad /Tests/RunCMake/ExcludeFromAll | |
parent | 36743436cf9ada77bb6970fb295baa39dc4c79d1 (diff) | |
download | CMake-807c8aa9f010ead006763f4c5343580d46eeb58e.zip CMake-807c8aa9f010ead006763f4c5343580d46eeb58e.tar.gz CMake-807c8aa9f010ead006763f4c5343580d46eeb58e.tar.bz2 |
Tests: Simplify RunCMake.ExcludeFromAll single-config case
Also avoid using parts of an unrelated test (NinjaMultiConfig)
that were not designed for use with all generators.
Diffstat (limited to 'Tests/RunCMake/ExcludeFromAll')
-rw-r--r-- | Tests/RunCMake/ExcludeFromAll/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/ExcludeFromAll/single-config.cmake | 10 |
2 files changed, 4 insertions, 8 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/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>]==]) +]]) |