User forums > Using Code::Blocks
Project build options / Search directories
bnilsson:
Hi!
Is there any way to make Compiler / "Search directories" go into subdirectories?
If the sources are structured in subfolders, there may be a lot of entries.
MortenMacFly:
--- Quote from: bnilsson on July 09, 2007, 10:37:06 am ---Is there any way to make Compiler / "Search directories" go into subdirectories?
--- End quote ---
This depends on the compiler, but I don't know any compiler that supports such.
And if a compiler would support such this would be very bad programming.
With regards, Morten.
bnilsson:
--- Quote ---And if a compiler would support such this would be very bad programming.
--- End quote ---
Well, Codewarrior supports it (but you have the control to turn it off, of course! :)) and it is quite handy.
But this would be a feature of the IDE, not the compiler itself, the subject of this entry was misleading. As you can see, I changed the subject line, I hope this is not regarded as bad manners here.
Maybe a clickbox "Expand subdirectories" in the "Project build options / Search Directories / Add" that would add the directory and all its subdirectories into the list.
That would not put any special requirements of the compiler.
Personally, I would appreciate such a feature, but maybe I am the only one.
dmoore:
bnilsson: setting up c++ projects with a heavily nested structure of #includes sounds like a mess and is likely to create problems for you in the long run. even the biggest libraries shouldn't need multiple levels of nested subfolders of includes.
the more standard use of sub-folders is to create a pseudo-#include namespace to avoid #include-ing identical filenames for commonly used header names and to create logical groupings of functionality (e.g. wxWidgets puts all of its standard headers in <install-path>/include/wx, but you are only supposed to use <install-path>/include as the search path and then #include <wx/window.h> etc). Also keep in mind the you can create headers whose sole purpose is to #include a collection of commonly used headers (e.g. Code::Blocks own sdk_common.h)
MortenMacFly:
Coming back to the compiler: I thought you mean something like a "-IR" command line switch for recursive includes or something (I'm aware that it can't be that easy).
--- Quote from: bnilsson on July 09, 2007, 12:36:28 pm ---Maybe a clickbox "Expand subdirectories" in the "Project build options / Search Directories / Add" that would add the directory and all its subdirectories into the list.
--- End quote ---
Hence you obviously mean the GUI part. For this I agree with dmoore here. Adding such a feature is no problem at all. But the use of such would be really error prone for several reasons. You may want to add a feature request for this to BerliOS so that the dev's can discuss it. But from my point of view I'd say it's unlikely that this feature would be implemented... such "feature" is actually "bad practice".
With regards, Morten.
Navigation
[0] Message Index
[#] Next page
Go to full version