CMakeLists.txt 3.03 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")
8
9
10
11
12
13
14
15
16
option(RUN_UNINSTALL "test run uninstalled apps (experimental)" FALSE)

set(ECM_VERSION ${KF5_VERSION})
# ECM setup
if (RUN_UNINSTALL)
   set(ECM_VERSION "5.38.0")
endif()

find_package(ECM ${ECM_VERSION} CONFIG REQUIRED)
17
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
18

19
20
21
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
Laurent Montel's avatar
Laurent Montel committed
22
include(CMakePackageConfigHelpers)
23
24
25
26
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
27
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
28
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
29
30
include(ECMCoverageOption)

31

Laurent Montel's avatar
Laurent Montel committed
32
33

set(KIDENTITYMANAGEMENT_LIB_VERSION ${PIM_VERSION})
34
set(PIMTEXTEDIT_LIB_VERSION "5.6.40")
35

36
ecm_setup_version(PROJECT VARIABLE_PREFIX KIDENTITYMANAGEMENT
Laurent Montel's avatar
Laurent Montel committed
37
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h"
Laurent Montel's avatar
Laurent Montel committed
38
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfigVersion.cmake"
39
                        SOVERSION 5
40
)
41

42
########### Find packages ###########
Laurent Montel's avatar
Laurent Montel committed
43
44
45
46
47
48

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)
49
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
50
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
51
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
52
find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
53

Laurent Montel's avatar
Laurent Montel committed
54
find_package(KF5PimTextEdit ${PIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
55
add_definitions(-DTRANSLATION_DOMAIN=\"libkpimidentities5\")
56
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
57
58
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
59
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
60
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
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)