Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenGL::GL cmake imported targets #23705

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cajomar
Copy link

@cajomar cajomar commented Feb 19, 2025

This allows projects to include OpenGL like so

find_package(OpenGL REQUIRED)
target_link_libraries(myproject OpenGL::GL)

Link to CMake's documentation: https://cmake.org/cmake/help/latest/module/FindOpenGL.html#imported-targets

CMake's FindOpenGL.cmake also produces GLES-related imported targets. While I think they would be nice to add, I've omitted them as I don't know if it would be as simple as duplicating the OpenGL::GL target or more needs to be to communicate that choice of flavor to emscripten.

Added OpenGL::GL and OpenGL::GLU to FindOpenGL.cmake following CMake's
own FindOpenGL.cmake
@sbc100
Copy link
Collaborator

sbc100 commented Feb 19, 2025

Can we test this? Perhaps by adding to the existing test/cmake/find_modules/ test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants