From 87bb9d0725c83fc9f2b3441f52ca120f5e987c8f Mon Sep 17 00:00:00 2001
From: Marcel Koch <marcel.koch@uni-muenster.de>
Date: Tue, 23 Jul 2019 11:28:55 +0200
Subject: [PATCH] automatically add pthread option to autotune targets

this need cmake 3.1, if the cmake version should stay at 2.8 I could
find another way to link it
---
 CMakeLists.txt        | 2 +-
 python/CMakeLists.txt | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a4961090..bf740e74 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.1.3)
 project(dune-codegen CXX)
 
 if(NOT (dune-common_DIR OR dune-common_ROOT OR
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 8881504f..67694937 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -24,6 +24,7 @@ add_subdirectory(test)
 add_executable(_autotune_target EXCLUDE_FROM_ALL _autotune.cc)
 target_compile_options(_autotune_target PUBLIC -fno-strict-aliasing)
 
-if(benchmark_FOUND)
-  target_link_libraries(_autotune_target benchmark)
+find_package(Threads)
+if(benchmark_FOUND AND Threads_FOUND)
+  target_link_libraries(_autotune_target benchmark Threads::Threads)
 endif()
-- 
GitLab