[vtkusers] find_package( ITK ) overrides ${VTK_LIBRARIES} from find_package( VTK )

Bill Lorensen bill.lorensen at gmail.com
Tue Dec 2 08:36:54 EST 2014


As David said you can explicitly list the modules that your app uses.

Or, reset the vtk modules that itk sets using:
set(VTK_MODULES_REQUESTED "")
before
find_package(VTK REQUIRED)

On Tue, Dec 2, 2014 at 12:39 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Pablo,
>
> It's best to only link to the VTK libraries that you need, rather than
> trying to
> link to them all via ${VTK_LIBRARIES}.
>
> The reason for the short list is probably that when ITK calls
> find_package(),
> it only requests the small set of VTK components that ITK uses:
> http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:find_package
>
>  - David
>
>
> On Mon, Dec 1, 2014 at 10:26 PM, Pablo Hernández
> <pablo.hernandez.cerdan at outlook.com> wrote:
>>
>> I  have a running/compiling CMakeLists.txt when using VTK only, this is
>> the related VTK part:
>> find_package(VTK 6.2 REQUIRED)
>>  message (status "** VTK FOUND: USE_FILES ${VTK_USE_FILE}")
>> message (status "** VTK FOUND: VTK_LIBRARIES ${VTK_LIBRARIES}")
>>
>> include(${VTK_USE_FILE})
>> include_directories( ${VTK_INCLUDE_DIRS})
>> include_directories(${CMAKE_CURRENT_SOURCE_DIR})
>>
>> add_executable(VTKNodesEdgesEXE main.cpp ${source_files} ${QT_UI_HEADERS}
>> ${QT_RESOURCES})
>> target_link_libraries(VTKNodesEdgesEXE ${VTK_LIBRARIES})
>> target_link_libraries(VTKNodesEdgesEXE Qt5::Widgets Qt5::PrintSupport)
>>
>>
>> The problem is that if I add find_package(ITK) anywhere, ${VTK_LIBRARIES}
>> gets overrides by a tiny list selected by ITK.
>
>



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtkusers mailing list