Don't share mailto
[kdepim.git] / libkdepim / CMakeLists.txt
blob8a3b6943318390fe488157a92c6d357f83a74922
1 cmake_minimum_required(VERSION 2.8.12)
3 project(libkdepim)
5 if(${CMAKE_SOURCE_DIR} STREQUAL ${libkdepim_SOURCE_DIR})
6 # ECM setup
7 find_package(ECM 5.16.0 CONFIG REQUIRED)
8 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
9 set(LIBRARY_NAMELINK)
10 include(GenerateExportHeader)
11 include(ECMSetupVersion)
12 include(ECMGenerateHeaders)
13 include(ECMGeneratePriFile)
14 include(ECMPackageConfigHelpers)
15 include(ECMSetupVersion)
16 include(FeatureSummary)
17 include(KDEInstallDirs)
18 include(KDECMakeSettings)
19 include(KDEFrameworkCompilerSettings)
20 include(ECMQtDeclareLoggingCategory)
21 include(ECMAddTests)
23 set(KF5_VERSION "5.16.0")
24 set(KDEPIMLIBS_LIB_VERSION "5.1")
25 set(KDEPIM_LIB_VERSION "5.1")
26 set(QT_REQUIRED_VERSION "5.4.0")
27 set(KMIME_LIB_VERSION "4.87.0")
28 set(KLDAP_LIB_VERSION "4.80.0")
29 set(KCONTACTS_LIB_VERSION "4.92.0")
31 find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
32 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools DBus Network)
33 find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
34 find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
35 find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
36 find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
37 find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
38 find_package(KF5Wallet ${KF5_VERSION} CONFIG REQUIRED)
39 find_package(KF5ItemViews ${KF5_VERSION} CONFIG REQUIRED)
40 find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
41 find_package(KF5ItemViews ${KF5_VERSION} CONFIG REQUIRED)
42 find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
43 find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
44 find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
46 find_package(KF5AkonadiSearch "5.0.42" CONFIG REQUIRED)
47 set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "http://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
50 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX LIBKDEPIM
51                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/libkdepim_version.h"
52                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfigVersion.cmake"
53                         SOVERSION 5
55 remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
57 ########### CMake Config Files ###########
58 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Libkdepim")
60 ecm_configure_package_config_file(
61   "${CMAKE_CURRENT_SOURCE_DIR}/KF5LibkdepimConfig.cmake.in"
62   "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfig.cmake"
63   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
66 install(FILES
67   "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfig.cmake"
68   "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfigVersion.cmake"
69   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
70   COMPONENT Devel
73 ecm_configure_package_config_file(MailTransportDBusServiceConfig.cmake.in
74   ${CMAKE_CURRENT_BINARY_DIR}/MailTransportDBusServiceConfig.cmake
75   PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
76   INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_PREFIX}/MailTransportDBusService")
78 install(FILES
79   ${CMAKE_CURRENT_BINARY_DIR}/MailTransportDBusServiceConfig.cmake
80   DESTINATION "${CMAKECONFIG_INSTALL_PREFIX}/MailTransportDBusService")
82 install(EXPORT KF5LibkdepimTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5LibkdepimTargets.cmake NAMESPACE KF5::)
84 install(FILES
85    ${CMAKE_CURRENT_BINARY_DIR}/libkdepim_version.h
86   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
89 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
91 else()
92 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX LIBKDEPIM
93                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/libkdepim_version.h"
94                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkdepimConfigVersion.cmake"
95                         SOVERSION 5
97 endif()
99 add_subdirectory(src)
100 if (BUILD_TESTING)
101    add_subdirectory(tests)
102 endif()