What exactly is the bad practice?
You should only add path's to include directories that are really required. Even such a complex framework as wx requires one (or two) includes. So settings up include path from a "root" including all sub-path's makes no sense in most cases. In fact it will lead in to trouble for sure some time in the future. Just one example scenario:
Imagine the following directory structure:
MyProject
- include
- lib_a_v1
- lib_a_v2
- lib_b
If you setup the include path's as required which maybe here:
1.)
include2.)
include\lib_a_v23.)
include\lib_bYou will never run into trouble, even though you have to setup 3 directories.
If you setup the path's recursively starting from "include" it will result in:
1.)
include2.) include\lib_a_v13.)
include\lib_a_v24.)
include\lib_bNow imagine the changes from
lib_a_v1 to
lib_a_v2 were an additional member in a structure. You won't receive any compilation errors when the first "definition file" (header files that defines the struct) is found in
lib_a_v1. This would be th case as the compiler would first find it there due to the order of the include command line switches (alphabetically) in this example case). Hence if you rely on
sizeof(mystruct) for any reason you compile possibly buggy code.
So *you* should ensure you always setup the right directories yourself, even if these are many and not leave it up to any IDE. In addition I have never seen any project that requires more then let's say 10 include directories. So it shouldn't be too hard to setup those step-by-step. However - That's only my personal opinion.
With regards, Morten.