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

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

6
# ECM setup
Laurent Montel's avatar
Laurent Montel committed
7
set(KF5_VERSION "5.43.0")
8

Laurent Montel's avatar
Laurent Montel committed
9
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
11

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

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.7.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
38
39
40
41

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)
42
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
43
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
44
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
45
find_package(KF5IconThemes ${KF5_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
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
50
51
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
52
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
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

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