From c04dcc2e7d834218ef2d4194331e383402495ae1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 10 Apr 2024 20:07:22 +0200 Subject: Adding upstream version 2:20.4+dfsg. Signed-off-by: Daniel Baumann --- cmake/modules/FindXRandR.cmake | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 cmake/modules/FindXRandR.cmake (limited to 'cmake/modules/FindXRandR.cmake') diff --git a/cmake/modules/FindXRandR.cmake b/cmake/modules/FindXRandR.cmake new file mode 100644 index 0000000..12f3478 --- /dev/null +++ b/cmake/modules/FindXRandR.cmake @@ -0,0 +1,47 @@ +#.rst: +# FindXRandR +# ---------- +# Finds the XRandR library +# +# This will define the following variables:: +# +# XRANDR_FOUND - system has XRANDR +# XRANDR_INCLUDE_DIRS - the XRANDR include directory +# XRANDR_LIBRARIES - the XRANDR libraries +# XRANDR_DEFINITIONS - the XRANDR definitions +# +# and the following imported targets:: +# +# XRandR::XRandR - The XRANDR library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_XRANDR xrandr QUIET) +endif() + +find_path(XRANDR_INCLUDE_DIR NAMES X11/extensions/Xrandr.h + PATHS ${PC_XRANDR_INCLUDEDIR}) +find_library(XRANDR_LIBRARY NAMES Xrandr + PATHS ${PC_XRANDR_LIBDIR}) + +set(XRANDR_VERSION ${PC_XRANDR_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(XRandR + REQUIRED_VARS XRANDR_LIBRARY XRANDR_INCLUDE_DIR + VERSION_VAR XRANDR_VERSION) + +if(XRANDR_FOUND) + set(XRANDR_LIBRARIES ${XRANDR_LIBRARY}) + set(XRANDR_INCLUDE_DIRS ${XRANDR_INCLUDE_DIR}) + set(XRANDR_DEFINITIONS -DHAVE_LIBXRANDR=1) + + if(NOT TARGET XRandR::XRandR) + add_library(XRandR::XRandR UNKNOWN IMPORTED) + set_target_properties(XRandR::XRandR PROPERTIES + IMPORTED_LOCATION "${XRANDR_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${XRANDR_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBXRANDR=1) + endif() +endif() + +mark_as_advanced(XRANDR_INCLUDE_DIR XRANDR_LIBRARY) -- cgit v1.2.3