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

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
12
13
14
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
15

Christophe Giboudeaux's avatar
Christophe Giboudeaux 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

Christian Weilbach's avatar
Christian Weilbach committed
24

Laurent Montel's avatar
Laurent Montel committed
25
set(KBLOG_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
26
27
28
set(CALENDARCORE_LIB_VERSION "5.11.90")
set(SYNDICATION_LIB_VERSION "5.11.90")
set(XMLRPCCLIENT_LIB_VERSION "5.11.90")
29
set(QT_REQUIRED_VERSION "5.11.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

Laurent Montel's avatar
Laurent Montel committed
40
41
42
find_package(KF5CalendarCore ${CALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
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_DISABLE_DEPRECATED_BEFORE=0x060000)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
47
48
########### Targets ###########
add_subdirectory(src)
49
50
51
52

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

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
54
########### CMake Config Files ###########
55
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Blog")
Christian Weilbach's avatar
Christian Weilbach committed
56

Laurent Montel's avatar
Laurent Montel committed
57
configure_package_config_file(
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
58
59
60
61
62
63
64
65
66
67
68
  "${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
69

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

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

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