Skip to content
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

Replace git submodules with native cmake features #254

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

BenjaminHinchliff
Copy link

This pull request modifies the cmake files to try to use installed libraries for glfw.

This is done by searching with cmake's native find_package and also with pkg-config (via cmake) for the rare cases where the cmake files aren't properly installed. If it cannot locate an already installed copy, it will fetch and build the latest release using cmake's FetchContent api (similar to existing behavior).

FetchContent declarations were also added for the example's dependency on glew and imgui, allowing git submodules to be removed entirely, and any dependencies will only be fetched when necessary during the configure step of cmake. Any dependencies not used will not be fetched.

Due to the usage of FetchContent and FetchContent_MakeAvailable the minimum required cmake version has been updated to 3.14, this being the main downside of the approach. However, since Debian stable is already using a 3.18 (at time of writing), I believe that it's an acceptable change.

Though by no means essential, this would streamline getting started with the library, and save on build times and duplication. As such, I believe it would be a valuable addition to the main project.

P.S. Really glad to have a wrapper like this - great work! ❤️

@janekb04
Copy link
Owner

Hi. Thanks for the PR, I really appreciate it! I am glad that the library is useful for you and that you are contributing to its development. The PR looks promising and I will see how it works, when I’ll have access to my dev machine. I agree that simplifying the build process GLFWPP would be really useful. I’ll try to review the changes and reach out in a few hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants