-
How should we use I've tried the following but it doesn't build:
Which results in the following output:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Not sure, I am not familiar with cmake enough, maybe someone else can help. In hindsight I shouldn't have added it to glad2 at all. I recommend you to manually generate and just check in the generated code, there is no gain to include glad into the build process, it just means your build process now also depends on python and jinja2. |
Beta Was this translation helpful? Give feedback.
-
As the original poster alludes to, the GLAD FetchContent_Declare(
glad
GIT_REPOSITORY https://github.com/Dav1dde/glad.git
GIT_TAG 658f48e72aee3c6582e80b05ac0f8787a64fe6bb #v2.0.6
GIT_PROGRESS TRUE
SOURCE_SUBDIR cmake
)
FetchContent_MakeAvailable(glad)
glad_add_library(glad_gl_core_43 STATIC REPRODUCIBLE LOADER API gl:core=4.3)
target_link_libraries(my_target PRIVATE glad_gl_core_43) |
Beta Was this translation helpful? Give feedback.
As the original poster alludes to, the GLAD
CMakeLists.txt
is not in the project root, so a workaround is needed. With theSOURCE_SUBDIR
option ofFetchContent_Declare
you can specify an alternative directory to use as the top of the CMake source tree, which is relative to the top directory of the populated content. So a full example would be: