在Eclipse CDT共享是构建不同的项目资源文件夹 [英] In Eclipse CDT shared resource folder that is built differently for the project

查看:128
本文介绍了在Eclipse CDT共享是构建不同的项目资源文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Eclipse项目Ç将所有引用code(.c和.h文件在同一文件夹混合)的一个共享的基础,但将受到不同建立了code的在每个项目的基础。

I have a set of Eclipse c projects that will all refer to a common shared base of code (a mix of .c and .h files in the same folder) but will be built that code differently on a per project basis.

共同code基可以从每个项目中进行编辑,但这些编辑将是修复跨所有项目进行。常见的code将每个项目没有发散,除了通过定义构建选项。

The common code base may be edited from within each project but these edits will be fixes to be carried across all the projects. The common code will no diverge per project except for build options through defines.

如果我创建一个项目为这个图书馆就意味着库的构建与是不是我所需要的。我需要所产生的对象文件,他们正在建设的项目土地。因此,一个C / C ++项目就没有意义了。

If I create a project for this library it implies a library build with is not what I need. I need the resulting object files to land in the project that they are being built for. So a c/c++ project does not make sense.

共同code将在一个颠覆回购进行检查(如将每一个项目)。我可以使用。新建文件夹 - >链接的资源,但我会preFER保持独立项目的目录结构开发商碰巧使用的

The common code will be checked in to a subversion repo (as will each project). I could use "New folder -> Linked resource" but I would prefer to keep the projects independent of the directory structure the developer happens to be using.

有没有干净的方式做到这一点?

Is there a clean way to do this?

感谢。

推荐答案

我不知道这会为您的Eclipse版本工作,或CDT(我与Java测试过),但似乎你应该创建一个第二源文件夹。由于源文件夹通常是私有的它存在于这个项目,你必须创建一个链接文件夹...(从上面的介绍我想也许你已经这样做了,但对于答案的完整性,我包括以下步骤)。

I'm not sure this will work for your version of Eclipse, or for CDT (I tested it with Java), but it seems you should create a second source folder. Since a source folder are usually private to the project it exists in, you have to create a linked folder... (from your description above I think perhaps you've already done that, but for completeness of the answer I include the steps below).

我就是这么做的:


  1. 在项目中创建一个新项目

  2. 选择文件夹(不是一个源文件夹,但一个简单的文件夹)

  3. 在文件夹中创建对话框中单击高级>>按钮,然后选中Link在文件系统文件夹复选框

  4. 单击浏览,选择的共源文件的文件夹

  5. 单击Finish(完成)

您现在有一个简单的文件夹,但为了在您的汇编文件夹中的文件(至少在Java中是这样工作的),你需要创建一个源文件夹:

You now have a simple folder, but in order to include the files in the folder in your compilation (at least in Java it works this way) you need to create a source folder:


  1. 在项目中创建一个新项目

  2. 选择Source文件夹

  3. 单击浏览旁边的文​​件夹名称文本框中

  4. 选择您的新创建的链接文件夹

现在,在我的Eclipse版本,并在Java中,这个文件夹包括在code编译。它希望以同样的方式在CDT ...

Now, in my version of Eclipse, and in Java, this folder is included in compilation of the code. It hopefully works the same way in CDT...

如果您运行与真正的符号链接的操作系统(Linux操作系统,OSX?),你也可以使用一个符号链接文件夹中的项目进行额外的源文件夹,然后你应该能够只是做源文件夹-creation上面的步骤。

If you run an OS with real symbolic links (Linux, OSX?) you may also use a symlinked folder in your project for the extra source folder, and then you should be able to just do the "Source folder"-creation steps above.

如果您的Eclipse版本没有源文件夹中创建对话框一个浏览按钮上,尽量只在文本框中键入相同的名称。

If your version of Eclipse do not have a "Browse"-button in the Source Folder creation dialog, try just typing the same name in the text box.

问候,

/ E

这篇关于在Eclipse CDT共享是构建不同的项目资源文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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