views:

221

answers:

3

We have a topdirectory containing code for lots of different projects. I would like to create an Eclipse CDT-project that contains only the source needed to work on and compile a specific project. I used SlickEdit before, and there I could just import a list of sources and headers. Is it possible to achieve something similar in Eclipse?

A: 

So far as I know, you can not do that. What you can do is import these source files into another project, which means these file will be copied to that created project.

arsane
I want the files to remain where they are, since they are version controlled and also used on other projects.
anr78
A: 

Traditionally, Eclipse assumes that the .project file is at the top-level directory of your project's sources and all the source code below it is included in the project. However, I think that you should be able to use linked folders so that you have a Eclipse project directory which is basically empty but for a .project file and a linked folder which points to your source tree. I do not think however that you can explicitly list the files to include in the project.

EDIT: if you do find a solution to this, please let me know.

JesperE
+1  A: 

In Eclipse, you can selectively import certain directories to be included in the project.

You can create an eclipse project somewhere else in your drive, and then create links only to the folders that you want in your original location (these are called "linked resources" in Eclipse)

You can also use the linked resource strategy for an entire project (I mean an Eclipse project, not your top-level project). For example, if your folder hierarchy is as follows:

/top-level
/top-level/projectA
/top-level/projectA/subProjectA
/top-level/projectB

You can create an eclipse workspace at location /my-workspace, create a project called subProjectA and have it linked to /top-level/projectA/subProjectA. You can do the same for projectB and they will appear in your Eclipse workspace as if they are side-by-side in a flat hierarchy.

Yoni