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.
The current cmake code does not export its targets (modern cmake).
If you make a project that uses GLFW with the following CMakeListst.txt I would've expected it to work.
With the small change in this PR, the above is possible (without a Findglfw3.cmake file), only specify glfw3_DIR=/src.
Details:
The old cmake solution would've been to write a find file for GLFW. Findglfw3.cmake. But modern cmake makes life easier. GLFW should instead produce glfw3Config.cmake file (already done in GLFW) that imports its own targets. No need to write a find. But this shouldn't effect finds in any way.
When find_package is run it will search glfw3_DIR, cmake path, & system path for a find (old cmake, or non-cmake libs) OR config file (modern).
GLFW config file is produced in /src. When glfw3_DIR=/src is given in a project. It fails to find any targets in the config. Looking at GLFW cmake code, no targets are exported. This PR is a fix for that. It now exports targets and the above cmake should work simply by providing glfw3_DIR=/src. No need for a find.