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

Fix CMake install search location for libws2811.pc #449

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

arcturis
Copy link
Contributor

This should fix the issue #448 that I was having.

Tells CMake to look for libws2811.pc in the current binary dir rather than the top level binary dir. This allows make install to find libws2811.pc even when the rpi_ws281x repo has been included as a FetchContent subdirectory in a parent project (see issue #448 ).

I am by no means a CMake expert but this change seemed to make sense according to the documentation, fixes the FetchContent issue and I found no regression in the regular build process.

@flokli I think you wrote the original CMake code for libws2811.pc so including you here, hopefully the fix makes sense!

Tells CMake to look for libws2811.pc in the correct location when this
repo is a FetchContent subdirectory in a parent project.
@flokli
Copy link
Contributor

flokli commented Mar 10, 2021

Do CMAKE_CURRENT_BINARY_DIR and CMAKE_BINARY_DIR differ when building rpi_ws281x independently?

@arcturis
Copy link
Contributor Author

No, I believe they have the same value when building an independent project, as the top level is the same as the current project in that case. However in the case of using FetchContent, it seems to create sub-directories in the build directory, and that causes the install step to fail as it's expecting libws2811.pc to be in the top level.

@Gadgetoid Gadgetoid merged commit 9432ba8 into jgarff:master Mar 22, 2021
@Gadgetoid
Copy link
Collaborator

Sounds rational. Thank you!

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.

3 participants