Building Boost - (example is for Boost version 1.63.0, with a root directory of /opt/projects/boost)
- Download and extract to /opt/projects/boost/src. /opt/projects/boost/src/boost_1_63_0/bootstrap.sh should now exist
- From /opt/projects/boost/src:
- ./bootstrap.sh --prefix=/opt/projects/boost/1_63_0
- mkdir build_1_63_0 && mkdir stage_1_63_0
- ./b2 --build-dir=build_1_63_0 stage --stage-dir=stage_1_63_0
- ./bjam install
There should now exist /opt/projects/boost/1_63_0 with sub-directories for include and lib.
Building FreeOrion - From freeorion source dir:
- mkdir build-x && cd build-x
- cmake -DBOOST_ROOT=/opt/projects/boost/1_63_0 ..
- make
I build from within KDevelop half the time: Project->Open Configuration->Configure build directory(+ sign)->
Alter build directory to something unique to version
Add Custom Argument: -DBOOST_ROOT=/opt/projects/boost/1_63_0
(remember to right click the new directory and "Exclude from project", else parser may choke during build)
For those on other IDEs, it may be useful to post how to adjust cmake flags.
Alternatively to downloading Boost, one could clone the super-project and checkout the desired version tag.
Can be useful to test fixes in some Boost pre-release, to see if a previous issue is addressed.
I've only done this with the posted script, creating a symlink for /opt/projects/boost/src/boost_$VERSION and passing $VERSION as the script arg
Do not recall if I successfully built FreeOrion with clang, I've at least built Boost by altering the boost build steps to:
- ./bootstrap.sh --with-toolset=clang
- mkdir build_1_63_0 && mkdir stage_1_63_0
- ./b2 toolset=clang cxxflags="=std=c++11 -stdlib=libc++" linkflags="-lc++abi -stdlib=libc++" --build-dir=build_1_63_0 stage --stage-dir=stage_1_63_0
- ./bjam install