CMakeLists.txt 2.74 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
6
set(KF5_VERSION "5.28.0")
Laurent Montel's avatar
Laurent Montel committed
7
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
8
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
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)
18
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
19
include(ECMQtDeclareLoggingCategory)
20

21
set(PIM_VERSION "5.4.40")
Laurent Montel's avatar
Laurent Montel committed
22
23

set(KIDENTITYMANAGEMENT_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
24
set(PIMTEXTEDIT_LIB_VERSION "5.4.40")
25

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

32
########### Find packages ###########
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)
Laurent Montel's avatar
Laurent Montel committed
43
find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
44

Laurent Montel's avatar
Laurent Montel committed
45
find_package(KF5PimTextEdit ${PIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
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)
51
52

if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
53
    add_subdirectory(autotests)
54
endif()
55

56
########### CMake Config Files ###########
57
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IdentityManagement")
58

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

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

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

install(FILES
Laurent Montel's avatar
Laurent Montel committed
79
   ${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h
80
   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
81
82
   COMPONENT Devel
)
83

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