CMakeLists.txt 3.1 KB
Newer Older
Vishesh Handa's avatar
Vishesh Handa committed
1
cmake_minimum_required(VERSION 2.8.12)
Laurent Montel's avatar
Laurent Montel committed
2

Vishesh Handa's avatar
Vishesh Handa committed
3
project(AkonadiSearch)
4

Vishesh Handa's avatar
Vishesh Handa committed
5
# ECM setup
Laurent Montel's avatar
Laurent Montel committed
6
set(KF5_VERSION "5.22.0")
Laurent Montel's avatar
Laurent Montel committed
7
find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
Vishesh Handa's avatar
Vishesh Handa committed
8
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
9

Vishesh Handa's avatar
Vishesh Handa committed
10
11
12
13
14
15
16
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
17
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Vishesh Handa's avatar
Vishesh Handa committed
18
19
include(ECMInstallIcons)
include(ECMAddTests)
20
include(ECMQtDeclareLoggingCategory)
21

22

Laurent Montel's avatar
Laurent Montel committed
23
24
25
set(PIM_VERSION "5.2.40")

set(AKONADISEARCH_VERSION ${PIM_VERSION})
26

Laurent Montel's avatar
Laurent Montel committed
27
28
29
30
31
set(AKONADI_VERSION "5.2.40")
set(KDEPIMLIBS_LIB_VERSION "5.2.40")
set(KCONTACTS_LIB_VERSION "5.2.40")
set(KCALENDARCORE_LIB_VERSION "5.2.40")
set(KMIME_LIB_VERSION "5.2.40")
32
33


Vishesh Handa's avatar
Vishesh Handa committed
34
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Test)
35
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Config Crash KCMUtils Runner)
36

Laurent Montel's avatar
Laurent Montel committed
37

Vishesh Handa's avatar
Vishesh Handa committed
38
39
40
41
42
43
44
find_package(Xapian CONFIG)
set_package_properties(Xapian PROPERTIES
    DESCRIPTION "The Xapian search engine library"
    URL "http://xapian.org"
    TYPE REQUIRED
)

45
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
46
47
find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
Vishesh Handa's avatar
Vishesh Handa committed
48
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
49
find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
Vishesh Handa's avatar
Vishesh Handa committed
50

51
ecm_setup_version(${AKONADISEARCH_VERSION}
Vishesh Handa's avatar
Vishesh Handa committed
52
53
    VARIABLE_PREFIX AKONADISEARCH
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/akonadi_search_version.h"
54
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiSearchConfigVersion.cmake"
Vishesh Handa's avatar
Vishesh Handa committed
55
56
57
    SOVERSION 5
)

Vishesh Handa's avatar
Vishesh Handa committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Compiler flags
add_definitions(-DQT_NO_KEYWORDS)

# Turn exceptions on
kde_enable_exceptions()

include_directories(
  ${XAPIAN_INCLUDE_DIR}
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_SOURCE_DIR}/core
  ${CMAKE_BINARY_DIR}/core
  ${CMAKE_SOURCE_DIR}/xapian
  ${CMAKE_BINARY_DIR}/xapian
)

# Targets
add_subdirectory(xapian)
add_subdirectory(core)
add_subdirectory(agent)
add_subdirectory(lib)
add_subdirectory(akonadiplugin)
Vishesh Handa's avatar
Vishesh Handa committed
79
add_subdirectory(search)
Laurent Montel's avatar
Laurent Montel committed
80
add_subdirectory(debug)
81
add_subdirectory(runner)
Vishesh Handa's avatar
Vishesh Handa committed
82
83

# Config files
84
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5AkonadiSearch")
Vishesh Handa's avatar
Vishesh Handa committed
85
86

ecm_configure_package_config_file(
87
88
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5AkonadiSearchConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiSearchConfig.cmake"
Vishesh Handa's avatar
Vishesh Handa committed
89
90
91
92
    INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
93
94
    "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiSearchConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiSearchConfigVersion.cmake"
Vishesh Handa's avatar
Vishesh Handa committed
95
96
97
98
    DESTINATION ${CMAKECONFIG_INSTALL_DIR}
    COMPONENT devel
)

99
install(EXPORT KF5AkonadiSearchTargets
Vishesh Handa's avatar
Vishesh Handa committed
100
101
        NAMESPACE KF5::
        DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
102
        FILE KF5AkonadiSearchTargets.cmake)
Vishesh Handa's avatar
Vishesh Handa committed
103
104
105

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/akonadi_search_version.h"
Laurent Montel's avatar
Laurent Montel committed
106
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
Vishesh Handa's avatar
Vishesh Handa committed
107
108
    COMPONENT Devel
)
Vishesh Handa's avatar
Vishesh Handa committed
109

Laurent Montel's avatar
Laurent Montel committed
110
111
install( FILES akonadi-search.categories DESTINATION ${KDE_INSTALL_CONFDIR} )

Vishesh Handa's avatar
Vishesh Handa committed
112
113
114
115
116
feature_summary(WHAT ALL
    INCLUDE_QUIET_PACKAGES
    FATAL_ON_MISSING_REQUIRED_PACKAGES
)