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

4
project(KMbox VERSION ${PIM_VERSION})
Àlex Fiestas's avatar
Àlex Fiestas committed
5

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

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

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
15
16
17
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
18

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
19
20
include(ECMSetupVersion)
include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
21
include(ECMQtDeclareLoggingCategory)
22

Laurent Montel's avatar
Laurent Montel committed
23

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
24

Laurent Montel's avatar
Laurent Montel committed
25
26

set(KMBOX_LIB_VERSION ${PIM_VERSION})
27
set(KMIME_LIB_VERSION "5.15.40")
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
28

29
ecm_setup_version(PROJECT VARIABLE_PREFIX KMBOX
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
30
31
32
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kmbox_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MboxConfigVersion.cmake"
                        SOVERSION 5
Volker Krause's avatar
Volker Krause committed
33
)
34

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
35
########### Find packages ###########
Laurent Montel's avatar
Laurent Montel committed
36
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
37

38
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
39
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054A00)
40

41
add_definitions(-DQT_NO_FOREACH)
42
add_definitions(-DQT_NO_KEYWORDS)
43
44
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
45

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
46
47
########### Targets ###########
add_subdirectory(src)
48
49
50
51

if(BUILD_TESTING)
    add_subdirectory(autotests)
endif()
52

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
53
########### CMake Config Files ###########
54
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Mbox")
55

Laurent Montel's avatar
Laurent Montel committed
56
configure_package_config_file(
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
57
58
59
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5MboxConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5MboxConfig.cmake"
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
Allen Winter's avatar
Allen Winter committed
60
)
61
62

install(FILES
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
63
64
65
  "${CMAKE_CURRENT_BINARY_DIR}/KF5MboxConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5MboxConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
66
67
  COMPONENT Devel
)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
68
69
70
71
72

install(EXPORT KF5MboxTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5MboxTargets.cmake NAMESPACE KF5::)

install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kmbox_version.h
73
   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
74
75
   COMPONENT Devel
)
Laurent Montel's avatar
Laurent Montel committed
76

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