Is it possible to automatically generate Xcode projects?

Simple question. Are there any tools for generating Xcode projects from the command line? We use SCons to build our cross-platform application, but this does not support Xcode's inline code development. We would like to avoid creating a project manually, because it involves maintaining multiple file lists.

+6
xcode scons
source share
7 answers

I think your question should be "Is there a way to generate an Xcode project from one SCons?". I believe, at your request and, reading others, the answer is "no."

SCons people need to know this better. I think they will be happy if you introduce the SCons Xcode project generator.

In the meantime, you can switch to CMake or manually create an Xcode project, which, given the good organization of the source tree, might be the best pragmatic solution.

+1
source share

Take a look at CMake . You can automatically generate Xcode projects. I found a previous StackOverflow question about using it here . To get it to create an Xcode project, you use it as such:

CMake -G xcode 
+4
source share

You can use premake ( http://industriousone.com/premake ) to generate Xcode projects. He can also create Visual Studio projects.

+3
source share

qmake in the Qt toolchain generates Xcode projects. You can at least download it and look at its source here (LGPL).

+1
source share

In the interest of anyone who lands on this question, Ive actually just clicked on the Xcode project file generator for SCons before Bitbucket.

+1
source share

You can create an Xcode project using a python-based build system called waf . You need to download and install waf with the xcode6 extension:

 $ curl -o waf-1.9.7.tar.bz2 https://waf.io/waf-1.9.7.tar.bz2 $ tar xjvf waf-1.9.7.tar.bz2 $ cd waf-1.9.7 $ ./waf-light --tools=xcode6 

This will create a waf that your project can create. You need to set up a way to create an wscript project inside a file called wscript , which should be in the project folder. The wscript file uses Python syntax. Here is an example of how you can customize your project:

 def configure(conf): # Use environment variables to set default project configuration # settings conf.env.FRAMEWORK_VERSION = '1.0' conf.env.ARCHS = 'x86_64' # This must be called at the end of configure() conf.load('xcode6') # This will build a XCode project with one target with type 'framework' def build(bld): bld.load('xcode6') bld.framework( includes='include', # Specify source files. # This will become the groups (folders) inside XCode. # Pass a dictionary to group by name. Use a list to add everything in one source_files={ 'MyLibSource': bld.path.ant_glob('src/MyLib/*.cpp|*.m|*.mm'), 'Include': bld.path.ant_glob(incl=['include/MyLib/*.h', 'include'], dir=True) }, # export_headers will put the files in the # 'Header Build Phase' in Xcode - ie tell XCode to ship them with your .framework export_headers=bld.path.ant_glob(incl=['include/MyLib/*.h', 'include/MyLib/SupportLib'], dir=True), target='MyLib', install='~/Library/Frameworks' ) 

There are many settings that you can use to configure it for your project.

Then to actually create the Xcode cd project in your project folder where wscript is and it will run your waf , for example

 $ ./waf configure xcode6 
0
source share

You can use Automator to generate them for you.

I checked and there is no ready action. Therefore, you will need to record your actions using Automator for this.

-one
source share

All Articles