Skip to content

Commit

Permalink
Add GUI config tool on path addon/rime/custom_config
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhao9 authored and wengxt committed Nov 3, 2020
1 parent c153af3 commit 5ed244d
Show file tree
Hide file tree
Showing 16 changed files with 1,953 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ add_definitions(-DFCITX_RIME_VERSION=\"${PROJECT_VERSION}\")

include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")

option(ENABLE_GUI "Build Fcitx5 Rime Config GUI Tool" ON)

add_subdirectory(po)
add_subdirectory(src)
add_subdirectory(data)

if(ENABLE_GUI)
add_subdirectory(gui)
endif()

fcitx5_translate_desktop_file(org.fcitx.fcitx5-rime.metainfo.xml.in
org.fcitx.fcitx5-rime.metainfo.xml XML)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.fcitx5-rime.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

39 changes: 39 additions & 0 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
set(REQUIRED_QT5_VERSION 5.7)

find_package(Qt5 ${REQUIRED_QT5_VERSION} CONFIG REQUIRED COMPONENTS Core Widgets Concurrent)
find_package(Fcitx5Qt5WidgetsAddons REQUIRED)

set(RIME_CONFIG_SRCS
Main.cpp
ConfigMain.cpp
Model.cpp
RimeConfigParser.cpp
keylistwidget.cpp)

set(RIME_CONFIG_HDRS
Main.h
ConfigMain.h
Model.h
Common.h
RimeConfigParser.h
keylistwidget.h)

add_library(rime-config
MODULE ${RIME_CONFIG_SRCS})

target_include_directories(rime-config PRIVATE ${PROJECT_SOURCE_DIR}/gui)

set_target_properties(rime-config PROPERTIES
LINK_FLAGS "-Wl,--no-undefined"
AUTOMOC TRUE
AUTOUIC TRUE
AUTOUIC_OPTIONS "-tr=fcitx::tr2fcitx;--include=fcitxqti18nhelper.h")

target_link_libraries(rime-config
Qt5::Widgets
Qt5::Concurrent
Fcitx5::Core
Fcitx5Qt5::WidgetsAddons
PkgConfig::Rime)

install(TARGETS rime-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/fcitx5/qt5)
Loading

0 comments on commit 5ed244d

Please sign in to comment.