CMakeLists.txt 2.84 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.15.40")
3

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

6
# ECM setup
7
set(KF5_MIN_VERSION "5.73.0")
8
set(QT_REQUIRED_VERSION "5.13.0")
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.15.41")
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
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
51
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054900)
52

Laurent Montel's avatar
Laurent Montel committed
53
add_definitions(-DQT_NO_FOREACH)
54
add_definitions(-DQT_NO_KEYWORDS)
55
56
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
57
58
########### Targets ###########
add_subdirectory(src)
59
60

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

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

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
92

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