# PortGroup xcode

`PortGroup xcode` allows for efficient porting of Xcode-based opensource software. A minimum Portfile for `PortGroup xcode` uses defaults for the configuration, build, and destroot phases. It also defines some values for Xcode-based software.

Using `PortGroup xcode` is a way to make your port able to tolerate Xcode version updates because the PortGroup is tested against all supported Mac OS X and Xcode versions.

## xcode PortGroup Specific Keywords

Portfiles using `PortGroup xcode` allow for port authors to set the following keywords in addition to the general Portfile keywords.

xcode.project

  The path relative to `${build.dir}` and `${destroot.dir}` of the Xcode project. If unset, let Xcode Tools should determine it automatically. It usually succeeds if there is a single project in the directory.

  - Type: optional

  - Default: none

  - Example:

        xcode.project ${name}.xcode

xcode.configuration

  Project configuration/buildstyle to use.

  - Type: optional

  - Default: `Deployment`

  - Example:

        xcode.configuration Main

xcode.target

  If present, it overrides `build.target` and `destroot.target`.

  - Type: optional

  - Default: none

  - Example:

        xcode.target ${name}

xcode.build.settings

  Additional settings passed to the xcode build tool during the build phase. These settings should be in the X=Y form.

  - Type: optional

  - Default: none

  - Example:

        xcode.build.settings FRAMEWORK_SEARCH_PATHS=${prefix}/Library/Frameworks

xcode.destroot.type

  Type of project that will be installed. This tells the xcode PortGroup how to destroot the project. Correct values are `application` and `framework`.

  - Type: optional

  - Default: `application`

  - Example:

        xcode.destroot.type framework

xcode.destroot.path

  Where to install the build product.

  - Type: optional

  - Default: `${prefix}/Library/Frameworks` or `/Applications/MacPorts` depending on `xcode.destroot.type`.

xcode.destroot.settings

  Additional settings passed to the xcode build tool during the destroot phase. These settings should be in the X=Y form.

  - Type: optional

  - Default: none

  - Example:

        xcode.destroot.settings SKIP_INSTALL=NO

xcode.universal.settings

  Settings passed to the xcode build tool when the +universal variant is selected. These settings should be in the X=Y form.

  - Type: optional

  - Default: `ARCHS="${universal_archs}" MACOSX_DEPLOYMENT_TARGET=${universal_target}`

xcode.universal.sdk

  SDK to use when the +universal variant is selected. The argument may be an absolute path to an SDK, or the canonical name of an SDK.

  - Type: optional

  - Default: `${universal_sysroot}`

## xcode PortGroup Sugar

Portfiles using the xcode PortGroup do not need to define the following variables:

categories

  Default: aqua

platforms

  Default: macosx

use_configure

  Default: no

## Portfile-Phase Keywords Affecting the xcode PortGroup

The following Portfile phase keywords affect the xcode PortGroup in a unique way. In most cases, you will not need to set any of these keywords in the Portfile. See portfile-phase 7

build.cmd

  Default: `${xcodebuildcmd}`.

build.target

  Default: ""

  This variable will be ignored if `xcode.target` is set.

build.args

  Default: `build`

destroot.cmd

  Default: `${xcodebuildcmd}`

destroot.target

  Default: ""

  This variable will be ignored if `xcode.target` is set.