Skip to content

Commit 0aaf956

Browse files
cmake: Make boost mandatory if MSGPACK_BOOST is ON
Signed-off-by: Stefan Herbrechtsmeier <[email protected]>
1 parent 918e7ed commit 0aaf956

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ install:
2727
# valgrind
2828
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2 && tar xjf valgrind-3.12.0.tar.bz2 && cd valgrind-3.12.0 && ./configure --prefix=${BASE}/usr > /dev/null && make -j3 > /dev/null && make install > /dev/null && cd ..; fi
2929
# boost
30-
- if [ "$BOOST" == "ON" ]; then wget http://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.zip && unzip -q boost_1_63_0.zip && cd boost_1_63_0 && ./bootstrap.sh && ./b2 -j3 --prefix=${BASE}/usr --with-timer --with-chrono address-model=${ARCH} install > /dev/null && cd ..; fi
30+
- if [ "$BOOST" == "ON" ]; then wget http://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.zip && unzip -q boost_1_63_0.zip && cd boost_1_63_0 && ./bootstrap.sh && ./b2 -j3 --prefix=${BASE}/usr --with-chrono --with-context --with-system --with-timer address-model=${ARCH} install > /dev/null && cd ..; fi
3131

3232
matrix:
3333
include:

CMakeLists.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,13 @@ IF (MSGPACK_BOOST)
9494
SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_BOOST ${CMAKE_CXX_FLAGS}")
9595
SET (Boost_USE_MULTITHREADED ON)
9696
SET (Boost_USE_STATIC_RUNTIME OFF)
97-
FIND_PACKAGE (Boost COMPONENTS chrono context timer system)
98-
IF (Boost_INCLUDE_DIRS)
99-
INCLUDE_DIRECTORIES (
100-
${Boost_INCLUDE_DIRS}
97+
FIND_PACKAGE (Boost REQUIRED COMPONENTS chrono context system timer)
98+
INCLUDE_DIRECTORIES (
99+
${Boost_INCLUDE_DIRS}
101100
)
102-
ENDIF ()
103-
IF (Boost_LIBRARY_DIRS)
104-
LINK_DIRECTORIES (
105-
${Boost_LIBRARY_DIRS}
101+
LINK_DIRECTORIES (
102+
${Boost_LIBRARY_DIRS}
106103
)
107-
ENDIF ()
108104
IF (MSGPACK_BOOST_DIR)
109105
INCLUDE_DIRECTORIES (
110106
${MSGPACK_BOOST_DIR}

example/cpp03/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ IF (NOT MSVC)
2222
)
2323
ENDIF ()
2424

25-
IF (Boost_TIMER_LIBRARY AND Boost_CHRONO_LIBRARY AND Boost_SYSTEM_LIBRARY)
25+
IF (MSGPACK_BOOST)
2626
LIST (APPEND with_boost_lib_PROGRAMS
2727
speed_test.cpp
2828
speed_test_nested_array.cpp

example/x3/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ IF (MSGPACK_USE_X3_PARSE)
77
unpack.cpp
88
parse.cpp
99
)
10-
IF (Boost_CONTEXT_LIBRARY AND Boost_SYSTEM_LIBRARY AND CMAKE_THREAD_LIBS_INIT)
10+
IF (MSGPACK_BOOST)
1111
LIST (APPEND with_boost_PROGRAMS
1212
stream_unpack.cpp
1313
)

0 commit comments

Comments
 (0)