From f753f4bc3046206659f5f433ad52adf4870400ed Mon Sep 17 00:00:00 2001 From: Guillaume Dumont Date: Wed, 16 Sep 2015 10:05:43 -0400 Subject: [PATCH] Visual Studio compatibility fixes Static linking fix --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3daaa0a..13ed2f84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,17 @@ message( STATUS "Boost Paths:") message( STATUS "Include : " ${Boost_INCLUDE_DIRS}) message( STATUS "Libraries: " ${Boost_LIBRARIES}) -# add_definitions( -DBOOST_ALL_NO_LIB ) +if(MSVC) + # With Visual Studio remove the automatic linking + # feature + add_definitions( -DBOOST_ALL_NO_LIB ) +endif() + +if(Boost_USE_STATIC_LIBS) + # if the user specified he wants to link to static libraries + # force linking to static boost python + add_definitions( -DBOOST_PYTHON_STATIC_LIB ) +endif() # In some cases, you may need to explicitly specify that a dynamic Boost is used; if so use: # add_definitions( -DBOOST_ALL_DYN_LINK )