The root directory of boost ($ENV{BOOST_ROOT}) is
C:\Boost\boost_1_64_0
All compiled libraries (.dll, .lib) are in
C:\Boost\boost_1_64_0\lib64-msvc-14.1
They have both boost_xxx and libboost_xxx.
My cmake file is
set(BOOST_ROOT "$ENV{BOOST_ROOT}")
set(BOOST_LIBRARYDIR "$ENV{BOOST_ROOT}/lib64-msvc-14.1")
message("${BOOST_ROOT}")
message("${BOOST_LIBRARYDIR}")
message("${Boost_INCLUDE_DIR}")
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
add_definitions(-DBOOST_ALL_DYN_LINK)
endif()
find_package(Boost 1.64.0 COMPONENTS system filesystem program_options REQUIRED)
And the output is
C:\Boost\boost_1_64_0
C:\Boost\boost_1_64_0/lib64-msvc-14.1
C:/Boost/boost_1_64_0
CMake Error at C:/Program Files/CMake/share/cmake-3.8/Modules/FindBoost.cmake:1842 (message):
Unable to find the requested Boost libraries.Boost version: 1.64.0
Boost include path: C:/Boost/boost_1_64_0
Could not find the following Boost libraries:
boost_system boost_filesystem boost_program_options
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 Boost. Call Stack (most recent call first):
CMakeLists.txt:78 (find_package)CMake Error at CMakeLists.txt:84 (message): Boost not found
Could someone help please? I have spent hours on this but couldn't figure out why this doesn't work.