CMakeLists.txt 2.65 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.11.40")
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_MIN_VERSION "5.57.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

Laurent Montel's avatar
Laurent Montel committed
12
13
14
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
15

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)
22

Laurent Montel's avatar
Laurent Montel committed
23

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
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
39
40
41
42
43
44
45
    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::)

Laurent Montel's avatar
Laurent Montel committed
79
80
81
82
83
84
# workaround for https://bugreports.qt.io/browse/QTBUG-74665 (bug in qt5.13 reevaluate it)
if (${Qt5Widgets_VERSION} STRGREATER "5.13")
   MESSAGE(STATUS "Qt version: ${Qt5Widgets_VERSION} DISABLE compile without deprecated methods. bug QTBUG-74665")
else()
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
Laurent Montel's avatar
Laurent Montel committed
85
add_definitions(-DQT_NO_FOREACH)
86

Laurent Montel's avatar
Laurent Montel committed
87
add_subdirectory(src)
88
89
90
91

install( FILES kontactinterface.renamecategories kontactinterface.categories DESTINATION ${KDE_INSTALL_CONFDIR} )


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