Since your library names start with lib
, it looks like you created static versions of boost libraries. format naming conventions :
lib
Prefix: In addition to Microsoft Windows, each Boost library name starts on this line. On Windows, only regular static libraries use the lib
prefix; import libraries and DLLs do not work.
The output generated by CMake has a line that reads:
-- [ F:/C++/yapimpl/acmake/FindBoost.cmake:570 ] Boost_USE_STATIC_LIBS = OFF
In addition, you can see that the library names that CMake is looking for do not start with lib
:
... Searching for UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE: boost_unit_test_framework-vc110-mt-1_54;...
To tell CMake to look for a static version of Boost, you just need to set Boost_USE_STATIC_LIBS
to ON
. You can do this in your CMakeLists.txt before calling find_package(Boost ...)
:
set(Boost_USE_STATIC_LIBS ON)
or you can just install it on the command line:
cmake . -DBoost_USE_STATIC_LIBS=ON
For more information about the CMake FindBoost
module, see > docs , or run
cmake --help-module FindBoost
source share