-DCGAL_USE_VTK should be only for io_image_plugin

Otherwise, I had a ld.so error with a few Mesh_3 plugins that do not
use VTK.
This commit is contained in:
Laurent Rineau 2020-07-20 17:07:07 +02:00
parent aea6ac3e06
commit 343dad840a
1 changed files with 4 additions and 3 deletions

View File

@ -22,9 +22,7 @@ if (VTK_FOUND)
if(TARGET VTK::IOImage)
set(VTK_LIBRARIES VTK::IOImage)
endif()
if(VTK_LIBRARIES)
add_definitions(-DCGAL_USE_VTK)
else()
if(NOT VTK_LIBRARIES)
message(STATUS "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to.")
endif()
else()
@ -39,6 +37,9 @@ if(Boost_FILESYSTEM_FOUND)
qt5_wrap_ui( imgUI_FILES Image_res_dialog.ui raw_image.ui)
polyhedron_demo_plugin(io_image_plugin Io_image_plugin Volume_plane_intersection.cpp Raw_image_dialog.cpp ${imgUI_FILES} ${VOLUME_MOC_OUTFILES} KEYWORDS IO Mesh_3)
target_link_libraries(io_image_plugin PUBLIC scene_image_item ${VTK_LIBRARIES} CGAL::CGAL_ImageIO)
if(VTK_LIBRARIES)
target_compile_definitions(io_image_plugin PRIVATE CGAL_USE_VTK)
endif()
if(TARGET Boost::filesystem)
target_link_libraries(io_image_plugin PUBLIC Boost::filesystem Boost::system)
else()