From 7ab2809a1caf90155e789bf818ace60f21387a6a Mon Sep 17 00:00:00 2001 From: David Wagner Date: Thu, 20 Feb 2014 12:15:50 +0100 Subject: CMake: Force POSIX threads to be available The FindThreads module in CMake can detect several thread libraries. We only want the phtread library, so enforce it. Signed-off-by: David Wagner --- remote-processor/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'remote-processor') diff --git a/remote-processor/CMakeLists.txt b/remote-processor/CMakeLists.txt index 60b6ff2..7b2cf0c 100644 --- a/remote-processor/CMakeLists.txt +++ b/remote-processor/CMakeLists.txt @@ -8,9 +8,13 @@ add_library(remote-processor SHARED RemoteProcessorServer.cpp RemoteProcessorServerBuilder.cpp) +set(CMAKE_THREAD_PREFER_PTHREAD 1) include(FindThreads) -# TODO: use the "prefer pthread" option; check if we are using pthread (what to -# do else ?) +if(NOT CMAKE_USE_PTHREADS_INIT) + message(SEND_ERROR " + pthread library not found! Please install the POSIX thread library and + headers.") +endif(NOT CMAKE_USE_PTHREADS_INIT) target_link_libraries(remote-processor ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS remote-processor LIBRARY DESTINATION lib) -- cgit v1.1