cmake add lib

target_link_libraries(target PRIVATE
    pthread
)

更多推荐