<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Thanks a lot, I have tested Bill suggestion and it worked:<br>> Or, reset the vtk modules that itk sets using:<br>> set(VTK_MODULES_REQUESTED "")<br>> before<br>> find_package(VTK REQUIRED)<br><br>And thanks for pointing out that linking all the libraries is not good, but I've some problems knowing what module corresponds to my #include<vtk**> header.  Is there any wiki page to discover that or any map linking module-library?<br><br>Thanks all for the solutions,<br>Pablo<br><br><div>> Date: Tue, 2 Dec 2014 11:34:20 -0500<br>> Subject: Re: [vtkusers] find_package( ITK ) overrides ${VTK_LIBRARIES} from find_package( VTK )<br>> From: cory.quammen@kitware.com<br>> To: bill.lorensen@gmail.com<br>> CC: david.gobbi@gmail.com; vtkusers@vtk.org; pablo.hernandez.cerdan@outlook.com<br>> <br>> Pablo,<br>> <br>> I was just looking into this myself after encountering the same behavior.<br>> <br>> If you want to include the VTK libraries needed for ITK and specify an<br>> additional set of VTK modules in your project, I suggest the<br>> following:<br>> <br>> find_package(ITK REQUIRED)<br>> include(${ITK_USE_FILE})<br>> <br>> set(VTK_MODULES_REQUESTED ${VTK_MODULES_REQUESTED} [additional VTK modules])<br>> find_package(VTK REQUIRED)<br>> include(${VTK_USE_FILE})<br>> <br>> This should work. VTK_LIBRARIES should be set to only the VTK<br>> libraries needed for the modules requested by ITK and by you, plus<br>> their dependencies. Let us know if it doesn't.<br>> <br>> Thanks,<br>> Cory<br>> <br>> <br>> On Tue, Dec 2, 2014 at 8:36 AM, Bill Lorensen <bill.lorensen@gmail.com> wrote:<br>> > As David said you can explicitly list the modules that your app uses.<br>> ><br>> > Or, reset the vtk modules that itk sets using:<br>> > set(VTK_MODULES_REQUESTED "")<br>> > before<br>> > find_package(VTK REQUIRED)<br>> ><br>> > On Tue, Dec 2, 2014 at 12:39 AM, David Gobbi <david.gobbi@gmail.com> wrote:<br>> >> Hi Pablo,<br>> >><br>> >> It's best to only link to the VTK libraries that you need, rather than<br>> >> trying to<br>> >> link to them all via ${VTK_LIBRARIES}.<br>> >><br>> >> The reason for the short list is probably that when ITK calls<br>> >> find_package(),<br>> >> it only requests the small set of VTK components that ITK uses:<br>> >> http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:find_package<br>> >><br>> >>  - David<br>> >><br>> >><br>> >> On Mon, Dec 1, 2014 at 10:26 PM, Pablo Hernández<br>> >> <pablo.hernandez.cerdan@outlook.com> wrote:<br>> >>><br>> >>> I  have a running/compiling CMakeLists.txt when using VTK only, this is<br>> >>> the related VTK part:<br>> >>> find_package(VTK 6.2 REQUIRED)<br>> >>>  message (status "** VTK FOUND: USE_FILES ${VTK_USE_FILE}")<br>> >>> message (status "** VTK FOUND: VTK_LIBRARIES ${VTK_LIBRARIES}")<br>> >>><br>> >>> include(${VTK_USE_FILE})<br>> >>> include_directories( ${VTK_INCLUDE_DIRS})<br>> >>> include_directories(${CMAKE_CURRENT_SOURCE_DIR})<br>> >>><br>> >>> add_executable(VTKNodesEdgesEXE main.cpp ${source_files} ${QT_UI_HEADERS}<br>> >>> ${QT_RESOURCES})<br>> >>> target_link_libraries(VTKNodesEdgesEXE ${VTK_LIBRARIES})<br>> >>> target_link_libraries(VTKNodesEdgesEXE Qt5::Widgets Qt5::PrintSupport)<br>> >>><br>> >>><br>> >>> The problem is that if I add find_package(ITK) anywhere, ${VTK_LIBRARIES}<br>> >>> gets overrides by a tiny list selected by ITK.<br>> >><br>> >><br>> ><br>> ><br>> ><br>> > --<br>> > Unpaid intern in BillsBasement at noware dot com<br>> > _______________________________________________<br>> > Powered by www.kitware.com<br>> ><br>> > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<br>> ><br>> > Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<br>> ><br>> > Follow this link to subscribe/unsubscribe:<br>> > http://public.kitware.com/mailman/listinfo/vtkusers<br></div>                                        </div></body>
</html>