-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
56 lines (43 loc) · 1.73 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
cmake_minimum_required(VERSION 3.6)
# The Project Name
project(fcitx5-kkc VERSION 5.1.5)
find_package(ECM REQUIRED 1.0.0)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(FeatureSummary)
include(GNUInstallDirs)
include(ECMUninstallTarget)
option(ENABLE_QT "Enable Qt for GUI configuration" On)
option(USE_QT6 "Build against Qt6" On)
find_package(PkgConfig REQUIRED)
find_package(Fcitx5Core 5.0.6 REQUIRED)
find_package(LibKKC REQUIRED)
find_package(Gettext REQUIRED)
pkg_check_modules(Gee IMPORTED_TARGET "gee-0.8" REQUIRED)
pkg_check_modules(JSonGlib IMPORTED_TARGET "json-glib-1.0" REQUIRED)
pkg_check_modules(GObject2 IMPORTED_TARGET "gobject-2.0" REQUIRED)
if (ENABLE_QT)
if (USE_QT6)
set(QT_MAJOR_VERSION 6)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
else()
set(QT_MAJOR_VERSION 5)
find_package(Qt5 5.7 REQUIRED COMPONENTS Core Gui Widgets)
endif()
find_package(Fcitx5Qt${QT_MAJOR_VERSION}WidgetsAddons REQUIRED)
endif ()
if (NOT SKK_DEFAULT_PATH)
set(SKK_DEFAULT_PATH "/usr/share/skk/")
endif ()
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-kkc\" -D_GNU_SOURCE)
fcitx5_add_i18n_definition()
configure_file(config.h.in config.h
IMMEDIATE @ONLY)
add_subdirectory(po)
add_subdirectory(src)
add_subdirectory(gui)
add_subdirectory(data)
fcitx5_translate_desktop_file(org.fcitx.Fcitx5.Addon.Kkc.metainfo.xml.in
org.fcitx.Fcitx5.Addon.Kkc.metainfo.xml XML)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.Addon.Kkc.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)