Skip to content

Commit f73fd9f

Browse files
committed
Move find(threads) to root list; use modern threads target.
1 parent f88f56d commit f73fd9f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ else()
5151
set(CUDA_USE_STATIC_CUDA_RUNTIME ON)
5252
endif()
5353

54+
# Require threads because of std::thread.
55+
find_package(Threads REQUIRED)
56+
5457
find_package(CUDA 7.0 REQUIRED)
5558

5659
if(NOT CUDA_FOUND)

src/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,8 @@ set_target_properties(popsift PROPERTIES DEBUG_POSTFIX "d")
5858

5959
# cannot use PRIVATE here as there is a bug in FindCUDA and CUDA_ADD_LIBRARY
6060
# https://gitlab.kitware.com/cmake/cmake/issues/16097
61-
target_link_libraries(popsift ${CUDA_CUDADEVRT_LIBRARY} ${CUDA_CUBLAS_LIBRARIES})
61+
target_link_libraries(popsift ${CUDA_CUDADEVRT_LIBRARY} ${CUDA_CUBLAS_LIBRARIES} Threads::Threads)
6262

63-
# Link to threads because we're using C++11 std::thread.
64-
find_package(Threads REQUIRED)
65-
target_link_libraries(popsift ${CMAKE_THREAD_LIBS_INIT})
6663

6764

6865
# EXPORTING THE LIBRARY

0 commit comments

Comments
 (0)