### Install Theme Files Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/classic/themes/default/CMakeLists.txt Installs collected image files and the translated desktop configuration file to the appropriate theme directory. It also specifies the component for installation. ```cmake install(FILES ${IMAGE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/theme.conf DESTINATION ${FCITX_INSTALL_PKGDATADIR}/themes/default COMPONENT config) ``` -------------------------------- ### Install Addon Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/virtualkeyboard/CMakeLists.txt Installs the generated virtualkeyboard.conf file to the addon configuration directory. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/virtualkeyboard.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Configure and Install Addon Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/fcitx4frontend/CMakeLists.txt Configures and installs the fcitx4frontend.conf file, translating it from a template. ```cmake configure_file(fcitx4frontend.conf.in.in fcitx4frontend.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/fcitx4frontend.conf.in fcitx4frontend.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fcitx4frontend.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Install Classic UI Addon Target and Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/classic/CMakeLists.txt Installs the compiled classicui addon target and its configuration file. The configuration file is processed and installed to the appropriate Fcitx5 data directory. ```cmake install(TARGETS classicui DESTINATION "${FCITX_INSTALL_ADDONDIR}") configure_file(classicui.conf.in.in classicui.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/classicui.conf.in classicui.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/classicui.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Install fcitx5 Executable Source: https://github.com/fcitx/fcitx5/blob/master/src/server/CMakeLists.txt Installs the fcitx5 executable to the specified binary directory. ```cmake install(TARGETS fcitx5 DESTINATION "${FCITX_INSTALL_BINDIR}") ``` -------------------------------- ### Configure and Install Pkg-config File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/CMakeLists.txt Configures the pkg-config file from a template and installs it to the appropriate directory. ```cmake configure_file(Fcitx5Module.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Module.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Module.pc DESTINATION "${CMAKE_INSTALL_LIBDATADIR}/pkgconfig") ``` -------------------------------- ### Install D-Bus Service File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/dbus/CMakeLists.txt Configures and installs the D-Bus service file for Fcitx5. ```cmake configure_file("${CMAKE_CURRENT_SOURCE_DIR}/org.fcitx.Fcitx5.service.in" "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.service" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.service" DESTINATION "${CMAKE_INSTALL_DATADIR}/dbus-1/services") ``` -------------------------------- ### Install Addon Target Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/virtualkeyboard/CMakeLists.txt Installs the virtualkeyboard target to the specified addon directory. ```cmake install(TARGETS virtualkeyboard DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Install XDG Autostart Entry Source: https://github.com/fcitx/fcitx5/blob/master/data/CMakeLists.txt Conditionally installs the Fcitx5 desktop file to the XDG autostart directory if ENABLE_XDGAUTOSTART is defined. ```cmake if (ENABLE_XDGAUTOSTART) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.desktop" DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/autostart) endif() ``` -------------------------------- ### Install Add-on Target Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/ibusfrontend/CMakeLists.txt Installs the built ibusfrontend add-on to the appropriate directory. ```cmake install(TARGETS ibusfrontend DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Install Quickphrase Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/quickphrase/CMakeLists.txt Installs the generated quickphrase.conf file to the Fcitx add-on data directory, marking it as a config component. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/quickphrase.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Install Metainfo File Source: https://github.com/fcitx/fcitx5/blob/master/data/CMakeLists.txt Installs the Fcitx5 metainfo XML file to the system's metainfo directory. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.metainfo.xml" DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) ``` -------------------------------- ### Configure and Install Add-on Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/ibusfrontend/CMakeLists.txt Configures and installs the ibusfrontend.conf file, used for add-on configuration. ```cmake configure_file(ibusfrontend.conf.in.in ibusfrontend.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/ibusfrontend.conf.in ibusfrontend.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ibusfrontend.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Install Quickphrase Add-on Target Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/quickphrase/CMakeLists.txt Installs the built quickphrase target to the Fcitx add-on directory. ```cmake install(TARGETS quickphrase DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Install fcitx4frontend Target Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/fcitx4frontend/CMakeLists.txt Installs the built fcitx4frontend target to the addon directory. ```cmake install(TARGETS fcitx4frontend DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Install Quickphrase Data Directory Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/quickphrase/CMakeLists.txt Installs the quickphrase.d directory, containing data files matching the *.mb pattern, to the Fcitx add-on data directory. ```cmake install(DIRECTORY quickphrase.d DESTINATION "${FCITX_INSTALL_PKGDATADIR}/data" COMPONENT config FILES_MATCHING PATTERN "*.mb") ``` -------------------------------- ### Install Charselectdata Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/unicode/CMakeLists.txt Installs the 'charselectdata' file to the Fcitx5 unicode data directory as a configuration component. ```cmake install(FILES charselectdata DESTINATION "${FCITX_INSTALL_PKGDATADIR}/unicode" COMPONENT config) ``` -------------------------------- ### Install Application Desktop Files Source: https://github.com/fcitx/fcitx5/blob/master/data/CMakeLists.txt Installs the translated desktop files for the Fcitx5 configuration tool and main application to the system's applications directory. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.desktop" "${CMAKE_CURRENT_BINARY_DIR}/fcitx5-configtool.desktop" DESTINATION "${FCITX_INSTALL_DATADIR}/applications") ``` -------------------------------- ### Configure and Install Keyboard Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/im/keyboard/CMakeLists.txt Configures the keyboard configuration template and installs the generated configuration file to the addon directory. ```cmake configure_file(keyboard.conf.in.in keyboard.conf.in @ONLY) ``` ```cmake fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/keyboard.conf.in keyboard.conf) ``` ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/keyboard.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Install Addon and Configuration Files Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/waylandim/CMakeLists.txt Installs the 'waylandim' target to the addon directory and configures/installs the addon's configuration file. ```cmake install(TARGETS waylandim DESTINATION "${FCITX_INSTALL_ADDONDIR}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/waylandim.conf.in.in ${CMAKE_CURRENT_BINARY_DIR}/waylandim.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/waylandim.conf.in waylandim.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/waylandim.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Translate and Install Kimpanel Configuration Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/kimpanel/CMakeLists.txt Translates the configuration file and installs it to the Fcitx add-on data directory. ```cmake fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/kimpanel.conf.in kimpanel.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kimpanel.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Install Addon Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/unicode/CMakeLists.txt Installs the translated 'unicode.conf' file to the Fcitx5 addon data directory, as a configuration component. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/unicode.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Translate and Install Wayland Configuration Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/wayland/CMakeLists.txt Translates the wayland.conf.in file and installs the resulting wayland.conf. ```cmake fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/wayland.conf.in wayland.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/wayland.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Install Fcitx5 DBus Addon and Configuration Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/dbus/CMakeLists.txt Installs the built DBus addon target and its configuration file. ```cmake install(TARGETS dbus DESTINATION "${FCITX_INSTALL_ADDONDIR}") configure_file(dbus.conf.in.in dbus.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/dbus.conf.in dbus.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Configure and Install Module Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/CMakeLists.txt Configures the main module configuration file from a template and installs it along with the version file. ```cmake configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Fcitx5ModuleConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Module.cmake" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5ModuleConfigVersion.cmake" "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5Module.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Fcitx5Module COMPONENT Devel ) ``` -------------------------------- ### Install Binary Scripts Source: https://github.com/fcitx/fcitx5/blob/master/data/CMakeLists.txt Installs the Fcitx5 configuration tool script and diagnose script to the system's binary directory with specific permissions. ```cmake install(FILES fcitx5-configtool.sh RENAME fcitx5-configtool DESTINATION "${FCITX_INSTALL_BINDIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fcitx5-diagnose" DESTINATION "${FCITX_INSTALL_BINDIR}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) ``` -------------------------------- ### Install Unicode Target Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/unicode/CMakeLists.txt Installs the 'unicode' target to the Fcitx5 addon directory. ```cmake install(TARGETS unicode DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Install XIM Target Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/xim/CMakeLists.txt Installs the 'xim' target to the Fcitx addon directory. ```cmake install(TARGETS xim DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Translate and Install DBus Frontend Configuration Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/dbusfrontend/CMakeLists.txt Translates the configuration file and installs it to the addon data directory. ```cmake fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/dbusfrontend.conf.in dbusfrontend.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dbusfrontend.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Install Kimpanel Add-on Target Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/kimpanel/CMakeLists.txt Installs the compiled Kimpanel add-on target to the Fcitx add-on directory. ```cmake install(TARGETS kimpanel DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Generate and Install Package Version File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/CMakeLists.txt Generates a basic package version file and installs it for CMake. ```cmake write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/Fcitx5ModuleConfigVersion.cmake" VERSION @FCITX_VERSION@ COMPATIBILITY AnyNewerVersion) ``` -------------------------------- ### Install Icon Sizes with CMake Source: https://github.com/fcitx/fcitx5/blob/master/data/icon/CMakeLists.txt Installs icon directories for specified pixel sizes. Excludes pattern files and backup files. ```cmake foreach(size 16 22 24 32 48 128) install(DIRECTORY ${size}x${size} DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor" PATTERN .* EXCLUDE PATTERN *~ EXCLUDE) endforeach(size 16 22 24 32 48 128) ``` -------------------------------- ### Install Wayland Addon Target Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/wayland/CMakeLists.txt Installs the 'wayland' target to the specified addon directory. ```cmake install(TARGETS wayland DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Install DBus Frontend Target Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/dbusfrontend/CMakeLists.txt Installs the built dbusfrontend target to the specified addon directory. ```cmake install(TARGETS dbusfrontend DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Install Fcitx5 Addon Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/testing/testui/CMakeLists.txt Installs the testui.conf configuration file to the Fcitx5 package data directory. This is necessary for addon configuration. ```cmake install(FILES testui.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/testing/addon") ``` -------------------------------- ### Install Fcitx5Utils CMake Configuration Files Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-utils/CMakeLists.txt Installs CMake configuration files, version files, macros, download templates, module templates, and compiler settings for Fcitx5Utils. These files are installed to the Fcitx5Utils CMake directory under the development component. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5UtilsConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/Fcitx5UtilsConfigVersion.cmake" Fcitx5Macros.cmake Fcitx5Download.cmake.in Fcitx5ModuleTemplate.cmake.in "${PROJECT_SOURCE_DIR}/cmake/Fcitx5CompilerSettings.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Fcitx5Utils COMPONENT Devel ) ``` -------------------------------- ### Install XIM Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/xim/CMakeLists.txt Installs the 'xim.conf' file to the Fcitx addon data directory, marked as a config component. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/xim.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Build fcitx5-wayland-launcher Executable with DBUS and Wayland Support Source: https://github.com/fcitx/fcitx5/blob/master/src/tools/CMakeLists.txt Builds the 'fcitx5-wayland-launcher' executable when both DBUS and Wayland are found. Links against Fcitx5::Utils and installs the executable. ```cmake if (ENABLE_DBUS AND WAYLAND_FOUND) add_executable(fcitx5-wayland-launcher wayland-launcher.cpp) target_link_libraries(fcitx5-wayland-launcher Fcitx5::Utils) install(TARGETS fcitx5-wayland-launcher DESTINATION "${FCITX_INSTALL_LIBEXECDIR}") endif() ``` -------------------------------- ### Install Scalable Icons with CMake Source: https://github.com/fcitx/fcitx5/blob/master/data/icon/CMakeLists.txt Installs scalable icon directories. Excludes pattern files and backup files. ```cmake install(DIRECTORY scalable DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor" PATTERN ".*" EXCLUDE PATTERN "*~" EXCLUDE) ``` -------------------------------- ### Build and Install Dictionary Compiler Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/spell/CMakeLists.txt Sets up an executable for compiling dictionary data. This is typically used for creating custom dictionary formats. ```cmake if (BUILD_SPELL_DICT) set(DICT_COMP_SRC comp_spell_dict.cpp ) add_executable(comp-spell-dict ${DICT_COMP_SRC}) add_executable(Fcitx5::comp-spell-dict ALIAS comp-spell-dict) target_link_libraries(comp-spell-dict Fcitx5::Utils) install(TARGETS comp-spell-dict DESTINATION "${FCITX_INSTALL_ADDONDIR}/libexec") endif() ``` -------------------------------- ### Install Wayland Launcher Desktop File Source: https://github.com/fcitx/fcitx5/blob/master/data/CMakeLists.txt Conditionally configures, translates, and installs the Wayland launcher desktop file if D-Bus and Wayland are enabled. This file is placed in the applications directory. ```cmake if (ENABLE_DBUS AND WAYLAND_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcitx5-wayland-launcher.desktop.in.in ${CMAKE_CURRENT_BINARY_DIR}/fcitx5-wayland-launcher.desktop.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/fcitx5-wayland-launcher.desktop.in fcitx5-wayland-launcher.desktop) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fcitx5-wayland-launcher.desktop" DESTINATION "${FCITX_INSTALL_DATADIR}/applications") endif() ``` -------------------------------- ### Install Fcitx5 Addon Target Source: https://github.com/fcitx/fcitx5/blob/master/testing/testui/CMakeLists.txt Installs the testui target to the Fcitx5 addon directory. This makes the addon available for runtime loading. ```cmake install(TARGETS testui DESTINATION "${FCITX_INSTALL_ADDONDIR}") ``` -------------------------------- ### Configure and Translate Desktop Files Source: https://github.com/fcitx/fcitx5/blob/master/data/CMakeLists.txt Configures and translates desktop entry files for the Fcitx5 configuration tool and main application. Ensures correct installation paths and formats. ```cmake configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcitx5-configtool.desktop.in.in ${CMAKE_CURRENT_BINARY_DIR}/fcitx5-configtool.desktop.in @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/org.fcitx.Fcitx5.desktop.in.in ${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.desktop.in @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fcitx5-diagnose.sh ${CMAKE_CURRENT_BINARY_DIR}/fcitx5-diagnose ESCAPE_QUOTES @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/fcitx5-configtool.desktop.in fcitx5-configtool.desktop) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/org.fcitx.Fcitx5.desktop.in org.fcitx.Fcitx5.desktop) fcitx5_translate_desktop_file(org.fcitx.Fcitx5.metainfo.xml.in org.fcitx.Fcitx5.metainfo.xml XML) ``` -------------------------------- ### Install Default Configuration Directory Source: https://github.com/fcitx/fcitx5/blob/master/data/CMakeLists.txt Installs the default configuration directory to the system's package data directory, marked with the 'config' component. ```cmake install(DIRECTORY default DESTINATION "${FCITX_INSTALL_PKGDATADIR}" COMPONENT config) ``` -------------------------------- ### Build and Install Emoji Addon Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/emoji/CMakeLists.txt Conditionally builds the emoji addon if ENABLE_EMOJI is set. Links against Fcitx5 Core and ZLIB, and installs the target and configuration files. ```cmake if (ENABLE_EMOJI) add_fcitx5_addon(emoji emoji.cpp) target_link_libraries(emoji Fcitx5::Core ZLIB::ZLIB) install(TARGETS emoji DESTINATION "${FCITX_INSTALL_ADDONDIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/emoji.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) add_subdirectory(data) endif() ``` -------------------------------- ### Configure and Translate NotificationItem Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/notificationitem/CMakeLists.txt Configures the notificationitem configuration file using CMake's configure_file and fcitx5_translate_desktop_file. This prepares the configuration for installation. ```cmake configure_file(notificationitem.conf.in.in notificationitem.conf @ONLY) ``` ```cmake fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/notificationitem.conf.in notificationitem.conf ``` -------------------------------- ### Install Emoji Dictionary Files Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/emoji/data/CMakeLists.txt This snippet uses CMake's file(GLOB) to find all .dict files and then installs them to the specified destination directory for emoji data. It is part of the configuration component. ```cmake file(GLOB DICT_FILES *.dict) install(FILES ${DICT_FILES} DESTINATION ${FCITX_INSTALL_PKGDATADIR}/emoji/data COMPONENT config) ``` -------------------------------- ### Install Xwayland Session Script Source: https://github.com/fcitx/fcitx5/blob/master/data/CMakeLists.txt Conditionally configures and installs an Xwayland session script if WAYLAND is found and ENABLE_X11 is set. This script is placed in the Xwayland-session.d directory. ```cmake if (WAYLAND_FOUND AND ENABLE_X11) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/20-fcitx-x11.in ${CMAKE_CURRENT_BINARY_DIR}/20-fcitx-x11 @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/20-fcitx-x11" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/Xwayland-session.d" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) endif() ``` -------------------------------- ### Build fcitx5-remote Executable with DBUS Support Source: https://github.com/fcitx/fcitx5/blob/master/src/tools/CMakeLists.txt Builds the 'fcitx5-remote' executable when DBUS is enabled. Links against Fcitx5::Utils and installs the executable. ```cmake if (ENABLE_DBUS) add_executable(fcitx5-remote remote.cpp) target_link_libraries(fcitx5-remote Fcitx5::Utils) install(TARGETS fcitx5-remote DESTINATION "${FCITX_INSTALL_BINDIR}") endif() ``` -------------------------------- ### Fcitx5 Addon Build Configuration Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/imselector/CMakeLists.txt Defines the Fcitx5 addon target, links necessary libraries, and specifies installation paths for the addon and its configuration file. ```cmake add_fcitx5_addon(imselector imselector.cpp) target_link_libraries(imselector Fcitx5::Core) install(TARGETS imselector DESTINATION "${FCITX_INSTALL_ADDONDIR}") configure_file(imselector.conf.in.in imselector.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/imselector.conf.in imselector.conf) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/imselector.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) ``` -------------------------------- ### Configure Include Directories for Fcitx5 Wayland Input Method Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method/CMakeLists.txt Sets public include directories for the Fcitx5 Wayland input method library, allowing build and install interfaces to access necessary headers. ```cmake target_include_directories(Fcitx5WaylandInputMethod PUBLIC "$") ``` -------------------------------- ### Export QuickPhrase Module Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/quickphrase/CMakeLists.txt Exports the QuickPhrase module using fcitx5_export_module, specifying the target, build include directories, headers, and installation path. ```cmake fcitx5_export_module(QuickPhrase TARGET quickphrase BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS quickphrase_public.h INSTALL) ``` -------------------------------- ### Fcitx5 Clipboard Module CMake Configuration Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/clipboard/CMakeLists.txt Defines the build process for the Fcitx5 clipboard module, including sources, dependencies, and installation targets. Conditional compilation is used for X11 and Wayland support. ```cmake add_fcitx5_addon(clipboard) target_sources(clipboard PRIVATE clipboard.cpp) target_link_libraries(clipboard Fcitx5::Core) if (ENABLE_X11) target_sources(clipboard PRIVATE xcbclipboard.cpp) target_link_libraries(clipboard Fcitx5::Module::XCB XCB::XCB) endif() if (WAYLAND_FOUND) target_sources(clipboard PRIVATE waylandclipboard.cpp) target_link_libraries(clipboard Fcitx5::Module::Wayland Fcitx5::Wayland::WLRDataControl Fcitx5::Wayland::ExtDataControl Pthread::Pthread) endif() install(TARGETS clipboard DESTINATION "${FCITX_INSTALL_ADDONDIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/clipboard.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) configure_file(clipboard.conf.in.in clipboard.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/clipboard.conf.in clipboard.conf) fcitx5_export_module(Clipboard TARGET clipboard BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS clipboard_public.h INSTALL) ``` -------------------------------- ### Configure Addon Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/virtualkeyboard/CMakeLists.txt Configures the virtualkeyboard.conf.in.in file with build-time variables. ```cmake configure_file(virtualkeyboard.conf.in.in virtualkeyboard.conf.in @ONLY) ``` -------------------------------- ### Configure and Translate Addon Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/unicode/CMakeLists.txt Configures the 'unicode.conf.in' file and then translates it using fcitx5_translate_desktop_file. ```cmake configure_file(unicode.conf.in.in unicode.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/unicode.conf.in unicode.conf) ``` -------------------------------- ### Main CMakeLists.txt Configuration Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/CMakeLists.txt Includes subdirectories for the Fcitx5 build. Conditional inclusion of 'kimpanel' and 'virtualkeyboard' is based on the ENABLE_DBUS flag. ```cmake add_subdirectory(classic) if (ENABLE_DBUS) add_subdirectory(kimpanel) add_subdirectory(virtualkeyboard) endif() ``` -------------------------------- ### Build and Test QuickPhrase Executable Source: https://github.com/fcitx/fcitx5/blob/master/test/CMakeLists.txt Adds the 'testquickphrase' executable, linking it with Fcitx5 core, QuickPhrase, and test modules. A test case for 'testquickphrase' is also defined. ```cmake add_executable(testquickphrase testquickphrase.cpp) target_link_libraries(testquickphrase Fcitx5::Core Fcitx5::Module::QuickPhrase Fcitx5::Module::TestFrontend Fcitx5::Module::TestIM) add_dependencies(testquickphrase copy-addon quickphrase testui testfrontend testim) add_test(NAME testquickphrase COMMAND testquickphrase) ``` -------------------------------- ### Translate Quickphrase Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/quickphrase/CMakeLists.txt Uses the fcitx5_translate_desktop_file macro to process the quickphrase.conf.in file into a final configuration file. ```cmake fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/quickphrase.conf.in quickphrase.conf) ``` -------------------------------- ### Create Fractional Scale Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/fractional-scale-v1/CMakeLists.txt Creates a static library for Fcitx5 Wayland fractional scale support and sets its properties. ```cmake add_library(Fcitx5WaylandFractionalScale STATIC ${FCITX_WAYLAND_FRACTIONAL_SCALE_PROTOCOL_SRCS} ${FRACTIONAL_SCALE_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandFractionalScale PROPERTIES POSITION_INDEPENDENT_CODE ON ) target_include_directories(Fcitx5WaylandFractionalScale PUBLIC "$") target_link_libraries(Fcitx5WaylandFractionalScale Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) ``` -------------------------------- ### Create Fcitx5 Wayland Input Method V2 Static Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method-v2/CMakeLists.txt Creates a static library for Fcitx5 Wayland Input Method V2, including generated protocol sources. ```cmake add_library(Fcitx5WaylandInputMethodV2 STATIC ${FCITX_WAYLAND_INPUTMETHOD_V2_SOURCES} ${WAYLAND_IM_V2_PROTOCOL_SRCS}) ``` -------------------------------- ### Create Static Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/plasma-window-management/CMakeLists.txt Creates a static library for the Fcitx5 Wayland Plasma window management module. This library will contain the compiled source files and the Wayland protocol definitions. ```cmake add_library(Fcitx5WaylandPlasmaWindowManagement STATIC ${FCITX_WAYLAND_PLASMA_WINDOW_MANAGEMENT_SOURCES} ${PLASMA_WINDOW_MANAGEMENT_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandPlasmaWindowManagement PROPERTIES POSITION_INDEPENDENT_CODE ON ) target_include_directories(Fcitx5WaylandPlasmaWindowManagement PUBLIC "$") target_link_libraries(Fcitx5WaylandPlasmaWindowManagement Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) ``` -------------------------------- ### Export Wayland Module Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/wayland/CMakeLists.txt Exports the Wayland module using fcitx5_export_module, specifying target, build directories, headers, and installation. ```cmake fcitx5_export_module(Wayland TARGET wayland BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS wayland_public.h INSTALL) ``` -------------------------------- ### Create Static Library for Wayland Blur Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/blur/CMakeLists.txt Creates a static library named Fcitx5WaylandBlur using the generated protocol sources and the protocol source files. It also sets position-independent code property and defines public include directories. ```cmake add_library(Fcitx5WaylandBlur STATIC ${FCITX_WAYLAND_BLUR_PROTOCOL_SOURCES} ${BLUR_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandBlur PROPERTIES POSITION_INDEPENDENT_CODE ON ) target_include_directories(Fcitx5WaylandBlur PUBLIC "$") target_link_libraries(Fcitx5WaylandBlur Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) ``` -------------------------------- ### Export Fcitx5 Module Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/unicode/CMakeLists.txt Exports the 'Unicode' module, specifying its target, build include directories, headers, and installation settings. ```cmake fcitx5_export_module(Unicode TARGET unicode BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS unicode_public.h INSTALL) ``` -------------------------------- ### Manage Addon Configuration Dependencies Source: https://github.com/fcitx/fcitx5/blob/master/test/addon/CMakeLists.txt Define a list of configuration files to be copied and conditionally add more based on build flags like `ENABLE_KEYBOARD` and `ENABLE_X11`. ```cmake set(COPY_ADDON_DEPENDS unicode.conf.in-fmt quickphrase.conf.in-fmt xcb.conf.in-fmt spell.conf.in-fmt) if (ENABLE_KEYBOARD) list(APPEND COPY_ADDON_DEPENDS keyboard.conf.in-fmt) endif() if (ENABLE_X11) list(APPEND COPY_ADDON_DEPENDS xim.conf.in-fmt) endif() ``` -------------------------------- ### Create Fcitx5 Wayland Input Method Static Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method/CMakeLists.txt Creates a static library for the Fcitx5 Wayland input method, including generated protocol sources and defined C++ sources. Sets properties for position-independent code. ```cmake add_library(Fcitx5WaylandInputMethod STATIC ${FCITX_WAYLAND_INPUTMETHOD_SOURCES} ${WAYLAND_IM_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandInputMethod PROPERTIES POSITION_INDEPENDENT_CODE ON ) ``` -------------------------------- ### Configure Kimpanel Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/kimpanel/CMakeLists.txt Configures the kimpanel.conf.in.in file using CMake's configure_file command. ```cmake configure_file(kimpanel.conf.in.in kimpanel.conf.in @ONLY) ``` -------------------------------- ### Configure Quickphrase Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/quickphrase/CMakeLists.txt Configures the quickphrase.conf.in.in file using CMake's configure_file command with @ONLY variable substitution. ```cmake configure_file(quickphrase.conf.in.in quickphrase.conf.in @ONLY) ``` -------------------------------- ### Create Static Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/ext-data-control/CMakeLists.txt Creates a static library named Fcitx5WaylandExtDataControl using the defined protocol source files and generated sources. Sets position-independent code property. ```cmake add_library(Fcitx5WaylandExtDataControl STATIC ${FCITX_WAYLAND_Ext_DATA_CONTROL_PROTOCOL_SOURCES} ${Ext_DATA_CONTROL_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandExtDataControl PROPERTIES POSITION_INDEPENDENT_CODE ON ) ``` -------------------------------- ### Configure Include Directories for Static Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method-v2/CMakeLists.txt Sets public include directories for the Fcitx5 Wayland Input Method V2 library, including build and source paths. ```cmake target_include_directories(Fcitx5WaylandInputMethodV2 PUBLIC "$") ``` -------------------------------- ### Translate Desktop File Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/virtualkeyboard/CMakeLists.txt Translates the virtualkeyboard.conf.in file to virtualkeyboard.conf. ```cmake fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/virtualkeyboard.conf.in virtualkeyboard.conf) ``` -------------------------------- ### Conditional Build for Notifications Addon with D-Bus Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/notifications/CMakeLists.txt This snippet configures the build for the notifications addon, enabling it only if D-Bus support is enabled. It links against Fcitx5 Core and D-Bus modules and specifies installation paths for the target and configuration files. ```cmake if (ENABLE_DBUS) add_fcitx5_addon(notifications notifications.cpp) target_link_libraries(notifications Fcitx5::Core Fcitx5::Module::DBus) install(TARGETS notifications DESTINATION "${FCITX_INSTALL_ADDONDIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/notifications.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon" COMPONENT config) endif() ``` -------------------------------- ### Create Static Library for Fcitx5 Wayland Tablet Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/tablet-v2/CMakeLists.txt Creates a static library named Fcitx5WaylandTablet using the defined source files and generated protocol sources. It also sets properties for the library. ```cmake add_library(Fcitx5WaylandTablet STATIC ${FCITX_WAYLAND_TABLET_SOURCES} ${WAYLAND_TABLET_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandTablet PROPERTIES POSITION_INDEPENDENT_CODE ON ) ``` -------------------------------- ### Configure Target Include Directories and Libraries Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/waylandim/CMakeLists.txt Sets private include directories for the 'waylandim' target and links necessary Fcitx5, Wayland, and XKBCommon libraries. ```cmake target_include_directories(waylandim PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(waylandim Fcitx5::Core Wayland::Client XKBCommon::XKBCommon Fcitx5::Wayland::PlasmaWindowManagement Fcitx5::Wayland::WLRForeignToplevelManagement Fcitx5::Module::Wayland Fcitx5::Wayland::Core Fcitx5::Wayland::InputMethod Fcitx5::Wayland::InputMethodV2) ``` -------------------------------- ### Configure Include Directories and Link Libraries Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/tablet-v2/CMakeLists.txt Sets the public include directories for the Fcitx5WaylandTablet library and links it against necessary dependencies like Wayland::Client and Fcitx5 utilities. ```cmake target_include_directories(Fcitx5WaylandTablet PUBLIC "$") target_link_libraries(Fcitx5WaylandTablet Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) ``` -------------------------------- ### Create Fcitx5 Wayland Viewporter Static Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/viewporter/CMakeLists.txt Creates a static library named Fcitx5WaylandViewporter using the defined source files and generated protocol sources. Sets position-independent code property. ```cmake add_library(Fcitx5WaylandViewporter STATIC ${FCITX_WAYLAND_VIEWPORTER_SOURCES} ${VIEWPORTER_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandViewporter PROPERTIES POSITION_INDEPENDENT_CODE ON ) ``` -------------------------------- ### Configure XKBCommon Components for X11 Source: https://github.com/fcitx/fcitx5/blob/master/CMakeLists.txt Sets up the required components for XKBCommon when X11 is enabled, including XCB and related libraries. ```cmake set(REQUIRED_XKBCOMMON_COMPONENTS XKBCommon) if (ENABLE_X11) set(REQUIRED_XKBCOMMON_COMPONENTS ${REQUIRED_XKBCOMMON_COMPONENTS} X11) find_package(XCB REQUIRED COMPONENTS XCB AUX XKB XFIXES ICCCM XINERAMA RANDR EWMH KEYSYMS) find_package(XCBImdkit 1.0.3 REQUIRED) pkg_check_modules(CairoXCB REQUIRED IMPORTED_TARGET cairo-xcb) pkg_check_modules(XkbFile REQUIRED IMPORTED_TARGET "xkbfile") endif() ``` -------------------------------- ### Configure DBus Frontend Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/dbusfrontend/CMakeLists.txt Configures the dbusfrontend.conf.in.in file using CMake's configure_file command with @ONLY variable substitution. ```cmake configure_file(dbusfrontend.conf.in.in dbusfrontend.conf.in @ONLY) ``` -------------------------------- ### Configure Cairo and Pango for UI Painting Source: https://github.com/fcitx/fcitx5/blob/master/CMakeLists.txt Checks for Cairo and Pango libraries for classic UI painting when X11 or Wayland is enabled. ```cmake if (ENABLE_X11 OR ENABLE_WAYLAND) pkg_check_modules(Cairo IMPORTED_TARGET cairo) pkg_check_modules(Pango IMPORTED_TARGET pango pangocairo) pkg_check_modules(GdkPixbuf IMPORTED_TARGET gdk-pixbuf-2.0) pkg_check_modules(GioUnix IMPORTED_TARGET gio-unix-2.0) if (USE_SYSTEM_YOGA) find_package(yoga REQUIRED) set(YOGA_TARGET yoga::yogacore) else() add_subdirectory(third_party/yoga/yoga) set(YOGA_TARGET yogacore) endif() endif() ``` -------------------------------- ### Add Fcitx5 Addon Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/virtualkeyboard/CMakeLists.txt Defines the virtualkeyboard addon and links its source file. ```cmake add_fcitx5_addon(virtualkeyboard virtualkeyboard.cpp) ``` -------------------------------- ### Link Libraries for Quickphrase Add-on Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/quickphrase/CMakeLists.txt Links the necessary Fcitx5 core and spell modules to the quickphrase target. ```cmake target_link_libraries(quickphrase Fcitx5::Core Fcitx5::Module::Spell) ``` -------------------------------- ### Create Alias Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/plasma-window-management/CMakeLists.txt Creates an alias for the Fcitx5 Wayland Plasma window management static library. This allows for easier referencing of the library within the build system. ```cmake add_library(Fcitx5::Wayland::PlasmaWindowManagement ALIAS Fcitx5WaylandPlasmaWindowManagement) ``` -------------------------------- ### Build and Test Spell Executable Source: https://github.com/fcitx/fcitx5/blob/master/test/CMakeLists.txt Adds the 'testspell' executable and links it with Fcitx5 core and test modules. It also defines a test case for 'testspell'. ```cmake if (ENABLE_KEYBOARD) add_executable(testspell testspell.cpp) target_link_libraries(testspell Fcitx5::Core Fcitx5::Module::TestFrontend keyboard) add_dependencies(testspell copy-addon spell testui testfrontend spell_en_dict) add_test(NAME testspell COMMAND testspell) endif() ``` -------------------------------- ### Create Alias for Fractional Scale Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/fractional-scale-v1/CMakeLists.txt Creates an alias for the Fcitx5 Wayland fractional scale library for easier referencing. ```cmake add_library(Fcitx5::Wayland::FractionalScale ALIAS Fcitx5WaylandFractionalScale) ``` -------------------------------- ### Configure Include Directories Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/ext-data-control/CMakeLists.txt Configures public include directories for the Fcitx5WaylandExtDataControl library, making them available to targets that link against it. ```cmake target_include_directories(Fcitx5WaylandExtDataControl PUBLIC "$") ``` -------------------------------- ### Define Fcitx5 Wayland Input Method V2 Sources Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method-v2/CMakeLists.txt Lists the source files for the Fcitx5 Wayland Input Method V2 library. ```cmake set(FCITX_WAYLAND_INPUTMETHOD_V2_SOURCES zwp_input_popup_surface_v2.cpp zwp_input_method_keyboard_grab_v2.cpp zwp_input_method_manager_v2.cpp zwp_input_method_v2.cpp zwp_virtual_keyboard_manager_v1.cpp zwp_virtual_keyboard_v1.cpp ) ``` -------------------------------- ### Configure Include Directories Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/cursor-shape/CMakeLists.txt Sets public include directories for the Fcitx5WaylandCursorShape library, making them available to targets that link against it. This includes build-specific and source-specific directories. ```cmake target_include_directories(Fcitx5WaylandCursorShape PUBLIC "$") ``` -------------------------------- ### Configure Include Directories Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/viewporter/CMakeLists.txt Sets public include directories for the Fcitx5WaylandViewporter library, allowing dependent targets to find its headers. ```cmake target_include_directories(Fcitx5WaylandViewporter PUBLIC "$") ``` -------------------------------- ### Define Fcitx5 Quickphrase Add-on Target Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/quickphrase/CMakeLists.txt Defines the build target for the quickphrase add-on, specifying its source files. ```cmake add_fcitx5_addon(quickphrase quickphrase.cpp quickphraseprovider.cpp) ``` -------------------------------- ### Create Alias for Fcitx5 Wayland Input Method Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method/CMakeLists.txt Creates an alias target 'Fcitx5::Wayland::InputMethod' for the 'Fcitx5WaylandInputMethod' static library, providing a namespaced target for easier dependency management. ```cmake add_library(Fcitx5::Wayland::InputMethod ALIAS Fcitx5WaylandInputMethod) ``` -------------------------------- ### Create Static Library for WLR Data Control Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/wlr-data-control/CMakeLists.txt Creates a static library for the Fcitx5 Wayland WLR data control integration, including generated sources and specifying build properties. ```cmake add_library(Fcitx5WaylandWLRDataControl STATIC ${FCITX_WAYLAND_WLR_DATA_CONTROL_PROTOCOL_SOURCES} ${WLR_DATA_CONTROL_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandWLRDataControl PROPERTIES POSITION_INDEPENDENT_CODE ON ) target_include_directories(Fcitx5WaylandWLRDataControl PUBLIC "$") target_link_libraries(Fcitx5WaylandWLRDataControl Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) ``` -------------------------------- ### Add Fcitx5 Kimpanel Add-on Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/kimpanel/CMakeLists.txt Defines the Kimpanel add-on target and its source file. ```cmake add_fcitx5_addon(kimpanel kimpanel.cpp) ``` -------------------------------- ### Create Alias Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/viewporter/CMakeLists.txt Creates an alias target Fcitx5::Wayland::Viewporter for the Fcitx5WaylandViewporter static library, providing a convenient way to reference it. ```cmake add_library(Fcitx5::Wayland::Viewporter ALIAS Fcitx5WaylandViewporter) ``` -------------------------------- ### Link Libraries for Fcitx5 Wayland Input Method Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method/CMakeLists.txt Links the Fcitx5 Wayland input method library against Wayland client, Fcitx5 Utils, and Fcitx5 Wayland Core libraries. ```cmake target_link_libraries(Fcitx5WaylandInputMethod Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) ``` -------------------------------- ### Link Libraries for Classic UI Addon Source: https://github.com/fcitx/fcitx5/blob/master/src/ui/classic/CMakeLists.txt Links the classicui addon target against core Fcitx5 libraries, PkgConfig dependencies, and the collected Wayland/X11/DBus libraries. ```cmake target_link_libraries(classicui Fcitx5::Core PkgConfig::Cairo PkgConfig::Pango PkgConfig::GdkPixbuf PkgConfig::GioUnix Fcitx5::Module::NotificationItem ${YOGA_TARGET} ${CLASSICUI_LIBS} ) ``` -------------------------------- ### Add Wayland Client Protocol Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/fractional-scale-v1/CMakeLists.txt Adds the fractional scale Wayland client protocol to the build system. ```cmake ecm_add_wayland_client_protocol(FRACTIONAL_SCALE_PROTOCOL_SRCS PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/fractional-scale-v1.xml BASENAME fractional-scale-v1) ``` -------------------------------- ### Configure and Export Emoji Module Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/emoji/CMakeLists.txt Configures the emoji.conf file and exports the emoji module, specifying build include directories and headers. ```cmake configure_file(emoji.conf.in.in emoji.conf.in @ONLY) ``` ```cmake fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/emoji.conf.in emoji.conf) ``` ```cmake fcitx5_export_module(Emoji TARGET emoji BUILD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" HEADERS emoji_public.h INSTALL) ``` -------------------------------- ### Configure Wayland Configuration File Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/wayland/CMakeLists.txt Configures the wayland.conf.in.in file using CMake's configure_file command. ```cmake configure_file(wayland.conf.in.in wayland.conf.in @ONLY) ``` -------------------------------- ### Link Libraries for Static Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method-v2/CMakeLists.txt Links necessary libraries to the Fcitx5 Wayland Input Method V2 static library, including Wayland client, Fcitx5 Utils, and Fcitx5 Wayland Core. ```cmake target_link_libraries(Fcitx5WaylandInputMethodV2 Wayland::Client Fcitx5::Utils Fcitx5::Wayland::Core) ``` -------------------------------- ### Find Expat Library for Keyboard Input Source: https://github.com/fcitx/fcitx5/blob/master/CMakeLists.txt Finds the Expat library, which is required for keyboard input processing. ```cmake if (ENABLE_KEYBOARD) find_package(Expat REQUIRED) endif() ``` -------------------------------- ### Find PkgConfig Source: https://github.com/fcitx/fcitx5/blob/master/CMakeLists.txt Finds the PkgConfig build tool, which is required for checking modules. ```cmake find_package(PkgConfig REQUIRED) ``` -------------------------------- ### Include Fcitx5 Tools Subdirectory Source: https://github.com/fcitx/fcitx5/blob/master/src/CMakeLists.txt Includes the tools subdirectory, which typically contains build configurations for utility programs and scripts related to Fcitx5. ```cmake add_subdirectory(tools) ``` -------------------------------- ### Configure XIM Configuration Template Source: https://github.com/fcitx/fcitx5/blob/master/src/frontend/xim/CMakeLists.txt Configures the 'xim.conf.in.in' template file to generate 'xim.conf.in'. ```cmake configure_file(xim.conf.in.in xim.conf.in @ONLY) ``` -------------------------------- ### Create Alias Library Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/ext-data-control/CMakeLists.txt Creates an alias target Fcitx5::Wayland::ExtDataControl for the Fcitx5WaylandExtDataControl static library, providing a convenient way to reference it. ```cmake add_library(Fcitx5::Wayland::ExtDataControl ALIAS Fcitx5WaylandExtDataControl) ``` -------------------------------- ### Add Wayland Client Protocol Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/input-method-v2/CMakeLists.txt Generates Wayland client protocol sources from XML definitions. Used for input method and virtual keyboard protocols. ```cmake ecm_add_wayland_client_protocol(WAYLAND_IM_V2_PROTOCOL_SRCS PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/input-method-unstable-v2.xml BASENAME input-method-unstable-v2) ecm_add_wayland_client_protocol(WAYLAND_IM_V2_PROTOCOL_SRCS PROTOCOL ${CMAKE_CURRENT_SOURCE_DIR}/virtual-keyboard-unstable-v1.xml BASENAME virtual-keyboard-unstable-v1) ``` -------------------------------- ### Create Static Library for Cursor Shape Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/cursor-shape/CMakeLists.txt Creates a static library named 'Fcitx5WaylandCursorShape' using the generated protocol sources and other specified C++ files. It also configures properties like position-independent code. ```cmake add_library(Fcitx5WaylandCursorShape STATIC ${FCITX_WAYLAND_CURSOR_SHAPE_PROTOCOL_SOURCES} ${CURSOR_SHAPE_PROTOCOL_SRCS}) set_target_properties(Fcitx5WaylandCursorShape PROPERTIES POSITION_INDEPENDENT_CODE ON ) ``` -------------------------------- ### XCB Configuration File Generation Source: https://github.com/fcitx/fcitx5/blob/master/src/modules/xcb/CMakeLists.txt Configures and translates the xcb.conf file using CMake macros. This ensures the configuration is correctly generated and translated for the addon. ```cmake configure_file(xcb.conf.in.in xcb.conf.in @ONLY) fcitx5_translate_desktop_file(${CMAKE_CURRENT_BINARY_DIR}/xcb.conf.in xcb.conf) ``` -------------------------------- ### Create Alias Library for Foreign Toplevel Management Source: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx-wayland/wlr-foreign-toplevel-management-unstable-v1/CMakeLists.txt Creates an alias target for the Fcitx5 Wayland foreign toplevel management static library, providing a convenient way to reference it. ```cmake add_library(Fcitx5::Wayland::WLRForeignToplevelManagement ALIAS Fcitx5WaylandWLRForeignToplevelManagement) ```