vtk version 6 and greater are supported by surface_mesher and polyhedron demos

vtk is strict and only the patch version can differ
(that is 6.1 is not compatible with 6.0)
This commit is contained in:
Sébastien Loriot 2015-10-22 16:38:21 +02:00
parent c54bcbb47c
commit 258ef34006
2 changed files with 18 additions and 11 deletions

View File

@ -509,16 +509,20 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
polyhedron_demo_plugin(example_plugin Polyhedron_demo_example_plugin ${exampleUI_FILES} ${example_dockUI_FILES}) polyhedron_demo_plugin(example_plugin Polyhedron_demo_example_plugin ${exampleUI_FILES} ${example_dockUI_FILES})
target_link_libraries(example_plugin scene_polyhedron_item) target_link_libraries(example_plugin scene_polyhedron_item)
find_package(VTK QUIET 6.0 COMPONENTS find_package(VTK QUIET COMPONENTS
vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML) vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML)
if (VTK_FOUND) if (VTK_FOUND)
include(${VTK_USE_FILE}) include(${VTK_USE_FILE})
if(VTK_LIBRARIES) if ("${VTK_VERSION_MAJOR}" GREATER "5")
polyhedron_demo_plugin(vtk_plugin Polyhedron_demo_vtk_plugin) if(VTK_LIBRARIES)
target_link_libraries(vtk_plugin scene_polyhedron_item polyhedron_demo_plugin(vtk_plugin Polyhedron_demo_vtk_plugin)
vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML) target_link_libraries(vtk_plugin scene_polyhedron_item
vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML)
else()
message(STATUS "NOTICE : the vtk IO plugin needs VTK libraries and will not be compiled.")
endif()
else() else()
message(STATUS "NOTICE : the vtk IO plugin needs VTK libraries and will not be compiled.") message(STATUS "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled (incorrect version found).")
endif() endif()
else() else()
message(STATUS "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled.") message(STATUS "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled.")

View File

@ -97,12 +97,15 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${prj} ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${prj} )
find_package(VTK QUIET 6.0 COMPONENTS find_package(VTK QUIET COMPONENTS vtkImagingCore)
vtkImagingCore
)
if(VTK_FOUND) if(VTK_FOUND)
add_definitions(-DCGAL_USE_VTK) include(${VTK_USE_FILE})
set(VTK_LIBS vtkImagingCore) if ("${VTK_VERSION_MAJOR}" GREATER "5")
add_definitions(-DCGAL_USE_VTK)
set(VTK_LIBS vtkImagingCore)
else()
set(VTK_LIBS "")
endif()
else() else()
set(VTK_LIBS "") set(VTK_LIBS "")
endif() endif()