This repository demonstrates how to set up a boost library in a Ubuntu machine and use CMake as a build system generator.
Prerequisite: I assume that you have already installed the latest boost library in your machine correctly. if not,
- download the latest boost library from : https://www.boost.org/users/history/version_1_67_0.html
- extract the boost library to the the desired location using: tar --bzip2 -xf /path/to/boost_1_67_0.tar.bz2
- go to the extracted directory: cd /path/to/boost_1_67_0
- ./bootstrap.sh --prefix=/usr/local
- sudo ./b2 install
After these steps boost library headers will be installed on /usr/local/include and compiled libraries will be installed on /usr/local/lib directory.
This project shows two examples using boost library. The first one, header_only.cpp needs header only boost library and the second one, boost_program_option.cpp needs a pre-compiled libboost_program_options library to be linked.
create a directory called build in projects's root directory: mkdir build
navigate to the build directory : cd build
Turn ON ENABLE_EXAMPLES: ccmake ..
Make the project: make