I need to use custom build of boost lib, which uses own library naming prefix as well as namespace in the code.
I need to link with it in CMakeLists.txt
:
set(BOOST_INCLUDEDIR /path/to/custom/boost/include)
set(BOOST_LIBRARYDIR /path/to/custom/boost/lib)
set(BOOST_NAMESPACE my_boost_161)
set(Boost_NO_SYSTEM_PATHS OFF)
set (Boost_USE_STATIC_LIBS OFF)
find_package (Boost REQUIRED COMPONENTS my_unit_test_framework)
include_directories (${Boost_INCLUDE_DIRS})
the libraries have a names like :
libmy_boost_161_unit_test_framework.so
and really exist in lib folder
there is a errors like:
CMake Error at /home/user1/.localcmake/share/cmake-3.14/Modules/FindBoost.cmake:2132 (message): Unable to find the requested Boost libraries.
Boost version: 1.61.0
Boost include path:
/path/to/custom/boost/includeCould not find the following Boost libraries:
boost_unit_test_framework
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of
How can I specify to look for libs with names like (my_
addition to standard names):
similar to Boost_LIB_VERSION
which gives an ability to add the version to lib name
my_boost_161_unit_test_framework
Could not find the following Boost libraries:
contains logical name of the library. For find, which filename is searching, pass-DBoost_DEBUG=ON
option tocmake
. – Tsyvarev