尝试从cmake文件夹生成Xcode项目时,出现与Xcode新构建系统相关的错误。

10

我正在尝试使用这个很好的答案,从一个cmake文件夹生成Xcode项目。当执行这个命令时:

cmake -G Xcode <dir of CMakeLists.txt>
我理解为:

我明白了:

CMake Error in CMakeLists.txt:
  The custom command generating

    /Users/fofo/Developer/ClientProject/desktop/always_build

  is attached to multiple targets:

    rake-all
    stage

  but none of these is a common dependency of the other(s).  This is not
  allowed by the Xcode "new build system".


CMake Generate step failed.  Build files cannot be regenerated correctly.

我是否可以在cmake -G Xcode <CMakeLists.txt所在的目录>中指定使用旧版Xcode构建系统,或者我是否可以通过更改cmake文件来解决问题?

2个回答

17

我在这里找到了答案。可以使用以下方法使用传统的构建系统:

cmake -G Xcode -T buildsystem=1 .

2
Xcode 14不再支持旧的构建系统,因此随着Xcode 14的采用,这个解决方案将停止工作。 - neuralmer

0
这个修复方法在XCode 14.3.1仍然有效,所以我不确定他们何时会停止支持旧的构建系统...

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接