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

drop REQUIRED from all find_package #34

Open
marakew opened this issue Jan 8, 2023 · 8 comments
Open

drop REQUIRED from all find_package #34

marakew opened this issue Jan 8, 2023 · 8 comments

Comments

@marakew
Copy link

marakew commented Jan 8, 2023

can you please drop it
let rewrite it by CMAKE_DISABLE_FIND_PACKAGE_
thanks

@pdimov
Copy link
Member

pdimov commented Jan 8, 2023

What specific problem are you having?

@marakew
Copy link
Author

marakew commented Jan 8, 2023 via email

@pdimov
Copy link
Member

pdimov commented Jan 8, 2023

Does this refer to a Boost built with b2 or to one built with CMake?

@pdimov
Copy link
Member

pdimov commented Jan 8, 2023

If with CMake, the config files don't use find_package or REQUIRED; they use find_dependency (e.g. find_dependency(ZLIB). This macro automatically sets QUIET or REQUIRED to match the parent find_package call. So if you call find_package(boost_iostreams REQUIRED), it will invoke find_package(ZLIB REQUIRED), but if you call find_package(boost_iostreams), it will invoke find_package(ZLIB). This is standard CMake behavior.

@pdimov
Copy link
Member

pdimov commented Jan 8, 2023

Opened a CMake issue about this at https://gitlab.kitware.com/cmake/cmake/-/issues/24293.

@marakew
Copy link
Author

marakew commented Jan 8, 2023 via email

@pdimov
Copy link
Member

pdimov commented Jan 8, 2023

So, your complaint is not about find_dependency(ZLIB) in the installed CMake config files, but (for example) about this use of find_package:

https://github.com/boostorg/iostreams/blob/d1c1114a611afb090a007c9ff3e94efbcb914ef3/CMakeLists.txt#L30

@marakew
Copy link
Author

marakew commented Jan 9, 2023 via email

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