CMakeLists.txt 4.11 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.16.0")
3

4
project(pimcommon VERSION ${PIM_VERSION})
5

6
set(KF5_MIN_VERSION "5.75.0")
Laurent Montel's avatar
Laurent Montel committed
7

8
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
9 10
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})

11 12 13 14
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

15 16 17 18
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
19

20 21 22 23
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
include(ECMInstallIcons)
Laurent Montel's avatar
Laurent Montel committed
24
include(ECMAddQtDesignerPlugin)
Laurent Montel's avatar
Laurent Montel committed
25

26 27
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Laurent Montel's avatar
Laurent Montel committed
28 29

set(PIMCOMMON_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
30 31
set(AKONADICONTACT_LIB_VERSION "5.16.0")
set(LIBKDEPIM_LIB_VERSION "5.16.0")
32
set(QT_REQUIRED_VERSION "5.13.0")
Laurent Montel's avatar
Laurent Montel committed
33 34 35 36 37 38
set(KMIME_LIB_VERSION "5.16.0")
set(KIMAP_LIB_VERSION "5.16.0")
set(KPIMTEXTEDIT_LIB_VERSION "5.16.0")
set(AKONADI_VERSION "5.16.0")
set(KLDAP_LIB_VERSION "5.16.0")
set(GRANTLEETHEME_LIB_VERSION "5.16.0")
39

40
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Network Test Xml PrintSupport)
41

42 43 44 45 46 47 48 49 50 51 52 53 54
find_package(KF5Archive ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ItemModels ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5JobWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
55
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
56

Laurent Montel's avatar
Laurent Montel committed
57
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
58
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
59
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
60
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
61
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
62
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
63
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
64
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
65

Laurent Montel's avatar
Laurent Montel committed
66
find_package(KF5Purpose ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
67

68

69 70
option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON)
add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
71

Laurent Montel's avatar
Laurent Montel committed
72 73
option(FORCE_DISABLE_AKONADI_SEARCH "Disable features and API that require akonadi-search, e.g. because xapian isn't available" OFF)
if (NOT FORCE_DISABLE_AKONADI_SEARCH)
Laurent Montel's avatar
Laurent Montel committed
74
   set(AKONADI_SEARCH_VERSION "5.16.0")	
Laurent Montel's avatar
Laurent Montel committed
75
   find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
76 77 78 79 80 81 82
   set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
endif()

set(DISABLE_AKONADI_SEARCH ${FORCE_DISABLE_AKONADI_SEARCH})
configure_file(config-akonadi-search.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config-akonadi-search.h)


83 84 85
find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")

86
if(BUILD_TESTING)
87
   find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
88 89
   add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)
90

91 92
########### Targets ###########

Laurent Montel's avatar
Laurent Montel committed
93
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
94
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054C00) 
95

Laurent Montel's avatar
Laurent Montel committed
96
add_definitions(-DQT_NO_FOREACH)
97
add_definitions(-DQT_NO_KEYWORDS)
98

99
add_subdirectory(src)
100
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
101 102 103 104
        EXPORT PIMCOMMON
        FILE pimcommon.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
105
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)