summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2013-03-14 14:11:47 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-19 11:26:41 +0100
commitbc1fb206bbff765310cbf2c122e3617c94efced0 (patch)
tree67983aab4735dd4567eae21bfad4827fa7f6ccad
parent9bf5870eb9a4e4449eda731029db5af2bcea39a3 (diff)
Run CMake dbus tests if dbus is expected to be available.
Instead of first finding it and then testing that we can find it. Change-Id: I1a1090693520b1d6adadef93839f25d277947e76 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
-rw-r--r--mkspecs/features/ctest_testcase.prf1
-rw-r--r--src/corelib/Qt5CTestMacros.cmake3
-rw-r--r--tests/auto/cmake/CMakeLists.txt6
3 files changed, 6 insertions, 4 deletions
diff --git a/mkspecs/features/ctest_testcase.prf b/mkspecs/features/ctest_testcase.prf
index dfbb765a25..58c683ff05 100644
--- a/mkspecs/features/ctest_testcase.prf
+++ b/mkspecs/features/ctest_testcase.prf
@@ -45,6 +45,7 @@ isEmpty(CMAKE_VERSION) {
CMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\"
!qtHaveModule(widgets): CMAKE_MODULE_DEFINES += -DNO_WIDGETS=True
+ !qtHaveModule(dbus): CMAKE_MODULE_DEFINES += -DNO_DBUS=True
dependentmodules = $$resolve_depends(CMAKE_QT_MODULES_UNDER_TEST, "QT.")
dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST
diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake
index 5d0dc60607..b313cd5c08 100644
--- a/src/corelib/Qt5CTestMacros.cmake
+++ b/src/corelib/Qt5CTestMacros.cmake
@@ -22,6 +22,9 @@ endif()
if (NO_WIDGETS)
list(APPEND BUILD_OPTIONS_LIST "-DNO_WIDGETS=True")
endif()
+if (NO_DBUS)
+ list(APPEND BUILD_OPTIONS_LIST "-DNO_DBUS=True")
+endif()
macro(expect_pass _dir)
string(REPLACE "(" "_" testname "${_dir}")
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 4cc0505a8c..7be3116cbd 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -64,9 +64,7 @@ expect_fail(test_wrap_cpp_options)
expect_pass(test_platform_defs_include)
expect_pass(test_qtmainwin_library)
-# If Qt D-Bus has been installed then run the tests for its macros.
-find_package(Qt5DBus QUIET)
-if (Qt5DBus_FOUND AND NOT APPLE)
+if (NOT NO_DBUS)
expect_pass(test_dbus_module)
endif()
expect_pass(test_multiple_find_package)
@@ -110,7 +108,7 @@ if (NOT NO_WIDGETS)
)
endif()
-if (UNIX AND NOT APPLE AND NOT QNXNTO)
+if (NOT NO_DBUS)
list(APPEND qt_module_includes
DBus QDBusMessage
)