Skip to content

Commit

Permalink
examples: data_collect: CMakeLists.txt: Link with pthread
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Togorean <[email protected]>
  • Loading branch information
btogorean committed Oct 27, 2022
1 parent 09b2f65 commit 9bf67c4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/data_collect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD
COMMENT "Copying cfgs and libs to build examples "
)

if (NOT WIN32)
find_library(PTHREAD_LIBRARIES pthread)
if (PTHREAD_LIBRARIES)
target_link_libraries(${PROJECT_NAME} PRIVATE ${PTHREAD_LIBRARIES})
else()
message(FATAL_ERROR "pthread libraries not found!")
endif()
endif()

if( WIN32 )
add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBTOFI_LIBDIR_PATH} $<TARGET_FILE_DIR:${PROJECT_NAME}>/.
Expand Down

0 comments on commit 9bf67c4

Please sign in to comment.