How to fetch boost libraries and their dependencies from github via CMake
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
On 29.05.2015 12:30, Gonzalo BG wrote:
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?
Have you looked into the ExternalProject module distributed with CMake? http://www.cmake.org/cmake/help/v3.0/module/ExternalProject.html
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.
On 5/29/15 9:33 AM, Gonzalo BG wrote:
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 Boost-users@lists.boost.org 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
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.
On May 30, 2015 5:24:49 AM EDT, Gonzalo BG
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).
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!
- 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 Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Sent from my Android device with K-9 Mail. Please excuse my brevity.
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
participants (5)
-
Gonzalo BG
-
Louis Dionne
-
Michael
-
Robert Ramey
-
Sergiu Dotenco