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.12.1")
3

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

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

9
find_package(ECM ${KF5_MIN_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})
Laurent Montel's avatar
Laurent Montel committed
27
set(PIMTEXTEDIT_LIB_VERSION "5.12.0")
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

find_package(Qt5Network NO_MODULE REQUIRED)
38
39
40
41
42
43
44
45
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${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

Laurent Montel's avatar
Laurent Montel committed
50
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
Laurent Montel's avatar
Laurent Montel committed
51
add_definitions(-DQT_NO_FOREACH)
52

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

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

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

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

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

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

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

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

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