emscripten
emscripten copied to clipboard
cmake: Add IMPORTED targets for OpenGL, GLU
These targets are similar to upstream CMake's generated targets for OpenGL.
See https://cmake.org/cmake/help/latest/module/FindOpenGL.html for details.
I would like also to contribute the test, but don't know how to organize it; I tested it locally in my own Emscripten instance with my old pet project (in-house rendering engine) which uses the OpenGL imported targets. I lazily port it into the Emscripten/WASM to make sure it would work in browser :)
Perhaps @juj or @sbc100 can take a look at this? (I don't know enough cmake myself.)
Regarding a test, in test/test_other.py there are several tests with names beginning with test_cmake_ that could be helpful (e.g. test_cmake_compile_features).
I'm not a cmake expert either I'm afraid but it looks like this should be tested as part of test_cmake_find_modules.
Knowing a little bit about CMake, I can see that it matches upstream. Specifically those lines: https://gitlab.kitware.com/cmake/cmake/-/blob/d166e7d740bfb53c18221f1126e984b668923208/Modules/FindOpenGL.cmake#L693
It would make the module in line with CMake 3.29, which is a very good thing, and expected from CMake users.
I'm in favor of this change too.. just waiting on a test.