Dav1dde / glad

Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.
https://glad.dav1d.de/
Other
3.73k stars 440 forks source link

WORKING_DIRECTORY does not contain Python module glad #393

Closed Destranix closed 8 months ago

Destranix commented 1 year ago

https://github.com/Dav1dde/glad/blob/f237a2bfcec0d9b82b90ec9af4af265c40de7183/cmake/CMakeLists.txt#L235-L247

How is this supposed to work? By using "WORKING_DIRECTORY" we are moving to the build directory as the manual says:

Execute the command with the given current working directory. If it is a relative path it will be interpreted relative to the build tree directory corresponding to the current source directory.

https://cmake.org/cmake/help/latest/command/add_custom_command.html

But then we try to execute the glad python module, that though is located in the source directory.

Dav1dde commented 1 year ago

It's not relative, it's absolute. Please include an actual broken reproducable setup if you think this is a bug.

Destranix commented 1 year ago

It causes problems if GLAD_SOURCES_DIR is set manually and not to an absolute path. Solution seems to be either to tell users not to do that or converting the path to an absolute path in the CMakeList.txt.

Dav1dde commented 8 months ago

I decided to document to use an absolute path, making it relative using cmake_path just has the same issue of potentially doing the wrong thing.