summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-16 17:30:32 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-16 19:00:26 (GMT)
commit26b5cc5e79320dd73e93e117fffd0d4554e89dbc (patch)
treea637252b2a2084f7b384a2f0460c82c324fbe364 /Tests/CMakeLists.txt
parent4556640855515b287dd8a5a0f7fb1a85218267a8 (diff)
downloadCMake-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/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 41032f8..1655f12 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1173,10 +1173,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
set(run_autogen_test QtAutogen)
set(run_autouic_test QtAutoUicInterface)
endif()
+ if(NOT CMAKE_CONFIGURATION_TYPES)
+ set(QtAutogen_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+ endif()
find_package(Qt5Widgets QUIET NO_MODULE)
if(Qt5Widgets_FOUND)
- add_test(Qt5Autogen ${CMAKE_CTEST_COMMAND}
+ add_test(NAME Qt5Autogen COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/QtAutogen"
"${CMake_BINARY_DIR}/Tests/Qt5Autogen"
@@ -1186,6 +1189,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--force-new-ctest-process
--build-options ${build_options}
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
+ ${QtAutogen_BUILD_OPTIONS}
--test-command ${run_autogen_test}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen")
@@ -1205,7 +1209,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface")
endif()
if(QT4_WORKS AND QT_QTGUI_FOUND)
- add_test(Qt4Autogen ${CMAKE_CTEST_COMMAND}
+ add_test(NAME Qt4Autogen COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/QtAutogen"
"${CMake_BINARY_DIR}/Tests/Qt4Autogen"
@@ -1215,6 +1219,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--force-new-ctest-process
--build-options ${build_options}
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
+ ${QtAutogen_BUILD_OPTIONS}
--test-command ${run_autogen_test}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen")