- # 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})
- endif()
-
- if (WITH_KDE)
- find_package(KF5CoreAddons QUIET)
- set_package_properties(KF5CoreAddons PROPERTIES TYPE REQUIRED
- URL "http://inqlude.org/libraries/kcoreaddons.html"
- DESCRIPTION "framework for solving common problems such as caching, randomization, and more"
- PURPOSE "Required for KDE Frameworks integration"
- )
-
- find_package(KF5TextWidgets QUIET)
- set_package_properties(KF5TextWidgets PROPERTIES TYPE REQUIRED
- URL "http://inqlude.org/libraries/ktextwidgets.html"
- DESCRIPTION "framework providing an assortment of widgets for displaying and editing text"
- PURPOSE "Allows to use extra features provided by KDE Frameworks in input widgets"
- )
-
- endif()
-
- endif(BUILD_GUI)
- 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"
- )
-
- # While QCA2 seems to support Qt5, it is not actually co-installable or distinguishable from the Qt4 version...
- # In order to avoid linking against the Qt4 version (which is probably the one installed), disable this for now
- #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(BUILD_CORE)
-
- 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()
-
- # 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})