title: Using static Boost libraries with vcpkg and CMake
body: <p>I'm using the package manager <code>vcpkg</code> to install the (static) <code>Boost</code> libraries via <code>vcpkg install boost:x64-windows-static</code>.</p>
  
  <p>Furthermore, I use <code>CMake</code> as my build system and I'm passing <code>C:\vcpkg\scripts\buildsystems\vcpkg.cmake</code> to <code>CMake</code> via the <code>-DCMAKE_TOOLCHAIN_FILE</code> <code>CMake</code> command.</p>
  
  <p>In my <code>CMakeLists.txt</code> I force static <code>Boost</code> libraries:</p>
  
  <pre><code>set(Boost_USE_STATIC_LIBS ON)
  find_package(Boost COMPONENTS filesystem iostreams REQUIRED)
  if (Boost_FOUND)
      include_directories(${Boost_INCLUDE_DIRS})
      link_directories(${Boost_LIBRARY_DIRS})
  endif ()
  
  # ...
  
  target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
  </code></pre>
  
  <p>However, <code>Visual Studio</code> still tries to look at the wrong file path for my <code>Boost</code> libraries:</p>
  
  <pre><code>Error 'C:/vcpkg/installed/x64-windows/lib/boost_filesystem-vc140-mt.lib', needed by 'MyProject.exe', missing and no known rule to make it
  </code></pre>
  
  <p>If I install the dynamic <code>Boost</code> libraries, it will build fine since this is where <code>Visual Studio</code> looks. However, I want to use the static libraries in my build instead so that all <code>DLL</code>s are "merged" into the final <code>EXE</code>.</p>
  
  <p>How can I accomplish this?</p>