Closed arcturis closed 3 years ago
Do CMAKE_CURRENT_BINARY_DIR
and CMAKE_BINARY_DIR
differ when building rpi_ws281x
independently?
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.
Sounds rational. Thank you!
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 allowsmake install
to findlibws2811.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!