CMake: target_include_directories() prints an error when I try to add the source directory itself, or one of its subdirectories

The origin of the problem is not the target_include_directories command itself, but the attempt to install a target that has a public or interface include directory prefixed in the source path (i.e. the include directory is a subdirectory of your ${PROJECT_SOURCE_DIR}.) While it is perfectly fine and desirable to use absolute paths when building the … Read more

Benefits of header-only libraries

Benefits of header-only library: Simplifies the build process. You don’t need to build the library, and you don’t need to specify the compiled library during the link step of the build. If you do have a compiled library, you will probably want to build multiple versions of it: One compiled with debugging enabled, another with … Read more