diff --git a/CMake/FindPThreads.cmake b/CMake/FindPThreads.cmake index 717200a5b352c7e42c31824e98798817a5b069e3..beeec53e2e40c949d09219b236df497341bbe66d 100644 --- a/CMake/FindPThreads.cmake +++ b/CMake/FindPThreads.cmake @@ -5,6 +5,7 @@ find_path(PTHREAD_INCLUDE_DIR find_library(PTHREAD_LIBRARY NAMES pthread + libpthread ) set(PTHREAD_INCLUDE_DIRS "${PTHREAD_INCLUDE_DIR}") @@ -23,6 +24,6 @@ mark_as_advanced( if(PTHREAD_FOUND AND NOT TARGET Threads::Threads) add_library(Threads::Threads INTERFACE IMPORTED) set_target_properties(Threads::Threads PROPERTIES - IMPORTED_LOCATION "${PTHREAD_LIBRARY}" + INTERFACE_LINK_LIBRARIES "${PTHREAD_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${PTHREAD_INCLUDE_DIRS}") endif() diff --git a/src/libclothBW/CMakeLists.txt b/src/libclothBW/CMakeLists.txt index c8c1e9a6b3b4523704a4aeb04f8232b2e4e1acfe..0b7314e964378616c085d03e441181130915f40a 100644 --- a/src/libclothBW/CMakeLists.txt +++ b/src/libclothBW/CMakeLists.txt @@ -26,5 +26,5 @@ target_link_libraries(clothBW minivector sparseMatrix INTERFACE - ${CMAKE_THREAD_LIBS_INIT} + Threads::Threads ) diff --git a/src/libcorotationalLinearFEM/CMakeLists.txt b/src/libcorotationalLinearFEM/CMakeLists.txt index 6337764ea2a874ae0f55f7751a2c255481dc8520..2e6f85210e0887fef0c98a58e110e910ecd7cd3b 100644 --- a/src/libcorotationalLinearFEM/CMakeLists.txt +++ b/src/libcorotationalLinearFEM/CMakeLists.txt @@ -1,9 +1,9 @@ -set(corotationallinearfem_srcs +set(corotationallinearfem_srcs corotationalLinearFEM.cpp) - -set(corotationallinearfem_hdrs + +set(corotationallinearfem_hdrs corotationalLinearFEM.h) - + if(VegaFEM_ENABLE_PTHREADS_SUPPORT) list(APPEND corotationallinearfem_hdrs corotationalLinearFEMMT.h) list(APPEND corotationallinearfem_srcs corotationalLinearFEMMT.cpp) @@ -23,5 +23,5 @@ target_link_libraries(corotationalLinearFEM sparseMatrix INTERFACE minivector - ${CMAKE_THREAD_LIBS_INIT} + Threads::Threads )