mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-03 20:29:56 -06:00
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.
18 lines
527 B
CMake
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>
|
|
)
|