This is a problem that has been cropping up in our projects that use ITK, VTK 
and SlicerExecutionModel.

You won’t see it UNLESS you turn on the ITKVTK/ITKVtkGlue modules.

The problem is this: if you find packages in this order:

find_package(VTK REQUIRED)
find_package(ITK REQUIRED)

You can’t real compile anything that needs VTK, because down in the ITK 
deployment stuff, it calls find_package(VTK) like this:
find_package(VTK COMPONENTS
  vtkCommonCore
  vtkRenderingCore
  vtkRenderingOpenGL
  vtkRenderingFreeType
  vtkInteractionStyle
  vtkIOImage
  vtkImagingSources
  REQUIRED)

Which blows away the larger list of include directories and libraries that the 
first find_package(VTK REQUIRED) built.

Even better — or worse — 
Modules/Segmentation/LevelSetsv4Visualization/CMakeLists.txt also include 
find_package(VTK) — so ITK tries to import VTK twice, with different module 
lists.

It doesn’t even help to reverse the order:
find_package(ITK REQUIRED)
find_package(VTK REQUIRED)

because apparently there’s some hangover from the find_package(VTK) inside the 
ITK CMake deployment files.  The only thing that works is to use COMPONENTS, 
i.e.

find_package(ITK REQUIRED)
find_package(VTK COMPONENTS vtkCommonCore vtkRenderingAnnotation … REQUIRED)

Which seems to trigger a proper re-scan and build of the library/include lists.

It gets even worse if you use find_package(SlicerExecutionModel) after 
find_package(ITK), for the same reason — SlicerExecutionModel depends on ITK, 
so it clobbers the include/library lists from the first find_package(ITK).




________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the 
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and 
may be legally privileged.  If you are not the intended recipient, you are 
hereby notified that any retention, dissemination, distribution, or copying of 
this communication is strictly prohibited.  Please reply to the sender that you 
have received the message in error, then delete it.  Thank you.
________________________________
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to