libblepp icon indicating copy to clipboard operation
libblepp copied to clipboard

Fix CMakeLists for usage as subdirectory in larger projects

Open collinmay opened this issue 5 years ago • 1 comments

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.

collinmay avatar Jul 26 '19 21:07 collinmay

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.

13steinj avatar Dec 26 '21 06:12 13steinj