Skip to content

Commit

Permalink
fix cmake boost refs for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
packetzero committed Aug 7, 2019
1 parent 7ef036d commit f84e6c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..
```

0 comments on commit f84e6c5

Please sign in to comment.