Discussion:
[Boost-users] How to fetch boost libraries and their dependencies from github via CMake
Gonzalo BG
2015-05-29 10:30:55 UTC
Permalink
Dear all,

I have a CMake project that requires some header-only boost libraries:
- container, dynamic_bitset, math, units

I would like CMake to always fetch automatically the latest version of
these libraries and their dependencies from github as an external project.

AFAIK FindBoost doesn't do this, is there maybe a different cmake script
that does?

Best regards,
Gonzalo
Sergiu Dotenco
2015-05-29 13:29:46 UTC
Permalink
Post by Gonzalo BG
Dear all,
- container, dynamic_bitset, math, units
I would like CMake to always fetch automatically the latest version of
these libraries and their dependencies from github as an external project.
AFAIK FindBoost doesn't do this, is there maybe a different cmake script
that does?
Have you looked into the ExternalProject module distributed with CMake?
http://www.cmake.org/cmake/help/v3.0/module/ExternalProject.html
Gonzalo BG
2015-05-29 16:33:42 UTC
Permalink
Yes, and I think that is the correct way to go.

For that to work, each Boost library should have its own
Find/FetchBoostLibrary.cmake file that fetches its dependencies, as well as
the intended library. There are two issues with this: the dependencies need
to be manually resolved, and the file has to be updated every time its
dependencies change.
Robert Ramey
2015-05-29 18:06:43 UTC
Permalink
Post by Gonzalo BG
Yes, and I think that is the correct way to go.
For that to work, each Boost library should have its own
Find/FetchBoostLibrary.cmake file that fetches its dependencies, as well
as the intended library. There are two issues with this: the
dependencies need to be manually resolved, and the file has to be
updated every time its dependencies change.
_______________________________________________
Boost-users mailing list
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Note there is a initiative proposed on the steering committee mailing
list which addresses a similar subject. No takers yet though.

Robert Ramey
Gonzalo BG
2015-05-30 09:24:49 UTC
Permalink
I started giving it a try with Boost.DynamicBitset but I discovered another
two issues:

- the boost libraries do not use git tags for marking the version used in
the boost release

It would help if the release version of each boost library was tagged on
its master branch (e.g. tag: 1.58). This can be worked around by using
exact commit hashes as a reference. Finding these commits (e.g. through the
modular boost superproject is extra work).

- where do all these Find/FetchBoostLibrary.cmake files live?

Ideally each library should have only its own, so to install a library with
dependencies we need to get a specific version of the
Find/FetchBoostLibrary.cmake file of each dependency. This is doable, but
needs some cmake machinery.

I think I'll give it another try in the next couple of days. I'm going to
start with Boost.Config, Boost.Assert, and Boost.Core. And I'm going to
completely ignore non-header only libraries first.

If anyone is willing to help or give fast feedback please let me know.
Michael
2015-05-30 11:23:06 UTC
Permalink
Post by Gonzalo BG
I started giving it a try with Boost.DynamicBitset but I discovered another
- the boost libraries do not use git tags for marking the version used in
the boost release
It would help if the release version of each boost library was tagged on
its master branch (e.g. tag: 1.58). This can be worked around by using
exact commit hashes as a reference. Finding these commits (e.g. through the
modular boost superproject is extra work).
Totally agree re: tagging. Parent project should tag.

I suspect however that you may find tagging coverage for contributed projects, though helpful, will be spotty at best; i.e. Boost.Contributed tag '1.0.0' (by some tagging naming convention). I'd highly encourage its use though. Meanwhile though a little more effort hashes can be mined.

Especially when there are breaking changes that contributors aren't necessarily ready to roll with yet. Modules can reference specific versions I believe (could be wrong, I am a git novice myself).

Anyway that's my git style guide two cents. HTH and good luck!
Post by Gonzalo BG
- where do all these Find/FetchBoostLibrary.cmake files live?
Ideally each library should have only its own, so to install a library with
dependencies we need to get a specific version of the
Find/FetchBoostLibrary.cmake file of each dependency. This is doable, but
needs some cmake machinery.
I think I'll give it another try in the next couple of days. I'm going to
start with Boost.Config, Boost.Assert, and Boost.Core. And I'm going to
completely ignore non-header only libraries first.
If anyone is willing to help or give fast feedback please let me know.
------------------------------------------------------------------------
_______________________________________________
Boost-users mailing list
http://lists.boost.org/mailman/listinfo.cgi/boost-users
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Louis Dionne
2015-05-30 16:34:25 UTC
Permalink
Post by Gonzalo BG
[...]
I think I'll give it another try in the next couple of days. I'm going to
start with Boost.Config, Boost.Assert, and Boost.Core. And I'm going to
completely ignore non-header only libraries first. 
If anyone is willing to help or give fast feedback please let me know.
FYI, your message prompted me to provide a FindHana.cmake module [1].
Since Hana is not an official Boost library, it has not been released with
any major Boost release yet and the FindHana module does not have any notion
of versioning. For now, using FindHana will only fetch the master branch. It
should be trivial to fetch a specific tag instead, like "1.59.0", to refer to
the version of Hana that's included with Boost 1.59.0 (if that ever happens!).

Regards,
Louis

[1]: https://github.com/ldionne/hana/issues/78

Loading...