CMakeLists.txt 2.57 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.14.40")
Andreas Pakulat's avatar
Andreas Pakulat committed
3

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

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
6
# ECM setup
7
set(KF5_MIN_VERSION "5.71.0")
Laurent Montel's avatar
Laurent Montel committed
8

9
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
Christian Weilbach's avatar
Christian Weilbach committed
11

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

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

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
20
21
include(ECMSetupVersion)
include(FeatureSummary)
22
include(ECMQtDeclareLoggingCategory)
23

Laurent Montel's avatar
Laurent Montel committed
24

Christian Weilbach's avatar
Christian Weilbach committed
25

Laurent Montel's avatar
Laurent Montel committed
26
set(KBLOG_LIB_VERSION ${PIM_VERSION})
27
28
set(SYNDICATION_LIB_VERSION "5.14.40")
set(XMLRPCCLIENT_LIB_VERSION "5.14.40")
29
set(QT_REQUIRED_VERSION "5.13.0")
30
ecm_setup_version(PROJECT VARIABLE_PREFIX KBLOG
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
31
32
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kblog_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5BlogConfigVersion.cmake"
33
                        SOVERSION 5)
34

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
35
########### Find packages ###########
36
37
38
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
39

40
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
41
42
find_package(KF5Syndication ${SYNDICATION_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5XmlRpcClient ${XMLRPCCLIENT_LIB_VERSION} CONFIG REQUIRED)
Christian Weilbach's avatar
Christian Weilbach committed
43

44
add_definitions(-DTRANSLATION_DOMAIN=\"libkblog5\")
Laurent Montel's avatar
Laurent Montel committed
45
add_definitions(-DQT_NO_FOREACH)
46
add_definitions(-DQT_NO_KEYWORDS)
47
48
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054700)
49

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
50
51
########### Targets ###########
add_subdirectory(src)
52
53
54
55

if(BUILD_TESTING)
    add_subdirectory(autotests)
endif()
Christian Weilbach's avatar
Christian Weilbach committed
56

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
57
########### CMake Config Files ###########
58
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Blog")
Christian Weilbach's avatar
Christian Weilbach committed
59

Laurent Montel's avatar
Laurent Montel committed
60
configure_package_config_file(
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
61
62
63
64
65
66
67
68
69
70
71
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5BlogConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5BlogConfig.cmake"
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
  "${CMAKE_CURRENT_BINARY_DIR}/KF5BlogConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5BlogConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)
Christian Weilbach's avatar
Christian Weilbach committed
72

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
73
install(EXPORT KF5BlogTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5BlogTargets.cmake NAMESPACE KF5::)
Christian Weilbach's avatar
Christian Weilbach committed
74

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
75
76
install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kblog_version.h
77
   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
78
79
   COMPONENT Devel
)
80
install(FILES kblog.renamecategories kblog.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Christian Weilbach's avatar
Christian Weilbach committed
81

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