Hi All,

I have a question about CMake variables and preprocessor directives.  I have a 
local project built using CMake that relies on ITK.  Some of the filters in 
this project rely on ITK filters that are in ITKReview.  I want to do the right 
thing in the CMake of my local project by checking for the ITKReview flag and 
then excluding all of my local filters that depend on ITKReview if the flag is 
not set.

This process worked fine when using "ITK_USE_REVIEW", but this flag has been 
deprecated now.  Xiaoxiao told me that the right flag to use is 
"ITKReview_LOADED" instead of "Module_ITKReview", and the CMake of my local 
project can now read successfully the "ITKReview_LOADED" flag.

However, I am still having trouble with a closely related question: is there a 
preprocessor directive for that flag as well?  For example, in my local project 
I have all of my tests in REGISTER_TEST commands in an AlgorithmsTests.cxx file 
(this is the same structure we used to have in ITK).  Here is the code:

#if defined(ITK_USE_REVIEW) || defined(ITKReview_LOADED) || 
defined(Module_ITKReview)
    REGISTER_TEST(MyTest);
#endif

However, this code is ignored even when I have the Module_ITKReview CMake 
variable set.  But if I link against a previous version of ITK with 
ITK_USE_REVIEW, it works!

Xiaoxiao pointed me to the #cmakedefine commands, and I noticed that in the 
itkConfigure.h.in file of InsightToolkit-3.20.1, there is
#cmakedefine ITK_USE_REVIEW

I tried doing a similar thing by adding the following line in 
Modules/Core/Common/src/itkConfigure.h of the most recent ITK:
#cmakedefine ITKReview_LOADED

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. I also tried the following lines 
to no avail:
#define ITKReview_LOADED @ITKReview_LOADED@
#define ITKReview_LOADED

So, my question is: in my local project, how do I access a preprocessor 
variable from ITK that tells whether ITKReview is on?

Many thanks,
Dirk

_______________________________________________
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

Reply via email to