CMakeLists.txt 2.1 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
########### Find packages ###########
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
29
30
31
32
33
34
35
find_package(KF5 ${KF5_VERSION} CONFIG REQUIRED COMPONENTS CoreAddons KDE4Support KIO)
#find_package(Qt5 COMPONENTS Locale)

if(${CMAKE_SOURCE_DIR} STREQUAL ${KPimIdentities_SOURCE_DIR})
  find_package(KF5PimUtils ${KF5_VERSION} CONFIG REQUIRED)
  find_package(KF5PimTextEdit ${KF5_VERSION} CONFIG REQUIRED)
endif()
36
37
38
39

########### Targets ###########
add_subdirectory(src)
#add_subdirectory(autotests)
40

41
42
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5PimIdentities")
43

44
45
46
47
48
ecm_configure_package_config_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5PimIdentitiesConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5PimIdentitiesConfig.cmake"
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
49

50
install(FILES
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  "${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
)
68

69
70
71
if ("${CMAKE_BINARY_DIR}" STREQUAL "${KPimIdentities_BINARY_DIR}")
  feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
endif()