使用包括相邻的CMake的子项目 [英] Use includes of adjacent subproject in cmake
问题描述
我开发出包括几个共享库的项目,并与CMake的构建。
每个库通过 add_subdirectory建()
。
I develop a project which consisting of several shared libraries and build it with CMake.
Each library is built via add_subdirectory()
.
什么是拳头库的所有API头添加到第二的的CMakeLists.txt的最佳方式?
What is the best way to add all the API headers of the fist library to the CMakeLists.txt of the second?
推荐答案
恩code中的包括目标本身目录:
Encode the include directories in the target itself:
<一个href=\"http://www.cmake.org/cmake/help/git-master/manual/cmake-buildsystem.7.html#include-directories-and-usage-requirements\">http://www.cmake.org/cmake/help/git-master/manual/cmake-buildsystem.7.html#include-directories-and-usage-requirements
这是商务部新,但由于CMake的2.8.11的target_include_directories命令存在。与接口或PUBLIC选项一起使用。
That doc is new, but the target_include_directories command exists since CMake 2.8.11. Use it with the INTERFACE or PUBLIC option.
这篇关于使用包括相邻的CMake的子项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!