logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

0001-CMake-Add-option-to-disable-X11-support.patch (2214B)


  1. From cc3bdb96d4fb991b373068114143515ead5bc7d6 Mon Sep 17 00:00:00 2001
  2. From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
  3. Date: Wed, 21 Sep 2022 08:59:16 +0200
  4. Subject: [PATCH 1/2] CMake: Add option to disable X11 support
  5. ---
  6. CMakeLists.txt | 27 +++++++++++++++------------
  7. 1 file changed, 15 insertions(+), 12 deletions(-)
  8. diff --git a/CMakeLists.txt b/CMakeLists.txt
  9. index e526b58..144884d 100644
  10. --- a/CMakeLists.txt
  11. +++ b/CMakeLists.txt
  12. @@ -13,6 +13,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  13. option(ENABLE_QT4 "Enable Qt 4" On)
  14. option(ENABLE_QT5 "Enable Qt 5" On)
  15. option(ENABLE_QT6 "Enable Qt 6" Off)
  16. +option(ENABLE_X11 "Enable X11" On)
  17. option(BUILD_ONLY_PLUGIN "Build only plugin" Off)
  18. option(BUILD_STATIC_PLUGIN "Build plugin as static" Off)
  19. option(WITH_FCITX_PLUGIN_NAME "Enable plugin name with fcitx" On)
  20. @@ -42,24 +43,26 @@ include(ECMSetupVersion)
  21. include(ECMGenerateHeaders)
  22. include(ECMUninstallTarget)
  23. -find_package(XCB REQUIRED COMPONENTS XCB)
  24. find_package(XKBCommon 0.5.0 REQUIRED COMPONENTS XKBCommon)
  25. if (NOT BUILD_ONLY_PLUGIN)
  26. -find_package(Fcitx5Utils 5.0.16 REQUIRED)
  27. + find_package(Fcitx5Utils 5.0.16 REQUIRED)
  28. +endif()
  29. +if (ENABLE_X11)
  30. + find_package(XCB REQUIRED COMPONENTS XCB)
  31. + find_package(X11 REQUIRED)
  32. +
  33. + add_library(X11Import UNKNOWN IMPORTED)
  34. + set_target_properties(X11Import PROPERTIES
  35. + IMPORTED_LOCATION "${X11_X11_LIB}"
  36. + INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_INCLUDE_PATH}")
  37. endif()
  38. -find_package(X11 REQUIRED)
  39. -
  40. -add_library(X11Import UNKNOWN IMPORTED)
  41. -set_target_properties(X11Import PROPERTIES
  42. - IMPORTED_LOCATION "${X11_X11_LIB}"
  43. - INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_INCLUDE_PATH}")
  44. if (BUILD_ONLY_PLUGIN)
  45. -# Dup a little bit option here.
  46. -include(CompilerSettings)
  47. + # Dup a little bit option here.
  48. + include(CompilerSettings)
  49. else()
  50. -include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
  51. -find_package(Gettext REQUIRED)
  52. + include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
  53. + find_package(Gettext REQUIRED)
  54. endif()
  55. set(Fcitx5Qt6_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/Fcitx5Qt6)
  56. --
  57. 2.41.0