I am trying to use vcpkg
to build and use Boost. This might not be the best practice but I modified the triplet x64-windows
directly and added these
set(VCPKG_VISUAL_STUDIO_PATH "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community")
set(VCPKG_PLATFORM_TOOLSET v142)
so that it uses the latest Visual Studio I have. Strange thing is, I don't have any other VC++ toolset anyways. This is where things get confusing for me. I do vcpkg install boost:x64-windows
. It builds fine. Under ${vcpkg_dir}/installed/x64-windows
, I can see that Boost libraries, dlls, includes are just there. When I use this in a CMake project later, with find_package(Boost)
, I also get BOOST_FOUND=true
. Boost include dirs, lib dirs etc. are correctly set. Problem is BOOST_COMPILER
says v140
and if I go to ${vcpkg_dir}/installed/x64-windows/lib
, I see that boost lib files have names similar to
libboost_filesystem-vc140-mt-1_72.lib
. It says vc140
! If I go to bin folder, I can see that dlls have vc142
in their name. In my CMake project, I get the variable BOOST_LIBRARIES
empty.
Of course, in my CMake project, I am using vc142.
So, to me it seems, my CMake project finds the Boost installed with vcpkg just fine. But since it sees incompatible libraries built with vc140, it says BOOST_LIBRARIES
are empty and I can't link to them. Does anyone have any ideas why BOOST_COMPILER=v140
even though I set it explicitly to my Visual Studio installation? Again, I don't have any other Visual Studio installation anyways.