SUIME/fcitx5-ext/CMakeLists.txt

36 lines
1.1 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

cmake_minimum_required(VERSION 3.10)
project(suime-fcitx5 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(PkgConfig REQUIRED)
pkg_check_modules(FCITX5 REQUIRED Fcitx5Core Fcitx5Utils)
pkg_check_modules(MSGPACK REQUIRED msgpack-c)
add_library(suime SHARED src/suime.cpp src/socket_client.cpp)
target_include_directories(suime PRIVATE ${FCITX5_INCLUDE_DIRS} ${MSGPACK_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(suime ${FCITX5_LIBRARIES} ${MSGPACK_LIBRARIES})
install(TARGETS suime DESTINATION lib/fcitx5)
# 准备并安装 Addon 配置文件
# 将 .conf.in 转换为 .conf (如果有变量替换需求),或者直接安装
configure_file(suime-addon.conf.in suime.conf)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/suime.conf
DESTINATION share/fcitx5/addon/)
# 准备并安装 InputMethod 配置文件
# 注意:这里安装后的文件名也应该是 suime.conf但在 inputmethod 目录下
configure_file(suime-im.conf.in suime-im.conf)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/suime-im.conf
RENAME suime.conf
DESTINATION share/fcitx5/inputmethod)