edrosten / libblepp

Modern clean C++ Bluetooth Low Energy on Linux without the Bluez DBUS API
Other
241 stars 63 forks source link

Fix CMakeLists for usage as subdirectory in larger projects #46

Closed collinmay closed 2 years ago

collinmay commented 5 years ago

When included via add_subdirectory(libblepp), the ${CMAKE_SOURCE_DIR} variable refers to the root project, not libblepp. Also fixes clobbering anything else that was previously in the path.

13steinj commented 2 years ago

Uh, quick note (I was randomly linked this for some thoughts) traditionally you aren't meant to take another project and add it as a subdirectory of your own (the only use would be to vendor the lib, and there's better, more standardized ways of doing that).

Usually it's compiled separately, then linked dynamically/statically, possibly needing a find_package() call in your own cmakefile. If this project is on conan, the process can be automated to an extent with cmake-conan.