CMakeLists.txt 2.45 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
Sandro Knauß's avatar
Sandro Knauß committed
2
set(PIM_VERSION "5.6.90")
3

4
project(KontactInterface VERSION ${PIM_VERSION})
5

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

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

Laurent Montel's avatar
Laurent Montel committed
12
13
14
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
Laurent Montel's avatar
Laurent Montel committed
15
include(CMakePackageConfigHelpers)
Laurent Montel's avatar
Laurent Montel committed
16
17
18
19
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
20
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
21
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
22
23
include(ECMCoverageOption)

24

25

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

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

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

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

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

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


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

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

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