c++ - 如何在cmake中链接第三方库
问题描述
我目前正在使用选择 CMake 作为构建系统的项目。尽管如此,我对 CMake 并不是很熟悉。我花了很多时间在包括第三方库上,结果不是很喜欢。有人可以提供一种方法来解决我的情况吗?
我的项目树在以下部分中给出:
|--->top-Level
|--->ThirdLib
|------>Lib1
|---------->DLL
|---------->Include
|---------->LIB
|------>Lib2
|---------->DLL
|---------->Include
|---------->LIB
|--->UseThirdLib
|----->test.h //this file will used third-part lib
解决方案
看来你需要一些基本的cmake教程?
https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20a%20Library.html
target_include_directories
target_link_libraries
推荐阅读
- nlp - 如何调整神经核以获得更好的共指结果?
- java - 如何在有状态会话 bean 上下文查找期间定义名称?
- gatsby - webpack-runtime js 文件得到 404
- r - 如何在 R 版本 3.5.3 中将使用 tab_df 函数(sjPlot 库)制作的表格导出为 png 文档
- javascript - 如果第一个 fetch 调用没有返回数据,如何添加条件来调用第二个 fetch?
- python - 如何编辑熊猫数据框中的行?
- r - 在 MAC 上的 R 中安装 Rcplex 时出错
- r - 等效于 Stata 的 egen group() 函数
- json - 使用 Swift Codable 解析 Reddit JSON
- android - 如何将字符串资源分配给 kotlin 值而不会出错