Skip to content

Commit

Permalink
[WIP] Add GUI config tool
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhao9 committed Oct 19, 2020
1 parent e20996d commit 97c52dd
Show file tree
Hide file tree
Showing 15 changed files with 1,953 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ add_definitions(-DFCITX_RIME_VERSION=\"${PROJECT_VERSION}\")

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

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

add_subdirectory(po)
add_subdirectory(src)
add_subdirectory(data)
if(ENABLE_QT5GUI)
add_subdirectory(gui)
endif(ENABLE_QT5GUI)
6 changes: 6 additions & 0 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(REQUIRED_QT5_VERSION 5.1.0)

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

add_subdirectory(src)
40 changes: 40 additions & 0 deletions gui/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
set(RIME_CONFIG_SRCS
Main.cpp
ConfigMain.cpp
Model.cpp
RimeConfigParser.cpp
ErrorOverlay.cpp)

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

set(RIME_CONFIG_UIS
ConfigMain.ui)

# fcitx5_translate_add_sources(
# ${RIME_CONFIG_SRCS}
# ${RIME_CONFIG_HDRS}
# ${RIME_CONFIG_UIS})

add_library(rime-config
MODULE ${RIME_CONFIG_SRCS})

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 97c52dd

Please sign in to comment.