Skip to content

Commit

Permalink
Use addon factory v2
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Jan 18, 2025
1 parent 254eae8 commit 4e10afa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.6)

project(fcitx-m17n VERSION 5.1.2)

set(REQUIRED_FCITX_VERSION 5.1.12)
find_package(ECM REQUIRED 1.0.0)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(FeatureSummary)
Expand All @@ -12,7 +13,7 @@ option(ENABLE_TEST "Build Test" On)
option(ENABLE_COVERAGE "Build the project with gcov support (Need ENABLE_TEST=On)" Off)
set(GCOV_TOOL "gcov" CACHE STRING "Path to gcov tool used by coverage.")

find_package(Fcitx5Core 5.0.2 REQUIRED)
find_package(Fcitx5Core ${REQUIRED_FCITX_VERSION} REQUIRED)
find_package(Fcitx5Module REQUIRED COMPONENTS TestFrontend)
find_package(Gettext REQUIRED)
find_package(fmt REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion im/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(fcitx_m17n_sources
keysymname.cpp
)

add_library(m17n MODULE ${fcitx_m17n_sources})
add_fcitx5_addon(m17n ${fcitx_m17n_sources})
target_link_libraries(m17n Fcitx5::Core Fcitx5::Config ${FMT_TARGET} PkgConfig::M17NGui)
target_include_directories(m17n PRIVATE ${PROJECT_BINARY_DIR})
set_target_properties(m17n PROPERTIES PREFIX "")
Expand Down
2 changes: 1 addition & 1 deletion im/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,4 +624,4 @@ void M17NState::select(int index) {
}
} // namespace fcitx

FCITX_ADDON_FACTORY(fcitx::M17NEngineFactory)
FCITX_ADDON_FACTORY_V2(m17n, fcitx::M17NEngineFactory)
3 changes: 3 additions & 0 deletions im/m17n.conf.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ Enabled=True
Library=m17n
Type=SharedLibrary
Configurable=True

[Addon/Dependencies]
0=core:@REQUIRED_FCITX_VERSION@

0 comments on commit 4e10afa

Please sign in to comment.