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

4
project(MailImporter VERSION ${PIM_VERSION})
5

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

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
24

25

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

28

29
set(AKONADIMIME_LIB_VERSION "5.16.40")
30
set(QT_REQUIRED_VERSION "5.13.0")
31 32 33
set(KMIME_LIB_VERSION "5.16.40")
set(AKONADI_VERSION "5.16.40")
set(PIMCOMMON_LIB_VERSION "5.16.40")
34

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

37
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
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} CONFIG REQUIRED)
47 48
########### Targets ###########

49

50
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
51
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054D00)
52 53
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
54

55 56 57
########### CMake Config Files ###########

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

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

65 66
add_subdirectory(src)

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

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)