CMakeLists.txt 4.48 KB
Newer Older
1 2 3 4
cmake_minimum_required(VERSION 2.8.12)

project(pimcommon)

5
set(KF5_VERSION "5.25.0")
Laurent Montel's avatar
Laurent Montel committed
6
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
7 8 9 10 11 12 13 14 15 16 17 18
set(LIBRARY_NAMELINK)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})

include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
19
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
20 21 22 23
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
include(ECMInstallIcons)

Laurent Montel's avatar
Laurent Montel committed
24
set(PIM_VERSION "5.3.56")
Laurent Montel's avatar
Laurent Montel committed
25 26

set(PIMCOMMON_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
27 28 29
set(AKONADIMIME_LIB_VERSION "5.3.40")
set(AKONADICONTACT_LIB_VERSION "5.3.40")
set(LIBKDEPIM_LIB_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
30
set(QT_REQUIRED_VERSION "5.6.0")
Laurent Montel's avatar
Laurent Montel committed
31 32 33
set(KMIME_LIB_VERSION "5.3.40")
set(KIMAP_LIB_VERSION "5.3.40")
set(KCONTACTS_LIB_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
34
set(KPIMTEXTEDIT_LIB_VERSION "5.3.43")
Laurent Montel's avatar
Laurent Montel committed
35
set(AKONADI_VERSION "5.3.40")
36

Milian Wolff's avatar
Milian Wolff committed
37
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Network Test WebEngineWidgets Xml PrintSupport)
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58

find_package(KF5Archive ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5ItemModels ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5ItemViews ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5JobWidgets ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Wallet ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
59
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
60 61
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
62
find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
63
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
64
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
65
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
66
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
67
find_package(Grantlee5 "5.1" CONFIG REQUIRED)
68

Laurent Montel's avatar
Laurent Montel committed
69 70
find_package(Qt5Designer CONFIG)
set_package_properties(Qt5Designer PROPERTIES
Laurent Montel's avatar
Indent  
Laurent Montel committed
71 72 73
    PURPOSE "Required to build the Qt Designer plugins"
    TYPE OPTIONAL
    )
Laurent Montel's avatar
Laurent Montel committed
74

75 76 77
if (Qt5Designer_FOUND)
    find_package(KF5DesignerPlugin ${KF5_VERSION} CONFIG REQUIRED)
endif()
78

Laurent Montel's avatar
Laurent Montel committed
79
ecm_setup_version(${PIMCOMMON_LIB_VERSION} VARIABLE_PREFIX PIMCOMMON
Laurent Montel's avatar
Indent  
Laurent Montel committed
80 81 82 83
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/pimcommon_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonConfigVersion.cmake"
    SOVERSION 5
    )
84 85 86 87 88 89 90 91 92 93 94 95

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.")

########### Targets ###########

add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")

########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5PimCommon")

ecm_configure_package_config_file(
Laurent Montel's avatar
Indent  
Laurent Montel committed
96 97 98 99
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5PimCommonConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )
100 101

install(FILES
Laurent Montel's avatar
Indent  
Laurent Montel committed
102 103 104 105 106
    "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )
107 108 109 110

install(EXPORT KF5PimCommonTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5PimCommonTargets.cmake NAMESPACE KF5::)

install(FILES
Laurent Montel's avatar
Indent  
Laurent Montel committed
111 112 113
    ${CMAKE_CURRENT_BINARY_DIR}/pimcommon_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )
114 115 116


add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
117
install( FILES pimcommon.renamecategories pimcommon.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
Laurent Montel's avatar
Laurent Montel committed
118
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)