gpt4 book ai didi

api - 在 cmake 中使用包括相邻子项目

转载 作者:行者123 更新时间:2023-12-04 13:50:38 28 4
gpt4 key购买 nike

我开发了一个由多个共享库组成的项目,并使用 CMake 构建它。
每个库都是通过 add_subdirectory() 构建的.

将第一个库的所有 API header 添加到第二个的 CMakeLists.txt 的最佳方法是什么?

最佳答案

对目标本身中的包含目录进行编码:

http://www.cmake.org/cmake/help/git-master/manual/cmake-buildsystem.7.html#include-directories-and-usage-requirements

该文档是新的,但 target_include_directories 命令自 CMake 2.8.11 以来就存在。将它与 INTERFACE 或 PUBLIC 选项一起使用。

关于api - 在 cmake 中使用包括相邻子项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21440698/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com