我看了这篇文章: Using CMake to statically link to a library outside the project 。但我仍然无法解释这意味着什么:
add_subdirectory(/path/to/the/library/source/directory subproject/grzeslib)
我假设“/path/to/the/library/source/directory”是指硬盘驱动器的路径,但我不明白“subproject/grzeslib”是什么意思。现在我尝试了:
include_directories(../path/to/dir)
add_subdirectory (../path/to/dir .)
但我收到了一个详细的警告。有一个更好的方法吗?
原文由 user3063750 发布,翻译遵循 CC BY-SA 4.0 许可协议
第二个参数是该子目录中目标结果的输出目录。
从这里的文档: https ://cmake.org/cmake/help/v3.3/command/add_subdirectory.html