首页 > 解决方案 > 如何在cmake中链接第三方库

问题描述

我目前正在使用选择 CMake 作为构建系统的项目。尽管如此,我对 CMake 并不是很熟悉。我花了很多时间在包括第三方库上,结果不是很喜欢。有人可以提供一种方法来解决我的情况吗?

我的项目树在以下部分中给出:

|--->top-Level
|--->ThirdLib
|------>Lib1
|---------->DLL
|---------->Include
|---------->LIB
|------>Lib2
|---------->DLL
|---------->Include
|---------->LIB
|--->UseThirdLib
|----->test.h                  //this file will used third-part lib

标签: c++cmake

解决方案


看来你需要一些基本的cmake教程?

https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20a%20Library.html

target_include_directories

target_link_libraries


推荐阅读