CMakeLists.txt 2.44 KB
Newer Older
1
project( sieveeditor )
2 3 4
if(${CMAKE_SOURCE_DIR} STREQUAL ${sieveeditor_SOURCE_DIR})
    cmake_minimum_required(VERSION 2.8.12)
    find_package(ECM 5.20.0 REQUIRED NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
5
    set(CMAKE_MODULE_PATH ${sieveeditor_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
6
    include(ECMInstallIcons)
Laurent Montel's avatar
Laurent Montel committed
7 8 9 10 11

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

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

25 26 27

    set(KF5_VERSION "5.20.0")

Laurent Montel's avatar
Laurent Montel committed
28
    set(KDEPIM_VERSION_NUMBER "5.2.47")
Laurent Montel's avatar
Laurent Montel committed
29 30 31 32 33 34 35 36
    set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")

    set(KMAILTRANSPORT_LIB_VERSION "5.2.40")
    set(KPIMTEXTEDIT_LIB_VERSION "5.2.40")

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

Laurent Montel's avatar
Laurent Montel committed
37
    set(MESSAGELIB_LIB_VERSION_LIB "5.2.64")
Laurent Montel's avatar
Laurent Montel committed
38
    set(PIMCOMMON_LIB_VERSION_LIB "5.2.40")
Laurent Montel's avatar
Laurent Montel committed
39
    set(LIBKSIEVE_LIB_VERSION_LIB "5.2.42")
Laurent Montel's avatar
Laurent Montel committed
40

41
    set(QT_REQUIRED_VERSION "5.6.0")
Laurent Montel's avatar
Laurent Montel committed
42
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Network Test)
43

Laurent Montel's avatar
Laurent Montel committed
44 45
    # Find KF5 package
    find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
46
    find_package(KF5DocTools ${KF5_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
47 48 49 50 51 52

    # 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)
53
    find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
54 55 56
    find_package(KF5LibKSieve ${LIBKSIEVE_LIB_VERSION_LIB} CONFIG REQUIRED)

    include_directories(${sieveeditor_SOURCE_DIR} ${sieveeditor_BINARY_DIR})
57

58

Laurent Montel's avatar
Laurent Montel committed
59 60
endif()
add_definitions(-DQT_USE_QSTRINGBUILDER)
61 62
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
63
add_definitions( -DQT_NO_URL_CAST_FROM_STRING )
Laurent Montel's avatar
Laurent Montel committed
64

Laurent Montel's avatar
Laurent Montel committed
65
add_subdirectory(src)
66 67 68
if (BUILD_TESTING)
    add_subdirectory(autotests)
endif()
Laurent Montel's avatar
Laurent Montel committed
69

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

Laurent Montel's avatar
Laurent Montel committed
72
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
Laurent Montel's avatar
Laurent Montel committed
73
    feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Laurent Montel's avatar
Laurent Montel committed
74
endif()
Laurent Montel's avatar
Laurent Montel committed
75