diff options
author | Brad King <brad.king@kitware.com> | 2015-04-16 17:30:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-04-16 19:00:26 (GMT) |
commit | 26b5cc5e79320dd73e93e117fffd0d4554e89dbc (patch) | |
tree | a637252b2a2084f7b384a2f0460c82c324fbe364 /Tests/QtAutogen | |
parent | 4556640855515b287dd8a5a0f7fb1a85218267a8 (diff) | |
download | CMake-26b5cc5e79320dd73e93e117fffd0d4554e89dbc.zip CMake-26b5cc5e79320dd73e93e117fffd0d4554e89dbc.tar.gz CMake-26b5cc5e79320dd73e93e117fffd0d4554e89dbc.tar.bz2 |
Tests/QtAutogen: Enable per-config source tests when possible
Pass CMAKE_BUILD_TYPE into the test on generators that use it so that
the per-config part of the test can activate as needed. Do not make the
per-config part conditional on the Debug configuration because the
generator expressions evaluate to empty in other configurations.
Skip the per-config source case with the Ninja generator because it does
not currently work. cmQtAutoGenerators::InitializeAutogenTarget needs
to know the list of source files on a target, but generator expressions
in the list cannot be evaluated until after CreateGeneratorTargets has
been called. That cannot happen until after Autogen targets have been
generated. It is a chicken-and-egg problem.
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 87ade2c..7b46619 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -67,10 +67,9 @@ add_custom_command( DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" ) -message("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") -if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_TYPES) +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_GENERATOR STREQUAL Ninja) set(debug_srcs "$<$<CONFIG:Debug>:debug_class.cpp>" $<$<CONFIG:Debug>:debug_resource.qrc>) - add_definitions(-DTEST_DEBUG_CLASS) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:TEST_DEBUG_CLASS>) endif() # The -no-protection option disables the generation of include guards. Verify |