|
| 1 | +find_package(Gettext REQUIRED) |
| 2 | + |
| 3 | +add_library(fcitx5-mozc MODULE |
| 4 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/surrounding_text_util.cc |
| 5 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/fcitx_key_event_handler.cc |
| 6 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/fcitx_key_translator.cc |
| 7 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_client_pool.cc |
| 8 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_engine_factory.cc |
| 9 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_engine.cc |
| 10 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_ipc_client.cc |
| 11 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_response_parser.cc |
| 12 | + ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc_state.cc |
| 13 | +) |
| 14 | +set_target_properties(fcitx5-mozc PROPERTIES PREFIX "") |
| 15 | + |
| 16 | +target_link_libraries(fcitx5-mozc |
| 17 | + Fcitx5::Core |
| 18 | + PkgConfig::Fcitx5Module |
| 19 | + mozc::protocol::protocol |
| 20 | + mozc::base::vlog |
| 21 | + mozc::base::process |
| 22 | + mozc::base::util |
| 23 | + mozc::base::init_mozc |
| 24 | + mozc::client::client) |
| 25 | +install(TARGETS fcitx5-mozc DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5") |
| 26 | +install(FILES ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc-addon.conf RENAME mozc.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" |
| 27 | + COMPONENT config) |
| 28 | +install(FILES ${MOZC_SOURCE_DIR}/unix/fcitx5/mozc.conf RENAME mozc.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod" |
| 29 | + COMPONENT config) |
| 30 | +fcitx5_translate_desktop_file(${MOZC_SOURCE_DIR}/unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml.in |
| 31 | + org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml XML PO_DIRECTORY ${MOZC_SOURCE_DIR}/unix/fcitx5/po) |
| 32 | +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) |
| 33 | + |
| 34 | +install(FILES ${MOZC_SOURCE_DIR}/data/images/product_icon_32bpp-128.png |
| 35 | + RENAME org.fcitx.Fcitx5.fcitx_mozc.png |
| 36 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps") |
| 37 | +install(FILES ${MOZC_SOURCE_DIR}/data/images/unix/ime_product_icon_opensource-32.png |
| 38 | + RENAME org.fcitx.Fcitx5.fcitx_mozc.png |
| 39 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps") |
| 40 | +install(FILES ${MOZC_SOURCE_DIR}/../scripts/icons/ui-alpha_full.png |
| 41 | + RENAME org.fcitx.Fcitx5.fcitx_mozc_alpha_full.png |
| 42 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps") |
| 43 | +install(FILES ${MOZC_SOURCE_DIR}/../scripts/icons/ui-direct.png |
| 44 | + RENAME org.fcitx.Fcitx5.fcitx_mozc_direct.png |
| 45 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps") |
| 46 | +install(FILES ${MOZC_SOURCE_DIR}/../scripts/icons/ui-hiragana.png |
| 47 | + RENAME org.fcitx.Fcitx5.fcitx_mozc_hiragana.png |
| 48 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps") |
| 49 | +install(FILES ${MOZC_SOURCE_DIR}/../scripts/icons/ui-katakana_full.png |
| 50 | + RENAME org.fcitx.Fcitx5.fcitx_mozc_katakana_full.png |
| 51 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps") |
| 52 | +install(FILES ${MOZC_SOURCE_DIR}/../scripts/icons/ui-katakana_half.png |
| 53 | + RENAME org.fcitx.Fcitx5.fcitx_mozc_katakana_half.png |
| 54 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps") |
| 55 | +install(FILES ${MOZC_SOURCE_DIR}/../scripts/icons/ui-dictionary.png |
| 56 | + RENAME org.fcitx.Fcitx5.fcitx_mozc_dictionary.png |
| 57 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps") |
| 58 | +install(FILES ${MOZC_SOURCE_DIR}/../scripts/icons/ui-properties.png |
| 59 | + RENAME org.fcitx.Fcitx5.fcitx_mozc_properties.png |
| 60 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps") |
| 61 | +install(FILES ${MOZC_SOURCE_DIR}/../scripts/icons/ui-tool.png |
| 62 | + RENAME org.fcitx.Fcitx5.fcitx_mozc_tool.png |
| 63 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps") |
| 64 | + |
| 65 | +install(FILES icons/fcitx_mozc.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps") |
| 66 | +install(FILES icons/fcitx_mozc.png DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps") |
| 67 | +install(FILES |
| 68 | + icons/fcitx_mozc_alpha_full.png |
| 69 | + icons/fcitx_mozc_properties.png |
| 70 | + icons/fcitx_mozc_hiragana.png |
| 71 | + icons/fcitx_mozc_dictionary.png |
| 72 | + icons/fcitx_mozc_katakana_half.png |
| 73 | + icons/fcitx_mozc_alpha_half.png |
| 74 | + icons/fcitx_mozc_direct.png |
| 75 | + icons/fcitx_mozc_tool.png |
| 76 | + icons/fcitx_mozc_katakana_full.png |
| 77 | + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps" |
| 78 | +) |
| 79 | + |
| 80 | +file(GLOB PO_FILES "${MOZC_SOURCE_DIR}/unix/fcitx5/po/*.po") |
| 81 | +set(MO_FILES) |
| 82 | +foreach(PO_FILE IN LISTS PO_FILES) |
| 83 | + get_filename_component(PO_LANG ${PO_FILE} NAME_WE) |
| 84 | + get_filename_component(ABS_PO_FILE ${PO_FILE} ABSOLUTE) |
| 85 | + set(MO_FILE ${CMAKE_CURRENT_BINARY_DIR}/fcitx5-mozc-${PO_LANG}.mo) |
| 86 | + |
| 87 | + add_custom_command( |
| 88 | + OUTPUT ${MO_FILE} |
| 89 | + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${MO_FILE} ${ABS_PO_FILE} |
| 90 | + DEPENDS ${ABS_PO_FILE} |
| 91 | + ) |
| 92 | + |
| 93 | + install(FILES ${MO_FILE} RENAME fcitx5-mozc.mo DESTINATION ${FCITX_INSTALL_LOCALEDIR}/${PO_LANG}/LC_MESSAGES |
| 94 | + COMPONENT translation) |
| 95 | + set(MO_FILES ${MO_FILES} ${MO_FILE}) |
| 96 | +endforeach () |
| 97 | +add_custom_target("fcitx5-mozc-translation" ALL DEPENDS ${MO_FILES}) |
0 commit comments