是否可以通过环境变量获取 Xcode 4 中的工作区路径 [英] Is it possible to acquire the workspace path in Xcode 4 via an environment variable

查看:33
本文介绍了是否可以通过环境变量获取 Xcode 4 中的工作区路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Xcode 构建设置参考.

基本上我需要像 $(WORKSPACE_DIR) 这样的东西.如果 Xcode 不提供它,是否有任何方法可以定义一个自定义用户变量,以便在工作工作区移动(想想分支等)的情况下以某种方式准确地提供工作区路径?

Essentially I need something like $(WORKSPACE_DIR). If Xcode doesn't provide it, is there any way to define a custom user variable that could somehow accurately provide the workspace path in the event that the working workspace were to move (think branches etc)?

推荐答案

可以在构建设置下定义自定义变量.我认为有一个名为 Add Build Setting 的按钮.因此,可以相对于 SRCROOT 或使用绝对路径定义一个新的变量工作区根.

Custom variables can be defined under build settings. I think there is a button named Add Build Setting. So, a new variable workspace root can be defined relative to the SRCROOT or use absolute path.

新设置显示在构建设置中的用户定义"组下.添加构建设置"按钮位于右下角附近.

The new setting is shown under "User Defined" group in build settings. "Add Build Setting" button is near lower right corner.

这篇关于是否可以通过环境变量获取 Xcode 4 中的工作区路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆