CMakeLists.txt 3.15 KB
Newer Older
1
cmake_minimum_required(VERSION 3.0)
Laurent Montel's avatar
Laurent Montel committed
2

Laurent Montel's avatar
Laurent Montel committed
3
set(PIM_VERSION "5.5.0")
4
project(AkonadiSearch VERSION ${PIM_VERSION})
5

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

Vishesh Handa's avatar
Vishesh Handa committed
11
12
include(GenerateExportHeader)
include(ECMGenerateHeaders)
Laurent Montel's avatar
Laurent Montel committed
13
include(CMakePackageConfigHelpers)
Vishesh Handa's avatar
Vishesh Handa committed
14
15
16
17
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
18
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Vishesh Handa's avatar
Vishesh Handa committed
19
20
include(ECMInstallIcons)
include(ECMAddTests)
21
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
22
23
include(ECMCoverageOption)

24

25

Laurent Montel's avatar
Laurent Montel committed
26
27

set(AKONADISEARCH_VERSION ${PIM_VERSION})
28

Laurent Montel's avatar
Laurent Montel committed
29
30
31
32
33
set(AKONADI_VERSION "5.5.0")
set(AKONADI_MIMELIB_VERSION "5.5.0")
set(KCONTACTS_LIB_VERSION "5.5.0")
set(KCALENDARCORE_LIB_VERSION "5.5.0")
set(KMIME_LIB_VERSION "5.5.0")
34
35


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

Laurent Montel's avatar
Laurent Montel committed
39

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

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

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

Vishesh Handa's avatar
Vishesh Handa committed
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# 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
81
add_subdirectory(search)
Laurent Montel's avatar
Laurent Montel committed
82
add_subdirectory(debug)
83
add_subdirectory(runner)
Vishesh Handa's avatar
Vishesh Handa committed
84
85

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

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

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

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

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

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

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