From 4d92914373768dbbb7f148659f9ab3c5778494dc Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Thu, 22 Aug 2013 21:44:15 +0000 Subject: [PATCH] Fix for boost compile flags on windows --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74b3ca0a7..3c3766dda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,8 +104,13 @@ endif() # Boost_NO_SYSTEM_PATHS: set to true to keep the find script from ignoring BOOST_ROOT # If using Boost shared libs, disable auto linking -if(MSVC AND NOT Boost_USE_STATIC_LIBS) - add_definitions(-DBOOST_ALL_NO_LIB) +if(MSVC) + # Some libraries, at least Boost Program Options, rely on this to export DLL symbols + add_definitions(-DBOOST_ALL_DYN_LINK) + # Disable autolinking + if(NOT Boost_USE_STATIC_LIBS) + add_definitions(-DBOOST_ALL_NO_LIB) + endif() endif() find_package(Boost 1.43 COMPONENTS serialization system filesystem thread program_options date_time regex timer chrono)