-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathCMakeLists.txt
62 lines (49 loc) · 2.05 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
cmake_minimum_required(VERSION 3.6.0)
project(fcitx5-rime VERSION 5.1.10)
set(REQUIRED_FCITX_VERSION 5.1.12)
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(ECMSetupVersion)
include(ECMUninstallTarget)
find_package(Gettext REQUIRED)
find_package(Fcitx5Core ${REQUIRED_FCITX_VERSION} REQUIRED)
find_package(Fcitx5Module REQUIRED COMPONENTS Notifications)
find_package(PkgConfig REQUIRED)
find_package(Pthread REQUIRED)
if (NOT DEFINED RIME_TARGET)
pkg_check_modules(Rime REQUIRED IMPORTED_TARGET "rime>=1.0.0")
set(RIME_TARGET PkgConfig::Rime)
endif()
if ("${Rime_VERSION}" VERSION_LESS "1.10.0")
add_definitions(-DFCITX_RIME_NO_HIGHLIGHT_CANDIDATE)
endif()
if ("${Rime_VERSION}" VERSION_LESS "1.8.0")
add_definitions(-DFCITX_RIME_NO_DELETE_CANDIDATE)
endif()
if ("${Rime_VERSION}" VERSION_LESS "1.7.0")
add_definitions(-DFCITX_RIME_LOAD_PLUGIN)
endif()
if ("${Rime_VERSION}" VERSION_LESS "1.6.0")
add_definitions(-DFCITX_RIME_NO_LOG_LEVEL)
endif()
if ("${Rime_VERSION}" VERSION_LESS "1.3.0")
add_definitions(-DFCITX_RIME_NO_SELECT_CANDIDATE)
endif()
if(NOT DEFINED RIME_DATA_DIR)
find_package(RimeData REQUIRED)
endif(NOT DEFINED RIME_DATA_DIR)
message(STATUS "Precompiler macro RIME_DATA_DIR is set to \"${RIME_DATA_DIR}\"")
add_definitions(-DRIME_DATA_DIR="${RIME_DATA_DIR}")
add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-rime\")
add_definitions(-DFCITX_RIME_VERSION=\"${PROJECT_VERSION}\")
fcitx5_add_i18n_definition()
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
add_subdirectory(po)
add_subdirectory(src)
add_subdirectory(data)
fcitx5_translate_desktop_file(org.fcitx.Fcitx5.Addon.Rime.metainfo.xml.in
org.fcitx.Fcitx5.Addon.Rime.metainfo.xml XML)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.Addon.Rime.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)