miniwin: Use the GLEW::GLEW target to find glew. (#246)

On some systems, the old-style GLEW_TARGET_LIBRARIES variable is not set by
find_package(GLEW), and instead we must use the newer GLEW::GLEW target, as
we do for OpenGL.

This fixes a build error on openSUSE Tumbleweed, which has a glew CMake config
in /usr/lib64/cmake/glew/glew-config.cmake.
This commit is contained in:
David Gow 2025-06-06 23:42:50 +08:00 committed by GitHub
parent 4c44f8f081
commit 43191c7530
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,8 +30,7 @@ if(OpenGL_FOUND AND GLEW_FOUND)
# Find and link OpenGL (1.5) # Find and link OpenGL (1.5)
target_link_libraries(miniwin PRIVATE OpenGL::GL) target_link_libraries(miniwin PRIVATE OpenGL::GL)
# Glew is used for getting a FBO for off screen rendering # Glew is used for getting a FBO for off screen rendering
target_include_directories(miniwin PRIVATE ${GLEW_INCLUDE_DIRS}) target_link_libraries(miniwin PRIVATE GLEW::GLEW)
target_link_libraries(miniwin PRIVATE ${GLEW_LIBRARIES})
endif() endif()
# Force reported render mods from MiniWin # Force reported render mods from MiniWin