在 Xcode GUI 中指定构建操作(例如安装)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5136172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Specifying a build action (e.g. install) in Xcode GUI
提问by MHC
Is it possible to specify a build action, for example install
using Xcode GUI?
是否可以指定构建操作,例如install
使用 Xcode GUI?
I can do
我可以
xcodebuild install
from the command line but can't find a key ACTION in the build settings in the GUI menu, or any relevant menu items.
从命令行,但在 GUI 菜单或任何相关菜单项的构建设置中找不到关键操作。
回答by MHC
I figured that if I set both Deployment Location(DEPLOYMENT_LOCATION) and Deployment Postprocessing(DEPLOYMENT_POSTPROCESSING), then the build process installs the product and also copies public/private headers. Setting DeploymentPostprocessingis required no matter what the actual postprocessing is.
我想如果我同时设置部署位置(DEPLOYMENT_LOCATION) 和部署后处理(DEPLOYMENT_POSTPROCESSING),那么构建过程会安装产品并复制公共/私有标头。无论实际的后处理是什么,都需要设置DeploymentPostprocessing。
Also, both Installation Directory(INSTALL_PATH) and Public/Private Headers Folder Path(PUBLIC/PRIVATE_HEADERS_FOLDER_PATH) are assumed to be under Installation Build Products Location(DST_ROOT), so the product and headers will be located there.
此外,假定安装目录(INSTALL_PATH) 和公共/私有头文件夹路径(PUBLIC/PRIVATE_HEADERS_FOLDER_PATH) 都位于安装构建产品位置(DST_ROOT) 下,因此产品和头将位于那里。
One thing that bothers me is that Installation Directoryshould start with "/
" in order to correctly appended to DST_ROOT. For example, if DST_ROOT is /myDistributionRoot/
and INSTALL_PATH is lib/
, then the destination directory becomes /myDistributionRootlib
, not /myDistributionRoot/lib
.
困扰我的一件事是安装目录应该以“ /
”开头,以便正确附加到 DST_ROOT。例如,如果 DST_ROOT 是/myDistributionRoot/
并且 INSTALL_PATH 是lib/
,则目标目录变为/myDistributionRootlib
,而不是/myDistributionRoot/lib
。