如何将 Xcode 项目类型从 Cocoa 框架转换为 Cocoa 应用程序?
请告诉我什么是最有效的方法?我需要至少保存编译器/链接器设置和源文件结构。
Please tell me what is the most efficient way? I need to save at least compiler / linker settings and source files structure.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
执行此操作的简单方法是将设置从目标/项目设置移动到 xcconfig 文件。然后,xcconfig 文件可以(重新)用于定义多个目标和/或项目的构建设置。为此:
为每个层、目标以及已定义设置的每个配置(例如 Project_Debug、Project_Release、Target_Debug、Target_Release)创建一个新的 xcconfig 文件,并对每个层/组合执行以下步骤:
,以使生活更轻松,您可以
#include
将一个 xcconfig 插入另一个 xcconfig。由于应用程序与框架不同,因此您将需要更改、删除一些设置或移回框架目标。
现在,不应在目标或项目级别中定义任何内容(除了特定于框架的内容),并且您可以轻松地将同一组构建设置应用于任何目标。
这里最简单的方法是:
在您的项目中创建一个新目标(是的 - 应用程序品种)。
对于框架中的每个构建阶段:
您可能需要首先克隆 Xcode 项目(就像使用 git 复制一样简单) )——并且一定要确保您的项目/源代码位于 scm 下。
如果您不想并行维护它们,则将其全部移至静态库,然后将每个目标链接到静态库。
祝你好运!
(这个问题最初是关于 Xcode 3 提出的 - Xcode 4 中会存在一些差异。Xcode 2 中的过程应该是相同的)
the easy way to do this is to move the settings from the target/project settings to an xcconfig file. the xcconfig file may then be (re)used to define the build settings for multiple targets and/or projects. to do this:
create a new xcconfig file for each tier, target, and each configuration where you have defined settings (e.g. Project_Debug, Project_Release, Target_Debug, Target_Release), and follow these steps for each tier/combination:
to make life easier, you may
#include
one xcconfig into another xcconfig.since an app is different from a framework, you'll have a few settings to change, delete, or move back to the framework target.
now nothing should be defined in the target or project levels (apart from your framework specific stuff), and you may easily apply the same set of build settings to any target.
the easiest way here is to:
create a new target in your project (yup - of the app variety).
for each build phase in the framework:
you may want to clone the Xcode project first (as easy as duplication with git) -- and definitely make sure you have your project/sources under scm.
if you'd rather not maintain these in parallel, then move it all over to a static library, then just link each target to the static lib.
gooood luck!
(the question was initially asked regarding Xcode 3 - some differences will exist in Xcode 4. the process should be the same in Xcode 2)