0001-CMake-Add-option-to-disable-X11-support.patch (2214B)
- From cc3bdb96d4fb991b373068114143515ead5bc7d6 Mon Sep 17 00:00:00 2001
- From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
- Date: Wed, 21 Sep 2022 08:59:16 +0200
- Subject: [PATCH 1/2] CMake: Add option to disable X11 support
- ---
- CMakeLists.txt | 27 +++++++++++++++------------
- 1 file changed, 15 insertions(+), 12 deletions(-)
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- index e526b58..144884d 100644
- --- a/CMakeLists.txt
- +++ b/CMakeLists.txt
- @@ -13,6 +13,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
- option(ENABLE_QT4 "Enable Qt 4" On)
- option(ENABLE_QT5 "Enable Qt 5" On)
- option(ENABLE_QT6 "Enable Qt 6" Off)
- +option(ENABLE_X11 "Enable X11" On)
- option(BUILD_ONLY_PLUGIN "Build only plugin" Off)
- option(BUILD_STATIC_PLUGIN "Build plugin as static" Off)
- option(WITH_FCITX_PLUGIN_NAME "Enable plugin name with fcitx" On)
- @@ -42,24 +43,26 @@ include(ECMSetupVersion)
- include(ECMGenerateHeaders)
- include(ECMUninstallTarget)
- -find_package(XCB REQUIRED COMPONENTS XCB)
- find_package(XKBCommon 0.5.0 REQUIRED COMPONENTS XKBCommon)
- if (NOT BUILD_ONLY_PLUGIN)
- -find_package(Fcitx5Utils 5.0.16 REQUIRED)
- + find_package(Fcitx5Utils 5.0.16 REQUIRED)
- +endif()
- +if (ENABLE_X11)
- + find_package(XCB REQUIRED COMPONENTS XCB)
- + find_package(X11 REQUIRED)
- +
- + add_library(X11Import UNKNOWN IMPORTED)
- + set_target_properties(X11Import PROPERTIES
- + IMPORTED_LOCATION "${X11_X11_LIB}"
- + INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_INCLUDE_PATH}")
- endif()
- -find_package(X11 REQUIRED)
- -
- -add_library(X11Import UNKNOWN IMPORTED)
- -set_target_properties(X11Import PROPERTIES
- - IMPORTED_LOCATION "${X11_X11_LIB}"
- - INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_INCLUDE_PATH}")
- if (BUILD_ONLY_PLUGIN)
- -# Dup a little bit option here.
- -include(CompilerSettings)
- + # Dup a little bit option here.
- + include(CompilerSettings)
- else()
- -include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
- -find_package(Gettext REQUIRED)
- + include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
- + find_package(Gettext REQUIRED)
- endif()
- set(Fcitx5Qt6_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/Fcitx5Qt6)
- --
- 2.41.0