CMakeLists.txt 2.59 KB
Newer Older
1
project( sieveeditor )
2
if(${CMAKE_SOURCE_DIR} STREQUAL ${sieveeditor_SOURCE_DIR})
Laurent Montel's avatar
Laurent Montel committed
3
    cmake_minimum_required(VERSION 3.1)
Laurent Montel's avatar
Laurent Montel committed
4
    set(KF5_VERSION "5.23.0")
Laurent Montel's avatar
Laurent Montel committed
5
    find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
6
    set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
7
    include(ECMInstallIcons)
Laurent Montel's avatar
Laurent Montel committed
8 9 10 11 12

    include(ECMOptionalAddSubdirectory)
    include(ECMSetupVersion)
    include(ECMAddTests)
    include(ECMMarkNonGuiExecutable)
13 14 15 16
    include(GenerateExportHeader)
    include(ECMGenerateHeaders)
    include(CMakePackageConfigHelpers)
    include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
17 18 19 20 21 22 23 24 25
    include(CheckFunctionExists)
    include(ECMGeneratePriFile)

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

Laurent Montel's avatar
Laurent Montel committed
26
    # Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
27
    set(KDEPIM_DEV_VERSION beta1)
Laurent Montel's avatar
Laurent Montel committed
28 29 30 31 32

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


Laurent Montel's avatar
Laurent Montel committed
35
    set(KDEPIM_VERSION_NUMBER "5.2.80")
Laurent Montel's avatar
Laurent Montel committed
36 37
    set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")

Laurent Montel's avatar
Laurent Montel committed
38 39
    set(KMAILTRANSPORT_LIB_VERSION "5.2.80")
    set(KPIMTEXTEDIT_LIB_VERSION "5.2.80")
Laurent Montel's avatar
Laurent Montel committed
40 41 42 43

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

Laurent Montel's avatar
Laurent Montel committed
44
    set(MESSAGELIB_LIB_VERSION_LIB "5.2.90")
Laurent Montel's avatar
Laurent Montel committed
45
    set(PIMCOMMON_LIB_VERSION_LIB "5.2.80")
46
    set(LIBKSIEVE_LIB_VERSION_LIB "5.2.81")
Laurent Montel's avatar
Laurent Montel committed
47

48
    set(QT_REQUIRED_VERSION "5.6.0")
Laurent Montel's avatar
Laurent Montel committed
49
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Network Test)
50

Laurent Montel's avatar
Laurent Montel committed
51 52
    # Find KF5 package
    find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
53
    find_package(KF5DocTools ${KF5_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
54 55 56 57 58 59

    # Find KdepimLibs Package
    find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)

    find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
60
    find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
61 62 63
    find_package(KF5LibKSieve ${LIBKSIEVE_LIB_VERSION_LIB} CONFIG REQUIRED)

    include_directories(${sieveeditor_SOURCE_DIR} ${sieveeditor_BINARY_DIR})
64
    add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
65

Laurent Montel's avatar
Laurent Montel committed
66 67
endif()
add_definitions(-DQT_USE_QSTRINGBUILDER)
68 69
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
Laurent Montel's avatar
Laurent Montel committed
70

Laurent Montel's avatar
Laurent Montel committed
71
add_subdirectory(src)
72 73 74
if (BUILD_TESTING)
    add_subdirectory(autotests)
endif()
Laurent Montel's avatar
Laurent Montel committed
75

Laurent Montel's avatar
Laurent Montel committed
76 77
install( FILES sieveeditor.categories DESTINATION ${KDE_INSTALL_CONFDIR} )

Laurent Montel's avatar
Laurent Montel committed
78
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
Laurent Montel's avatar
Laurent Montel committed
79
    feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Laurent Montel's avatar
Laurent Montel committed
80
endif()
Laurent Montel's avatar
Laurent Montel committed
81