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

4
project(KontactInterface VERSION ${PIM_VERSION})
5

Laurent Montel's avatar
Laurent Montel committed
6
# ECM setup
7
set(KF5_MIN_VERSION "5.63.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

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

Laurent Montel's avatar
Laurent Montel committed
38
########### Find packages ###########
39
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
40 41 42 43 44 45
    CoreAddons
    Parts
    WindowSystem
    I18n
    XmlGui
)
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 80
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
81
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
82 83
endif()

Laurent Montel's avatar
Laurent Montel committed
84
add_definitions(-DQT_NO_FOREACH)
85

Laurent Montel's avatar
Laurent Montel committed
86
add_subdirectory(src)
87

88
install(FILES kontactinterface.renamecategories kontactinterface.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
89 90


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