CMakeLists.txt 2.42 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
set(PIM_VERSION "5.10.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
Laurent Montel's avatar
Laurent Montel committed
7
set(KF5_MIN_VERSION "5.56.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})
26
27
28
set(CALENDARCORE_LIB_VERSION "5.10.40")
set(SYNDICATION_LIB_VERSION "5.10.40")
set(XMLRPCCLIENT_LIB_VERSION "5.10.40")
29
set(QT_REQUIRED_VERSION "5.10.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\")
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()
Christian Weilbach's avatar
Christian Weilbach committed
52

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

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

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

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
71
72
install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kblog_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
install( FILES kblog.renamecategories kblog.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
Christian Weilbach's avatar
Christian Weilbach committed
77

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