I'm struggling with a large C++ project that uses CMake. Now I'm trying to add a dependency (a pre-compiled and installed library), but I'm not sure where to add is, what to include, and where to link it.
Particularly, I'd like to know the difference between the following commands:
include_directoriestarget_include_directorieslink_librariestarget_link_libraries
Also, when I need to use the following commands:
find_packageandadd_library
I know it has something to do with header-only libraries and so on, but I couldn't find a comprehensible and condensed explanation.
Also, how should I handle the following case:
The included library requires for example Boost, but the core project not. How can I avoid bloating up the entire CMakeLists.txt file and the binaries, and still use the precompiled library? (I think this is also part of this question)