CMakeLists.txt 2.86 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
2
set(PIM_VERSION "5.6.40")
3

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

6
# ECM setup
7
set(KF5_VERSION "5.37.0")
Laurent Montel's avatar
Laurent Montel committed
8
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
9
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
10

11
12
13
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
Laurent Montel's avatar
Laurent Montel committed
14
include(CMakePackageConfigHelpers)
15
16
17
18
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
19
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
20
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
21
22
include(ECMCoverageOption)

23

Laurent Montel's avatar
Laurent Montel committed
24
25

set(KIDENTITYMANAGEMENT_LIB_VERSION ${PIM_VERSION})
26
set(PIMTEXTEDIT_LIB_VERSION "5.6.40")
27

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

34
########### Find packages ###########
Laurent Montel's avatar
Laurent Montel committed
35
36
37
38
39
40

find_package(Qt5Network NO_MODULE REQUIRED)
find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)
41
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
42
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
43
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
44
find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
45

Laurent Montel's avatar
Laurent Montel committed
46
find_package(KF5PimTextEdit ${PIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
47
add_definitions(-DTRANSLATION_DOMAIN=\"libkpimidentities5\")
48
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
49
50
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
51
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
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

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