emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

cmake: Add IMPORTED targets for OpenGL, GLU

Open leha-bot opened this issue 1 year ago • 5 comments

These targets are similar to upstream CMake's generated targets for OpenGL.

See https://cmake.org/cmake/help/latest/module/FindOpenGL.html for details.

leha-bot avatar Feb 23 '24 09:02 leha-bot

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 :)

leha-bot avatar Feb 23 '24 09:02 leha-bot

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).

kripken avatar Mar 05 '24 23:03 kripken

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.

sbc100 avatar Mar 06 '24 00:03 sbc100

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.

gracicot avatar Apr 01 '24 21:04 gracicot

I'm in favor of this change too.. just waiting on a test.

sbc100 avatar Apr 01 '24 21:04 sbc100