CMakeLists.txt 2.44 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.15.41")
3

4
project(libkdepim VERSION ${PIM_VERSION})
5

Laurent Montel's avatar
Laurent Montel committed
6
set(KF5_MIN_VERSION "5.74.0")
Laurent Montel's avatar
Laurent Montel committed
7

8
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
9
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
10 11 12 13 14

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

15 16 17 18
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
19

20 21 22
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
23

Laurent Montel's avatar
Laurent Montel committed
24

Laurent Montel's avatar
Laurent Montel committed
25
set(LIBKDEPIM_LIB_VERSION ${PIM_VERSION})
26
set(QT_REQUIRED_VERSION "5.13.0")
27

28 29
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test DBus Network)

30 31
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
32
find_package(KF5Completion ${KF5_MIN_VERSION} CONFIG REQUIRED)
33 34 35 36 37 38
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ItemViews ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5JobWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
39
find_package(KF5GuiAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
40

41 42
option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON)
add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
43

44
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
45
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054A00)
46

Laurent Montel's avatar
Laurent Montel committed
47
add_definitions(-DQT_NO_FOREACH)
48
add_definitions(-DQT_NO_KEYWORDS)
Laurent Montel's avatar
Laurent Montel committed
49
set(CMAKE_CXX_STANDARD 14)
50 51
set(CMAKE_CXX_STANDARD_REQUIRED ON)

52 53 54 55
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Libkdepim")


Laurent Montel's avatar
Laurent Montel committed
56
configure_package_config_file(MailTransportDBusServiceConfig.cmake.in
57 58 59 60 61 62 63 64 65 66 67
  ${CMAKE_CURRENT_BINARY_DIR}/MailTransportDBusServiceConfig.cmake
  PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
  INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_PREFIX}/MailTransportDBusService")

install(FILES
  ${CMAKE_CURRENT_BINARY_DIR}/MailTransportDBusServiceConfig.cmake
  DESTINATION "${CMAKECONFIG_INSTALL_PREFIX}/MailTransportDBusService")


add_subdirectory(src)

68
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
69 70 71 72
        EXPORT LIBKDEPIM
        FILE libkdepim.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
73

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