Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When trying to generate an Xcode project from a cmake folder, I get an error related to Xcode new build system. Any possible solution?

Tags:

xcode

cmake

I am trying to generate an Xcode project from a cmake folder, using this very good answer. When executing this command:

cmake -G Xcode <dir of CMakeLists.txt>

I get:

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.

Can I somehow specify to cmake -G Xcode to use the old Xcode build system, or can I somehow solve the problem changing the cmake files ? Any help is greatly appreciated. Thanks

like image 324
Alfonso Tesauro Avatar asked Dec 28 '20 05:12

Alfonso Tesauro


People also ask

What is new build system in Xcode?

Xcode 10 uses a new build system. The new build system provides improved reliability and build performance, and it catches project configuration problems that the legacy build system does not.


Video Answer


1 Answers

I have found the answer here. It is possible to use the legacy build system using:

cmake -G Xcode -T buildsystem=1 .

Thanks a lot for your attention.

like image 195
Alfonso Tesauro Avatar answered Oct 19 '22 13:10

Alfonso Tesauro