c++ - Cannot find boost with CMake on Linux Mint -


i have been working on library in c++ , have run bit of difficulty trying integrate boost project. kept message boost not found, on other hand, fellow developer using arch had no issues.

we figured out because linux mint (at least libboost-all-dev package) installs libraries /usr/lib/x86_64-linux-gnu not searched findboost module. fixed creating symbolic links:

ln -s /usr/lib/x86_64-linux-gnu/libboost* /usr/lib/ 

what want know: there better (more acceptable) way of fixing because when compile major projects, not run problem.

here cmakelists.txt (with omissions)

cmake_minimum_required(version 2.8) project(testlibrary cxx)  set(cmake_cxx_flags "-std=c++0x ${cmake_cxx_flags}")  set(boost_use_static_libs on) set(boost_use_multithreaded off) set(boost_use_static_runtime off)  find_package(boost 1.55.0 components unit_test_framework thread log required)  include_directories(${boost_include_dirs})  add_library(testlibrary static ${source_main})  target_link_libraries(testlibrary ${boost_libraries}) 

you can set hint boost_librarydir:

set(boost_librarydir "/usr/lib/x86_64-linux-gnu") find_package(boost 1.55.0 components unit_test_framework thread log required) 

alternative, can set when running cmake this:

cmake -dboost_librarydir="/usr/lib/x86_64-linux-gnu" <project_root> 

if run:

cmake <project_root> 

then findboost.cmake in usual spots boost libaries.

see documentation of findboost.cmake cmake version here.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -