Skip to content

Commit 5097c08

Browse files
committed
Added link to Pthread libs in Linux, was missing before
1 parent beb44e9 commit 5097c08

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ find_package( OpenCV REQUIRED )
3434
IF(WIN32)
3535
set(PTHREADS_INCLUDE_DIR "" CACHE PATH "Pthreads Include Directory")
3636
set(PTHREADS_LIB_DIR "" CACHE PATH "Pthreads Lib Directory")
37+
ELSEIF(UNIX)
38+
find_package(Threads)
3739
ENDIF()
3840

3941
# uninstall target

example/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ if(WIN32)
1818
target_link_libraries(opencvblobslibExample ${PTHREADS_LIB_DIR}/pthreadVC2.lib)
1919
message("Linked " ${PTHREADS_LIB_DIR}/pthreadVC2.lib)
2020
endif()
21+
elseif(UNIX)
22+
target_link_libraries(opencvblobslibExample ${CMAKE_THREAD_LIBS_INIT})
23+
message("Linked " ${CMAKE_THREAD_LIBS_INIT})
2124
endif()
2225

2326
#I copy the images needed for the example to run

0 commit comments

Comments
 (0)