[Insight-developers] CMake variables and preprocessor directives

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Feb 20 10:04:04 EST 2014


One of the features of the modular system, is that you can vary the modules includes and use in different directories/libraries which use ITK. For example you might include the testing module in your testing directory but not the main library.

This got me thinking perhaps an ideal/exemplar way to do this would be to add them as command line defines with some add_definition commands?

Although this would only work for interfaces which encapsulate parts of ITK, and does not expose those modules.

Thinking of alternatives, and best practices.
Brad


On Feb 20, 2014, at 9:52 AM, Brad King <brad.king at kitware.com> wrote:

> On 02/19/2014 03:08 PM, Padfield, Dirk R (GE Global Research) wrote:
>> This did not work, so I tried putting the same line in the
>> itkConfigure.h.in of my local project, but that didn't work either.
> 
> No central header in ITK lists all the modules because the set
> that is loaded is not known until the application calls the
> find_package(ITK) command.  It can specify a subset of modules.
> 
> You should configure it into a local header.  The line
> 
> #cmakedefine ITKReview_LOADED
> 
> should work with configure_file as long as it occurs after the
> find_package(ITK) call.  Local testing works for me.
> 
> -Brad
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers



More information about the Insight-developers mailing list