summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: e8ac2108b67d553eb00543b64d07fc0ef1357532 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 3.16)

project(QtMessagingFramework
  VERSION 4.0.4
  DESCRIPTION "a C++ library and daemon server process to build email clients")

set(CMAKE_AUTOMOC ON)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 11)

option(BUILD_WIDGETS "Build widgets" OFF)
option(BUILD_MESSAGESERVER_PLUGINS "Build plugins for the message server" ON)
option(USE_HTML_PARSER "Use HTML parser to handle rich text" OFF)
option(USE_ACCOUNTS_QT "Use libaccounts-qt to handle mail account" OFF)

include(FeatureSummary)
include(GNUInstallDirs)
include(CTest)

find_package(PkgConfig REQUIRED)

find_package(Qt6 REQUIRED COMPONENTS Core Xml DBus Sql Network Core5Compat OPTIONAL_COMPONENTS LinguistTools)
if(BUILD_WIDGETS)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
endif()
if(USE_HTML_PARSER)
find_package(Qt6 REQUIRED COMPONENTS Gui)
endif()
if(USE_ACCOUNTS_QT)
  pkg_check_modules(LIBACCOUNTS REQUIRED accounts-qt6 IMPORTED_TARGET)
endif()
if(BUILD_TESTING)
  find_package(Qt6 REQUIRED COMPONENTS Test)
endif()
pkg_check_modules(ICU icu-i18n IMPORTED_TARGET)

add_subdirectory(src)
if(BUILD_TESTING)
  add_subdirectory(tests)
endif()
add_subdirectory(benchmarks)
add_subdirectory(examples)

if (TARGET Qt6::LinguistTools)
  qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES ar de en_GB en_SU en_US es fr it ja ko pt_BR zh_CN zh_TW)
endif()

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)