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

4
project(MailImporter VERSION ${PIM_VERSION})
5

6
set(KF5_MIN_VERSION "5.71.0")
Laurent Montel's avatar
Laurent Montel committed
7

8
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
9 10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
11 12 13 14 15

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

16 17 18 19
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
20

21 22 23
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
24

Laurent Montel's avatar
Laurent Montel committed
25

26

Laurent Montel's avatar
Laurent Montel committed
27 28
set(MAILIMPORTER_LIB ${PIM_VERSION})

29

30
set(AKONADIMIME_LIB_VERSION "5.14.40")
31
set(QT_REQUIRED_VERSION "5.13.0")
32 33
set(KMIME_LIB_VERSION "5.14.40")
set(AKONADI_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
34
set(PIMCOMMON_LIB_VERSION_LIB "5.14.42")
35

36 37
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Xml)

38 39 40 41
find_package(KF5Archive ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
42 43

find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
44
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
45
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
46
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
47 48
########### Targets ###########

49

50
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
51
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
52
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054700)
53 54
endif()

55

56 57 58
########### CMake Config Files ###########

add_definitions(-DTRANSLATION_DOMAIN=\"libmailimporter\")
Laurent Montel's avatar
Laurent Montel committed
59 60 61

if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
62
endif()
Laurent Montel's avatar
Laurent Montel committed
63
add_definitions(-DQT_NO_FOREACH)
64
add_definitions(-DQT_NO_KEYWORDS)
Laurent Montel's avatar
Laurent Montel committed
65

66 67
add_subdirectory(src)

68
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
69 70 71 72
        EXPORT MAILIMPORTER
        FILE mailimporter.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
73 74

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)