Closed soro closed 5 months ago
How does the "root" find_package(Boost)
find the appropriate lib/cmake
directory with Boost-1.85.0
in it, but the nested find_dependency
calls do not? Where is it issued?
I suppose we could change
if(NOT boost_assert_FOUND)
find_dependency(boost_assert 1.85.0 EXACT)
endif()
to
if(NOT boost_assert_FOUND)
find_dependency(boost_assert 1.85.0 EXACT HINTS "${CMAKE_CURRENT_LIST_DIR}/..")
endif()
(or should that be ../../..
?)
One potential problem with that is that find_dependency
only allows arguments different from version and EXACT
starting from CMake 3.9, although I'm not sure that anyone will object to that; a CMake-installed Boost is a relatively new phenomenon so its users will probably be on 3.9 or newer.
If you want to experiment with that locally, the line to change is
Will give that a try and report back when I get a chance, thanks
That change did indeed fix the build (adding HINTS "${CMAKE_CURRENT_LIST_DIR}/.."
). Would it be a problem to make this change?
Would you like to make a pull request?
Sure, I can do that later today
Hi, I have been trying to build folly with cmake via the bazel package
rules_foreign_cc
. Boost does build fine, and the files get copied and paths set up correctly, but the configure step fails to discoverboost_assert
while trying to configureboost_context
.Here are error and call stack:
Notably, it does look like the header cmake config is found correctly, and the path set. This is what is generated for
boost_context-config.cmake
:It seems that these
find_dependency
calls aren't passed the correct directory hints?I notice that in
boostcfg_find_component
, the hint is explicitly set asAny advice for further investigation? Superficially, everything looks like it is set up correctly. The files are all there, directory structure looks fine:
cmake dir:
boost_assert-1.85.0 dir:
I don't think this is due to incorrect copying of the cmake build output of boost? Can this be made more robust?