[cmake-developers] [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




More information about the cmake-developers mailing list