CMakeLists.txt 2.38 KB
Newer Older
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
1
cmake_minimum_required(VERSION 2.8.12)
Andreas Pakulat's avatar
Andreas Pakulat committed
2

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
3
project(KBlog)
Àlex Fiestas's avatar
Àlex Fiestas committed
4

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
5
# ECM setup
Laurent Montel's avatar
Laurent Montel committed
6
find_package(ECM 5.19.0 CONFIG REQUIRED)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
7
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
Christian Weilbach's avatar
Christian Weilbach committed
8

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
9 10 11 12 13 14 15 16
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
17
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
18
include(ECMQtDeclareLoggingCategory)
Christian Weilbach's avatar
Christian Weilbach committed
19

Laurent Montel's avatar
Laurent Montel committed
20
set(KF5_VERSION "5.19.0")
Laurent Montel's avatar
Laurent Montel committed
21 22 23 24
set(KBLOG_LIB_VERSION "5.2.40")
set(CALENDARCORE_LIB_VERSION "5.2.40")
set(SYNDICATION_LIB_VERSION "5.2.40")
set(XMLRPCCLIENT_LIB_VERSION "5.2.40")
Laurent Montel's avatar
Laurent Montel committed
25
set(REQUIRED_QT_VERSION "5.4.0")
Laurent Montel's avatar
Laurent Montel committed
26
ecm_setup_version(${KBLOG_LIB_VERSION} VARIABLE_PREFIX KBLOG
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
27 28
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kblog_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5BlogConfigVersion.cmake"
29
                        SOVERSION 5)
30

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
31
########### Find packages ###########
32 33
find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
34

Laurent Montel's avatar
Laurent Montel committed
35
find_package(Qt5WebKitWidgets ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
36

Laurent Montel's avatar
Laurent Montel committed
37 38 39
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
40

41
add_definitions(-DTRANSLATION_DOMAIN=\"libkblog5\")
42
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
43 44
########### Targets ###########
add_subdirectory(src)
45 46 47 48

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

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
50
########### CMake Config Files ###########
51
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Blog")
Christian Weilbach's avatar
Christian Weilbach committed
52

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
53 54 55 56 57 58 59 60 61 62 63 64
ecm_configure_package_config_file(
  "${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
65

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

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
68 69
install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kblog_version.h
70
   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
71 72
   COMPONENT Devel
)
Christian Weilbach's avatar
Christian Weilbach committed
73

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