CMakeLists.txt 1.94 KB
Newer Older
1
cmake_minimum_required(VERSION 2.8.12)
2

3
project(KPimIdentities)
4

5
6
7
# ECM setup
find_package(ECM 0.0.11 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
8

9
10
11
12
13
14
15
16
17
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
18
19


20
21
22
23
24
25
set(KF5_VERSION "4.97.0")

ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KPIMIDENTITIES
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpimidentities_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PimIdentitiesConfigVersion.cmake"
                        SOVERSION 5
26
)
27

28
29
30
31
32
33
34
########### Find packages ###########
find_package(KF5 ${KF5_VERSION} CONFIG REQUIRED COMPONENTS CoreAddons KDE4Support KIO Sonnet)
find_package(KF5PimUtils ${KF5_VERSION} CONFIG REQUIRED)

########### Targets ###########
add_subdirectory(src)
#add_subdirectory(autotests)
35

36
37
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5PimIdentities")
38

39
40
41
42
43
ecm_configure_package_config_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5PimIdentitiesConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5PimIdentitiesConfig.cmake"
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
44

45
install(FILES
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  "${CMAKE_CURRENT_BINARY_DIR}/KF5PimIdentitiesConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5PimIdentitiesConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

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

install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kpimidentities_version.h
   DESTINATION ${INCLUDE_INSTALL_DIR}
   COMPONENT Devel
)
63

64
65
66
if ("${CMAKE_BINARY_DIR}" STREQUAL "${KPimIdentities_BINARY_DIR}")
  feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
endif()