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

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

6
# ECM setup
7
set(KF5_MIN_VERSION "5.68.0")
8

9
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
11

12
13
14
15
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

16
17
18
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
19

20
21
include(ECMSetupVersion)
include(FeatureSummary)
22
include(ECMQtDeclareLoggingCategory)
23

Laurent Montel's avatar
Laurent Montel committed
24

25

Laurent Montel's avatar
Laurent Montel committed
26
27

set(KIDENTITYMANAGEMENT_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
28
set(PIMTEXTEDIT_LIB_VERSION "5.13.40")
29

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

36
########### Find packages ###########
Laurent Montel's avatar
Laurent Montel committed
37
38

find_package(Qt5Network NO_MODULE REQUIRED)
39
40
41
42
43
44
45
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_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
51
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
52
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
53
54
endif()

Laurent Montel's avatar
Laurent Montel committed
55
add_definitions(-DQT_NO_FOREACH)
56
57
########### Targets ###########
add_subdirectory(src)
58
59

if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
60
    add_subdirectory(autotests)
61
endif()
62

63
########### CMake Config Files ###########
64
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IdentityManagement")
65

Laurent Montel's avatar
Laurent Montel committed
66
configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
67
68
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5IdentityManagementConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfig.cmake"
69
70
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
71

72
install(FILES
Laurent Montel's avatar
Laurent Montel committed
73
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfig.cmake"
Laurent Montel's avatar
Laurent Montel committed
74
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfigVersion.cmake"
75
76
77
78
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

Laurent Montel's avatar
Laurent Montel committed
79
install(EXPORT KF5IdentityManagementTargets
80
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
Laurent Montel's avatar
Laurent Montel committed
81
    FILE KF5IdentityManagementTargets.cmake
82
83
84
85
    NAMESPACE KF5::
)

install(FILES
Laurent Montel's avatar
Laurent Montel committed
86
   ${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h
87
   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
88
89
   COMPONENT Devel
)
90

Laurent Montel's avatar
Laurent Montel committed
91

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