[vtk-developers] And one include to rule them all

Brad King brad.king at kitware.com
Tue Sep 4 11:59:29 EDT 2012


On 09/01/2012 04:35 PM, David Thompson wrote:
> We had talked about simplifying the list of include directives VTK 6 passes to the compiler.

Since CMake added support for response files for passing -I
options to the compiler I wasn't aware of more problems with
the current approach.  The wrappers use response files too.

>     #include "vtkDataArray.h"
> 
> would get modified to
> 
>     #include "Common/Core/vtkDataArray.h"

This approach has at least the following drawbacks:

(1) Authors can accidentally include headers from modules on
which no dependency has been declared and it will compile.
We would need to teach HeaderTest to check such dependencies.

(2) It requires changing the install tree layout to duplicate
the source layout.  This also requires applications to have a
specific directory in their -I path because headers will not
be able to include their dependencies from the same directory
with simple #include "" syntax.

(3) Application code will have to be changed to use this style
also because the headers will have been re-arranged in (2).
Otherwise they will now need the extensive list of module
directories in their -I path instead of just the one install
tree location.

-Brad



More information about the vtk-developers mailing list