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

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

6
# ECM setup
Laurent Montel's avatar
Laurent Montel committed
7
set(KF5_MIN_VERSION "5.56.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})
27
set(PIMTEXTEDIT_LIB_VERSION "5.11.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

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
51
52
53
54
55
# workaround for https://bugreports.qt.io/browse/QTBUG-74665 (bug in qt5.13 reevaluate it)
if (${Qt5Widgets_VERSION} STRGREATER "5.13")
   MESSAGE(STATUS "Qt version: ${Qt5Widgets_VERSION} DISABLE compile without deprecated methods. bug QTBUG-74665")
else()
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
56
57
58
59
60
if (${KF5Config_VERSION} STRGREATER "5.56.0")
        add_definitions(-DQT_NO_FOREACH)
        MESSAGE(STATUS "compile without foreach")
endif()

61
62
########### Targets ###########
add_subdirectory(src)
63
64

if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
65
    add_subdirectory(autotests)
66
endif()
67

68
########### CMake Config Files ###########
69
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IdentityManagement")
70

Laurent Montel's avatar
Laurent Montel committed
71
configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
72
73
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5IdentityManagementConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfig.cmake"
74
75
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
76

77
install(FILES
Laurent Montel's avatar
Laurent Montel committed
78
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfig.cmake"
Laurent Montel's avatar
Laurent Montel committed
79
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfigVersion.cmake"
80
81
82
83
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

Laurent Montel's avatar
Laurent Montel committed
84
install(EXPORT KF5IdentityManagementTargets
85
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
Laurent Montel's avatar
Laurent Montel committed
86
    FILE KF5IdentityManagementTargets.cmake
87
88
89
90
    NAMESPACE KF5::
)

install(FILES
Laurent Montel's avatar
Laurent Montel committed
91
   ${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h
92
   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
93
94
   COMPONENT Devel
)
95

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

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