CMakeLists.txt 3.15 KB
Newer Older
1
2
3
4
cmake_minimum_required(VERSION 2.8.12)

project(libkleo)

Laurent Montel's avatar
Laurent Montel committed
5
find_package(ECM 5.19.0 CONFIG REQUIRED)
6
7
8
9
10
11
12
13
14
15
16
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
17
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
18
19
20
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)

Laurent Montel's avatar
Laurent Montel committed
21
set(PIM_VERSION "5.2.40")
Laurent Montel's avatar
Laurent Montel committed
22
set(KF5_VERSION "5.19.0")
Laurent Montel's avatar
Laurent Montel committed
23
set(LIBKLEO_LIB_VERSION ${PIM_VERSION})
24
set(QT_REQUIRED_VERSION "5.4.0")
Laurent Montel's avatar
Laurent Montel committed
25
26
27
set(GPGMEPP_LIB_VERSION "5.2.40")
set(KDEPIMTEXTEDIT_VERSION "5.2.40")
set(PIMCOMMON_LIB_VERSION "5.2.40")
28

Andre Heinecke's avatar
Andre Heinecke committed
29
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets)
30
31
32
33
34
35
36
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Gpgmepp ${GPGMEPP_LIB_VERSION} CONFIG REQUIRED)
37
find_package(KF5PimTextEdit ${KDEPIMTEXTEDIT_VERSION} CONFIG)
Laurent Montel's avatar
Laurent Montel committed
38
39
40
41
42
43

find_package(Boost 1.34.0)
set_package_properties(Boost PROPERTIES DESCRIPTION "Boost C++ Libraries" URL "http://www.boost.org" TYPE REQUIRED PURPOSE "Boost is required for building most KDEPIM applications")



44
45
46
47
48
set_package_properties(KF5PimTextEdit PROPERTIES DESCRIPTION
                       "A textedit with PIM-specific features."
                       URL "https://projects.kde.org/projects/kde/pim/kpimtextedit"
                       TYPE OPTIONAL PURPOSE "Improved audit log viewer.")

Laurent Montel's avatar
Laurent Montel committed
49
ecm_setup_version(${LIBKLEO_LIB_VERSION} VARIABLE_PREFIX LIBKLEO
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/libkleo_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkleoConfigVersion.cmake"
                        SOVERSION 5
)

########### Targets ###########
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
remove_definitions( -DQT_NO_CAST_FROM_ASCII )
remove_definitions( -DQT_NO_CAST_TO_ASCII )

########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Libkleo")

ecm_configure_package_config_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5LibkleoConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkleoConfig.cmake"
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
  "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkleoConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5LibkleoConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

install(EXPORT KF5LibkleoTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5LibkleoTargets.cmake NAMESPACE KF5::)

install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/libkleo_version.h
  DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)

Laurent Montel's avatar
Laurent Montel committed
84

85
86

add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
87
install( FILES libkleo.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
Laurent Montel's avatar
Laurent Montel committed
88
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)