-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
53 lines (40 loc) · 1.7 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
cmake_minimum_required(VERSION 3.6.0)
project(fcitx5-skk VERSION 5.1.5)
find_package(ECM 1.0.0 REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
option(ENABLE_QT "Enable Qt for GUI configuration" On)
option(USE_QT6 "Build against Qt6" On)
include(ECMUninstallTarget)
include(FeatureSummary)
find_package(PkgConfig REQUIRED)
find_package(Fcitx5Core 5.0.6 REQUIRED)
find_package(Gettext REQUIRED)
pkg_check_modules(GObject2 IMPORTED_TARGET "gobject-2.0" REQUIRED)
find_package(LibSKK REQUIRED)
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
set(SKK_DEFAULT_PATH "/usr/share/skk/SKK-JISYO.L" CACHE STRING "Default path of SKK")
include(GNUInstallDirs)
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()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/config.h"
IMMEDIATE @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-skk\" -D_GNU_SOURCE)
fcitx5_add_i18n_definition()
add_subdirectory(po)
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(gui)
fcitx5_translate_desktop_file(org.fcitx.Fcitx5.Addon.Skk.metainfo.xml.in
org.fcitx.Fcitx5.Addon.Skk.metainfo.xml XML)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.Addon.Skk.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)