On 02/22/2013 02:47 PM, Williams, Norman K wrote:
> My patch for ITK depends on the patched DCMTK.  It might be possible to
> maintain backwards compatibility with the old find_package and unpatched
> DCMTK, but I'm not sure how to implement that.  Would it be as simple as
> this?
> 
> find_package(DCMTK NO_MODULE QUIET)
> if(NOT DCMTK_FOUND)
>   find_package(DCMTK REQUIRED QUIET)
>   if(NOT DCMTK_FOUND)
>     message(FATAL_ERROR "DCMTK package not found. Please set DCMTK_DIR and
> re-run CMake")
>   endif()
> endif()

You can teach FindDCMTK to try the NO_MODULE mode first and then
fall back to the rest of its implementation.  Add something like
this at the top of FindDCMTK in ITK (untested):

 if(NOT DCMTK_FOUND)
   find_package(DCMTK NO_MODULE QUIET)
 endif()
 if(DCMTK_FOUND)
   return()
 endif()

Of course the rest of the logic for exports will have to be
conditional on how DCMTK was found.

-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

Reply via email to