Xcode4 project with custom configuration name versus Debug / Release dependency library?

I have an Xcode application project with the available configurations "Foo", "Bar" and "Baz". This project depends on a static library with the Debug and Release configurations.

Xcode4 creates products from the application project into the Foo-iphoneos directory and products from the library project into the Release-iphoneos directory.

What is the best practice for these two projects to use the same build product catalog?

+6
iphone xcode xcode4 project
source share
3 answers

You can add the following path to the library search path for any custom configuration:

"$(BUILT_PRODUCTS_DIR)/../Release-$(PLATFORM_NAME)" 

This works for me with xcode 4.6. I'm not sure if there is a way to control which configuration will be built for dependent sibling projects, but for my purposes, Release was what I wanted.

+1
source share

One solution is that if your dependent projects have the same configuration names, such as the main project (for example, Foo, Bar, Baz), then Xcode will match them and build using the same configuration.

So, if you need a debug build instead of a release build, you can duplicate the Debug configuration and call it Foo. If you really do not need both options, you can rename the configuration rather than duplicate it, but with example names like Foo, I'm not sure what would make sense for your situation.

However, the title mentions Xcode 4. The technique described above is what I used in Xcode 3; I have not figured out how to manage these configurations yet in Xcode 4. I'm trying to figure it out now.

Update. To manage configurations in Xcode 4, you can click the name of your project or dependent project at the top of the project navigator (where all your files / folders are listed on the left). In the main window, select "Information" (on another tab "Build Settings"). Then you will see the “Configuration” section, in which you can add / delete / rename your configurations.

0
source share

I found that if the configurations of your goals and dependencies do not match, then the dependencies will be built with the Release configuration.

I could not find a way to configure this.

0
source share

All Articles