-
Notifications
You must be signed in to change notification settings - Fork 32
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
CMake package of libraries with dependencies to external libraries #18
Comments
The problem with Iostreams is that ZLIB is an optional dependency. |
Actually it's even worse than that, Iostreams may build its own zlib from source and install it. :-/ |
Well Iostreams was just an example, my real issue is with MPI :-) and that is most probably fixed with When the |
That's not easy at all. The architecture of It's probably possible to hack something that will mostly work, I suppose. There might be a way to do it properly, but my |
OK I understand better the complexity. I have only basic user knowledge about Boost.Build so won't be able to help you much. I guess the idea would be to generate the CMake config at build time (as opposed to config time). Maybe we could take some inspiration from the install rule that apparently knows about the dependencies since it has an option |
boostorg/uuid#68 might mean that even header-only bits need a target per library. |
Another solution might be to add |
There are more mundane cases where an external dependency is needed but not exposed in the config files. For example, in Boost.Filesystem (boostorg/filesystem#156), Boost.Log and Boost.Atomic we need to link the Boost libraries against some Windows SDK (synchronization, bcrypt, advapi32, etc.) or system (rt, socket, nsl, ipv6) libraries. It is important to expose those dependencies because when linking against static Boost libraries the user must still specify the private dependencies in the linker command line. |
I've added code to develop that translates linking to |
Some Boost libraries have dependencies to third party libraries: Boost.Iostreams (zlib, bzip2), Boost.Local (ICU), Boost.MPI (some MPI lib) come to mind.
In the current configuration package generated by the
boost-install
rule, the dependency to the third party library is not set explicitly. If we look at the Iostreams test:This introduce subtle issues with the linking order since the dependency graph is
instead of
A possible solution would be to add something like
find_dependency(ZLIB)
andtarget_link_libraries(Boost::iostreams ZLIB::ZLIB)
in the CMake config file.The text was updated successfully, but these errors were encountered: