Skip to content

Commit 04726a5

Browse files
Implement issue #923: Make boost timer optional
1 parent 44aa90e commit 04726a5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples." ON)
8383

8484
SET (Boost_USE_MULTITHREADED ON)
8585
SET (Boost_USE_STATIC_RUNTIME OFF)
86-
FIND_PACKAGE (Boost REQUIRED COMPONENTS chrono system timer)
86+
FIND_PACKAGE (Boost REQUIRED COMPONENTS chrono system OPTIONAL_COMPONENTS timer)
8787

8888
INCLUDE_DIRECTORIES (
8989
${Boost_INCLUDE_DIRS}

example/cpp03/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ IF (NOT MSVC)
2222
)
2323
ENDIF ()
2424

25-
LIST (APPEND with_boost_lib_PROGRAMS
26-
speed_test.cpp
27-
speed_test_nested_array.cpp
28-
)
25+
if (Boost_TIMER_LIBRARY)
26+
LIST (APPEND with_boost_lib_PROGRAMS
27+
speed_test.cpp
28+
speed_test_nested_array.cpp
29+
)
30+
endif()
2931

3032
FOREACH (source_file ${exec_PROGRAMS})
3133
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)

0 commit comments

Comments
 (0)