CMakeLists.txt 2.73 KB
Newer Older
1
cmake_minimum_required(VERSION 2.8.12)
2

Laurent Montel's avatar
Laurent Montel committed
3
project(KIdentityManagement)
4

5
# ECM setup
Laurent Montel's avatar
Laurent Montel committed
6
find_package(ECM 5.16.0 CONFIG REQUIRED)
7
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
8

9
10
11
12
13
14
15
16
17
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
18
include(ECMQtDeclareLoggingCategory)
19

Laurent Montel's avatar
Laurent Montel committed
20
21
22
set(KF5_VERSION "5.16.0")
set(KIDENTITYMANAGEMENT_LIB_VERSION "4.82.0")
set(PIMTEXTEDIT_LIB_VERSION "4.86.0")
23

Laurent Montel's avatar
Laurent Montel committed
24
ecm_setup_version(${KIDENTITYMANAGEMENT_LIB_VERSION} VARIABLE_PREFIX KIDENTITYMANAGEMENT
Laurent Montel's avatar
Laurent Montel committed
25
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h"
Laurent Montel's avatar
Laurent Montel committed
26
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5IdentityManagementConfigVersion.cmake"
27
                        SOVERSION 5
28
)
29

30
########### Find packages ###########
Laurent Montel's avatar
Laurent Montel committed
31
32
33
34
35
36

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)
37
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
38
39
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Emoticons ${KF5_VERSION} CONFIG REQUIRED)
40
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
41
find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Cleanup    
Christophe Giboudeaux committed
42

Laurent Montel's avatar
Laurent Montel committed
43
find_package(KF5PimTextEdit ${PIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
44
add_definitions(-DTRANSLATION_DOMAIN=\"libkpimidentities5\")
45
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
46
47
48

########### Targets ###########
add_subdirectory(src)
49
50

if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
51
52
    MESSAGE(STATUS "reactivate autotests")
    #add_subdirectory(autotests)
53
endif()
54

55
########### CMake Config Files ###########
56
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5IdentityManagement")
57

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

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

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

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

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