From e858b098226a825c9c89f5e4d3467fc5f0539cc8 Mon Sep 17 00:00:00 2001 From: Philippe Liard Date: Wed, 23 Nov 2011 09:19:28 +0000 Subject: [PATCH] CPP: Fix CMakeLists to require Boost datetime needed by Boost thread. This also makes the library link with the Boost static libs on Windows. Review URL: http://codereview.appspot.com/5430053 --- cpp/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index f9d50184b..c7c7557f0 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -73,9 +73,12 @@ option ("USE_RE2" "Use RE2" "OFF") option ("USE_STD_MAP" "Force the use of std::map" "OFF") # Find all the required libraries and programs. -find_package (Boost 1.40.0 COMPONENTS thread) +if (WIN32) + set (Boost_USE_STATIC_LIBS ON) +endif () +find_package (Boost 1.40.0 COMPONENTS date_time thread) if (NOT Boost_FOUND) - print_error ("Boost Thread" "Boost") + print_error ("Boost Datetime/Thread" "Boost") endif () include_directories (${Boost_INCLUDE_DIRS})