diff options
author | Brad King <brad.king@kitware.com> | 2020-10-20 20:37:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-16 19:04:30 (GMT) |
commit | 92d7b456e581453cf7a223c60c8734a88d887534 (patch) | |
tree | 99970c99741a78116befb01a1b4c4f90f8da5e95 /Tests/QtAutogen/AutogenOriginDependsOff | |
parent | 3ffebbaefb876f40c2d2751b58800cacf4951407 (diff) | |
download | CMake-92d7b456e581453cf7a223c60c8734a88d887534.zip CMake-92d7b456e581453cf7a223c60c8734a88d887534.tar.gz CMake-92d7b456e581453cf7a223c60c8734a88d887534.tar.bz2 |
Autogen: Add support for per-config sources
Fixes: #20682
Diffstat (limited to 'Tests/QtAutogen/AutogenOriginDependsOff')
-rw-r--r-- | Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt index d9fc2b0..17855ff 100644 --- a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt +++ b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt @@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.11) project(AutogenOriginDependsOff) include("../AutogenCoreTest.cmake") +get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +# XXX(xcode-per-cfg-src): Enable multi-config code path for Xcode +# when the Xcode generator supports per-config sources. +if(_isMultiConfig AND NOT CMAKE_GENERATOR STREQUAL "Xcode") + set(mocs_compilation_cpp "mocs_compilation_$<CONFIG>.cpp") +else() + set(mocs_compilation_cpp "mocs_compilation.cpp") +endif() + set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) set(CBD ${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CSD}) @@ -19,7 +28,7 @@ add_custom_command ( add_custom_target ( a_mc COMMAND ${CMAKE_COMMAND} -E sleep 2 COMMAND ${CMAKE_COMMAND} - "-DMCF=${CBD}/a_qt_autogen/mocs_compilation.cpp" + "-DMCF=${CBD}/a_qt_autogen/${mocs_compilation_cpp}" "-DCF_IN=${CSD}/a_mc.hpp.in" "-DCF_OUT=${CBD}/a_mc.hpp" -P ${CSD}/configure_content.cmake @@ -51,7 +60,7 @@ add_custom_command ( DEPENDS b_qt_autogen COMMAND ${CMAKE_COMMAND} -E sleep 2 COMMAND ${CMAKE_COMMAND} - "-DMCF=${CBD}/b_qt_autogen/mocs_compilation.cpp" + "-DMCF=${CBD}/b_qt_autogen/${mocs_compilation_cpp}" "-DCF_IN=${CSD}/b_mc.cpp.in" "-DCF_OUT=${CBD}/b_mc.cpp" -P ${CSD}/configure_content.cmake |