当目标是/usr/local/bin时如何在XCode中设置相对项目路径 [英] How to set relative project path in XCode when target is /usr/local/bin

查看:36
本文介绍了当目标是/usr/local/bin时如何在XCode中设置相对项目路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以将我的产品的 XCode 项目路径设置为相对路径,并从中访问其他项目的相对路径.但是,如果我想将我的产品安装到/usr/local/bin 并仍然访问项目相对路径,我该怎么做?

I can set my XCode project path for my Product to be relative and from that access other project relative paths. However, if I would like to install my Product to /usr/local/bin and still access project relative paths how do I do it?

我的项目布局是:

project/
-- Makefile
-- obj/
---- target .o files
-- python/
---- .py files
-- src/
---- C/C++ files incl headers

我希望我的产品位于/usr/local/bin 并访问我的 python 文件夹.

I want my Product to be at /usr/local/bin and also access my python folder.

谢谢.

推荐答案

我认为最好的答案是设置项目数据文件的绝对路径并从那里引用它们.然后可以为您的平台硬编码此路径.

I think the best answer is to set absolute paths to your project data files and refer to them from there. This path can then be hardcoded for your platform.

应用程序数据的存储位置(非用户特定)在 Linux 上

这篇关于当目标是/usr/local/bin时如何在XCode中设置相对项目路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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