I have a C++ project using CMake and Boost that compiles/links under Linux without any problems. I'm working towards porting this to Windows via Visual C++ 2012.
My CMake configuration is as follows:
set(BOOST_ROOT ${DEPENDENCY_DIR}/boost/)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.53 COMPONENTS system date_time chrono serialization filesystem program_options random thread regex unit_test_framework)
message(STATUS "Boost Version:" ${Boost_VERSION})
message(STATUS "Boost Include Dirs:" ${Boost_INCLUDE_DIR})
message(STATUS "Boost Libraries:")
foreach(lib ${Boost_LIBRARIES})
message(STATUS ${lib})
endforeach()
include_directories(${Boost_INCLUDE_DIR})
and I'm using `target_link_libraries` with `${Boost_LIBRARIES}` in my targets. Also above `message` commands show all found files without any problem.
However, when I build one of the targets, I get
2>LINK : fatal error LNK1104: cannot open file 'boost_unit_test_framework-vc110-mt-gd-1_53.lib'
I removed another Boost library and from the error it seems the linker is able to find others. (like `chrono` or `serialization`.) But the error message is a bit different. The filename has _lib_ in front of it.
2>LINK : fatal error LNK1104: cannot open file 'libboost_serialization-vc110-mt-gd-1_53.lib'
Why does VC++ looks for a file prefixed with **boost** and not **libboost** for unit_test_framework?
Best Regards,
Emre