patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.89k stars 596 forks source link

Build Boost 1.71.0 with Visual Studion 2019 #261

Closed CorvoOrc closed 5 years ago

CorvoOrc commented 5 years ago

In ...\CMake\share\cmake-3.14\Modules\FindBoost.cmake need add 2 lines:

set(Boost_LIB_PREFIX "lib") set(_boost_RELEASE_ABI_TAG ".lib")

CorvoOrc commented 5 years ago

In case using Visual Studion 2019 on Windows 10 in CMakeList.txt examples in case boost 1.70.0+ (also try on 1.71.0) need remove follow lines:

if(MSVC)
  # The standard find_package for boost on Win finds the dynamic libs, so for dynamic linking to boost we need to #define:
  add_definitions(-DBOOST_ALL_NO_LIB) # Don't use the automatic library linking by boost with VS (#pragma ...). Instead, we specify everything here in cmake.
  add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds.
  add_definitions(-D_HAS_AUTO_PTR_ETC) # Boost 1.65.1 still does not work with VS C++17 mode, this is the workaround
endif()

or if already builded with above lines than before compile need remove BOOST_ALL_NO_LIB, BOOST_ALL_DYN_LINK, _HAS_AUTO_PTR_ETC from "Preprocessor Definitions".