Advertisement
KukuRuzo

No X11

Aug 4th, 2022
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.45 KB | None | 0 0
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index 6295de6f..9d941026 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -199,6 +199,8 @@ if(UNIX AND NOT (APPLE OR HAIKU))
  6.      if(USE_X11)
  7.          add_definitions( -DHAVE_X11 )
  8.          message(STATUS "X11 features support - ENABLED")
  9. +    elseif(NOT LIMIT_X11_USAGE)
  10. +        set(USE_XSS OFF)
  11.      endif()
  12.      if(LIMIT_X11_USAGE)
  13.          add_definitions( -DLIMIT_X11_USAGE )
  14. diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
  15. index 5f56f15b..d53f36e9 100644
  16. --- a/plugins/CMakeLists.txt
  17. +++ b/plugins/CMakeLists.txt
  18. @@ -56,6 +56,10 @@ endif()
  19.  
  20.  option( BUILD_DEV_PLUGINS "Build plugins from dev directory" OFF )
  21.  set(MAIN_PROGRAM_NAME "psi" CACHE STRING "Main program name: psi or psi-plus")
  22. +if(NOT (DEFINED USE_X11))
  23. +    option( USE_X11 "Enable X11 features support" ON )
  24. +endif()
  25. +
  26.  
  27.  if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/generic")
  28.      set(GENERIC_PLUGINS_FOUND ON)
  29. diff --git a/plugins/generic/CMakeLists.txt b/plugins/generic/CMakeLists.txt
  30. index cf07f9b3..ff9c8b59 100644
  31. --- a/plugins/generic/CMakeLists.txt
  32. +++ b/plugins/generic/CMakeLists.txt
  33. @@ -31,14 +31,14 @@ set( plugins_list
  34.      watcherplugin
  35.  )
  36.  
  37. -if(NOT HAIKU)
  38. +if((WIN32 OR APPLE) OR USE_X11 AND (NOT HAIKU))
  39.      # qxt library is buildable only in Linux, *BSD, Windows and macOS
  40.      list(APPEND plugins_list
  41.          screenshotplugin
  42.      )
  43.  endif()
  44.  
  45. -if(NOT APPLE AND (NOT HAIKU))
  46. +if(NOT APPLE AND (NOT HAIKU) AND (WIN32 OR USE_X11))
  47.      list(APPEND plugins_list
  48.          videostatusplugin
  49.      )
  50. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
  51. index 2cf168c7..493fcff2 100644
  52. --- a/src/CMakeLists.txt
  53. +++ b/src/CMakeLists.txt
  54. @@ -53,12 +53,14 @@ if(LINUX)
  55.      if(USE_DBUS)
  56.          find_package(Qt5 COMPONENTS DBus REQUIRED)
  57.      endif()
  58. -    find_package(XCB REQUIRED)
  59. -    set(EXTRA_LIBS
  60. -        ${XCB_LIBRARY}
  61. -    )
  62. -    include_directories(${LIBXCB_INCLUDE_DIR})
  63. -    add_definitions(${LIBXCB_DEFINITIONS})
  64. +    if(USE_X11 OR LIMIT_X11_USAGE)
  65. +        find_package(XCB REQUIRED)
  66. +        set(EXTRA_LIBS
  67. +            ${XCB_LIBRARY}
  68. +        )
  69. +        include_directories(${LIBXCB_INCLUDE_DIR})
  70. +        add_definitions(${LIBXCB_DEFINITIONS})
  71. +    endif()
  72.  endif()
  73.  
  74.  if(APPLE)
  75. @@ -109,7 +111,7 @@ else()
  76.      endif()
  77.  endif()
  78.  
  79. -if(LINUX)
  80. +if(LINUX AND (USE_X11 OR LIMIT_X11_USAGE))
  81.      find_package(X11 REQUIRED)
  82.      include_directories(${X11_INCLUDE_DIR})
  83.  endif()
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement