On Jun 17, 2005, at 11:15 AM, Dix Lorenz wrote: I've finally got my projects to build well in Xcode 2.1, using build configurations, project-wide xcconfig-files and generally cleaning up the mess from maintaining projects over the years. Mainly I managed to get around bugs in Xcode, I hope they will be fixed soon (bugs are filed, more to come).
What I still don't get (and which is hardly documented) is what xcodebuild exactly does. Especially: what does "install" do? I guess it inherently sets some flags ("Deployment location"? "Deployment Postprocessing"? Anything else?). How exactly does it determine where to install the binaries? I have one project where I have set the "Release" Configuration to have an Installation Directory of "/dldev/bin". That setting is not overridden in my targets, but xcodebuild installs in ".../Uninstalled Products". Only when I also set this same setting in the target it installs where it's supposed to install.
The xcodebuild tool is a corollary to the traditional Unix 'make' tool. It's utterly familiar if you've used make all your life, and completely foreign if you've used CodeWarrior or other pure-IDE solutions.
There are four actions. Build and Clean are just like the corresponding actions in the Xcode IDE. install and installsrc are administrative actions used to prepare products for distribution. They often involve steps that require administrator privileges or want to be run on a central build machine, which is why they're not available in the IDE.
The install action sets DEPLOYMENT_POSTPROCESSING to YES so the three deployment tasks (install in DSTROOT, strip executables, and set permissions) take place. (You can set this yourself in the project or target configuration for the Release build configuration and get the same results, but you have to make sure that you have administrator privileges to do these actions). The Installation Build Products Location (DSTROOT) is usually passed in a command-line argument to xcodebuild, and is / for installation on the running system, or some temporary place in preparation for creating a root that will be used in PackageMaker.
So if you want the IDE to "build and put the executable where it belongs," check Deployment Postprocessing and Deployment Location, set Installation Build Products Location to / , and Installation Directory to the place you want your executables to be installed.
Chris |