[Insight-developers] Building ITK with Module_ITKVtkGlue forces client applications to find_package(VTK)?

David Doria daviddoria at gmail.com
Tue Jun 26 11:37:44 EDT 2012


On Tue, Jun 26, 2012 at 10:44 AM, Xiaoxiao Liu <xiaoxiao.liu at kitware.com>wrote:

> It's the  Module_ITKVtkGlue that depends on VTK , not your own code.
> You should be able to configure VTK_DIR when you enabled Module_ITKVtkGlue.
> (Checkout "ITK/Modules/Bridge/VtkGlue/itk-module-init.cmake" ).
>

Xiaoxiao,

Yep, that's what I thought. I did configure VTK_DIR when I
enabled Module_ITKVtkGlue - then ITK built fine. However, then in my client
program, everything works fine, as long as I find_package(VTK) like I
mentioned. What I'm trying to say is that I don't think that should be
necessary, and you seem to agree :)

I have attached the demo I'm using - would you mind trying to build this
without the find_package(VTK) in the CMakeLists.txt? I have reproduced this
on two machines.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120626/a7df7f1e/attachment.htm>
-------------- next part --------------
cmake_minimum_required(VERSION 2.8)
PROJECT(TestITK)

FIND_PACKAGE(ITK)
INCLUDE(${USE_ITK_FILE})

# With this commented, I get the linker errors
# FIND_PACKAGE(VTK)
# INCLUDE(${USE_VTK_FILE})

ADD_EXECUTABLE(TestITK TestITK.cxx)

TARGET_LINK_LIBRARIES(TestITK ${ITK_LIBRARIES})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestITK.cxx
Type: application/octet-stream
Size: 63 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120626/a7df7f1e/attachment.obj>


More information about the Insight-developers mailing list