CMakeLists.txt 2.76 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
set(PIM_VERSION "5.10.40")
3

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

6
# ECM setup
7
set(KF5_VERSION "5.53.0")
8

Laurent Montel's avatar
Laurent Montel committed
9
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
11

12
13
14
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
15

16
17
18
19
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
20
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
21
include(ECMQtDeclareLoggingCategory)
22

Laurent Montel's avatar
Laurent Montel committed
23

24

Laurent Montel's avatar
Laurent Montel committed
25
26

set(KIDENTITYMANAGEMENT_LIB_VERSION ${PIM_VERSION})
27
set(PIMTEXTEDIT_LIB_VERSION "5.10.40")
28

29
ecm_setup_version(PROJECT VARIABLE_PREFIX KIDENTITYMANAGEMENT
Laurent Montel's avatar
Laurent Montel committed
30
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h"
Laurent Montel's avatar
Laurent Montel committed
31
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfigVersion.cmake"
32
                        SOVERSION 5
33
)
34

35
########### Find packages ###########
Laurent Montel's avatar
Laurent Montel committed
36
37
38
39
40
41

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)
42
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
43
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
44
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
45
find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
46

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

50
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
51
52
53

########### Targets ###########
add_subdirectory(src)
54
55

if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
56
    add_subdirectory(autotests)
57
endif()
58

59
########### CMake Config Files ###########
60
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IdentityManagement")
61

Laurent Montel's avatar
Laurent Montel committed
62
configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
63
64
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5IdentityManagementConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfig.cmake"
65
66
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
67

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

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

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

Laurent Montel's avatar
Laurent Montel committed
87
install( FILES kidentitymanagement.categories kidentitymanagement.renamecategories DESTINATION ${KDE_INSTALL_CONFDIR} )
Laurent Montel's avatar
Laurent Montel committed
88

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