-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
62 lines (47 loc) · 2.04 KB
/
CMakeLists.txt
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
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.6)
project(fcitx5-virtualkeyboard-ui VERSION 5.0.0)
find_package(ECM 1.0.0 REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(FeatureSummary)
include(GNUInstallDirs)
include(ECMUninstallTarget)
set(REQUIRED_FCITX5_VERSION 5.0.14)
find_package(Fcitx5Core "${REQUIRED_FCITX5_VERSION}" REQUIRED)
find_package(Fcitx5Module REQUIRED COMPONENTS NotificationItem)
find_package(Gettext REQUIRED)
find_package(PkgConfig REQUIRED)
if (NOT (TARGET fmt::fmt OR TARGET fmt::fmt-header-only))
find_package(fmt REQUIRED)
endif()
if (TARGET fmt::fmt-header-only)
set(FMT_TARGET fmt::fmt-header-only)
else()
set(FMT_TARGET fmt::fmt)
endif ()
pkg_check_modules(Cairo IMPORTED_TARGET cairo)
pkg_check_modules(Pango IMPORTED_TARGET pango pangocairo)
pkg_check_modules(GdkPixbuf IMPORTED_TARGET gdk-pixbuf-2.0)
pkg_check_modules(GioUnix IMPORTED_TARGET gio-unix-2.0)
option(ENABLE_X11 "Enable X11 support" On)
option(ENABLE_WAYLAND "Enable wayland support" On)
option(INSTALL_THEME "Install theme files" Off)
if (ENABLE_X11)
set(REQUIRED_XKBCOMMON_COMPONENTS ${REQUIRED_XKBCOMMON_COMPONENTS} X11)
find_package(XCB REQUIRED COMPONENTS XCB AUX XKB XFIXES ICCCM XINERAMA RANDR EWMH KEYSYMS)
pkg_check_modules(CairoXCB IMPORTED_TARGET cairo-xcb)
find_package(Fcitx5Module REQUIRED COMPONENTS XCB)
endif()
if (ENABLE_WAYLAND)
find_package(Wayland REQUIRED COMPONENTS Client Egl)
find_package(WaylandScanner REQUIRED)
find_package(WaylandProtocols REQUIRED)
find_package(EGL)
find_package(Fcitx5Module REQUIRED COMPONENTS Wayland)
endif()
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-virtualkeyboard-ui\" -D_GNU_SOURCE)
fcitx5_add_i18n_definition()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(src)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)