miniwin: Use the GLEW::GLEW target to find glew.

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 21:42:48 +08:00
parent 06fb577d7f
commit abcbdea108
No known key found for this signature in database
GPG Key ID: C622A73A190CDB42

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