cmake Xcode生成器创建一个无法构建的项目 [英] cmake Xcode generator creates a project that cannot build

查看:279
本文介绍了cmake Xcode生成器创建一个无法构建的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试找到我的问题的答案一段时间后,我决定询问是否有人有同样的问题。



我有一个c ++项目,使用cmake构建系统。我使用Macbook Pro开发,所以当我使用终端一切都像一个魅力,我可以建立我的项目。



然而,今天我发现,使用cmake生成器创建相应项目后使用Xcode:

  $> cmake -G Xcode。 

它工作的项目,它看起来不错,除了我不能构建任何东西。它无法识别包含文件中包含的符号。有谁知道这是为什么吗?看起来好像cmake环境变量没有传递给Xcode。



任何人都可以指向正确的方向?

解决方案

舍弃点(。 )在命令调用中,只剩下 cmake -G Xcode 。当我第一次使用CMake,我也生成Xcode项目,不会构建。我使用CMake的交互式向导UI,这导致了一个伤害的世界。由于经常发生,使用最简单的命令通常是要走的路。一旦我停止使用向导并使用默认值,我得到一个可靠建立的Xcode项目。


After trying to find an answer to my problem for some time I decided to ask to see if someone had the same problem.

I have a c++ project that uses the cmake build system. I use a Macbook Pro for development, so when I use the terminal everything works like a charm and I can build my project.

However, today I found out that I could use Xcode after creating the respective project using the cmake generator:

$> cmake -G Xcode .

It works the project and it looks fine, except for the fact that I can't build anything. It doesn't recognize symbols included from included files. Does anyone know why is this? It seems as if the cmake environmental variables are not passed to Xcode.

Can anyone point me in the right direction? Thank you all,

aa

解决方案

Omit the dot (.) in your command invocation, leaving just cmake -G Xcode. When I first started using CMake, I also was generating Xcode projects that would not build. I was using CMake's interactive wizard UI, which led to a world of hurt. As often happens, using the simplest command is often the way to go. Once I stopped using the wizard and just using the defaults, I got an Xcode project that builds reliably.

这篇关于cmake Xcode生成器创建一个无法构建的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆