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

Marcus D. Hanwell marcus.hanwell at kitware.com
Sun Sep 2 13:21:17 EDT 2012


On Sat, Sep 1, 2012 at 4:35 PM, David Thompson
<david.thompson at kitware.com> wrote:
> Hi Marcus (et al.),
>
> We had talked about simplifying the list of include directives VTK 6 passes to the compiler. Attached is a ReadMe and a couple of Python scripts to walk through the VTK source tree and change all the include directives in the source so they contain the kit name. For example:
>
>     #include "vtkDataArray.h"
>
> would get modified to
>
>     #include "Common/Core/vtkDataArray.h"
>
> The ReadMe goes into a little more detail. I haven't tried altering CMakeLists.txt to change the list of include directives passed to the compiler yet (much less tried compiling), but figured people might have comments on things so far.
>
> The map that the first script builds should also be usable for external projects that include VTK.
>
Sounds good to me, but I was always in support of moving to something
like this. I think with a Python script like this to help others
change their code it should be pretty easy to port. I was also
looking, and we can do what other projects such as Qt do where the
found modules are added to the compiler's include path if the use file
is included, if not they would need to use the full path.

I will try running the script and see what it looks like, it would be
great to only have to add one or two lines to the compiler's include
path by default. I can probably expand out the CMake support to
preserve the directories on install, this would also have the major
advantage of removing many differences present when building against a
build or install tree.

Marcus



More information about the vtk-developers mailing list