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

add: cmake config include guard #2592

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Conversation

Akashic-Theory
Copy link
Contributor

@Akashic-Theory Akashic-Theory commented Jul 25, 2022

raylib does not currently guard against multiple inclusion in cmake projects.

This causes issues when you want to first check for existence of a raylib install and actually add it later.

For example, in my case, I first check for a local install of all my dependencies using find_package('dependency here' QUIET). If not found, I then use FetchContent to automatically grab the missing dependency. Works fine when I DON'T have a local install of raylib. But this causes issues when a local install exists and I attempt the find_package(raylib REQUIRED) call because raylib's config will attempt to add an already existing library ("raylib") when calling find_package on it multiple times.

This change will only run the cmake configuration logic if the raylib target does not already exist.

@raysan5 raysan5 merged commit 6f3a633 into raysan5:master Jul 26, 2022
@raysan5
Copy link
Owner

raysan5 commented Jul 26, 2022

@myuncle Thanks for the improvement! Merged!

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.

None yet

2 participants