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

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

6
# ECM setup
7
set(KF5_MIN_VERSION "5.61.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.12.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
46
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
47

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

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

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

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

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

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

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

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

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

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

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