1 cmake_minimum_required(VERSION 2.8.12)
3 project(kaddressbookgrantlee)
5 if(${CMAKE_SOURCE_DIR} STREQUAL ${kaddressbookgrantlee_SOURCE_DIR})
7 find_package(ECM 5.16.0 CONFIG REQUIRED)
8 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
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)
24 set(KF5_VERSION "5.16.0")
25 set(KDEPIMLIBS_LIB_VERSION "5.0.47")
26 set(KDEPIM_LIB_VERSION "5.0.46")
27 set(QT_REQUIRED_VERSION "5.4.0")
28 set(KCONTACTS_LIB_VERSION "4.92.0")
30 find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
31 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools)
32 find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
33 find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
34 find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
35 find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
36 find_package(Grantlee5 "5.0" CONFIG REQUIRED)
37 find_package(KF5Libkleo ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
38 find_package(KF5GrantleeTheme ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
39 find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
40 find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
43 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX KADDRESSBOOKGRANTLEE
44 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kaddressbookgrantlee_version.h"
45 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KaddressbookGrantleeConfigVersion.cmake"
49 ########### Targets ###########
51 add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
53 ########### CMake Config Files ###########
54 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KaddressbookGrantlee")
56 ecm_configure_package_config_file(
57 "${CMAKE_CURRENT_SOURCE_DIR}/KF5KaddressbookGrantleeConfig.cmake.in"
58 "${CMAKE_CURRENT_BINARY_DIR}/KF5KaddressbookGrantleeConfig.cmake"
59 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
63 "${CMAKE_CURRENT_BINARY_DIR}/KF5KaddressbookGrantleeConfig.cmake"
64 "${CMAKE_CURRENT_BINARY_DIR}/KF5KaddressbookGrantleeConfigVersion.cmake"
65 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
69 install(EXPORT KF5KaddressbookGrantleeTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5KaddressbookGrantleeTargets.cmake NAMESPACE KF5::)
72 ${CMAKE_CURRENT_BINARY_DIR}/kaddressbookgrantlee_version.h
73 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
76 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
78 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX KADDRESSBOOKGRANTLEE
79 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kaddressbookgrantlee_version.h"
80 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KaddressbookGrantleeConfigVersion.cmake"