FindBoost can't be run with find_dependency
FindBoost partially fills in targets that were not requested, such as Boost::Filesystem
, but doesn't do it all the way. Then, on rerun, it will not touch the existing target.
Correction: when using find_dependency
, FindBoost does not seem to rerun and pick up new components.
For example, let's say a user runs FindBoost:
find_package(Boost COMPONENTS system)
If you have a *Config.cmake.in
file that does this:
include(CMakeFindDependencyMacro)
find_dependency(Boost REQUIRED COMPONENTS system filesystem)
You now end up with a broken target that looks like this (after the first run and after the second run)!
Properties for TARGET Boost::filesystem:
Boost::filesystem.LOCATION = <NOTFOUND>
Boost::filesystem.INTERFACE_LINK_LIBRARIES = ";Boost::system"
A possible solution would be to only fill targets that can be completely filled, and then on rerun to fill out targets that do not exist. (This is how it currently works, except when using find_dependency
)
Edited by Henry Schreiner