[ITK] [ITK-dev] find_package issues with ITK and VTK (and SlicerExecution Model)

Brad King brad.king at kitware.com
Tue Sep 30 11:22:57 EDT 2014


On 09/30/2014 11:13 AM, Bradley Lowekamp wrote:
> Do you have a suggestion on how to conditionally include a
> module if it's available? e.g. Use ITKDeprecated if ITK was
> configure with it?

 find_package(ITK REQUIRED)
 set(MY_ITK_COMPONENTS ...) # list required mods here
 if(";${ITK_MODULES_ENABLED};" MATCHES ";ITKDeprecated;")
   list(APPEND MY_ITK_COMPONENTS ITKDeprecated)
 endif()
 itk_module_config(ITK ${MY_ITK_COMPONENTS})

I think the if() line could also be written

 if(TARGET ITKDeprecated)

but I don't remember off the top of my head whether the
library names and module names always match exactly.

-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://public.kitware.com/mailman/listinfo/insight-developers



More information about the Community mailing list