[cmake-developers] [PATCH] FindBoost does not detect absence of header file

Brad King brad.king at kitware.com
Fri May 13 09:36:26 EDT 2016


On 05/12/2016 03:49 PM, Roger Leigh wrote:
> I have made the suggested changes above where this was possible, and 
> merged the boost-component-headers branch into next for testing.

Thanks.  It looks pretty good, but there is one problem:

> +    find_path(Boost_${UPPERCOMPONENT}_HEADER
> +      NAMES         ${Boost_${UPPERCOMPONENT}_HEADER_NAME}
> +      HINTS         ${Boost_INCLUDE_DIR}

This leaves a bunch of Boost_${UPPERCOMPONENT}_HEADER values in
the cache.  The names look public, and they are publicly visible.
We should not expose this implementation detail.

Also, the find_path() approach means it might find the header somewhere
other than Boost_INCLUDE_DIR.  If it is not there, we cannot be confident
that it will match the library found.

Can the check use just if(EXISTS) instead?

Thanks,
-Brad



More information about the cmake-developers mailing list