CMakeLists.txt 3.85 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1 2
project(kalarm)

Laurent Montel's avatar
Laurent Montel committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
if(${CMAKE_SOURCE_DIR} STREQUAL ${kalarm_SOURCE_DIR})
    cmake_minimum_required(VERSION 2.8.12)
    find_package(ECM 5.20.0 REQUIRED NO_MODULE)
    include(ECMInstallIcons)

    include(ECMOptionalAddSubdirectory)
    include(ECMSetupVersion)
    include(ECMAddTests)
    include(ECMMarkNonGuiExecutable)
    include(GenerateExportHeader)
    include(ECMGenerateHeaders)
    include(CMakePackageConfigHelpers)
    include(FeatureSummary)
    include(CheckFunctionExists)
    include(ECMGeneratePriFile)

    include(KDEInstallDirs)
    include(KDECMakeSettings)
    include(KDECompilerSettings NO_POLICY_SCOPE)
    include(ECMAddAppIcon)
    include(ECMQtDeclareLoggingCategory)


    set(KF5_VERSION "5.20.0")

Laurent Montel's avatar
Laurent Montel committed
28
    set(KDEPIM_VERSION_NUMBER "5.2.43")
Laurent Montel's avatar
Laurent Montel committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
    set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")

    set(KHOLIDAYS_LIB_VERSION "5.2.40")
    set(KDEPIMLIBS_LIB_VERSION "5.2.40")
    set(KMAILTRANSPORT_LIB_VERSION "5.2.40")
    set(AKONADICALENDAR_LIB_VERSION "5.2.40")
    set(CALENDARSUPPORT_LIB_VERSION_LIB "5.2.40")
    set(KPIMTEXTEDIT_LIB_VERSION "5.2.40")
    set(AKONADI_VERSION "5.2.40")
    set(KONTACTINTERFACE_LIB_VERSION "5.2.40")
    set(AKONADIKALARM_LIB_VERSION "5.2.40")

    set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
    set(KDEPIM_LIB_SOVERSION "5")


    set(QT_REQUIRED_VERSION "5.6.0")
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Sql)
    find_package(Qt5X11Extras NO_MODULE)
    set(LIBMAILIMPORTER_VERSION_LIB "5.2.40")
    set(MAILCOMMON_LIB_VERSION_LIB "5.2.40")
    set(LIBKLEO_LIB_VERSION_LIB "5.2.40")
    set(PIMCOMMON_LIB_VERSION_LIB "5.2.40")
    set(LIBKDEPIM_LIB_VERSION_LIB "5.2.40")
    set(CALENDARUTILS_LIB_VERSION "5.2.40")
    set(LIBGRANTLEETHEME_LIB_VERSION_LIB "5.2.40")
    # Find KF5 package
    find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5DocTools REQUIRED)
    find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
    find_package(Phonon4Qt5 CONFIG REQUIRED)

    # Find KdepimLibs Package
    find_package(KF5AlarmCalendar ${AKONADIKALARM_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
    find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5KdepimDBusInterfaces ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
    find_package(KF5Holidays ${KHOLIDAYS_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
72 73
    find_package(Boost 1.34.0)
    set_package_properties(Boost PROPERTIES DESCRIPTION "Boost C++ Libraries" URL "http://www.boost.org" TYPE REQUIRED PURPOSE "Boost is required for building most KDEPIM applications")
Laurent Montel's avatar
Laurent Montel committed
74 75


Laurent Montel's avatar
Laurent Montel committed
76 77 78
    if (NOT APPLE)
        find_package(X11)
    endif()
Laurent Montel's avatar
Laurent Montel committed
79
endif()
Laurent Montel's avatar
Laurent Montel committed
80 81 82
set(CMAKE_MODULE_PATH ${kalarm_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
Laurent Montel's avatar
Laurent Montel committed
83 84
set(KDEPIM_HAVE_X11 ${X11_FOUND})
configure_file(src/config-kalarm.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kalarm.h )
Laurent Montel's avatar
Laurent Montel committed
85

Laurent Montel's avatar
Laurent Montel committed
86
include_directories(${kalarm_SOURCE_DIR} ${kalarm_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
87

Laurent Montel's avatar
Laurent Montel committed
88 89 90 91 92 93 94
add_definitions(-DQT_STRICT_ITERATORS)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_MESSAGELOGCONTEXT)

set(CMAKE_AUTOMOC_RELAXED_MODE ON)

Laurent Montel's avatar
Laurent Montel committed
95
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
96 97 98 99

if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
  feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
endif()