diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindGLX.cmake | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindGLX.cmake')
-rw-r--r-- | cmake/modules/FindGLX.cmake | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/cmake/modules/FindGLX.cmake b/cmake/modules/FindGLX.cmake new file mode 100644 index 0000000..066cbb8 --- /dev/null +++ b/cmake/modules/FindGLX.cmake @@ -0,0 +1,36 @@ +#.rst: +# FindGLX +# ----- +# Finds the GLX library +# +# This will define the following variables:: +# +# GLX_FOUND - system has GLX +# GLX_INCLUDE_DIRS - the GLX include directory +# GLX_LIBRARIES - the GLX libraries +# GLX_DEFINITIONS - the GLX definitions +# +# and the following imported targets:: +# +# GLX::GLX - The GLX library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_GLX glx QUIET) +endif() + +find_path(GLX_INCLUDE_DIR NAMES GL/glx.h + PATHS ${PC_GLX_INCLUDEDIR}) +find_library(GLX_LIBRARY NAMES GL + PATHS ${PC_GLX_LIBDIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLX + REQUIRED_VARS GLX_LIBRARY GLX_INCLUDE_DIR) + +if(GLX_FOUND) + set(GLX_LIBRARIES ${GLX_LIBRARY}) + set(GLX_INCLUDE_DIRS ${GLX_INCLUDE_DIR}) + set(GLX_DEFINITIONS -DHAS_GLX=1) +endif() + +mark_as_advanced(GLX_INCLUDE_DIR GLX_LIBRARY) |