在CMake中,我们使用TARGET_LINK_LIBRARIES()将共享库链接到库/可执行文件.
For example:
TARGET_LINK_LIBRARIES(ExecutableName xxx)
where ExecutableName - is the name of executable
xxx - is the library name.
Run Code Online (Sandbox Code Playgroud)
据我所知,CMake在LINK_DIRECTORIES()宏中提到的路径中搜索"libxxx.so".但是如果我有一个名为"libxxx.a"的第三方库,那么如何使用CMake将库链接到可执行文件.
提前谢谢你的帮助!
cmake ×1