On 8/05/2019 07:31, Robert Ramey wrote:
git clone --depth 1 https://github.com/boostorg/boost.git cd boost git submodule update --init tools/boostdep libs/$X python tools/boostdep/depinst/depinst.py -X test $X ./bootstrap.sh ./b2 --prefix=$Y --with-$X install
a) I have to clone the whole of boost including the superproject. That's exactly what I'm trying to avoid.
Actually no, that's not what the above does. You are cloning the superproject with --depth 1 (which means no history, just the current tree). So it's basically no different from downloading a snapshot archive with a bit of extra .git metadata. The rest are just empty subdirectories until you run the submodule update. And the submodule update is fetching only those named submodules, not all of Boost. By default the above grabs current master, but you can also add -b to request a specific branch (or release tag). So for example, if you just want Boost 1.70, you can: git clone --depth 1 -b boost-1.70.0 --no-tags https://github.com/boostorg/boost.git You can also pass --depth 1 to the submodule update when fetching specific libraries. And add -g '--depth 1' to the depinst command as well. Or fetch the dependencies manually with more submodule updates rather than using depinst; it might still be a bit too eager at fetching dependencies as-is since it's looking at all the library files. Or if you don't use --depth 1, then you get a larger download but you can easily move between different versions and update to new versions in the future.
b) i have to build and invoke b2. Another thing i want to avoid.
If you're using any non-header-only library (and large chunks of Boost fall into that category, such as Boost.Thread), then you can't avoid that.
b) clone the library(s) into this local boost directory manually move the libraries include/boost/.. subdirectory into my newly created boost directory. Optionally I can create links to do the same thing.
Or you could run b2 headers, rather than making life complicated for yourself.
No tools, no hassle. It's a pain, but its a one time thing. I only need to do it when I add a new boost library to my app.
Or when you update any of them, or switch versions. It's hardly a one time thing.