summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/CMakeLists.txt9
-rw-r--r--Tests/QtAutogen/CMakeLists.txt5
2 files changed, 9 insertions, 5 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")
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