CMake is not able to find BOOST libraries

后端 未结 8 1809
既然无缘
既然无缘 2020-12-07 22:00

I tried everything like:

  1. Configure environment variable
  2. Make fresh build
  3. Re-install BOOST from source
  4. sudo apt-get install libb
8条回答
  •  被撕碎了的回忆
    2020-12-07 22:50

    seems the answer is in the comments and as an edit but to clarify this should work for you:

    export BUILDDIR='your path to  build directory here'
    export SRCDIR='your path to source dir here'
    export BOOST_ROOT="/opt/boost/boost_1_57_0"
    export BOOST_INCLUDE="/opt/boost/boost-1.57.0/include"
    export BOOST_LIBDIR="/opt/boost/boost-1.57.0/lib"
    export BOOST_OPTS="-DBOOST_ROOT=${BOOST_ROOT} -DBOOST_INCLUDEDIR=${BOOST_INCLUDE} -DBOOST_LIBRARYDIR=${BOOST_LIBDIR}"
    (cd ${BUILDDIR} && cmake ${BOOST_OPTS} ${SRCDIR})
    

    you need to specify the arguments as command line arguments or you can use a toolchain file for that, but cmake will not touch your environment variables.

提交回复
热议问题