CMakeLists.txt 2.65 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
set(PIM_VERSION "5.14.80")
3

4
project(KontactInterface VERSION ${PIM_VERSION})
5

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

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

12 13 14 15
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

Laurent Montel's avatar
Laurent Montel committed
16 17 18
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
19

Laurent Montel's avatar
Laurent Montel committed
20 21
include(ECMSetupVersion)
include(FeatureSummary)
22
include(ECMQtDeclareLoggingCategory)
23
include(ECMSetupQtPluginMacroNames)
Laurent Montel's avatar
Laurent Montel committed
24

25

26

27
add_definitions(-DTRANSLATION_DOMAIN=\"kontactinterfaces5\")
Laurent Montel's avatar
Laurent Montel committed
28 29

set(KONTACTINTERFACE_LIB_VERSION ${PIM_VERSION})
30
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KontactInterface")
31

32
ecm_setup_version(PROJECT VARIABLE_PREFIX KONTACTINTERFACE
Laurent Montel's avatar
Laurent Montel committed
33 34 35
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kontactinterface_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KontactInterfaceConfigVersion.cmake"
                        SOVERSION 5
Allen Winter's avatar
cleanup  
Allen Winter committed
36
)
37

38 39 40 41 42 43 44 45 46
ecm_setup_qtplugin_macro_names(
    JSON_NONE
        EXPORT_KONTACT_PLUGIN
    JSON_ARG3
        EXPORT_KONTACT_PLUGIN_WITH_JSON
    CONFIG_CODE_VARIABLE
        PACKAGE_SETUP_AUTOMOC_VARIABLES
)

Laurent Montel's avatar
Laurent Montel committed
47
########### Find packages ###########
48
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
49 50 51 52 53 54
    CoreAddons
    Parts
    WindowSystem
    I18n
    XmlGui
)
55

56 57 58
if (NOT APPLE)
    find_package(X11)
endif()
59 60
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
61 62 63 64 65

set(KONTACTINTERFACE_HAVE_X11 ${X11_FOUND})
configure_file(config-kontactinterface.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kontactinterface.h )


Laurent Montel's avatar
Laurent Montel committed
66
configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
67 68 69 70 71
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5KontactInterfaceConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5KontactInterfaceConfig.cmake"
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

Laurent Montel's avatar
Laurent Montel committed
72 73 74 75 76 77 78 79
########### Install Files ###########
install(FILES
  "${CMAKE_CURRENT_BINARY_DIR}/KF5KontactInterfaceConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5KontactInterfaceConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

Laurent Montel's avatar
Laurent Montel committed
80

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


Laurent Montel's avatar
Laurent Montel committed
88 89
install(EXPORT KF5KontactInterfaceTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5KontactInterfaceTargets.cmake NAMESPACE KF5::)

90
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
91
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054700)
92

Laurent Montel's avatar
Laurent Montel committed
93
add_definitions(-DQT_NO_FOREACH)
94
add_definitions(-DQT_NO_KEYWORDS)
95

Laurent Montel's avatar
Laurent Montel committed
96
add_subdirectory(src)
97 98


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