This came up in the C++ Slack earlier and reminded me that this library could cause the same issue as well.
Consider that include/fplus gets installed as the <prefix>/include/fplus directory and adds <prefix>/include to the include paths of the installed target. If you link against the installed FunctionalPlus::fplus target, then you get the whole of <prefix>/include added to your include paths. I'm sure you can guess what kind of trouble that could cause.
My preferred install path where I have control is <prefix>/include/<project-name>-<project-version>, so when linking against the CMake package target, you don't get the whole world in your include paths implicitly, just the library you linked against and possibly dependencies.
I propose that this be changed and instead of <prefix>/include FunctionalPlus be installed to <prefix>/include/FunctionalPlus. Anyone not using CMake (why would anyone want to do that???) can still reach the library with #include <FunctionalPlus/fplus/fplus.hpp> via the implicit system include paths, but anyone using the CMake package will get the correct include path that makes only FunctionalPlus available, so #include <fplus/fplus.hpp> can be used like usual.
This came up in the C++ Slack earlier and reminded me that this library could cause the same issue as well.
Consider that
include/fplusgets installed as the<prefix>/include/fplusdirectory and adds<prefix>/includeto the include paths of the installed target. If you link against the installedFunctionalPlus::fplustarget, then you get the whole of<prefix>/includeadded to your include paths. I'm sure you can guess what kind of trouble that could cause.My preferred install path where I have control is
<prefix>/include/<project-name>-<project-version>, so when linking against the CMake package target, you don't get the whole world in your include paths implicitly, just the library you linked against and possibly dependencies.I propose that this be changed and instead of
<prefix>/includeFunctionalPlus be installed to<prefix>/include/FunctionalPlus. Anyone not using CMake (why would anyone want to do that???) can still reach the library with#include <FunctionalPlus/fplus/fplus.hpp>via the implicit system include paths, but anyone using the CMake package will get the correct include path that makes only FunctionalPlus available, so#include <fplus/fplus.hpp>can be used like usual.