From 062fa39531ff95cec98e055a9b2388f716b49962 Mon Sep 17 00:00:00 2001 From: "enrico.detoma" Date: Mon, 17 Oct 2016 11:53:45 +0200 Subject: [PATCH] Change to CMake configuration to build library + examples + tests with MSVC2015. Some tests do not pass, though. --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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")