J.N.
J.N.

Reputation: 8421

Eclipse CDT convert a "normal folder" to a "source folder" or vice versa

Because of me not being used to Eclipse I have projects whose subfolders are mixed "source" and "normal" folders. This is not much of a problem since those are Makefile projects but it bothers me to have my folders not being listed alphabetically (the source folders are displayed first).

I would like to convert my "normal" folders to "source" folders but I can't find anything related in the right click menu on said folders nor in the "properties" window.

Is there a way to convert folder types that doesn't involve editing the .cproject file manually ? If not, can I just edit the sourceEntries tag (it seems to work so far) ?

I am using CDT 8.0.2.

Upvotes: 12

Views: 13099

Answers (3)

bkepley
bkepley

Reputation: 81

In Eclipse 2022-12, Right click on the project then New->Source folder and select the folder.

Upvotes: 1

Edgard Leal
Edgard Leal

Reputation: 2720

Right click on the folder, "BuildPath" and "Use as Source Folder"

Upvotes: 11

In order to do this in Eclipse, you should get in your project's properties, then expand C/C++ general -> Paths and Symbols -> Sources tab

Then click the Add Folder button, and choose the normal folders you wish to include as "source" folders.

Upvotes: 17

Related Questions