Special Boost libraries With Cmake3

centos中默认安装的C++ boost libraries过于老旧有些依赖编译安装的软件预编译不过

Unable to find the Boost header files.  Please set BOOST_ROOT to the root   directory containing Boost or BOOST_INCLUDEDIR to the directory containing

https://www.boost.org下载最新的版本

wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz
tar -xzf boost_1_72_0.tar.gz cd boost_1_72_0 
./bootstrap.sh --prefix=/opt/boost 
./b2 install --prefix=/opt/boost --with=all

在cmake时指定boost安装路径

cmake3 -DBOOST_ROOT=/opt/boost

from https://cmake.org/cmake/help/v3.0/module/FindBoost.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注