Files
CMake/Tests/FindOpenGL/CMakeLists.txt
Tom Fogal e2e8a690cd FindOpenGL: Add support for GLVND on Linux
Find GLVND components if available.  Add `GLX` and `EGL` options for
COMPONENTS that allow requesting these libraries explicitly.  Introduce
new import targets for these windowing-system-specific libraries.

On a GLVND system, populate the legacy `OPENGL_LIBRARIES` variable and
the `OpenGL::GL` target using the `OpenGL` and `GLX` components.  On
non-GLVND systems, continue to use the legacy `GL` library and simply do
not provide the GLVND components.  Application code can choose to adapt
based on the availability of GLVND components as imported targets.
2017-09-25 09:22:29 -04:00

18 lines
527 B
CMake

if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMake_TEST_FindOpenGL_VND)
set(_vnd_testing TRUE)
else()
set(_vnd_testing FALSE)
endif()
add_test(NAME FindOpenGL.Test COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
"${CMake_SOURCE_DIR}/Tests/FindOpenGL/Test"
"${CMake_BINARY_DIR}/Tests/FindOpenGL/Test"
${build_generator_args}
--build-project TestFindOpenGL
--build-options ${build_options}
-DOpenGL_TEST_VND=${_vnd_testing}
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)