From 60abde4968e88b8e42da837e6287934a8d2de2d4 Mon Sep 17 00:00:00 2001 From: Thomas Heinemann Date: Mon, 30 Jul 2012 11:02:07 +0200 Subject: [PATCH] Added dependency on thread in CMakeLists.txt --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d81d1137d..5eb520c60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ include_directories("${PROJECT_SOURCE_DIR}/src") FIND_PACKAGE(GTest REQUIRED) FIND_PACKAGE(Boost REQUIRED) FIND_PACKAGE(Doxygen REQUIRED) +FIND_PACKAGE(Threads REQUIRED) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) @@ -69,4 +70,13 @@ add_test( NAME MRMC-tests COMMAND MRMC-tests ) -endif(GTEST_FOUND) + +# GTest needs pThreads, so it is linked into MRMC-tests. +if (THREADS_FOUND) + +include_directories(${THREADS_INCLUDE_DIRS}) +target_link_libraries (MRMC-tests ${CMAKE_THREAD_LIBS_INIT}) + +endif(THREADS_FOUND) + +endif(GTEST_FOUND) \ No newline at end of file