-
Notifications
You must be signed in to change notification settings - Fork 440
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
How to use directly from CMAKE #186
Comments
Yes it's possible. Make a subdirectory in your project and add a cmake_minimum_required(VERSION 3.0)
project(Glad)
add_library(glad include/glad/glad.h src/glad.c)
target_include_directories(glad PUBLIC include/) Then in your main add_subdirectory(glad/)
target_link_libraries(<your target> PRIVATE glad) Or something like that. There are a bunch of ways of achieving this. |
@Shimmen thanks for the explanation! You can also look through the issue #174 where a few awesome people added more ways to do that. Personally I'd include the generated files though, the symbols should be sorted so if you upgrade the generated files at one point you'll get minimal diffs, also it means you don't have a dependency on external resources and Python. |
I just realized I didn't at all supply an answer to the original question! Personally I like to keep the glad stuff out of my source directory and out of the build step of my main executable, so that's what my example does. |
I'll assume this is answered, if not please feel free to re-open. |
I understand it's typical to put the generated files into your include directory, but IS there a way to have this generate when building CMake? I don't think requiring Python is that big of a deal, it's very common place. Having the option is at least nice. |
@DerekCresswell yes you can run the generator on a build, there is a I've also been working on glad2 which has a new |
Hi,
I want to use the
.h
and.c.
files created by the webservice in my project but I do not want to store each ~10k line file in my repo.Is there a way to include this and "build" it via CMAKE and have the needed files generated (similar to GLFW)?
Thanks for your project
The text was updated successfully, but these errors were encountered: