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,10 +509,11 @@ 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})
target_link_libraries(example_plugin scene_polyhedron_item)
find_package(VTK QUIET 6.0 COMPONENTS
find_package(VTK QUIET COMPONENTS
vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML)
if (VTK_FOUND)
include(${VTK_USE_FILE})
if ("${VTK_VERSION_MAJOR}" GREATER "5")
if(VTK_LIBRARIES)
polyhedron_demo_plugin(vtk_plugin Polyhedron_demo_vtk_plugin)
target_link_libraries(vtk_plugin scene_polyhedron_item
@ -520,6 +521,9 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
else()
message(STATUS "NOTICE : the vtk IO plugin needs VTK libraries and will not be compiled.")
endif()
else()
message(STATUS "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled (incorrect version found).")
endif()
else()
message(STATUS "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled.")
endif()

View File

@ -97,15 +97,18 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND)
add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${prj} )
find_package(VTK QUIET 6.0 COMPONENTS
vtkImagingCore
)
find_package(VTK QUIET COMPONENTS vtkImagingCore)
if(VTK_FOUND)
include(${VTK_USE_FILE})
if ("${VTK_VERSION_MAJOR}" GREATER "5")
add_definitions(-DCGAL_USE_VTK)
set(VTK_LIBS vtkImagingCore)
else()
set(VTK_LIBS "")
endif()
else()
set(VTK_LIBS "")
endif()
# Link the executable to CGAL and third-party libraries
target_link_libraries( ${prj} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})