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

4
project(KIdentityManagement VERSION ${PIM_VERSION})
5

6
# ECM setup
7
set(KF5_VERSION "5.28.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
14
15
16
17
18
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
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})
Laurent Montel's avatar
Laurent Montel committed
26
set(PIMTEXTEDIT_LIB_VERSION "5.4.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
43
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Emoticons ${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
52

########### Targets ###########
add_subdirectory(src)
53
54

if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
55
    add_subdirectory(autotests)
56
endif()
57

58
########### CMake Config Files ###########
59
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IdentityManagement")
60

61
ecm_configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
62
63
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5IdentityManagementConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfig.cmake"
64
65
  INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
66

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

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

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

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