- This Guide assumes that you have installed msys2, mingw-64 using this link https://gist.github.com/ahmednawazkhan/4da8acbdafe0798527874b0f00f16e45
- This guide was made with the help of https://gist.github.com/sim642/29caef3cc8afaa273ce6
- Download boost from https://www.boost.org/users/download/
- Extract the contents to
/c/downloads/boost_1_77_0
- Create a folder within for building.
/c/downloads/boost_1_77_0/build
- Create a folder for Boost Build installation
/c/downloads/boost-build
- Create a folder for installation
/c/libs/boost
- Make sure
g++ --version
is successfuly running - Open
Msys2 Mingw 64-bit
with administrative rights - Navigate to
/c/downloads/boost_1_77_0/tools/build
- Run
./bootstrap.bat mingw
- Run
./b2 install --prefix="/c/downloads/boost-build"
- Add
/c/downloads/boost-build/bin
to Windows PATH. - In order for msys2 to have windows environment variables, add
MSYS2_PATH_TYPE=inherit
variable to windows environment. - Close
Msys2
and restart using administrative rights - Verify that you can access
b2
and windows env variables are picked up by Msys2 - Navigate to
/c/downloads/boost_1_77_0
- Run
b2 --build-dir="/c/downloads/boost_1_77_0/build" --prefix="/c/libs/boost" toolset=gcc install
- After Installation is complete go to your project and go to its
build
folder - Run
cmake -DBoost_ROOT="/c/libs/boost" path_to_cmakelist
- Add
Boost_ROOT
to windows env varaibles to run cmake without passingBoost_ROOT
param.