Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with find_package REQUIRED etc. #87

Open
andrewkcorcoran opened this issue Jan 30, 2020 · 1 comment
Open

Usage with find_package REQUIRED etc. #87

andrewkcorcoran opened this issue Jan 30, 2020 · 1 comment

Comments

@andrewkcorcoran
Copy link

andrewkcorcoran commented Jan 30, 2020

Some of our existing dependencies use find_package(Boost REQUIRED) or check for the cache variables set by find_package/FindBoost (Boost_INCLUDE_DIR etc.). This seems like it would be quite a common usage. Is there any way to support this usage with boost-cmake?

Note: Even submitting a PR to the dependencies to use modern CMake (target_link_libraries TARGET Boost::thread) won't work as the find_package(Boost COMPONENTS thread REQUIRED) call with cause the configure step to fail unless we manually build the boost components required by the dependency. If we were to do that then we could end up in a weird situation where the dependency is linking to the prebuilt boost library and our library is linking to the boost-cmake boost library. No idea what cmake would do in that situation but it doesn't sound good.

@erutovic
Copy link

Hi,

Same issue here. I was able to make it work with the following code :

add_subdirectory(boost-cmake)
SET (BOOST_ROOT ${CMAKE_CACHEFILE_DIR}/_deps/boost-src)
find_package(Boost 1.71 REQUIRED)
include_directories(${Boost_INCLUDE_DIRS}) 

I hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants