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

4
project(KontactInterface VERSION ${PIM_VERSION})
5

Laurent Montel's avatar
Laurent Montel committed
6
# ECM setup
7
set(KF5_VERSION "5.35.0")
Laurent Montel's avatar
Laurent Montel committed
8
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
9
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
10

Laurent Montel's avatar
Laurent Montel committed
11
12
13
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
Laurent Montel's avatar
Laurent Montel committed
14
include(CMakePackageConfigHelpers)
Laurent Montel's avatar
Laurent Montel committed
15
16
17
18
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

24

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

set(KONTACTINTERFACE_LIB_VERSION ${PIM_VERSION})
28
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KontactInterface")
29

30
ecm_setup_version(PROJECT VARIABLE_PREFIX KONTACTINTERFACE
Laurent Montel's avatar
Laurent Montel committed
31
32
33
                        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
34
)
35

Laurent Montel's avatar
Laurent Montel committed
36
########### Find packages ###########
37
38
39
40
41
42
43
44
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS
    CoreAddons
    Parts
    WindowSystem
    I18n
    XmlGui
    IconThemes
)
45

46
47
48
49
50
51
52
53
if (NOT APPLE)
    find_package(X11)
endif()

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
54
configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
55
56
57
58
59
  "${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
60
61
62
63
64
65
66
67
########### 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
68

Laurent Montel's avatar
Laurent Montel committed
69
70
install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kontactinterface_version.h
71
   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
Laurent Montel's avatar
Laurent Montel committed
72
73
74
75
   COMPONENT Devel
)


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

78
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
79
80
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
81
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
82

Laurent Montel's avatar
Laurent Montel committed
83
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
84
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Laurent Montel's avatar
Laurent Montel committed
85