-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add support to use cmake package configuration file from boost #154
Conversation
It is needed, even when you set CONFIG in find_package! See BoostConfig line 51 in hunter. The original FindBoost from cmake add for example in iostream regex as required dependency but this is an optional dependency ....
This PR introduced the possibility to use the cmake config module provided from the boost project. That has the advantage that the "user" does not need to know which dependency for example boost::log needs. See the difference in the diff https://github.com/cpp-pm/hunter/pull/154/files#diff-20118a896da0e1fbefa637e8075cb6fa It will also solve a potential problem that the BoostConfig from hunter is using FindBoost see #139 |
Btw. this PR needs the PR from #140 |
Note that this isn't fully true, you just need a cmake version that knows about the Boost version and then it automatically adds the knowledge of what you need to link transitively. It doesn't know when cmake is older than boost. But clearly it's better to trust boost whenever everything works fine. The problem is mostly for me the static vs shared strategy that we should get changed. |
@daminetreg Yep I know, but hunter introduced its own FindBoost.cmake and it is not well maintained ... @daminetreg Did you know why in hunter is a FindBoost.cmake? |
@daminetreg Maybe you can update this FindBoost.cmake in hunter in your PR #140 ? |
Oh 😨 Thanks for noticing, I didn't remember that.
I think he might have updated based on the version of Boost @ruslo integrated but I'm unsure. I'll try to find the common ancestor in cmake repository in the times he added the "fixed" FindBoost to see what changes he operated.
If I can I'll make a separate PR for this, because it's better to have what we have now, than to extend the scope infinitely of this PR. |
Does anybody know hunter maintains a fork of FindBoost.cmake? It seems like something that should be understood before bolting on more complexity to work around it? |
@BenWhetton Again my idea is to use the BoostConfig from boost so that BoostConfig and FindBoost from hunter is not any more used (maybe remove it) ... in my opinion it is lesser complexity and lesser maintained stuff in hunter ... |
Sorry, this problem that I mentioned above was only a local issue. 1f1e729 is absolutely working correctly. See also Travis/AppVeyor test builds:
Please test/give it a try and give your opinion This is the hunter "version config" to test:
Add in the
As additional information: |
What do you mean by this? If you want to test both the old and new behavior, you can add some new tests for this flag. |
I believe this solution will not work for previous versions of Boost where there is no CMake support so it is not a full solution to #141. |
@BenWhetton Yep absolutely right, that's why I added a Boost version check ... for example
hunter/cmake/projects/Boost/hunter.cmake Line 428 in b2bd8ae
As I said ... maybe we can remove it .... but I think it is not yet possible to remove it because it has to be backward compatible .... Sometimes I think, maybe it is better to create a new "Boost" package with boost config support? It is maybe lesser to "maintain"/ better to understand? But I don't know if the "community"/user will understands this? |
@rbsheth Ok, I added some new tests: Boost-useBoostConfig, Boost-filesystem-useBoostConfig, Boost-iostream-useBoostConfig, Boost-chrono-useBoostConfig and Boost-log-useBoostConfig Here is the links to the Travis/AppVeyor with status "All passed":
I think I should add a comment in the Boost.rst .... I will do this next days... |
Ok, I added a hint about So I'm done ... Discussable is maybe that approach in hunter.cmake line 428 - 448 to set the package configuration options for the boost package configuration file. |
@Bjoe Do you think this is ready for merge? |
All test`s are green: With enabled
Without enabled
So from my side it looks fine. It would be great if someone else can test this also ... or you wait until I test that in my company where we build a project for iOS, Android, linux, Windows and macOS..... |
I've followed this guide
step by step carefully. Yes
I've tested this package remotely and have excluded all broken builds.
Here is the links to the Travis/AppVeyor with status "All passed":