diff --git a/CMakeLists.txt b/CMakeLists.txt index 6edb14a..5620f2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,20 @@ set(CMAKE_CXX_RELEASE_FLAGS "-DNDEBUG=1") set(DEPDIR $ENV{DEPDIR}) +set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_MULTITHREADED ON) + +if(WINDOWS) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT /NODEFAULTLIB") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") + add_definitions(-DBOOST_ALL_NO_LIB) +endif() + +find_package(Boost REQUIRED COMPONENTS filesystem system) +include_directories(${Boost_INCLUDE_DIRS}) +link_libraries(${Boost_LIBRARIES}) + + # find dependencies FIND_LIBRARY(GTEST_LIB gtest HINT ${DEPDIR}/lib ) diff --git a/README.md b/README.md index 90923e4..c29c856 100644 --- a/README.md +++ b/README.md @@ -60,5 +60,5 @@ The application can optionally persist the state by calling `persistState()`. I ## Building Tests Define an environment variable named DEPDIR that has dependencies installed in ./include and ./lib subdirectories. I build them using [mason](https://github.com/mapbox/mason) install and link . ``` -DEPDIR=/path/to/mason_packages/.link cmake .. +DEPDIR=/path/to/mason_packages/.link BOOST_ROOT=/path/to/mason_packages/.link cmake .. ```