私はC++ 11で書いていますが、何らかの理由でgccをコンパイルすることができなかったため、XCodeを使用しています。ただし、コマンド ラインから引数を取るプログラムを作成しているため、シェルから実行できるようにする必要があります。現在、XCode は、コンパイルしたバイナリを奥深くて不便な場所 (/Users/username/Library/Developer/XCode/DerivedData/ProjectName/Build/Products/Debug/... ヤバイ!) に埋めています。より適切な場所を指定できるようにしたいと考えています。別の名前も指定できる可能性があります。XCode 4.5.2 を使用しています。誰でもこれで私を助けることができますか?
3 に答える
You can configure this once globally for all projects in the Xcode preferences:
"Xcode" Menu -> "Preferences..." -> "Locations" Tab -> "Advanced..." Button
Or you can change it per project. Just open a project, select one of the project windows and then:
"File" Menu -> "Project Settings..." -> "Advanced..."
Unless otherwise configured, new projects use the defaults you have configured in the global Xcode prefs, but you may want to override them for individual projects.
Note that if you select "Legacy", Xcode will place them by default into the folder where the Xcode project itself is located, but "Legacy" also allows you to specify the location using build settings, thus you can even set different locations per target. The project settings are named Build Products Path
and Intermediate Build Files Path
. If you are not in "Legacy" mode (either by setting it on the project or globally for all projects), these two build settings have no effect and are entirely ignored.
Also note that when you build Xcode projects on command line using xcodebuild
, they are always built in legacy mode, regardless what you configured in Xcode or in the project settings. This is useful, since it allows you to override the output location from command line by overriding the two projects settings I mentioned above. This can be either done in a xcconfig
file, just tell xcodebuild
to read config from such a file (-xcconfig <filename>
) or it can be done directly on the command line by adding <setting>=<value>
as an argument at the end of the xcodebuild
call. When specified in a xcconfig
file or via command line, the two settings are named SYMROOT
(=Build Products Path
) and OBJROOT
(=Intermediate Build Files Path
).
場所は、[設定]->[場所]で指定できます。私は使用します~/tmp
:
または、Xcode では、[ビルド フェーズ] に移動し、[新しいビルド フェーズを追加] に移動して、[新しい実行スクリプト フェーズ] を選択することもできます。次に、のようなスクリプトを追加するだけcp /path/to/build/products/productname /path/to/where/you/want/to/copy/newproductname
です。cp
コマンド ラインコピーコマンドです。これは、ビルド製品を必要な場所に配置するための優れたクリーンな方法です。