2
votes

I'm working on a script that clones Boost official repository and init only the modules I need.

I read git submodule man page, and found a way to update only some modules. I don't even need to compile because I'm only using multi_index.

git clone -b boost-1.60.0 https://github.com/boostorg/boost.git boost
cd boost
git submodule update --init libs/multi_index/ tools/build

But I would like to improve my git submodule update command by using module names (e.g. multi_index found in .gitsubmodules) instead of path (e.g. libs\multi_index)

How can I achieve that ?

Also, when I want to use that setup, boost/version.hpp is missing.
I executed boostrap.sh and ./b2 --with-multi_index but it replied with error: wrong library name 'multi_index' in the --with-<library> option.

How can I generate boost/version.hpp that CMake find_package(Boost REQUIRED) requires ?

CMake Error at /usr/share/cmake-3.0/Modules/FindBoost.cmake:699 (file): file STRINGS file "/home/leflou/PROJECTS/tradingsuite/FinancialMarket/Server/boost/libs/boost/version.hpp" cannot be read. Call Stack (most recent call first): FinancialMarket/Server/CMakeLists.txt:5 (find_package)

1

1 Answers

1
votes

Firstly, whenever a library is updated, you need to ./b2 headers in the main repo, so all the symlinks to the library headers get updated in the boost/ subdirectory.

You seem to be forgetting that Multi Index relies on a host of other boost libraries - which need to be synchronized in the updates.

E.g. BMI uses MPL, tuple, and many others:

 60 boost/mpl
 56 boost/config.hpp
 39 boost/type_traits
 32 boost/detail
 29 boost/preprocessor
 17 boost/serialization
 11 boost/noncopyable.hpp
 10 boost/move
  7 boost/utility
  7 boost/tuple
  6 boost/static_assert.hpp
  5 boost/throw_exception.hpp
  5 boost/call_traits.hpp
  4 boost/operators.hpp
  4 boost/foreach_fwd.hpp
  4 boost/bind.hpp
  4 boost/archive (optional)
  3 boost/iterator
  2 boost/ref.hpp
  2 boost/limits.hpp
  2 boost/functional (for `hash`)
  2 boost/assert.hpp
  1 boost/integer

You should be looking at BCP to do the right extraction