From: Manuel Nickschas Date: Mon, 16 Jul 2018 22:11:57 +0000 (+0200) Subject: cmake: Remove build system support for Qt4/KDE4 X-Git-Tag: test-travis-01~190 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=0216d4a650c02155b5bcd517567209f674d8a120 cmake: Remove build system support for Qt4/KDE4 In our quest to modernize the codebase, remove support for the long-dead Qt4 libraries (and consequently, also for integration into KDE4) from the build system. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index aabf607a..225dfd63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,16 +65,6 @@ include(QuasselMacros) # Options and variables that can be set on the command line ##################################################################### -# Choose a Qt version. We support USE_QT5 and USE_QT4; if neither is set, Qt5 will be used -option(USE_QT5 "Enable support for Qt5" OFF) -if (USE_QT5) # takes precedence - set(USE_QT4 OFF) -else() - if (NOT USE_QT4) - set(USE_QT5 ON) - endif() -endif() - # Select the binaries to build option(WANT_CORE "Build the core (server) binary" ON) option(WANT_QTCLIENT "Build the client-only binary" ON) @@ -83,25 +73,17 @@ add_feature_info(WANT_CORE WANT_CORE "Build the core (server) binary") add_feature_info(WANT_QTCLIENT WANT_QTCLIENT "Build the client-only binary (requires a core to connect to)") add_feature_info(WANT_MONO WANT_MONO "Build the monolithic (all-in-one) binary") -# Whether to enable KDE integration (work in progress for Qt5 / KDE Frameworks) -# Note that when building with Qt5, WITH_KDE enables integration with higher-tier KDE frameworks that -# require runtime support. We still optionally make use of certain Tier 1 frameworks even if WITH_KDE -# is disabled. -if (USE_QT4) - option(WITH_KDE "KDE4 integration" OFF) - add_feature_info(WITH_KDE WITH_KDE "Enable KDE4 integration") -else() - option(WITH_KDE "Integration with the KDE Frameworks runtime environment") - add_feature_info(WITH_KDE WITH_KDE "Integrate with the KDE Frameworks runtime environment") -endif() +# Whether to enable integration with higher-tier KDE frameworks that require runtime support. +# We still optionally make use of certain Tier 1 frameworks even if WITH_KDE is disabled. +option(WITH_KDE "Integration with the KDE Frameworks runtime environment") +add_feature_info(WITH_KDE WITH_KDE "Integrate with the KDE Frameworks runtime environment") # Icon theme support. By default, install the Breeze icon theme (may be disabled if a system installation is present) option(WITH_BUNDLED_ICONS "Install required icons from the Breeze icon theme" ON) add_feature_info(WITH_BUNDLED_ICONS WITH_BUNDLED_ICONS "Install required icons from the Breeze icon theme") -# For Qt4, always support Oxygen -cmake_dependent_option(WITH_OXYGEN_ICONS "Support the Oxygen icon theme (KDE4)" OFF "USE_QT5" ON) -add_feature_info(WITH_OXYGEN_ICONS WITH_OXYGEN_ICONS "Support the Oxygen icon theme (KDE4)" OFF) +option(WITH_OXYGEN_ICONS "Support the Oxygen icon theme (KDE4)" OFF) +add_feature_info(WITH_OXYGEN_ICONS WITH_OXYGEN_ICONS "Support the Oxygen icon theme (KDE4)") if (WITH_BUNDLED_ICONS) add_definitions(-DWITH_BUNDLED_ICONS) @@ -162,7 +144,7 @@ option(WITH_LDAP "Enable LDAP authentication support if present on system" ON) # Setup CMake ##################################################################### -if (USE_QT5 AND WITH_KDE) +if (WITH_KDE) cmake_minimum_required(VERSION 2.8.12) else() cmake_minimum_required(VERSION 2.8.9) @@ -205,285 +187,212 @@ endif() # using -DCMAKE_DISABLE_FIND_PACKAGE_=TRUE ##################################################################### -if (USE_QT5) - message(STATUS "Building for Qt5...") - set(QT_MIN_VERSION "5.2.0") - add_definitions(-DHAVE_QT5) +set(QT_MIN_VERSION "5.2.0") +add_definitions(-DHAVE_QT5) - find_package(Qt5Core ${QT_MIN_VERSION} QUIET) - set_package_properties(Qt5Core PROPERTIES TYPE REQUIRED - URL "https://www.qt.io/" - DESCRIPTION "contains core functionality for Qt" - ) - # find_package without REQUIRED won't check for the version properly; also, older Qt5 versions - # used Qt5Core_VERSION_STRING... let's just make sure here that we bail out here if our Qt5 is not new enough. - if (NOT Qt5Core_VERSION OR Qt5Core_VERSION VERSION_LESS ${QT_MIN_VERSION}) - message(FATAL_ERROR "Could NOT find Qt5 >= version ${QT_MIN_VERSION}!") - endif() +find_package(Qt5Core ${QT_MIN_VERSION} QUIET) +set_package_properties(Qt5Core PROPERTIES TYPE REQUIRED + URL "https://www.qt.io/" + DESCRIPTION "contains core functionality for Qt" +) + +# find_package without REQUIRED won't check for the version properly; also, older Qt5 versions +# used Qt5Core_VERSION_STRING... let's just make sure here that we bail out here if our Qt5 is not new enough. +if (NOT Qt5Core_VERSION OR Qt5Core_VERSION VERSION_LESS ${QT_MIN_VERSION}) + message(FATAL_ERROR "Could NOT find Qt5 >= version ${QT_MIN_VERSION}!") +endif() - find_package(Qt5Network QUIET) - set_package_properties(Qt5Network PROPERTIES TYPE REQUIRED - DESCRIPTION "the network module for Qt5" +find_package(Qt5Network QUIET) +set_package_properties(Qt5Network PROPERTIES TYPE REQUIRED + DESCRIPTION "the network module for Qt5" +) + +if (BUILD_GUI) + find_package(Qt5Gui QUIET) + set_package_properties(Qt5Gui PROPERTIES TYPE REQUIRED + DESCRIPTION "the GUI module for Qt5" + ) + find_package(Qt5Widgets QUIET) + set_package_properties(Qt5Widgets PROPERTIES TYPE REQUIRED + DESCRIPTION "the widgets module for Qt5" ) - if (BUILD_GUI) - find_package(Qt5Gui QUIET) - set_package_properties(Qt5Gui PROPERTIES TYPE REQUIRED - DESCRIPTION "the GUI module for Qt5" - ) - find_package(Qt5Widgets QUIET) - set_package_properties(Qt5Widgets PROPERTIES TYPE REQUIRED - DESCRIPTION "the widgets module for Qt5" + if (NOT WIN32) + find_package(Qt5DBus QUIET) + set_package_properties(Qt5DBus PROPERTIES TYPE RECOMMENDED + URL "https://www.qt.io/" + DESCRIPTION "D-Bus support for Qt5" + PURPOSE "Needed for supporting D-Bus-based notifications and tray icon, used by most modern desktop environments" ) - - if (NOT WIN32) - find_package(Qt5DBus QUIET) - set_package_properties(Qt5DBus PROPERTIES TYPE RECOMMENDED - URL "https://www.qt.io/" - DESCRIPTION "D-Bus support for Qt5" - PURPOSE "Needed for supporting D-Bus-based notifications and tray icon, used by most modern desktop environments" + if (Qt5DBus_FOUND) + find_package(dbusmenu-qt5 QUIET CONFIG) + set_package_properties(dbusmenu-qt5 PROPERTIES TYPE RECOMMENDED + URL "https://launchpad.net/libdbusmenu-qt" + DESCRIPTION "a library implementing the DBusMenu specification" + PURPOSE "Required for having a context menu for the D-Bus-based tray icon" ) - if (Qt5DBus_FOUND) - find_package(dbusmenu-qt5 QUIET CONFIG) - set_package_properties(dbusmenu-qt5 PROPERTIES TYPE RECOMMENDED - URL "https://launchpad.net/libdbusmenu-qt" - DESCRIPTION "a library implementing the DBusMenu specification" - PURPOSE "Required for having a context menu for the D-Bus-based tray icon" - ) - endif() endif() + endif() - find_package(Qt5Multimedia QUIET) - set_package_properties(Qt5Multimedia PROPERTIES TYPE RECOMMENDED - URL "https://www.qt.io/" - DESCRIPTION "Multimedia support for Qt5" + find_package(Qt5Multimedia QUIET) + set_package_properties(Qt5Multimedia PROPERTIES TYPE RECOMMENDED + URL "https://www.qt.io/" + DESCRIPTION "Multimedia support for Qt5" + PURPOSE "Required for audio notifications" + ) + + if (NOT Qt5Multimedia_FOUND) + find_package(Phonon4Qt5 QUIET) + set_package_properties(Phonon4Qt5 PROPERTIES TYPE RECOMMENDED + URL "https://projects.kde.org/projects/kdesupport/phonon" + DESCRIPTION "a multimedia abstraction library" PURPOSE "Required for audio notifications" ) + endif() - if (NOT Qt5Multimedia_FOUND) - find_package(Phonon4Qt5 QUIET) - set_package_properties(Phonon4Qt5 PROPERTIES TYPE RECOMMENDED - URL "https://projects.kde.org/projects/kdesupport/phonon" - DESCRIPTION "a multimedia abstraction library" - PURPOSE "Required for audio notifications" - ) - endif() - - find_package(LibsnoreQt5 0.7.0 QUIET) - set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL + find_package(LibsnoreQt5 0.7.0 QUIET) + set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL + URL "https://projects.kde.org/projects/playground/libs/snorenotify" + DESCRIPTION "a cross-platform notification framework" + PURPOSE "Enable support for the snorenotify framework" + ) + if(LibsnoreQt5_FOUND) + find_package(LibsnoreSettingsQt5) + set_package_properties(LibsnoreSettingsQt5 PROPERTIES TYPE REQUIRED URL "https://projects.kde.org/projects/playground/libs/snorenotify" DESCRIPTION "a cross-platform notification framework" PURPOSE "Enable support for the snorenotify framework" ) - if(LibsnoreQt5_FOUND) - find_package(LibsnoreSettingsQt5) - set_package_properties(LibsnoreSettingsQt5 PROPERTIES TYPE REQUIRED - URL "https://projects.kde.org/projects/playground/libs/snorenotify" - DESCRIPTION "a cross-platform notification framework" - PURPOSE "Enable support for the snorenotify framework" - ) - endif() + endif() - if (WITH_WEBKIT) - find_package(Qt5WebKit QUIET) - set_package_properties(Qt5WebKit PROPERTIES TYPE RECOMMENDED + if (WITH_WEBKIT) + find_package(Qt5WebKit QUIET) + set_package_properties(Qt5WebKit PROPERTIES TYPE RECOMMENDED + URL "https://www.qt.io/" + DESCRIPTION "a WebKit implementation for Qt" + PURPOSE "Needed for displaying previews for URLs in chat" + ) + if (Qt5WebKit_FOUND) + find_package(Qt5WebKitWidgets QUIET) + set_package_properties(Qt5WebKitWidgets PROPERTIES TYPE RECOMMENDED URL "https://www.qt.io/" - DESCRIPTION "a WebKit implementation for Qt" + DESCRIPTION "widgets for Qt's WebKit implementation" PURPOSE "Needed for displaying previews for URLs in chat" ) - if (Qt5WebKit_FOUND) - find_package(Qt5WebKitWidgets QUIET) - set_package_properties(Qt5WebKitWidgets PROPERTIES TYPE RECOMMENDED - URL "https://www.qt.io/" - DESCRIPTION "widgets for Qt's WebKit implementation" - PURPOSE "Needed for displaying previews for URLs in chat" - ) - endif() endif() + endif() - if (WITH_WEBKIT AND Qt5WebKitWidgets_FOUND) - set(HAVE_WEBKIT true) - endif() - add_feature_info("WITH_WEBKIT, QtWebKit and QtWebKitWidgets modules" HAVE_WEBKIT "Support showing previews for URLs in chat (legacy)") + if (WITH_WEBKIT AND Qt5WebKitWidgets_FOUND) + set(HAVE_WEBKIT true) + endif() + add_feature_info("WITH_WEBKIT, QtWebKit and QtWebKitWidgets modules" HAVE_WEBKIT "Support showing previews for URLs in chat (legacy)") - if (WITH_WEBENGINE) - find_package(Qt5WebEngine QUIET) - set_package_properties(Qt5WebEngine PROPERTIES TYPE RECOMMENDED + if (WITH_WEBENGINE) + find_package(Qt5WebEngine QUIET) + set_package_properties(Qt5WebEngine PROPERTIES TYPE RECOMMENDED + URL "https://www.qt.io/" + DESCRIPTION "a WebEngine implementation for Qt" + PURPOSE "Needed for displaying previews for URLs in chat" + ) + if (Qt5WebEngine_FOUND) + find_package(Qt5WebEngineWidgets QUIET) + set_package_properties(Qt5WebEngineWidgets PROPERTIES TYPE RECOMMENDED URL "https://www.qt.io/" - DESCRIPTION "a WebEngine implementation for Qt" + DESCRIPTION "widgets for Qt's WebEngine implementation" PURPOSE "Needed for displaying previews for URLs in chat" ) - if (Qt5WebEngine_FOUND) - find_package(Qt5WebEngineWidgets QUIET) - set_package_properties(Qt5WebEngineWidgets PROPERTIES TYPE RECOMMENDED - URL "https://www.qt.io/" - DESCRIPTION "widgets for Qt's WebEngine implementation" - PURPOSE "Needed for displaying previews for URLs in chat" - ) - endif() - endif() - - if (WITH_WEBENGINE AND Qt5WebEngineWidgets_FOUND) - set(HAVE_WEBENGINE true) - endif() - add_feature_info("WITH_WEBENGINE, QtWebEngine and QtWebEngineWidgets modules" HAVE_WEBENGINE "Support showing previews for URLs in chat") - - # KDE Frameworks - ################ - - if (WITH_KDE) - set(ecm_find_type "REQUIRED") - else() - # Even with KDE integration disabled, we optionally use tier1 frameworks if we find them - set(ecm_find_type "RECOMMENDED") - endif() - - # extra-cmake-modules - find_package(ECM NO_MODULE QUIET) - set_package_properties(ECM PROPERTIES TYPE ${ecm_find_type} - URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules" - DESCRIPTION "extra modules for CMake, maintained by the KDE project" - PURPOSE "Required to find KDE Frameworks components" - ) - - if (ECM_FOUND) - list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) - if (WITH_KDE) - find_package(KF5 COMPONENTS ConfigWidgets CoreAddons Notifications NotifyConfig Sonnet TextWidgets WidgetsAddons XmlGui QUIET REQUIRED) - set_package_properties(KF5 PROPERTIES TYPE REQUIRED - URL "http://www.kde.org" - DESCRIPTION "KDE Frameworks" - PURPOSE "Required for integration into the Plasma desktop" - ) - else() - find_package(KF5Sonnet QUIET) - set_package_properties(KF5Sonnet PROPERTIES TYPE RECOMMENDED - URL "http://api.kde.org/frameworks-api/frameworks5-apidocs/sonnet/html" - DESCRIPTION "framework for providing spell-checking capabilities" - PURPOSE "Enables spell-checking support in input widgets" - ) - endif() endif() - endif() - if (BUILD_CORE) - find_package(Qt5Script QUIET) - set_package_properties(Qt5Script PROPERTIES TYPE REQUIRED - DESCRIPTION "provides scripting support for Qt5" - ) - find_package(Qt5Sql QUIET) - set_package_properties(Qt5Sql PROPERTIES TYPE REQUIRED - DESCRIPTION "the database support module for Qt5" - ) - - find_package(QCA2-QT5) - set_package_properties(QCA2-QT5 PROPERTIES TYPE RECOMMENDED - URL "https://projects.kde.org/projects/kdesupport/qca" - DESCRIPTION "Qt Cryptographic Architecture" - PURPOSE "Required for encryption support" - ) - + if (WITH_WEBENGINE AND Qt5WebEngineWidgets_FOUND) + set(HAVE_WEBENGINE true) endif() + add_feature_info("WITH_WEBENGINE, QtWebEngine and QtWebEngineWidgets modules" HAVE_WEBENGINE "Support showing previews for URLs in chat") - find_package(Qt5LinguistTools QUIET) - set_package_properties(Qt5LinguistTools PROPERTIES TYPE RECOMMENDED - DESCRIPTION "contains tools for handling translation files" - PURPOSE "Required for having translations" - ) - - # Some Qt5 versions do not define a target for lconvert, so we need to find it ourselves - if (Qt5LinguistTools_FOUND) - if (NOT TARGET Qt5::lconvert AND TARGET Qt5::lrelease) - get_target_property(_lrelease_location Qt5::lrelease LOCATION) - get_filename_component(_lrelease_path ${_lrelease_location} PATH) - find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert-qt5 lconvert PATHS ${_lrelease_path} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - elseif(TARGET Qt5::lconvert AND NOT Qt5_LCONVERT_EXECUTABLE) - # Newer Qt5 versions define the target, but not the Qt5_LCONVERT_EXECUTABLE variable for some reason - get_target_property(QT_LCONVERT_EXECUTABLE Qt5::lconvert LOCATION) - endif() + # KDE Frameworks + ################ - # Compatibility with the Qt4 variables - set(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE}) - set(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE}) - if (Qt5_LCONVERT_EXECUTABLE) - set(QT_LCONVERT_EXECUTABLE ${Qt5_LCONVERT_EXECUTABLE}) - endif() + if (WITH_KDE) + set(ecm_find_type "REQUIRED") + else() + # Even with KDE integration disabled, we optionally use tier1 frameworks if we find them + set(ecm_find_type "RECOMMENDED") endif() -else() - message(STATUS "Building for Qt4...") - set(QT_MIN_VERSION "4.8.0") - - find_package(Qt4 ${QT_MIN_VERSION} QUIET REQUIRED) - - if (BUILD_GUI) - add_feature_info("QtDBus module" QT_QTDBUS_FOUND "Needed for supporting D-Bus-based notifications and tray icon, used by most modern desktop environments") - if (QT_QTDBUS_FOUND) - find_package(dbusmenu-qt QUIET CONFIG) - set_package_properties(dbusmenu-qt PROPERTIES TYPE RECOMMENDED - URL "https://launchpad.net/libdbusmenu-qt" - DESCRIPTION "a library implementing the DBusMenu specification" - PURPOSE "Required for having a context menu for the D-Bus-based tray icon" - ) - endif() - - if (WITH_WEBKIT AND QT_QTWEBKIT_FOUND) - set(HAVE_WEBKIT true) - endif() - add_feature_info("WITH_WEBKIT and QtWebKit module" HAVE_WEBKIT "Support showing previews for URLs in chat") + # extra-cmake-modules + find_package(ECM NO_MODULE QUIET) + set_package_properties(ECM PROPERTIES TYPE ${ecm_find_type} + URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules" + DESCRIPTION "extra modules for CMake, maintained by the KDE project" + PURPOSE "Required to find KDE Frameworks components" + ) + if (ECM_FOUND) + list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) if (WITH_KDE) - # KDE has overzealous CFLAGS making miniz not compile, so save our old flags - set(_cflags ${CMAKE_C_FLAGS}) - find_package(KDE4 4.4 QUIET) - set_package_properties(KDE4 PROPERTIES TYPE REQUIRED + find_package(KF5 COMPONENTS ConfigWidgets CoreAddons Notifications NotifyConfig Sonnet TextWidgets WidgetsAddons XmlGui QUIET) + set_package_properties(KF5 PROPERTIES TYPE REQUIRED URL "http://www.kde.org" - DESCRIPTION "a world-class desktop environment" - PURPOSE "Enables various bits for improving integration with KDE" + DESCRIPTION "KDE Frameworks" + PURPOSE "Required for integration into the Plasma desktop" ) - set(CMAKE_C_FLAGS ${_cflags}) - else() - find_package(Phonon QUIET) - set_package_properties(Phonon PROPERTIES TYPE RECOMMENDED - URL "https://projects.kde.org/projects/kdesupport/phonon" - DESCRIPTION "a multimedia abstraction library" - PURPOSE "Required for audio notifications" + find_package(KF5Sonnet QUIET) + set_package_properties(KF5Sonnet PROPERTIES TYPE RECOMMENDED + URL "http://api.kde.org/frameworks-api/frameworks5-apidocs/sonnet/html" + DESCRIPTION "framework for providing spell-checking capabilities" + PURPOSE "Enables spell-checking support in input widgets" ) endif() + endif() - find_package(IndicateQt QUIET) - set_package_properties(IndicateQt PROPERTIES TYPE OPTIONAL - URL "https://launchpad.net/libindicate-qt/" - DESCRIPTION "a library to raise flags on DBus for other components of the desktop to pick up and visualize" - PURPOSE "Provides integration into the Ayatana notification system used by e.g. Ubuntu" - ) +endif() - endif() +if (BUILD_CORE) + find_package(Qt5Script QUIET) + set_package_properties(Qt5Script PROPERTIES TYPE REQUIRED + DESCRIPTION "provides scripting support for Qt5" + ) + find_package(Qt5Sql QUIET) + set_package_properties(Qt5Sql PROPERTIES TYPE REQUIRED + DESCRIPTION "the database support module for Qt5" + ) - if (BUILD_CORE) + find_package(QCA2-QT5) + set_package_properties(QCA2-QT5 PROPERTIES TYPE RECOMMENDED + URL "https://projects.kde.org/projects/kdesupport/qca" + DESCRIPTION "Qt Cryptographic Architecture" + PURPOSE "Required for encryption support" + ) - find_package(QCA2 QUIET) - set_package_properties(QCA2 PROPERTIES TYPE RECOMMENDED - URL "https://projects.kde.org/projects/kdesupport/qca" - DESCRIPTION "Qt Cryptographic Architecture" - PURPOSE "Required for encryption support" - ) +endif() +find_package(Qt5LinguistTools QUIET) +set_package_properties(Qt5LinguistTools PROPERTIES TYPE RECOMMENDED + DESCRIPTION "contains tools for handling translation files" + PURPOSE "Required for having translations" +) +# Some Qt5 versions do not define a target for lconvert, so we need to find it ourselves +if (Qt5LinguistTools_FOUND) + if (NOT TARGET Qt5::lconvert AND TARGET Qt5::lrelease) + get_target_property(_lrelease_location Qt5::lrelease LOCATION) + get_filename_component(_lrelease_path ${_lrelease_location} PATH) + find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert-qt5 lconvert PATHS ${_lrelease_path} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + elseif(TARGET Qt5::lconvert AND NOT Qt5_LCONVERT_EXECUTABLE) + # Newer Qt5 versions define the target, but not the Qt5_LCONVERT_EXECUTABLE variable for some reason + get_target_property(QT_LCONVERT_EXECUTABLE Qt5::lconvert LOCATION) endif() - # Qt4 does not consider lconvert relevant, so they don't support finding it... - # Rather than shipping hacked buildsys files, let's just infer the path from lrelease - if (QT_LRELEASE_EXECUTABLE) - get_filename_component(_lrelease_path ${QT_LRELEASE_EXECUTABLE} PATH) - find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert-qt4 lconvert PATHS ${_lrelease_path} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + # Compatibility with the Qt4 variables + set(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE}) + set(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE}) + if (Qt5_LCONVERT_EXECUTABLE) + set(QT_LCONVERT_EXECUTABLE ${Qt5_LCONVERT_EXECUTABLE}) endif() endif() - # Non-Qt-based packages # zlib for compression, however we can always fall back to miniz @@ -511,7 +420,7 @@ cmake_push_check_state(RESET) set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") -if (USE_QT5 AND Qt5_POSITION_INDEPENDENT_CODE) +if (Qt5_POSITION_INDEPENDENT_CODE) set(CMAKE_REQUIRED_FLAGS "-fPIC -DQT_NO_VERSION_TAGGING") endif() @@ -528,12 +437,13 @@ cmake_pop_check_state() ##################################################################### # This sets -fPIC and friends if required by the installed Qt5 library -if (USE_QT5 AND Qt5_POSITION_INDEPENDENT_CODE) +if (Qt5_POSITION_INDEPENDENT_CODE) set(CMAKE_POSITION_INDEPENDENT_CODE ON) + set(CMAKE_REQUIRED_FLAGS "-DQT_NO_VERSION_TAGGING") endif() # Needed to compile with mingw without kde -if (MINGW AND NOT KDE4_FOUND) +if (MINGW AND NOT WITH_KDE) add_definitions(-D_WIN32_WINNT=0x0500) message(STATUS "Added _WIN32_WINNT=0x0500 definition for MinGW") # workaround for bug in mingw gcc 4.0 @@ -560,22 +470,13 @@ else() message(STATUS "Not enabling LDAP authentication support") endif() -# Setup KDE / KDE Frameworks +# Setup support for KDE Frameworks ##################################################################### # We want to do this up here, so we have the necessary variables and defines set before # compiling anything -if (KDE4_FOUND) - # We always use external icons for KDE4 support, since we use its iconloader rather than Qt's - set(EMBED_DATA OFF) - - # Better have the compile flags global, even for the core, to avoid problems with linking the mono client - add_definitions(-DHAVE_KDE -DHAVE_KDE4 ${KDE4_DEFINITIONS} ${KDE4_ENABLE_EXCEPTIONS}) - set(WITH_KDE4 TRUE) -endif() - -if (USE_QT5 AND WITH_KDE) +if (WITH_KDE) # If KDE Frameworks are present, they're most probably providing Qt5 integration including icon loading set(EMBED_DATA OFF) @@ -620,10 +521,6 @@ else() message(STATUS "Installing data files separately") endif() -if (INDICATEQT_FOUND) - add_definitions(-DXDG_APPS_INSTALL_DIR=${CMAKE_INSTALL_APPDIR}) -endif() - if (NOT WIN32) check_function_exists(umask HAVE_UMASK) if(HAVE_UMASK) @@ -643,9 +540,7 @@ if (WIN32) set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:YES /NODEFAULTLIB:libcmt") set(CMAKE_EXE_LINKER_FLAGS_DEBUGFULL "${CMAKE_EXE_LINKER_FLAGS_DEBUG}") link_libraries(Version dwmapi shlwapi) - if (USE_QT5) - set(QT_QTMAIN_LIBRARY Qt5::WinMain) - endif() + set(QT_QTMAIN_LIBRARY Qt5::WinMain) endif() if(HAVE_SSL AND STATIC) find_package(OpenSSL REQUIRED) diff --git a/INSTALL b/INSTALL index a7a1bd99..e352897d 100644 --- a/INSTALL +++ b/INSTALL @@ -34,7 +34,7 @@ fairly recent compiler: Furthermore, CMake 2.8.9 or later is required (2.8.12 for KDE Frameworks). -As Quassel is a Qt application, you need the Qt SDK, either Qt 4.8+ or Qt 5.2+. +As Quassel is a Qt application, you need the Qt SDK, version 5.2 or higher. There are several optional dependencies; we will talk about that later. @@ -80,13 +80,8 @@ options here: Distributors may want to disable automatic detection if they have their own caching mechanism set up. --DUSE_QT4=ON - Build against the deprecated Qt4 instead of the default Qt5. Note that you - should empty your build directory when switching between Qt versions, - otherwise weird things may happen. - -DWITH_KDE=ON - Enable integration into KDE4 (with Qt4) or KDE Frameworks (with Qt5). + Enable integration with the KDE Frameworks runtime environment -DWITH_BUNDLED_ICONS=ON Quassel requires a number of icons that are part of the KDE/Plasma icon themes @@ -102,12 +97,12 @@ options here: Support the Oxygen icon theme. Oxygen was the default theme in KDE 4, and also the bundled icon theme in Quassel before version 0.13. Since the move to Qt5, the more modern Breeze icon theme is preferred, and thus Oxygen - is disabled by default when building against Qt5. + is disabled by default. -DWITH_WEBENGINE=ON Use WebEngine for showing previews of webpages linked in the chat. Requires the QtWebEngine module to be available, and increases the client's RAM usage - by *a lot* if enabled at runtime. Only available for Qt5. The default is ON. + by *a lot* if enabled at runtime. The default is ON. -DWITH_WEBKIT=OFF Use WebKit for showing previews of webpages linked in the chat. Requires diff --git a/cmake/QuasselInstallDirs.cmake b/cmake/QuasselInstallDirs.cmake index 9075a808..c03895c2 100644 --- a/cmake/QuasselInstallDirs.cmake +++ b/cmake/QuasselInstallDirs.cmake @@ -43,23 +43,4 @@ if (NOT WITH_KDE) set(CMAKE_INSTALL_APPDIR "${CMAKE_INSTALL_DATAROOTDIR}/applications") endif() endif() -else() - if (WITH_KDE4) - # FindKDE4Internal.cmake sets its own set of variables, however with deprecated names - if (NOT DEFINED CMAKE_INSTALL_BINDIR) - set(CMAKE_INSTALL_BINDIR "${BIN_INSTALL_DIR}" CACHE PATH "Install path for binaries") - endif() - if (NOT DEFINED CMAKE_INSTALL_DATADIR) - set(CMAKE_INSTALL_DATADIR "${DATA_INSTALL_DIR}" CACHE PATH "Install path for data files") - endif() - if (NOT DEFINED CMAKE_INSTALL_ICONDIR) - set(CMAKE_INSTALL_ICONDIR "${ICON_INSTALL_DIR}" CACHE PATH "Install path for icons") - endif() - if (NOT DEFINED CMAKE_INSTALL_APPDIR) - set(CMAKE_INSTALL_APPDIR "${XDG_APPS_INSTALL_DIR}" CACHE PATH "Install path for .desktop files") - endif() - endif() - - # KF5 does the correct thing, so we don't need to do anything - # We have already included KDEInstallDirs at this point. endif() diff --git a/cmake/QuasselMacros.cmake b/cmake/QuasselMacros.cmake index d77ba1cf..bc665725 100644 --- a/cmake/QuasselMacros.cmake +++ b/cmake/QuasselMacros.cmake @@ -2,9 +2,6 @@ # # (C) 2014 by the Quassel Project # -# The qt4_use_modules function was taken from CMake's Qt4Macros.cmake: -# (C) 2005-2009 Kitware, Inc. -# # The qt5_use_modules function was taken from Qt 5.10.1 (and modified): # (C) 2005-2011 Kitware, Inc. # @@ -15,37 +12,6 @@ # Macros for dealing with Qt ############################ -# CMake gained this function in 2.8.10. To be able to use older versions, we've copied -# this here. If present, the function from CMake will take precedence and our copy will be ignored. -function(qt4_use_modules _target _link_type) - if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE") - set(modules ${ARGN}) - set(link_type ${_link_type}) - else() - set(modules ${_link_type} ${ARGN}) - endif() - foreach(_module ${modules}) - string(TOUPPER ${_module} _ucmodule) - set(_targetPrefix QT_QT${_ucmodule}) - if (_ucmodule STREQUAL QAXCONTAINER OR _ucmodule STREQUAL QAXSERVER) - if (NOT QT_Q${_ucmodule}_FOUND) - message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") - endif() - set(_targetPrefix QT_Q${_ucmodule}) - else() - if (NOT QT_QT${_ucmodule}_FOUND) - message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") - endif() - if ("${_ucmodule}" STREQUAL "MAIN") - message(FATAL_ERROR "Can not use \"${_module}\" module with qt4_use_modules.") - endif() - endif() - target_link_libraries(${_target} ${link_type} ${${_targetPrefix}_LIBRARIES}) - set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${${_targetPrefix}_INCLUDE_DIR} ${QT_HEADERS_DIR} ${QT_MKSPECS_DIR}/default) - set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${${_targetPrefix}_COMPILE_DEFINITIONS}) - endforeach() -endfunction() - # Qt 5.11 removed the qt5_use_modules function, so we need to provide it until we can switch to a modern CMake version. # If present, the Qt-provided version will be used automatically instead. function(qt5_use_modules _target _link_type) @@ -81,52 +47,6 @@ function(qt5_use_modules _target _link_type) endforeach() endfunction() -# Some wrappers for simplifying dual-Qt support - -function(qt_use_modules) - if (USE_QT5) - qt5_use_modules(${ARGN}) - else() - qt4_use_modules(${ARGN}) - endif() -endfunction() - -function(qt_wrap_ui _var) - if (USE_QT5) - qt5_wrap_ui(var ${ARGN}) - else() - qt4_wrap_ui(var ${ARGN}) - endif() - set(${_var} ${${_var}} ${var} PARENT_SCOPE) -endfunction() - -function(qt_add_resources _var) - if (USE_QT5) - qt5_add_resources(var ${ARGN}) - else() - qt4_add_resources(var ${ARGN}) - endif() - set(${_var} ${${_var}} ${var} PARENT_SCOPE) -endfunction() - -function(qt_add_dbus_interface _var) - if (USE_QT5) - qt5_add_dbus_interface(var ${ARGN}) - else() - qt4_add_dbus_interface(var ${ARGN}) - endif() - set(${_var} ${${_var}} ${var} PARENT_SCOPE) -endfunction() - -function(qt_add_dbus_adaptor _var) - if (USE_QT5) - qt5_add_dbus_adaptor(var ${ARGN}) - else() - qt4_add_dbus_adaptor(var ${ARGN}) - endif() - set(${_var} ${${_var}} ${var} PARENT_SCOPE) -endfunction() - ###################################### # Macros for dealing with translations ###################################### diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 5c6762d5..0986abb8 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,5 +1,5 @@ if (BUILD_GUI) - if (KDE4_FOUND OR (UNIX AND NOT APPLE)) + if (UNIX AND NOT APPLE) if (WANT_QTCLIENT) install(FILES quasselclient.desktop DESTINATION ${CMAKE_INSTALL_APPDIR}) endif() @@ -8,10 +8,6 @@ if (BUILD_GUI) install(FILES quassel.desktop DESTINATION ${CMAKE_INSTALL_APPDIR}) endif() - if (WITH_KDE4) - install(FILES quassel.notifyrc DESTINATION ${CMAKE_INSTALL_DATADIR}/quassel) - endif() - if (WITH_KF5) install(FILES quassel.notifyrc DESTINATION ${CMAKE_INSTALL_KNOTIFY5RCDIR}) endif() diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index fab63f66..ca4df01a 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -58,8 +58,8 @@ if (WANT_MONO OR WANT_QTCLIENT) # hicolor contains the application icon in all relevant sizes install(DIRECTORY hicolor DESTINATION ${CMAKE_INSTALL_ICONDIR}) - if (USE_QT4 OR (USE_QT5 AND Qt5Core_VERSION VERSION_LESS 5.5.0)) - # Qt 4 doesn't seem to correctly load icons from injected themes + if (Qt5Core_VERSION VERSION_LESS 5.5.0) + # Qt < 5.5 doesn't seem to correctly load icons from injected themes # Install Quassel-specific ones from Oxygen into hicolor as fallback install(DIRECTORY oxygen/ DESTINATION ${CMAKE_INSTALL_ICONDIR}/hicolor) endif() diff --git a/snapcraft.yaml b/snapcraft.yaml index 826a5777..eee31704 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -18,7 +18,7 @@ parts: quasselcore: source: . plugin: cmake - configflags: [-DUSE_QT5=1, -DWANT_MONO=0, -DWANT_QTCLIENT=0, -DCMAKE_BUILD_TYPE=Release] + configflags: [-DWANT_MONO=0, -DWANT_QTCLIENT=0, -DCMAKE_BUILD_TYPE=Release] build-packages: - cmake - g++ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ea613af6..8beb17c0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,7 +39,7 @@ endif() if(WANT_CORE) add_executable(quasselcore common/main.cpp ${CORE_DEPS} ${COMMON_DEPS}) - qt_use_modules(quasselcore Core Network ${CORE_QT_MODULES}) + qt5_use_modules(quasselcore Core Network ${CORE_QT_MODULES}) add_dependencies(quasselcore po) set_target_properties(quasselcore PROPERTIES COMPILE_FLAGS "-DBUILD_CORE" @@ -48,13 +48,9 @@ if(WANT_CORE) install(TARGETS quasselcore RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() -if (KDE4_FOUND) - include_directories(${KDE4_INCLUDES}) -endif() - if(WANT_QTCLIENT) add_executable(quasselclient WIN32 common/main.cpp ${CLIENT_DEPS} ${COMMON_DEPS}) - qt_use_modules(quasselclient Core Gui Network ${CLIENT_QT_MODULES}) + qt5_use_modules(quasselclient Core Gui Network ${CLIENT_QT_MODULES}) add_dependencies(quasselclient po) set_target_properties(quasselclient PROPERTIES COMPILE_FLAGS "-DBUILD_QTUI" @@ -65,7 +61,7 @@ endif() if(WANT_MONO) add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${CLIENT_DEPS} ${CORE_DEPS} ${COMMON_DEPS}) - qt_use_modules(quassel Core Gui Network ${CLIENT_QT_MODULES} ${CORE_QT_MODULES}) + qt5_use_modules(quassel Core Gui Network ${CLIENT_QT_MODULES} ${CORE_QT_MODULES}) add_dependencies(quassel po) set_target_properties(quassel PROPERTIES COMPILE_FLAGS "-DBUILD_MONO" diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 7e171d25..783e8ddd 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -1,7 +1,6 @@ # Builds the client module -# In Qt4, we still have some minor deps to QtGui: QItemSelectionModel, QSortFilterProxyModel -# Still in Qt5: QAbstractItemView in BufferModel +# We still have a minor dep to QtWidgets: QAbstractItemView in BufferModel set(SOURCES abstractmessageprocessor.cpp @@ -38,13 +37,9 @@ set(SOURCES abstractui.h ) -if (USE_QT5) - list(APPEND qt_modules Widgets) -endif() - -qt_add_resources(SOURCES ${CLIENT_RCS}) +qt5_add_resources(SOURCES ${CLIENT_RCS}) add_library(mod_client STATIC ${SOURCES}) -qt_use_modules(mod_client Network Core Gui ${qt_modules}) +qt5_use_modules(mod_client Network Core Gui Widgets) target_link_libraries(mod_client mod_common) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 32b53708..661d10c1 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -37,6 +37,7 @@ set(SOURCES peer.cpp peerfactory.cpp presetnetworks.cpp + qt5cliparser.cpp quassel.cpp remotepeer.cpp settings.cpp @@ -58,13 +59,7 @@ set(SOURCES protocol.h ) -if (USE_QT5) - list(APPEND SOURCES qt5cliparser.cpp) -else() - list(APPEND SOURCES cliparser.cpp) -endif() - -if (QCA2_FOUND OR QCA2-QT5_FOUND) +if (QCA2-QT5_FOUND) set(SOURCES ${SOURCES} keyevent.cpp) endif() @@ -75,10 +70,6 @@ else() set(SOURCES ${SOURCES} ../../3rdparty/miniz/miniz.c) endif() -if (USE_QT4) - set(SOURCES ${SOURCES} ../../3rdparty/sha512/sha512.c) -endif() - if (HAVE_SYSLOG) add_definitions(-DHAVE_SYSLOG) endif() @@ -97,10 +88,10 @@ else() set(SOURCES ${SOURCES} logbacktrace_unix.cpp posixsignalwatcher.cpp) endif() -qt_add_resources(SOURCES ${COMMON_RCS}) +qt5_add_resources(SOURCES ${COMMON_RCS}) add_library(mod_common STATIC ${SOURCES}) -qt_use_modules(mod_common Core Network) +qt5_use_modules(mod_common Core Network) if (APPLE) target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation") diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index a7646083..db3337ee 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -51,13 +51,6 @@ if(HAVE_SSL) include_directories(${OPENSSL_INCLUDE_DIR}) endif() -if (QCA2_FOUND) - add_definitions(-DHAVE_QCA2) - include_directories(${QCA2_INCLUDE_DIR}) - list(APPEND SOURCES cipher.cpp) - list(APPEND LIBS ${QCA2_LIBRARIES}) -endif() - if (QCA2-QT5_FOUND) add_definitions(-DHAVE_QCA2) include_directories(${QCA2-QT5_INCLUDE_DIR}) @@ -75,10 +68,10 @@ endif(HAVE_LDAP) include_directories(${CMAKE_SOURCE_DIR}/src/common) set(CORE_RCS ${CORE_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/sql.qrc) -qt_add_resources(SOURCES ${CORE_RCS}) +qt5_add_resources(SOURCES ${CORE_RCS}) add_library(mod_core STATIC ${SOURCES}) -qt_use_modules(mod_core Core Network Script Sql) +qt5_use_modules(mod_core Core Network Script Sql) target_link_libraries(mod_core mod_common ${LIBS}) diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index 3861d609..3564dc31 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -88,13 +88,6 @@ set(FORMS set(LIBS ) set(QT_MODULES ) -if (WITH_KDE4) - add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS}) - include_directories(${KDE4_INCLUDES}) - list(APPEND SOURCES knotificationbackend.cpp) - list(APPEND LIBS ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY} ${KDE4_KNOTIFYCONFIG_LIBRARY}) -endif() - if (WITH_KF5) list(APPEND SOURCES knotificationbackend.cpp) list(APPEND LIBS KF5::ConfigWidgets KF5::Notifications KF5::NotifyConfig KF5::WidgetsAddons KF5::XmlGui) @@ -114,7 +107,7 @@ if (Qt5Multimedia_FOUND) set(FORMS ${FORMS} qtmultimedianotificationconfigwidget.ui) endif() -if (PHONON_FOUND OR Phonon4Qt5_FOUND) +if (Phonon4Qt5_FOUND) add_definitions(-DHAVE_PHONON) include_directories(${PHONON_INCLUDES}) set(SOURCES ${SOURCES} phononnotificationbackend.cpp) @@ -122,39 +115,29 @@ if (PHONON_FOUND OR Phonon4Qt5_FOUND) list(APPEND LIBS ${PHONON_LIBS}) # PHONON_LIBRARIES only exists in config mode, it's not set by the legacy FindPhonon.cmake endif() -if (QT_QTDBUS_FOUND OR Qt5DBus_FOUND) +if (Qt5DBus_FOUND) add_definitions(-DHAVE_DBUS) list(APPEND QT_MODULES DBus) - if (dbusmenu-qt_FOUND OR dbusmenu-qt5_FOUND) + if (dbusmenu-qt5_FOUND) add_definitions(-DHAVE_DBUSMENU) - include_directories(${dbusmenu-qt_INCLUDE_DIRS} ${dbusmenu-qt5_INCLUDE_DIRS}) - if (dbusmenu-qt_FOUND) - list(APPEND LIBS dbusmenu-qt) - else() - list(APPEND LIBS dbusmenu-qt5) - endif() + include_directories(${dbusmenu-qt5_INCLUDE_DIRS}) + list(APPEND LIBS dbusmenu-qt5) endif() list(APPEND SOURCES statusnotifieritem.cpp statusnotifieritemdbus.cpp dockmanagernotificationbackend.cpp) - qt_add_dbus_interface(SOURCES ../../interfaces/org.kde.StatusNotifierWatcher.xml statusnotifierwatcher) - qt_add_dbus_interface(SOURCES ../../interfaces/org.freedesktop.Notifications.xml notificationsclient) - qt_add_dbus_adaptor (SOURCES ../../interfaces/org.kde.StatusNotifierItem.xml statusnotifieritemdbus.h StatusNotifierItemDBus) + qt5_add_dbus_interface(SOURCES ../../interfaces/org.kde.StatusNotifierWatcher.xml statusnotifierwatcher) + qt5_add_dbus_interface(SOURCES ../../interfaces/org.freedesktop.Notifications.xml notificationsclient) + qt5_add_dbus_adaptor (SOURCES ../../interfaces/org.kde.StatusNotifierItem.xml statusnotifieritemdbus.h StatusNotifierItemDBus) endif() if (HAVE_WEBKIT) add_definitions(-DHAVE_WEBKIT) - list(APPEND QT_MODULES WebKit) - if (USE_QT5) - list(APPEND QT_MODULES WebKitWidgets) - endif() + list(APPEND QT_MODULES WebKit WebKitWidgets) endif() if (HAVE_WEBENGINE) add_definitions(-DHAVE_WEBENGINE) - list(APPEND QT_MODULES WebEngine) - if (USE_QT5) - list(APPEND QT_MODULES WebEngineWidgets) - endif() + list(APPEND QT_MODULES WebEngine WebEngineWidgets) endif() if(HAVE_SSL) @@ -162,14 +145,6 @@ if(HAVE_SSL) set(FORMS ${FORMS} sslinfodlg.ui) endif() -if (INDICATEQT_FOUND) - add_definitions(-DHAVE_INDICATEQT) - include_directories(${INDICATEQT_INCLUDE_DIRS}) - list(APPEND SOURCES indicatornotificationbackend.cpp) - list(APPEND FORMS indicatornotificationconfigwidget.ui) - list(APPEND LIBS ${INDICATEQT_LIBRARIES}) -endif() - if (WITH_NOTIFICATION_CENTER) add_definitions(-DHAVE_NOTIFICATION_CENTER) list(APPEND SOURCES osxnotificationbackend.mm) @@ -206,14 +181,9 @@ include_directories(${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/uisupport ) -qt_wrap_ui(UI ${FORMPATH} ${SPFRM}) - -if (USE_QT5) - list(APPEND QT_MODULES Widgets) -endif() - +qt5_wrap_ui(UI ${FORMPATH} ${SPFRM}) add_library(mod_qtui STATIC ${SOURCES} ${SPSRC} ${UI}) -qt_use_modules(mod_qtui Core Gui Network ${QT_MODULES}) +qt5_use_modules(mod_qtui Core Gui Network Widgets ${QT_MODULES}) target_link_libraries(mod_qtui mod_client mod_common mod_uisupport ${LIBS}) diff --git a/src/uisupport/CMakeLists.txt b/src/uisupport/CMakeLists.txt index 591b993c..03474231 100644 --- a/src/uisupport/CMakeLists.txt +++ b/src/uisupport/CMakeLists.txt @@ -37,29 +37,15 @@ set(SOURCES abstractnotificationbackend.h ) -if (WITH_KDE4) - include_directories(${KDE4_INCLUDES}) - add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS}) - set(SOURCES ${SOURCES} kcmdlinewrapper.cpp) -endif() - include_directories(${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/client ) -if (USE_QT5) - list(APPEND qt_modules Widgets) -endif() - add_library(mod_uisupport STATIC ${SOURCES}) -qt_use_modules(mod_uisupport Core Gui Network ${qt_modules}) +qt5_use_modules(mod_uisupport Core Gui Network Widgets) target_link_libraries(mod_uisupport mod_client mod_common) -if (WITH_KDE4) - target_link_libraries(mod_uisupport ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY}) -endif() - if (WITH_KF5) target_link_libraries(mod_uisupport KF5::CoreAddons KF5::TextWidgets KF5::XmlGui) endif()