简体   繁体   English

CMake Xcode在问题导航器中使用错误的文件

[英]CMake Xcode using wrong files in Issue Navigator

I generate an Xcode project from CMake that builds a static library and test executable. 我从CMake生成了一个Xcode项目,该项目构建了一个静态库并测试了可执行文件。

After the library is built, there is a file copy operation that moves the headers to a central directory (an include folder next to the built library). 构建库之后,将执行文件复制操作,将标头移动到中央目录(已构建库旁边的include文件夹)。

This directory is not listed in the header search paths for either project (I have verified this inside the Xcode project and CMakeLists files). 该目录未在任何一个项目的标题搜索路径中列出(我已经在Xcode项目和CMakeLists文件中验证了此目录)。

When I am working in the generated Xcode project, the Issue Navigator will open the files in the central directory instead of the files used to build the project. 当我在生成的Xcode项目中工作时,问题导航器将在中央目录中打开文件,而不是用于构建项目的文件。

Can anyone tell me why this happens and how I can fix it? 谁能告诉我为什么会这样以及如何解决?

Thanks for your help. 谢谢你的帮助。

Use a separate build directory. 使用一个单独的构建目录。 Create a new directory. 创建一个新目录。 Navigate to that in terminal and say : 导航到终端中的内容,然后说:

cmake -G Xcode <path_to_source>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM