From 98ff1d2b50a7b500333ef67ea9154e2ebaf396cc Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Fri, 9 Apr 2021 03:20:19 +0300 Subject: [PATCH] Yet another attempt to fix pthreads ld error --- clover/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clover/CMakeLists.txt b/clover/CMakeLists.txt index 5cde1ffb..a62ffd7f 100644 --- a/clover/CMakeLists.txt +++ b/clover/CMakeLists.txt @@ -44,6 +44,9 @@ find_package(OpenCV ${_opencv_version} REQUIRED imgproc ) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) + ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) @@ -195,7 +198,7 @@ set_target_properties(clover_rc PROPERTIES OUTPUT_NAME rc) set_target_properties(clover_led PROPERTIES OUTPUT_NAME led) -target_link_libraries(clover_rc ${catkin_LIBRARIES}) +target_link_libraries(clover_rc ${catkin_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(camera_markers ${catkin_LIBRARIES})