diff --git a/.gitmodules b/.gitmodules index d34e6ec..9e57697 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,18 +7,6 @@ [submodule "engines/fcitx5-rime"] path = engines/fcitx5-rime url = https://github.com/fcitx/fcitx5-rime -[submodule "data/rime-essay"] - path = data/rime-essay - url = https://github.com/rime/rime-essay -[submodule "data/rime-prelude"] - path = data/rime-prelude - url = https://github.com/rime/rime-prelude -[submodule "data/rime-luna-pinyin"] - path = data/rime-luna-pinyin - url = https://github.com/rime/rime-luna-pinyin -[submodule "data/rime-stroke"] - path = data/rime-stroke - url = https://github.com/rime/rime-stroke [submodule "deps/AlertToast"] path = deps/AlertToast url = https://github.com/fcitx-contrib/AlertToast diff --git a/CMakeLists.txt b/CMakeLists.txt index bb42e76..f061686 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,16 +30,13 @@ include(AddSwift) set(KEYBOARD_NAME "Keyboard") set(KEYBOARD_LANGUAGE "zh-Hans") -set(PREBUILDER_LIB_DIR "${PROJECT_BINARY_DIR}/sysroot/usr/lib") -set(PREBUILDER_SHARE_DIR "${PROJECT_BINARY_DIR}/sysroot/usr/share") +set(FIND_ROOT_PATH "${PROJECT_BINARY_DIR}/sysroot/usr") +set(PREBUILDER_LIB_DIR "${FIND_ROOT_PATH}/lib") +set(PREBUILDER_SHARE_DIR "${FIND_ROOT_PATH}/share") set(ENV{PKG_CONFIG_PATH} "${PREBUILDER_LIB_DIR}/pkgconfig") -# For dependencies not to be find via pkg-config -set(LibIntl_DIR "${PREBUILDER_LIB_DIR}/cmake") -find_package(LibIntl) -set(fmt_DIR "${PREBUILDER_LIB_DIR}/cmake/fmt") -find_package(fmt) +list(APPEND CMAKE_FIND_ROOT_PATH "${FIND_ROOT_PATH}") add_subdirectory(deps) @@ -76,6 +73,22 @@ option(RIME "" OFF) set(ADDONS) set(DEFAULT_INPUT_METHODS) +function(copy_to_keyboard cmd file relative_path) + add_custom_command(TARGET ${BUNDLE_NAME} + POST_BUILD COMMAND /bin/sh -c \" + ${CMAKE_COMMAND} -E ${cmd} ${file} + ${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/${relative_path} + \") +endfunction() + +function(copy_to_app cmd file relative_path) + add_custom_command(TARGET ${BUNDLE_NAME} + POST_BUILD COMMAND /bin/sh -c \" + ${CMAKE_COMMAND} -E ${cmd} ${file} + ${PROJECT_BINARY_DIR}/src/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/${BUNDLE_NAME}.app/${relative_path} + \") +endfunction() + if (HALLELUJAH) add_definitions(-DHALLELUJAH) add_subdirectory(engines/fcitx5-hallelujah) diff --git a/data/default.yaml b/data/default.yaml deleted file mode 100644 index e497426..0000000 --- a/data/default.yaml +++ /dev/null @@ -1,63 +0,0 @@ -# Rime default settings -# encoding: utf-8 - -config_version: '0.40' - -schema_list: - - schema: luna_pinyin - - schema: luna_pinyin_tw - - schema: luna_pinyin_simp - - schema: luna_pinyin_fluency - - schema: stroke - -switcher: - caption: 〔方案選單〕 - hotkeys: - - Control+grave - - Control+Shift+grave - - F4 - save_options: - - full_shape - - ascii_punct - - simplification - - extended_charset - - zh_hant - - zh_hans - - zh_hant_tw - fold_options: true - abbreviate_options: true - option_list_separator: '/' - -menu: - page_size: 5 - -punctuator: - full_shape: - __include: punctuation:/full_shape - half_shape: - __include: punctuation:/half_shape - -key_binder: - bindings: - __patch: - - key_bindings:/emacs_editing - - key_bindings:/move_by_word_with_tab - - key_bindings:/paging_with_minus_equal - - key_bindings:/paging_with_comma_period - - key_bindings:/numbered_mode_switch - -recognizer: - patterns: - email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$" - uppercase: "[A-Z][-_+.'0-9A-Za-z]*$" - url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$" - -ascii_composer: - good_old_caps_lock: true - switch_key: - Shift_L: inline_ascii - Shift_R: commit_text - Control_L: noop - Control_R: noop - Caps_Lock: clear - Eisu_toggle: clear diff --git a/data/rime-essay b/data/rime-essay deleted file mode 160000 index e0519d0..0000000 --- a/data/rime-essay +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e0519d0579722a0871efb68189272cba61a7350b diff --git a/data/rime-luna-pinyin b/data/rime-luna-pinyin deleted file mode 160000 index ce5c828..0000000 --- a/data/rime-luna-pinyin +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ce5c828d99b0777c7a6bc6b1699e34f8c25623ef diff --git a/data/rime-prelude b/data/rime-prelude deleted file mode 160000 index 3803f09..0000000 --- a/data/rime-prelude +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3803f09458072e03b9ed396692ce7e1d35c88c95 diff --git a/data/rime-stroke b/data/rime-stroke deleted file mode 160000 index 65fdbbf..0000000 --- a/data/rime-stroke +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 65fdbbf2f9485cc907cb9a6d6b9210938a50f71e diff --git a/fcitx5 b/fcitx5 index 5e52ade..58131c4 160000 --- a/fcitx5 +++ b/fcitx5 @@ -1 +1 @@ -Subproject commit 5e52ade745be8d303d87d101ebcb519a4cd77650 +Subproject commit 58131c4d8e64f1ecc537b41bd6689659f6dfc83d diff --git a/iosfrontend/CMakeLists.txt b/iosfrontend/CMakeLists.txt index a309754..4875437 100644 --- a/iosfrontend/CMakeLists.txt +++ b/iosfrontend/CMakeLists.txt @@ -23,13 +23,3 @@ target_include_directories(iosfrontend PUBLIC configure_file(iosfrontend.conf.in.in iosfrontend.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/iosfrontend.conf.in iosfrontend.conf) - -add_custom_command( - TARGET iosfrontend - POST_BUILD COMMAND /bin/sh -c - \" - ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_BINARY_DIR}/iosfrontend.conf - ${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/fcitx5/addon/iosfrontend.conf - \" -) diff --git a/iosnotifications/CMakeLists.txt b/iosnotifications/CMakeLists.txt index 0394754..962071d 100644 --- a/iosnotifications/CMakeLists.txt +++ b/iosnotifications/CMakeLists.txt @@ -18,13 +18,3 @@ target_link_libraries(iosnotifications Fcitx5::Core Fcitx5::Module::Notification configure_file(notifications.conf.in.in notifications.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/notifications.conf.in notifications.conf) - -add_custom_command( - TARGET iosnotifications - POST_BUILD COMMAND /bin/sh -c - \" - ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_BINARY_DIR}/notifications.conf - ${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/fcitx5/addon/notifications.conf - \" -) diff --git a/keyboard/CMakeLists.txt b/keyboard/CMakeLists.txt index 13b3aa8..10b3b74 100644 --- a/keyboard/CMakeLists.txt +++ b/keyboard/CMakeLists.txt @@ -34,12 +34,3 @@ target_link_libraries(keyboard PRIVATE ) add_dependencies(keyboard gen_profile) -add_custom_command( - TARGET keyboard - POST_BUILD COMMAND /bin/sh -c - \" - ${CMAKE_COMMAND} -E copy - ${PROJECT_BINARY_DIR}/profile - ${CMAKE_CURRENT_BINARY_DIR}/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/profile - \" -) diff --git a/patches/fcitx5.patch b/patches/fcitx5.patch index b9043e5..da54cbd 100644 --- a/patches/fcitx5.patch +++ b/patches/fcitx5.patch @@ -38,10 +38,10 @@ index 85c9865b..edf51a44 100644 ) target_include_directories(Fcitx5Config PUBLIC diff --git a/src/lib/fcitx-utils/CMakeLists.txt b/src/lib/fcitx-utils/CMakeLists.txt -index dd67e07d..2b942b28 100644 +index e1498a14..4dfbe2e1 100644 --- a/src/lib/fcitx-utils/CMakeLists.txt +++ b/src/lib/fcitx-utils/CMakeLists.txt -@@ -119,23 +119,22 @@ ecm_setup_version(PROJECT +@@ -121,23 +121,22 @@ ecm_setup_version(PROJECT PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5UtilsConfigVersion.cmake" SOVERSION 2) diff --git a/patches/hallelujah.patch b/patches/hallelujah.patch index 41d0dcd..8b20b04 100644 --- a/patches/hallelujah.patch +++ b/patches/hallelujah.patch @@ -20,34 +20,8 @@ index 7ffcf34..a57a061 100644 add_subdirectory(src) if (ENABLE_TEST) -diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt -index 4e8b3f7..eef37ec 100644 ---- a/data/CMakeLists.txt -+++ b/data/CMakeLists.txt -@@ -5,3 +5,21 @@ add_custom_target(google ALL - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/google_227800_words.bin" DESTINATION ${DEST_DIR} COMPONENT config) - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/words.json" DESTINATION ${DEST_DIR} COMPONENT config) - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/cedict.json" DESTINATION ${DEST_DIR} COMPONENT config) -+ -+add_custom_command( -+ TARGET google -+ POST_BUILD COMMAND /bin/zsh -c -+ \" -+ ${CMAKE_COMMAND} -E copy -+ ${CMAKE_CURRENT_BINARY_DIR}/google_227800_words.bin -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/hallelujah/google_227800_words.bin -+ \; -+ ${CMAKE_COMMAND} -E copy -+ ${CMAKE_CURRENT_SOURCE_DIR}/words.json -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/hallelujah/words.json -+ \; -+ ${CMAKE_COMMAND} -E copy -+ ${CMAKE_CURRENT_SOURCE_DIR}/cedict.json -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/hallelujah/cedict.json -+ \" -+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dcbd627..6b0f00d 100644 +index dcbd627..05832b4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ @@ -56,24 +30,6 @@ index dcbd627..6b0f00d 100644 target_link_libraries(hallelujah Fcitx5::Core Fcitx5::Module::Spell fmt::fmt ${MARISA_TARGET} ${JSONC_TARGET}) install(TARGETS hallelujah DESTINATION "${FCITX_INSTALL_LIBDIR}/fcitx5") fcitx5_translate_desktop_file(hallelujah.conf.in hallelujah.conf) -@@ -6,3 +6,17 @@ configure_file(hallelujah-addon.conf.in.in hallelujah-addon.conf.in) - fcitx5_translate_desktop_file("${CMAKE_CURRENT_BINARY_DIR}/hallelujah-addon.conf.in" hallelujah-addon.conf) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/hallelujah.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod" COMPONENT config) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/hallelujah-addon.conf" RENAME hallelujah.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) -+ -+add_custom_command( -+ TARGET hallelujah -+ POST_BUILD COMMAND /bin/sh -c -+ \" -+ ${CMAKE_COMMAND} -E copy -+ ${CMAKE_CURRENT_BINARY_DIR}/hallelujah-addon.conf -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/fcitx5/addon/hallelujah.conf -+ \; -+ ${CMAKE_COMMAND} -E copy -+ ${CMAKE_CURRENT_BINARY_DIR}/hallelujah.conf -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/fcitx5/inputmethod/hallelujah.conf -+ \" -+) diff --git a/src/hallelujah.h b/src/hallelujah.h index 2dcee57..caf1bec 100644 --- a/src/hallelujah.h diff --git a/patches/rime.patch b/patches/rime.patch index a97b0ad..4cafff8 100644 --- a/patches/rime.patch +++ b/patches/rime.patch @@ -21,7 +21,7 @@ index 1a1637a..92a41e0 100644 add_subdirectory(po) add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 0854a9a..14c1cd1 100644 +index 0854a9a..a3ef4a0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,7 +22,9 @@ else() @@ -35,42 +35,6 @@ index 0854a9a..14c1cd1 100644 target_link_libraries(rime ${RIME_LINK_LIBRARIES}) install(TARGETS rime DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5") fcitx5_translate_desktop_file(rime.conf.in rime.conf) -@@ -31,3 +33,35 @@ fcitx5_translate_desktop_file("${CMAKE_CURRENT_BINARY_DIR}/rime-addon.conf.in" r - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/rime.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod" COMPONENT config) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/rime-addon.conf" RENAME rime.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) - -+ -+add_custom_command( -+ TARGET rime -+ POST_BUILD COMMAND /bin/sh -c -+ \" -+ ${CMAKE_COMMAND} -E copy -+ ${CMAKE_CURRENT_BINARY_DIR}/rime-addon.conf -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/fcitx5/addon/rime.conf -+ \; -+ ${CMAKE_COMMAND} -E copy -+ ${CMAKE_CURRENT_BINARY_DIR}/rime.conf -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/fcitx5/inputmethod/rime.conf -+ \; -+ mkdir -p ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/rime-data -+ \; -+ cp ${CMAKE_SOURCE_DIR}/data/rime-prelude/*.yaml ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/rime-data -+ \; -+ cp ${CMAKE_SOURCE_DIR}/data/rime-essay/essay.txt ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/rime-data -+ \; -+ cp ${CMAKE_SOURCE_DIR}/data/rime-luna-pinyin/*.yaml ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/rime-data -+ \; -+ cp ${CMAKE_SOURCE_DIR}/data/rime-stroke/*.yaml ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/rime-data -+ \; -+ ${CMAKE_COMMAND} -E copy -+ ${CMAKE_SOURCE_DIR}/data/default.yaml -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/rime-data/default.yaml -+ \; -+ ${CMAKE_COMMAND} -E copy_directory -+ ${PREBUILDER_SHARE_DIR}/opencc -+ ${CMAKE_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/rime-data/opencc -+ \" -+) diff --git a/src/rimeengine.cpp b/src/rimeengine.cpp index 090ee37..e924ba7 100644 --- a/src/rimeengine.cpp diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index e5fbf2d..b91429c 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -29,3 +29,13 @@ done sed -i '' "s|=/usr/include|=$(pwd)/$EXTRACT_DIR/include|" $EXTRACT_DIR/lib/pkgconfig/{json-c,libuv,marisa,rime}.pc sed -i '' "s|-L\${libdir} -luv|$(pwd)/$EXTRACT_DIR/lib/libuv.a|" $EXTRACT_DIR/lib/pkgconfig/libuv.pc sed -E -i '' "s|Libs:.*-l(.*)|Libs: $(pwd)/$EXTRACT_DIR/lib/lib\1.a|" $EXTRACT_DIR/lib/pkgconfig/json-c.pc + +plugins=( + rime +) + +for plugin in "${plugins[@]}"; do + file=$plugin-any.tar.bz2 + [[ -f cache/$file ]] || wget -P cache https://github.com/fcitx-contrib/fcitx5-macos-plugins/releases/download/latest/$file + tar xjvf cache/$file -C $EXTRACT_DIR +done diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b732c79..418a834 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,6 +37,7 @@ target_link_libraries(${BUNDLE_NAME} PRIVATE ${ADDONS} ) +# Make main app the last target so that keyboard can be copied into it. add_dependencies(${BUNDLE_NAME} keyboard) set_target_properties(${BUNDLE_NAME} PROPERTIES @@ -45,36 +46,31 @@ set_target_properties(${BUNDLE_NAME} PROPERTIES set_xcode_property(${BUNDLE_NAME} CODE_SIGN_ENTITLEMENTS ${PROJECT_SOURCE_DIR}/assets/app.entitlements) -add_custom_command( - TARGET ${BUNDLE_NAME} - POST_BUILD COMMAND /bin/sh -c - \" - ${CMAKE_COMMAND} -E copy_directory - ${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex - ${PROJECT_BINARY_DIR}/src/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/${BUNDLE_NAME}.app/PlugIns/keyboard.appex - \" -) +copy_to_keyboard(copy "${PROJECT_BINARY_DIR}/profile" profile) +copy_to_keyboard(copy "${PROJECT_BINARY_DIR}/iosfrontend/iosfrontend.conf" "share/fcitx5/addon/iosfrontend.conf") +copy_to_keyboard(copy "${PROJECT_BINARY_DIR}/iosnotifications/notifications.conf" "share/fcitx5/addon/notifications.conf") +copy_to_keyboard(copy "${PROJECT_BINARY_DIR}/uipanel/uipanel.conf" "share/fcitx5/addon/uipanel.conf") + +if (HALLELUJAH) + set(HALLELUJAH_SOURCE_DIR "${PROJECT_SOURCE_DIR}/engines/fcitx5-hallelujah") + set(HALLELUJAH_BINARY_DIR "${PROJECT_BINARY_DIR}/engines/fcitx5-hallelujah") + copy_to_keyboard(copy "${HALLELUJAH_BINARY_DIR}/data/google_227800_words.bin" "share/hallelujah/google_227800_words.bin") + copy_to_keyboard(copy "${HALLELUJAH_SOURCE_DIR}/data/words.json" "share/hallelujah/words.json") + copy_to_keyboard(copy "${HALLELUJAH_SOURCE_DIR}/data/cedict.json" "share/hallelujah/cedict.json") + copy_to_keyboard(copy "${HALLELUJAH_BINARY_DIR}/src/hallelujah-addon.conf" "share/fcitx5/addon/hallelujah.conf") + copy_to_keyboard(copy "${HALLELUJAH_BINARY_DIR}/src/hallelujah.conf" "share/fcitx5/inputmethod/hallelujah.conf") +endif() + +if (RIME) + set(RIME_BINARY_DIR "${PROJECT_BINARY_DIR}/engines/fcitx5-rime") + copy_to_keyboard(copy "${RIME_BINARY_DIR}/src/rime-addon.conf" "share/fcitx5/addon/rime.conf") + copy_to_keyboard(copy "${RIME_BINARY_DIR}/src/rime.conf" "share/fcitx5/inputmethod/rime.conf") + copy_to_keyboard(copy_directory "${PREBUILDER_SHARE_DIR}/rime-data" "share/rime-data") +endif() # Embed keyboard.appex in app. +copy_to_app(copy_directory "${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex" "PlugIns/keyboard.appex") # Copy share directory, icon and profile. -add_custom_command( - TARGET ${BUNDLE_NAME} - POST_BUILD COMMAND /bin/sh -c - \" - ${CMAKE_COMMAND} -E copy_directory - ${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex - ${PROJECT_BINARY_DIR}/src/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/${BUNDLE_NAME}.app/PlugIns/keyboard.appex - \; - ${CMAKE_COMMAND} -E copy_directory - ${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share - ${PROJECT_BINARY_DIR}/src/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/${BUNDLE_NAME}.app/share - \; - ${CMAKE_COMMAND} -E copy - ${PROJECT_SOURCE_DIR}/assets/${ICON_FILE} - ${PROJECT_BINARY_DIR}/src/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/${BUNDLE_NAME}.app - \; - ${CMAKE_COMMAND} -E copy - ${PROJECT_BINARY_DIR}/profile - ${PROJECT_BINARY_DIR}/src/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/${BUNDLE_NAME}.app/profile - \" -) +copy_to_app(copy_directory "${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share" "share") +copy_to_app(copy "${PROJECT_SOURCE_DIR}/assets/${ICON_FILE}" "${ICON_FILE}") +copy_to_app(copy "${PROJECT_BINARY_DIR}/profile" profile) diff --git a/uipanel/CMakeLists.txt b/uipanel/CMakeLists.txt index 835f23e..a70ae8d 100644 --- a/uipanel/CMakeLists.txt +++ b/uipanel/CMakeLists.txt @@ -32,13 +32,3 @@ target_include_directories(uipanel PUBLIC configure_file(uipanel.conf.in.in uipanel.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/uipanel.conf.in uipanel.conf) - -add_custom_command( - TARGET uipanel - POST_BUILD COMMAND /bin/sh -c - \" - ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_BINARY_DIR}/uipanel.conf - ${PROJECT_BINARY_DIR}/keyboard/$${CMAKE_XCODE_EFFECTIVE_PLATFORMS}/keyboard.appex/share/fcitx5/addon/uipanel.conf - \" -)