1 cmake_minimum_required(VERSION 2.8.12)
3 project(TemplateParser)
6 if(${CMAKE_SOURCE_DIR} STREQUAL ${TemplateParser_SOURCE_DIR})
8 find_package(ECM 5.16.0 CONFIG REQUIRED)
9 set(CMAKE_MODULE_PATH ${TemplateParser_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
11 include(GenerateExportHeader)
12 include(ECMSetupVersion)
13 include(ECMGenerateHeaders)
14 include(ECMGeneratePriFile)
15 include(ECMPackageConfigHelpers)
16 include(ECMSetupVersion)
17 include(FeatureSummary)
18 include(KDEInstallDirs)
19 include(KDECMakeSettings)
20 include(KDEFrameworkCompilerSettings)
21 include(ECMQtDeclareLoggingCategory)
25 set(KF5_VERSION "5.16.0")
26 set(KDEPIMLIBS_LIB_VERSION "5.0.81")
27 set(KDEPIM_LIB_VERSION "5.0.90")
28 set(QT_REQUIRED_VERSION "5.4.0")
29 set(KMIME_LIB_VERSION "4.87.0")
30 set(IDENTITYMANAGEMENT_LIB_VERSION "4.80.0")
32 find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
33 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools WebKitWidgets)
34 find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
35 find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
36 find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
37 find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)
38 find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
39 find_package(KF5Completion ${KF5_VERSION} CONFIG REQUIRED)
40 find_package(KF5PimCommon ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
41 find_package(KF5MessageViewer ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
42 find_package(KF5MessageCore ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
43 find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
44 find_package(KF5Libkleo ${KDEPIM_LIB_VERSION} CONFIG REQUIRED)
45 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX TEMPLATEPARSER
46 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/templateparser_version.h"
47 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5TemplateParserConfigVersion.cmake"
51 remove_definitions( -DQT_NO_CAST_FROM_BYTEARRAY )
53 ########### CMake Config Files ###########
54 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5TemplateParser")
56 ecm_configure_package_config_file(
57 "${CMAKE_CURRENT_SOURCE_DIR}/KF5TemplateParserConfig.cmake.in"
58 "${CMAKE_CURRENT_BINARY_DIR}/KF5TemplateParserConfig.cmake"
59 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
63 "${CMAKE_CURRENT_BINARY_DIR}/KF5TemplateParserConfig.cmake"
64 "${CMAKE_CURRENT_BINARY_DIR}/KF5TemplateParserConfigVersion.cmake"
65 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
69 install(EXPORT KF5TemplateParserTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5TemplateParserTargets.cmake NAMESPACE KF5::)
72 ${CMAKE_CURRENT_BINARY_DIR}/templateparser_version.h
73 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
76 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
78 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX TEMPLATEPARSER
79 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mailimporter_version.h"
80 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MailImporterConfigVersion.cmake"
87 add_subdirectory(autotests)
88 add_subdirectory(tests)