CMakeLists.txt 2.67 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 5.12.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.12.0")
Laurent Montel's avatar
Laurent Montel committed
21
set(KIDENTITYMANAGEMENT_LIB_VERSION "4.81.0")
Laurent Montel's avatar
Laurent Montel committed
22
set(PIMTEXTEDIT_LIB_VERSION "4.79.0")
23

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

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

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)
39
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
40
41
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Emoticons ${KF5_VERSION} CONFIG REQUIRED)
42
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
43

Laurent Montel's avatar
Laurent Montel committed
44
find_package(KF5PimTextEdit ${PIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
45
add_definitions(-DTRANSLATION_DOMAIN=\"libkpimidentities5\")
46
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
47
48
49

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

52
########### CMake Config Files ###########
53
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IdentityManagement")
54

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
80
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)