且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CMake链接外部库

更新时间:2022-06-14 23:28:57

ADD_LIBRARY(LibsModule 
        file1.cpp
        file2.cpp
    )

然后将它们添加到模块调用 LibsModule

then add them to a module call LibsModule

target_link_libraries(LibsModule -lpthread)

请参阅此帖子:使用cmake添加库

作为建议,请在发帖前使用问类似问题",以避免投票不足或被关闭.欢呼

As an advice please use the "Similar Question Asked" before posting to avoid getting downvoted or being closed as duplicate. Cheer