fix(cmake): Require XRandR 1.5+ for monitor support

Refs #280
This commit is contained in:
Michael Carlberg 2017-01-13 04:13:44 +01:00
parent 506ac3e4ac
commit 081578b168
2 changed files with 8 additions and 1 deletions

View File

@ -69,7 +69,11 @@ option(WITH_XCOMPOSITE "XCOMPOSITE support" OFF)
option(WITH_XKB "XKB support" ON)
if(NOT DEFINED ENABLE_XRANDR_MONITORS)
set(ENABLE_XRANDR_MONITORS ON CACHE STRING "Enable XRandR monitor feature (requires version 1.5+)")
pkg_check_modules(XRANDR QUIET xrandr>=1.5.0)
if(NOT XRANDR_FOUND)
set(XRANDR_FOUND OFF)
endif()
set(ENABLE_XRANDR_MONITORS ${XRANDR_FOUND} CACHE BOOL "Enable XRandR monitor feature (requires version 1.5+)")
endif()
# }}}

View File

@ -26,6 +26,9 @@ set(APP_INCLUDE_DIRS ${APP_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
# xpp library
set(XCB_PROTOS xproto)
if(WITH_XRANDR)
if(ENABLE_XRANDR_MONITORS)
pkg_check_modules(XRANDR REQUIRED xrandr>=1.5.0)
endif()
set(XCB_PROTOS "${XCB_PROTOS}" randr)
set(XPP_EXTENSION_LIST ${XPP_EXTENSION_LIST} xpp::randr::extension)
else()