From 702bf6b441aa7758022f72fcfbc6de7660dddd40 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Fri, 3 Apr 2015 20:46:00 +0200 Subject: Require PTHREAD using cmake canonic way Pthread was required by included directly findPthread.cmake then testing for success. Use the find_package command and require success with the REQUIRED option. Signed-off-by: Kevin Rocard --- remote-processor/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/remote-processor/CMakeLists.txt b/remote-processor/CMakeLists.txt index 23307a1..598bd4f 100644 --- a/remote-processor/CMakeLists.txt +++ b/remote-processor/CMakeLists.txt @@ -37,12 +37,8 @@ add_library(remote-processor SHARED RemoteProcessorServerBuilder.cpp) set(CMAKE_THREAD_PREFER_PTHREAD 1) -include(FindThreads) -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) +find_package(Threads REQUIRED) + target_link_libraries(remote-processor ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS remote-processor LIBRARY DESTINATION lib) -- cgit v1.1