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>
This commit is contained in:
Stephen Kelly 2013-03-14 14:11:47 +01:00 committed by The Qt Project
parent 9bf5870eb9
commit bc1fb206bb
3 changed files with 6 additions and 4 deletions

View File

@ -45,6 +45,7 @@ isEmpty(CMAKE_VERSION) {
CMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\" CMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\"
!qtHaveModule(widgets): CMAKE_MODULE_DEFINES += -DNO_WIDGETS=True !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 = $$resolve_depends(CMAKE_QT_MODULES_UNDER_TEST, "QT.")
dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST

View File

@ -22,6 +22,9 @@ endif()
if (NO_WIDGETS) if (NO_WIDGETS)
list(APPEND BUILD_OPTIONS_LIST "-DNO_WIDGETS=True") list(APPEND BUILD_OPTIONS_LIST "-DNO_WIDGETS=True")
endif() endif()
if (NO_DBUS)
list(APPEND BUILD_OPTIONS_LIST "-DNO_DBUS=True")
endif()
macro(expect_pass _dir) macro(expect_pass _dir)
string(REPLACE "(" "_" testname "${_dir}") string(REPLACE "(" "_" testname "${_dir}")

View File

@ -64,9 +64,7 @@ expect_fail(test_wrap_cpp_options)
expect_pass(test_platform_defs_include) expect_pass(test_platform_defs_include)
expect_pass(test_qtmainwin_library) expect_pass(test_qtmainwin_library)
# If Qt D-Bus has been installed then run the tests for its macros. if (NOT NO_DBUS)
find_package(Qt5DBus QUIET)
if (Qt5DBus_FOUND AND NOT APPLE)
expect_pass(test_dbus_module) expect_pass(test_dbus_module)
endif() endif()
expect_pass(test_multiple_find_package) expect_pass(test_multiple_find_package)
@ -110,7 +108,7 @@ if (NOT NO_WIDGETS)
) )
endif() endif()
if (UNIX AND NOT APPLE AND NOT QNXNTO) if (NOT NO_DBUS)
list(APPEND qt_module_includes list(APPEND qt_module_includes
DBus QDBusMessage DBus QDBusMessage
) )