[cmakelists]CMakeLists.txt中手动指定boost的安装路径

下载并安装boost

# 例如boost_1_71_0 https://www.boost.org/users/history/version_1_71_0.html
wget https://boostorg.jfrog.io/artifactory/main/release/1.71.0/source/boost_1_71_0.tar.gz
tar -xzf boost_1_71_0.tar.gz
cd boost_1_71_0 
# ./bootstrap.sh --help
./bootstrap.sh --prefix=/home/spurs/installed 
./b2 install

在相应的CMakeLists.txt

find_package(Boost REQUIRED) 
改为
set(BOOST_ROOT "/home/spurs/package/boost_1_71_0/install")
set(BOOST_INCLUDE_DIRS "${BOOST_ROOT}/include")
set(BOOST_LIBRARY_DIRS "${BOOST_ROOT}/lib")
find_package(Boost REQUIRED)

你可能感兴趣的:(CMakeLists,mysql,服务器,linux)