Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 CMake 生成 Xcode 项目时,它不会添加/usr/local/include到 Xcode 的标头搜索路径中。有没有办法在 CMake 构建文件中解决这个问题,而无需在每次生成项目时手动更改?
/usr/local/include
我发现这比我想象的要容易,因为我需要做的只是一个简单的:
include_directories(/usr/local/include)
为了可移植性,我最终选择了以下内容,尽管我不确定这是否对非 Linux 平台有很大帮助,无论如何:
include_directories(${CMAKE_INSTALL_PREFIX}/include)