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

Laurent Montel's avatar
Laurent Montel committed
3
if(${CMAKE_SOURCE_DIR} STREQUAL ${korganizer_SOURCE_DIR})
Laurent Montel's avatar
Laurent Montel committed
4
    cmake_minimum_required(VERSION 3.1)
Laurent Montel's avatar
Laurent Montel committed
5 6 7
    if (POLICY CMP0063)
        cmake_policy(SET CMP0063 NEW)
    endif()
8
    set(KF5_VERSION "5.25.0")
Laurent Montel's avatar
Laurent Montel committed
9
    find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
10
    set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
Laurent Montel's avatar
Laurent Montel committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
    include(ECMOptionalAddSubdirectory)
    include(ECMInstallIcons)
    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)

    # Do NOT add quote
Laurent Montel's avatar
5.3.40  
Laurent Montel committed
30
    set(KDEPIM_DEV_VERSION pre)
Laurent Montel's avatar
Laurent Montel committed
31 32 33 34 35 36

    # add an extra space
    if(DEFINED KDEPIM_DEV_VERSION)
        set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
    endif()

Laurent Montel's avatar
Laurent Montel committed
37
    set(KDEPIM_VERSION_NUMBER "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
38 39 40
    set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")


Laurent Montel's avatar
Laurent Montel committed
41 42 43
    set(AKONADI_MIMELIB_VERSION "5.3.40")
    set(AKONADI_CONTACT_VERSION "5.3.40")
    set(KCALENDARCORE_LIB_VERSION "5.3.40")
44
    set(IDENTITYMANAGEMENT_LIB_VERSION "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
45 46 47 48 49 50 51
    set(KLDAP_LIB_VERSION "5.3.40")
    set(KMAILTRANSPORT_LIB_VERSION "5.3.40")
    set(CALENDARUTILS_LIB_VERSION "5.3.40")
    set(KHOLIDAYS_LIB_VERSION "5.3.40")
    set(AKONADICALENDAR_LIB_VERSION "5.3.40")
    set(KONTACTINTERFACE_LIB_VERSION "5.3.40")
    set(KMIME_LIB_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
52
    set(KPIMTEXTEDIT_LIB_VERSION "5.3.41")
53
    set(AKONADI_VERSION "5.3.43")
Laurent Montel's avatar
Laurent Montel committed
54 55 56

    set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
    set(KDEPIM_LIB_SOVERSION "5")
Laurent Montel's avatar
Laurent Montel committed
57
    set(AKONADINOTES_LIB_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
58 59 60

    set(QT_REQUIRED_VERSION "5.6.0")
    option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
Laurent Montel's avatar
Laurent Montel committed
61
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools)
Laurent Montel's avatar
Laurent Montel committed
62
    find_package(Qt5X11Extras NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
63
    set(MAILCOMMON_LIB_VERSION_LIB "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
64
    set(KDEPIM_APPS_LIB_VERSION_LIB "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
65
    set(PIMCOMMON_LIB_VERSION_LIB "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
66
    set(LIBKDEPIM_LIB_VERSION_LIB "5.3.42")
Laurent Montel's avatar
Laurent Montel committed
67 68
    set(LIBINCIDENCEEDITOR_LIB_VERSION_LIB "5.3.41")
    set(CALENDARSUPPORT_LIB_VERSION_LIB "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
69
    set(EVENTVIEW_LIB_VERSION_LIB "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
70
    set(KCONTACTS_LIB_VERSION "5.3.43")
Laurent Montel's avatar
Laurent Montel committed
71

Laurent Montel's avatar
Laurent Montel committed
72
    find_package(KF5AkonadiSearch "5.3.40" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
73 74 75 76 77 78 79 80
    set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "http://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")

    # Find KF5 package
    find_package(KF5NewStuff ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
81
    find_package(KF5DocTools ${KF5_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
82
    find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
83
    find_package(KF5Crash ${KF5_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
84 85 86 87 88 89

    # Find KdepimLibs Package
    find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
    find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
90
    find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
91 92
    find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
93
    find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
94 95
    find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5Holidays ${KHOLIDAYS_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
96
    find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
97
    find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
98
    find_package(Phonon4Qt5 CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
99 100 101 102 103

    find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
104
    find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
105 106 107 108 109 110
    find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5IncidenceEditor ${LIBINCIDENCEEDITOR_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5EventViews ${EVENTVIEW_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
111 112 113
    if (NOT APPLE)
        find_package(X11)
    endif()
Laurent Montel's avatar
Laurent Montel committed
114 115
    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
116

Laurent Montel's avatar
Laurent Montel committed
117
    set(KDEPIM_HAVE_X11 ${X11_FOUND})
118
    add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
Laurent Montel's avatar
Laurent Montel committed
119
endif()
Laurent Montel's avatar
Laurent Montel committed
120
add_definitions(-DQT_USE_QSTRINGBUILDER)
Laurent Montel's avatar
Laurent Montel committed
121
configure_file(config-korganizer.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-korganizer.h )
Laurent Montel's avatar
Laurent Montel committed
122 123
configure_file(korgac/config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )
include_directories(${korganizer_SOURCE_DIR} ${korganizer_BINARY_DIR} ${korgac_SOURCE_DIR} ${korgac_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
124
configure_file(korganizer-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/korganizer-version.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
125

Laurent Montel's avatar
Laurent Montel committed
126 127 128
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )

Laurent Montel's avatar
Laurent Montel committed
129
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
130
add_subdirectory(korgac)
Laurent Montel's avatar
Laurent Montel committed
131

Laurent Montel's avatar
Laurent Montel committed
132 133 134

install( FILES korganizer.categories DESTINATION ${KDE_INSTALL_CONFDIR} )

Laurent Montel's avatar
Laurent Montel committed
135
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
Laurent Montel's avatar
Laurent Montel committed
136
    feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Laurent Montel's avatar
Laurent Montel committed
137
endif()