[build][cmake] export automatically raylib definitions and compile/link options#5179
Merged
raysan5 merged 1 commit intoraysan5:masterfrom Sep 12, 2025
Merged
[build][cmake] export automatically raylib definitions and compile/link options#5179raysan5 merged 1 commit intoraysan5:masterfrom
raysan5 merged 1 commit intoraysan5:masterfrom
Conversation
Owner
|
@brccabral Merging but I do not maintain the CMake build system, so user with more experience should take a look. @Not-Nik please, could you take a look? |
Contributor
|
I don't really use CMake's install functionality, but I had a look anyways. FWICT this doesn't break anything (good) and it looks to be a bit more idiomatic (also good). That being said, I don't think it really changes anything for the end user, apart from maybe saving a few linking directives here and there. For example on macOS it includes information to link with OpenGL.framework. Overall a decent update. |
Owner
|
@Not-Nik Thank you very much for taking a look, I like PRs that simplify code/building! |
psxdev
pushed a commit
to raylib4Consoles/raylib
that referenced
this pull request
Sep 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Installing
raylib-targets.cmakefrom CMake sends all PUBLIC definitions and options added fromtarget_compile_definitions,target_compile_optionsto consumer.It is the raylib library telling consumer how to import itself. Consumer just has to
target_link_library(project PRIVATE raylib)and the project will be correctly configured.A user that selects Platform Desktop will get
if Web