User forums > Using Code::Blocks

add a directory to the browser without specifing each single file

<< < (2/2)

MortenMacFly:

--- Quote from: mattn2 on October 15, 2012, 12:57:06 pm ---but nothing more pops up in the wiki or the forum.

--- End quote ---
Its a power user feature that has no UI support (yet). It was introduced with the 25 August 2012 nightly build,more precisely in revision 8233:

--- Quote ---* added power user support for units glob feature (these are directory paths that can be specified, and all files in there will be considered as sources for the project. This can be based on a wildcard for the * file types, and can be recursive. When no wildcard is specified (empty) the default CB wildcard for adding files is used.

--- End quote ---
http://preview.tinyurl.com/8lrwz29
It adds another project file entry "UnitsGlob", which "are directory paths that can be specified, and all files in there will be considered as sources for the project. This can be based on a wildcard for the file types, and can be recursive. When no wildcard is specified (empty) the default CB wildcard for adding files is used".

You either try to understand from the changes or wait until killerbot enlighten you, maybe. I don't know how busy he is atm...

mattn2:
thanks a lot for the link
i will try it with this asap:  <UnitsGlob directory="src" wildcard="*.cpp" recursive="1" />

killerbot:
ring ring   ;D

There's no GUI for it (yet), but I have been using it for 2 months now, and no problems discovered.
How does it work :
- you specify which directories should be searched for source files
- recursively or not
- you can specify a pattern/wildcard (by default it uses the same wildcard as CB uses when you add files recursively to a project through the gui)

New file in the directory are only picked up when the project is loaded, so you might need to reload the project (workspace) [we don't have a project reload command (??yet??)], or you can later on extra files to the project as in the past. At save time of the project extra added files that are actually covered by the glob entries will be removed as separate unit entries since the glob covers them.

Limitations : this is more or less an "all are equal approach", the moment you specify specific build options per file, there might be inconsistencies, and more business logic, or user feedback will be needed.
But if you can live with the "all are equal" approach this feature rocks  8)

Typical examples :

--- Code: ---<UnitsGlob directory="src" recursive="1" />
<UnitsGlob directory="include" recursive="1" />

--- End code ---

MortenMacFly:

--- Quote from: killerbot on October 25, 2012, 11:00:58 pm ---ring ring   ;D

--- End quote ---
Should this make it into the WiKi at least?

Navigation

[0] Message Index

[*] Previous page

Go to full version