From 25e0fa8140e2483da810439e81b42a08f5b3c216 Mon Sep 17 00:00:00 2001
From: Thomas Moulard <thomas.moulard@gmail.com>
Date: Tue, 2 Nov 2010 15:08:48 +0100
Subject: [PATCH] Switch to generic pthread detection macro.

---
 CMakeLists.txt | 20 +++-----------------
 cmake          |  2 +-
 2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 85760ed..fddd0c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 INCLUDE(cmake/base.cmake)
 INCLUDE(cmake/boost.cmake)
+INCLUDE(cmake/pthread.cmake)
 
 SET(PROJECT_NAME dynamic-graph)
 SET(PROJECT_VERSION 1.0.0.99)
@@ -44,26 +45,11 @@ SET(PKG_CONFIG_EXTRA
 plugindir=${CMAKE_INSTALL_PREFIX}/${PLUGINDIR}")
 
 # Add dependency toward dynamic graph library in pkg-config file.
-SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} ${LIBINCL_KW}dynamic-graph${LIB_EXT}")
+PKG_CONFIG_APPEND_LIBS("dynamic-graph")
 
 # Search for Boost.
 SEARCH_FOR_BOOST()
-
-# Search for Pthread.
-INCLUDE(FindThreads)
-IF(UNIX)
-  IF(CMAKE_USE_PTHREADS_INIT)
-    ADD_DEFINITIONS(-pthread)
-  ELSE(CMAKE_USE_PTHREADS_INIT)
-    MESSAGE(FATAL_ERROR
-      "Pthread is required on Unix, but "
-      ${CMAKE_THREAD_LIBS_INIT} " has been detected.")
-  ENDIF(CMAKE_USE_PTHREADS_INIT)
-ELSEIF(WIN32)
-  # Nothing to do.
-ELSE(UNIX)
-  MESSAGE(FATAL_ERROR "Thread support for this platform is not implemented.")
-ENDIF(UNIX)
+SEARCH_FOR_PTHREAD()
 
 # Remove additional warnings.
 IF(WIN32)
diff --git a/cmake b/cmake
index 027d203..30f815f 160000
--- a/cmake
+++ b/cmake
@@ -1 +1 @@
-Subproject commit 027d20357f83e69338bca882e9e8b73e89385139
+Subproject commit 30f815f6d9e4d3486eca42c2445e20bc2e116a67
-- 
GitLab