From 04726a5acf8491ca2e379dc443a3451feff23046 Mon Sep 17 00:00:00 2001 From: Arvid Norlander Date: Fri, 16 Oct 2020 10:51:49 +0200 Subject: [PATCH] Implement issue #923: Make boost timer optional --- CMakeLists.txt | 2 +- example/cpp03/CMakeLists.txt | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f78e5576..4e6051fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,7 @@ OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples." ON) SET (Boost_USE_MULTITHREADED ON) SET (Boost_USE_STATIC_RUNTIME OFF) -FIND_PACKAGE (Boost REQUIRED COMPONENTS chrono system timer) +FIND_PACKAGE (Boost REQUIRED COMPONENTS chrono system OPTIONAL_COMPONENTS timer) INCLUDE_DIRECTORIES ( ${Boost_INCLUDE_DIRS} diff --git a/example/cpp03/CMakeLists.txt b/example/cpp03/CMakeLists.txt index 8a1c276a..5c48ca4f 100644 --- a/example/cpp03/CMakeLists.txt +++ b/example/cpp03/CMakeLists.txt @@ -22,10 +22,12 @@ IF (NOT MSVC) ) ENDIF () -LIST (APPEND with_boost_lib_PROGRAMS - speed_test.cpp - speed_test_nested_array.cpp -) +if (Boost_TIMER_LIBRARY) + LIST (APPEND with_boost_lib_PROGRAMS + speed_test.cpp + speed_test_nested_array.cpp + ) +endif() FOREACH (source_file ${exec_PROGRAMS}) GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)