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

Laurent Montel's avatar
Laurent Montel committed
3
project(KIdentityManagement)
4

5
# ECM setup
Laurent Montel's avatar
Laurent Montel committed
6
find_package(ECM 1.3.0 CONFIG REQUIRED)
7
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


Laurent Montel's avatar
Laurent Montel committed
20
set(KF5_VERSION "5.5.0")
Laurent Montel's avatar
Laurent Montel committed
21
set(KDEPIMLIBS_VERSION "4.78.0")
22

Laurent Montel's avatar
Laurent Montel committed
23
ecm_setup_version(${KDEPIMLIBS_VERSION} VARIABLE_PREFIX KIDENTITYMANAGEMENT
Laurent Montel's avatar
Laurent Montel committed
24
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h"
Laurent Montel's avatar
Laurent Montel committed
25
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfigVersion.cmake"
26
                        SOVERSION 5
27
)
28

29
########### Find packages ###########
Laurent Montel's avatar
Laurent Montel committed
30
#REMOVE IT WHEN WE REMOVE from KF5PimTextEdit or KF5PimUtils
Laurent Montel's avatar
Laurent Montel committed
31
find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
32
33
34
35
36
37

find_package(Qt5Network NO_MODULE REQUIRED)
find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)
38
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
39
40
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Emoticons ${KF5_VERSION} CONFIG REQUIRED)
41
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
42

Laurent Montel's avatar
Laurent Montel committed
43
if("${CMAKE_SOURCE_DIR}" STREQUAL "${KIdentityManagement_SOURCE_DIR}")
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
44
  find_package(KF5PimTextEdit ${KDEPIMLIBS_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
45
endif()
46
add_definitions(-DTRANSLATION_DOMAIN=\"libkpimidentities5\")
47
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
48
49
50

########### Targets ###########
add_subdirectory(src)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
51
add_subdirectory(autotests)
52

53
########### CMake Config Files ###########
Laurent Montel's avatar
Laurent Montel committed
54
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5IdentityManagement")
55

56
ecm_configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
57
58
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5IdentityManagementConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfig.cmake"
59
60
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
61

62
install(FILES
Laurent Montel's avatar
Laurent Montel committed
63
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfig.cmake"
Laurent Montel's avatar
Laurent Montel committed
64
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfigVersion.cmake"
65
66
67
68
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

Laurent Montel's avatar
Laurent Montel committed
69
install(EXPORT KF5IdentityManagementTargets
70
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
Laurent Montel's avatar
Laurent Montel committed
71
    FILE KF5IdentityManagementTargets.cmake
72
73
74
75
    NAMESPACE KF5::
)

install(FILES
Laurent Montel's avatar
Laurent Montel committed
76
   ${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h
77
   DESTINATION ${KF5_INCLUDE_INSTALL_DIR}
78
79
   COMPONENT Devel
)
80

Laurent Montel's avatar
Laurent Montel committed
81
if ("${CMAKE_BINARY_DIR}" STREQUAL "${KIdentityManagement_BINARY_DIR}")
82
83
  feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
endif()