diff --git a/CMakeLists.txt b/CMakeLists.txt index 7aa000b..c9a9b61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,64 +1,65 @@ cmake_minimum_required(VERSION 3.0) project(PlasmaIntegration) set(PROJECT_VERSION "5.14.80") set(PROJECT_VERSION_MAJOR 5) set(QT_MIN_VERSION "5.11.0") set(KF5_MIN_VERSION "5.50.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(FeatureSummary) include(GenerateExportHeader) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Widgets DBus X11Extras QuickControls2) +find_package(Qt5Gui ${QT_MIN_VERSION} CONFIG REQUIRED Private) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Config ConfigWidgets I18n IconThemes KIO Notifications Wayland WidgetsAddons WindowSystem ConfigWidgets ) find_package(XCB COMPONENTS XCB) set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding" URL "http://xcb.freedesktop.org" TYPE REQUIRED PURPOSE "Required to pass style properties to native Windows on X11 Platform" ) find_package(Breeze 5 CONFIG) set_package_properties(Breeze PROPERTIES TYPE REQUIRED PURPOSE "For setting the default QStyle name") # dependencies for QPA plugin find_package(Qt5ThemeSupport REQUIRED) set(QT5PLATFORMSUPPORT_LIBS Qt5ThemeSupport::Qt5ThemeSupport) add_definitions(-DTRANSLATION_DOMAIN=\"plasmaintegration5\") if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ki18n_install(po) endif() add_subdirectory(src) add_subdirectory(autotests) add_subdirectory(tests) find_package(FontNotoSans) set_package_properties(FontNotoSans PROPERTIES PURPOSE "Default sans-serif font -- this is not detected automatically, pass -DCMAKE_DISABLE_FIND_PACKAGE_FontNotoSans=true to mark it ignored." URL "https://www.google.com/get/noto/" TYPE RUNTIME ) find_package(FontHack) set_package_properties(FontHack PROPERTIES PURPOSE "Default monospace font -- this is not detected automatically, pass -DCMAKE_DISABLE_FIND_PACKAGE_FontHack=true to mark it ignored." URL "http://sourcefoundry.org/hack/" TYPE RUNTIME ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 097a2bd..882f2cd 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -1,84 +1,83 @@ include(ECMMarkAsTest) include(ECMMarkNonGuiExecutable) find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET) find_package(Qt5Qml ${QT_MIN_VERSION} CONFIG QUIET) if(NOT Qt5Test_FOUND) message(STATUS "Qt5Test not found, autotests will not be built.") return() endif() if(NOT Qt5Qml_FOUND) message(STATUS "Qt5Qml not found, QML autotests will not be built.") endif() -include_directories( ${Qt5Gui_PRIVATE_INCLUDE_DIRS} ${Qt5PlatformSupport_PRIVATE_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/src/platformtheme ) - set(CONFIGFILE "${CMAKE_CURRENT_SOURCE_DIR}/kdeplatformtheme_kdeglobals") set(CHANGED_CONFIGFILE "${CMAKE_CURRENT_SOURCE_DIR}/kdeplatformtheme_changed_kdeglobals") configure_file(kdeplatformtheme_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/kdeplatformtheme_config.h) remove_definitions(-DQT_NO_CAST_FROM_ASCII) # qdbusmenubar uses them remove_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS) macro(FRAMEWORKINTEGRATION_TESTS _testname) add_executable(${_testname} ${_testname}.cpp ${ARGN}) set_target_properties(${_testname} PROPERTIES COMPILE_FLAGS "-DUNIT_TEST") add_test(NAME frameworkintegration-${_testname} COMMAND ${_testname}) ecm_mark_as_test(${_testname}) ecm_mark_nongui_executable(${_testname}) - target_link_libraries(${_testname} Qt5::Test Qt5::DBus Qt5::X11Extras Qt5::QuickControls2 ${QT5PLATFORMSUPPORT_LIBS} KF5::ConfigWidgets KF5::ConfigCore KF5::IconThemes KF5::KIOFileWidgets KF5::I18n KF5::Notifications KF5::WindowSystem KF5::WaylandClient XCB::XCB) + target_include_directories(${_testname} PRIVATE ${CMAKE_BINARY_DIR}/src/platformtheme) + target_link_libraries(${_testname} Qt5::GuiPrivate Qt5::Test Qt5::DBus Qt5::X11Extras Qt5::QuickControls2 ${QT5PLATFORMSUPPORT_LIBS} KF5::ConfigWidgets KF5::ConfigCore KF5::IconThemes KF5::KIOFileWidgets KF5::I18n KF5::Notifications KF5::WindowSystem KF5::WaylandClient XCB::XCB) endmacro() set(platformThemeSRCS ../src/platformtheme/qdbusmenubar.cpp # fork of Qt's qdbusmenubar with some added setters for our convenience ../src/platformtheme/kdeplatformtheme.cpp ../src/platformtheme/kfontsettingsdata.cpp ../src/platformtheme/khintssettings.cpp ../src/platformtheme/kdeplatformfiledialoghelper.cpp ../src/platformtheme/kdeplatformfiledialogbase.cpp ../src/platformtheme/kdeplatformsystemtrayicon.cpp ../src/platformtheme/kdirselectdialog.cpp ../src/platformtheme/kfiletreeview.cpp ../src/platformtheme/kwaylandintegration.cpp ../src/platformtheme/x11integration.cpp ) frameworkintegration_tests( kdeplatformtheme_unittest ${platformThemeSRCS} ) frameworkintegration_tests( kfontsettingsdata_unittest ../src/platformtheme/kfontsettingsdata.cpp ) frameworkintegration_tests( kfiledialog_unittest ) frameworkintegration_tests( ksni_unittest ) frameworkintegration_tests( kdirselectdialog_unittest ../src/platformtheme/kdeplatformfiledialogbase.cpp ../src/platformtheme/kdirselectdialog.cpp ../src/platformtheme/kfiletreeview.cpp ) frameworkintegration_tests( khintssettings_unittest ../src/platformtheme/khintssettings.cpp ) if(Qt5Qml_FOUND) add_test(NAME qmltests COMMAND qmltestrunner WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) frameworkintegration_tests(kfiledialogqml_unittest) target_link_libraries(kfiledialogqml_unittest Qt5::Qml) endif() diff --git a/src/platformtheme/CMakeLists.txt b/src/platformtheme/CMakeLists.txt index 21fb79c..44093ad 100644 --- a/src/platformtheme/CMakeLists.txt +++ b/src/platformtheme/CMakeLists.txt @@ -1,67 +1,65 @@ find_package(X11) set_package_properties(X11 PROPERTIES DESCRIPTION "Required for updating the Cursor theme on X11" URL "http://www.x.org" TYPE REQUIRED ) set(HAVE_X11 ${X11_FOUND}) if(HAVE_X11) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED X11Extras) find_package(XCB COMPONENTS XCB) set_package_properties(XCB PROPERTIES TYPE REQUIRED) endif() configure_file(config-platformtheme.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-platformtheme.h ) # qdbusmenubar uses them remove_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS) -include_directories(${Qt5Core_PRIVATE_INCLUDE_DIRS}) -include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}) - set(platformtheme_SRCS qdbusmenubar.cpp # fork of Qt's qdbusmenubar with some added setters for our convenience kdeplatformtheme.cpp kfontsettingsdata.cpp khintssettings.cpp kdeplatformfiledialoghelper.cpp kdeplatformfiledialogbase.cpp kdeplatformsystemtrayicon.cpp kfiletreeview.cpp kdirselectdialog.cpp kwaylandintegration.cpp x11integration.cpp main.cpp ) add_library(KDEPlasmaPlatformTheme MODULE ${platformtheme_SRCS}) target_link_libraries(KDEPlasmaPlatformTheme PRIVATE + Qt5::GuiPrivate Qt5::DBus Qt5::X11Extras Qt5::QuickControls2 KF5::ConfigWidgets KF5::ConfigCore KF5::IconThemes KF5::KIOFileWidgets # KFileFilterCombo, KDirSortFilterProxyModel, KRecentDirs KF5::KIOWidgets KF5::XmlGui KF5::I18n KF5::Notifications KF5::WindowSystem KF5::WaylandClient XCB::XCB ${QT5PLATFORMSUPPORT_LIBS} ) if(HAVE_X11) target_link_libraries(KDEPlasmaPlatformTheme PRIVATE Qt5::X11Extras ${X11_Xcursor_LIB} ${XCB_XCB_LIBRARY}) endif() install(TARGETS KDEPlasmaPlatformTheme DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/platformthemes) install(FILES fonts_global_toolbar.upd fonts_global.upd fonts_akregator.upd fonts_kate.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) install(PROGRAMS fonts_global.pl fonts_akregator.pl fonts_kate.pl DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})