Skip to content

Commit

Permalink
CMake: Add a check for VTK_READER/VTK_IMPORTER in plugin CMake logic (#…
Browse files Browse the repository at this point in the history
…1661)

Co-authored-by: Michael MIGLIORE <[email protected]>
  • Loading branch information
mwestphal and Meakk authored Oct 9, 2024
1 parent 1eafdb1 commit 8707cbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cmake/f3dPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ macro(f3d_plugin_declare_reader)
set(F3D_READER_HAS_GEOMETRY_READER 0)
endif()

if (NOT F3D_READER_HAS_SCENE_READER AND NOT F3D_READER_HAS_GEOMETRY_READER)
message(FATAL_ERROR "Please provide either a VTK_IMPORTER or a VTK_READER")
endif ()

string(JSON F3D_PLUGIN_JSON
SET "${F3D_PLUGIN_JSON}" "readers" ${F3D_PLUGIN_CURRENT_READER_INDEX} "${F3D_READER_JSON}")

Expand Down
3 changes: 1 addition & 2 deletions library/src/scene_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,8 @@ scene& scene_impl::add(const std::vector<fs::path>& filePaths)
vtkSmartPointer<vtkImporter> importer = reader->createSceneReader(filePath.string());
if (!importer)
{
// XXX: F3D Plugin CMake logic ensure there is either a scene reader or a geometry reader
auto vtkReader = reader->createGeometryReader(filePath.string());
// XXX: We assume the f3d reader provide either a scene reader or a geometry reader
// TODO: Put in f3d::reader directly
assert(vtkReader);
vtkSmartPointer<vtkF3DGenericImporter> genericImporter =
vtkSmartPointer<vtkF3DGenericImporter>::New();
Expand Down

0 comments on commit 8707cbb

Please sign in to comment.