[Insight-developers] Module include directories and IDE

Brad King brad.king at kitware.com
Thu Mar 31 17:35:43 EDT 2011


On 03/31/2011 04:44 PM, Arnaud GELAS wrote:
> For modules that have libraries, sources already show up in IDEs.
> I am interested in showing *.h and *.txx...

I know.  I was saying that we need a target in which to put them.  For
those with libraries the library targets work for that.  For those without
libraries we need another place.

> A hack is to add these files in the list of files to be compiled when
> building tests; but that's not very clean... Is there any other way?

Currently every module has an "all" target that gets added for purposes
of the modularized dashboard testing.  We can take advantage of this
feature added in CMake 2.8.0:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c5f70ff2

Essentially one can do:

  add_custom_target(... SOURCES any.c sources.h)

and the source files will be listed in the IDE but won't build in that
target.

We can use this to list all the sources in a module in it's "all" target.
Advantages:

 - It is a consistent place to look for sources of a module in the IDE
 - It gives a real reason to have the "all" targets for non-dashboard builds
 - It can be generated automatically with a little bit of tweaking to
   the modular infrastructure

I will investigate further when I get a chance.

-Brad


More information about the Insight-developers mailing list