Replace git submodules with native cmake features #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withpkg-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
andimgui
, 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
andFetchContent_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! ❤️