diff --git a/source/common/CMakeLists.txt b/source/common/CMakeLists.txt index 0cac2afb0a..f787fc6c0b 100644 --- a/source/common/CMakeLists.txt +++ b/source/common/CMakeLists.txt @@ -47,3 +47,10 @@ target_link_libraries(ur_common PUBLIC ${CMAKE_DL_LIBS} ${PROJECT_NAME}::headers ) + +if (UNIX) + set(CMAKE_THREAD_PREFER_PTHREAD TRUE) + set(THREADS_PREFER_PTHREAD_FLAG TRUE) + find_package(Threads REQUIRED) + target_link_libraries(ur_common PUBLIC Threads::Threads) +endif()