Warning, /plasma/plasma-integration/qt5/autotests/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 include(ECMMarkAsTest)
0002 include(ECMMarkNonGuiExecutable)
0003
0004 find_package(Qt5Test ${QT5_MIN_VERSION} CONFIG QUIET)
0005 find_package(Qt5Qml ${QT5_MIN_VERSION} CONFIG QUIET)
0006
0007 if(NOT Qt5Test_FOUND)
0008 message(STATUS "Qt5Test not found, autotests will not be built.")
0009 return()
0010 endif()
0011
0012 if(NOT Qt5Qml_FOUND)
0013 message(STATUS "Qt5Qml not found, QML autotests will not be built.")
0014 endif()
0015
0016 set(CONFIGFILE "${CMAKE_CURRENT_SOURCE_DIR}/kdeplatformtheme_kdeglobals")
0017 set(CHANGED_CONFIGFILE "${CMAKE_CURRENT_SOURCE_DIR}/kdeplatformtheme_changed_kdeglobals")
0018 configure_file(kdeplatformtheme_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/kdeplatformtheme_config.h)
0019
0020 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
0021 # qdbusmenubar uses them
0022 remove_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
0023
0024 macro(FRAMEWORKINTEGRATION_TESTS _testname)
0025 add_executable(${_testname}5 ${_testname}.cpp ${ARGN})
0026 set_target_properties(${_testname}5 PROPERTIES COMPILE_FLAGS "-DUNIT_TEST")
0027 add_test(NAME frameworkintegration-${_testname}5 COMMAND ${_testname}5)
0028 ecm_mark_as_test(${_testname}5)
0029 ecm_mark_nongui_executable(${_testname}5)
0030 target_include_directories(${_testname}5 PRIVATE ${CMAKE_BINARY_DIR}/qt5/src/platformtheme)
0031 target_link_libraries(${_testname}5
0032 Qt5::GuiPrivate
0033 Qt5::Test
0034 Qt5::DBus
0035 Qt5::QuickControls2
0036 ${QT5PLATFORMSUPPORT_LIBS}
0037 KF5::ConfigWidgets
0038 KF5::ConfigCore
0039 KF5::IconThemes
0040 KF5::KIOFileWidgets
0041 KF5::I18n
0042 KF5::Notifications
0043 KF5::WindowSystem
0044 KF5::GuiAddons
0045 Qt5::WaylandClient
0046 XCB::XCB
0047 Wayland::Client
0048 KF5::WaylandClient
0049 KF5::XmlGui
0050 Qt5::X11Extras
0051 )
0052 endmacro()
0053
0054 set(dbus_interface)
0055 qt5_add_dbus_interface(dbus_interface ../src/platformtheme/org.kde.StatusNotifierWatcher.xml statusnotifierwatcher_interface)
0056
0057 frameworkintegration_tests(
0058 kdeplatformtheme_unittest
0059 )
0060 set(wayland_interfaces)
0061 ecm_add_qtwayland_client_protocol(wayland_interfaces
0062 PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/appmenu.xml
0063 BASENAME appmenu
0064 )
0065
0066 ecm_add_qtwayland_client_protocol(wayland_interfaces
0067 PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/server-decoration-palette.xml
0068 BASENAME server-decoration-palette
0069 )
0070
0071 target_sources(kdeplatformtheme_unittest5 PRIVATE
0072 ../src/platformtheme/kdeplatformtheme.cpp ../src/platformtheme/kdeplatformtheme.h
0073 ../src/platformtheme/kfontsettingsdata.cpp ../src/platformtheme/kfontsettingsdata.h
0074 ../src/platformtheme/khintssettings.cpp ../src/platformtheme/khintssettings.h
0075 ../src/platformtheme/kdeplatformfiledialoghelper.cpp ../src/platformtheme/kdeplatformfiledialoghelper.h
0076 ../src/platformtheme/kdeplatformfiledialogbase.cpp
0077 ../src/platformtheme/kdeplatformsystemtrayicon.cpp ../src/platformtheme/kdeplatformsystemtrayicon.h
0078 ../src/platformtheme/kdirselectdialog.cpp
0079 ../src/platformtheme/kfiletreeview.cpp
0080 ../src/platformtheme/kwaylandintegration.cpp ../src/platformtheme/kwaylandintegration.h
0081 ../src/platformtheme/x11integration.cpp ../src/platformtheme/x11integration.h
0082 ../src/platformtheme/qxdgdesktopportalfiledialog.cpp
0083 ${dbus_interface}
0084 ${wayland_interfaces}
0085 )
0086 target_sources(kdeplatformtheme_unittest5 PRIVATE
0087 ../src/platformtheme/qdbusmenubar.cpp # fork of Qt's qdbusmenubar with some added setters for our convenience
0088 )
0089
0090 frameworkintegration_tests(
0091 kfontsettingsdata_unittest
0092 ../src/platformtheme/kfontsettingsdata.cpp ../src/platformtheme/kfontsettingsdata.h
0093 )
0094
0095 frameworkintegration_tests(
0096 kfiledialog_unittest
0097 )
0098
0099 frameworkintegration_tests(
0100 ksni_unittest
0101 )
0102
0103 frameworkintegration_tests(
0104 kdeplatformsystemtrayicon_unittest
0105 ../src/platformtheme/kdeplatformsystemtrayicon.cpp ../src/platformtheme/kdeplatformsystemtrayicon.h
0106 ${dbus_interface}
0107 )
0108
0109 frameworkintegration_tests(
0110 kdirselectdialog_unittest
0111 ../src/platformtheme/kdeplatformfiledialogbase.cpp
0112 ../src/platformtheme/kdirselectdialog.cpp
0113 ../src/platformtheme/kfiletreeview.cpp
0114 )
0115
0116 frameworkintegration_tests(
0117 khintssettings_unittest
0118 ../src/platformtheme/khintssettings.cpp ../src/platformtheme/khintssettings.h
0119 )
0120
0121 if(Qt5Qml_FOUND)
0122 add_test(NAME qmltests5 COMMAND qmltestrunner WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
0123
0124 frameworkintegration_tests(kfiledialogqml_unittest)
0125 target_link_libraries(kfiledialogqml_unittest5 Qt5::Qml)
0126 endif()