[Insight-users] [Insight-developers] CMake config problem: ITK + GDCM 2 + VTK

Karthik Krishnan karthik.krishnan at kitware.com
Sun Jul 18 13:34:14 EDT 2010


Hi Stephen:

All I was suggesting was to move the lines :

  set( METAIO_USE_NAMESPACE .. )
  set( METAIO_NAMESPACE .. )
  set( METAIO_LibrariesToLinkAgainst .. )

over to the parent directory, where there is no need to check VTK_VERSION
etc, and then recurse into the MetaIO directory. Right now, there are switch
statements in the MetaIO CMakeLists.txt files stating "IF METAIO_FOR_ITK"
and "IF METAIO_FOR_VTK". The libraries in the Utilities folder, should not
need know that they are being built as a part of ITK or VTK.

Others adopt the same strategy. For instance :

(a) DICOMParser : The upper level CMakeLists.txt checks if sets the
variables : DICOMPARSER_NAMESPACE, DICOMPARSER_LIBRARY,
DICOMPARSER_STANDALONE  before recursing in

(b) KWSys. Again, all the options, namespace names etc are set by the
toolkit in the parent directory..

Thanks
--
karthik


On Sun, Jul 18, 2010 at 5:49 PM, Stephen Aylward <
stephen.aylward at kitware.com> wrote:

>
> It would be nice for code that is duplicated in ITK and VTK (a robot
> automatically syncs the MetaIO directories in ITK and VTK) to have an
> automated mechanism for determining if it is being compiled in ITK or VTK.
> Any suggestions on what alternate method to use?  I guess we need a var that
> is specific and not exported via find_package.  I'd rather not create a new
> one.  Surely one already exists and thereby would be a more general/elegant
> solution?
>
> So are you saying that having a find_package() in a use.cmake file is ok?
>
> S
>
> -- Sent from an Android phone.  Please forgive the typos.
>
> On Jul 18, 2010 6:19 AM, "Karthik Krishnan" <karthik.krishnan at kitware.com>
> wrote:
>
> Alternatively, the fix could also be made in ITK/VTK. After all
> VTK-VERSION is used solely to decide if MetaIO is being compiled
> within ITK or VTK. One could set the MetaIO-FOR-VTK / ITK from the
> parent Utilities directory as well.
>
>
> On 7/18/10, Stephen Aylward <stephen.aylward at kitware.com> wrote:
> > Hi,
> >
> > I am far from a cmake ex...
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100718/2aaf517f/attachment.htm>


More information about the Insight-users mailing list