diff --git a/CMakeLists.txt b/CMakeLists.txt index f77e69912..07c1b9f4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,11 @@ elseif (${CMAKE_CXX_COMPILER_ID} MATCHES Clang) endif() +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") + set(gtest_force_shared_crt true) +endif() + if (Boost_FOUND) if (MSVC) add_definitions(-D_SCL_SECURE_NO_WARNINGS) @@ -108,6 +113,7 @@ if (Boost_FOUND) add_definitions(-D_WIN32_WINNT=0x0501) endif(WIN32) include_directories(${Boost_INCLUDE_DIRS}) + link_directories(${Boost_LIBRARY_DIRS}) enable_testing() add_subdirectory(libs/network/src) @@ -120,10 +126,6 @@ if (Boost_FOUND) endif (CPP-NETLIB_BUILD_EXAMPLES) endif(Boost_FOUND) -if (MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") -endif() - enable_testing() set(CPP-NETLIB_LIBRARIES ${Boost_LIBRARIES} CACHE INTERNAL "Dependent libraries for header-only use")