Skip to content

[vtk:9] component-less find_package(VTK) fails brutally. #5047

@bartoszek

Description

@bartoszek

This component-less call to find_package(VTK) brings a plethora of issues with vtk>=9 as such call is treated as all components are required those any missing obscure external dependency of vtk that is never touched by pcl results in an error.

https://vtk.org/doc/nightly/html/md__builds_gitlab_kitware_sciviz_ci_Documentation_Doxygen_ModuleSystem.html#autotoc_md76

After VERSION_{GREATER,LESS} in pcl_find_vtk.cmake passed there need to be another find_package(VTK COMPONENTS ${NON_PREFIX_PCL_VTK_COMPONENTS}) at least for vtk>=9

# Start with a generic call to find any VTK version we are supporting, so we retrieve
# the version of VTK. As the module names were changed from VTK 8.2 to 9.0, we don't
# search explicitly for modules. Furthermore we don't pass required minimum version 6.2
# to find_package because then it only accept versions with same major version.
find_package(VTK)

env:{cmake:3.22.0,vtk:9.1.0}

Excerpt from CMake log:

CMake Error in apps/CMakeLists.txt:
  Imported target "VTK::Java" includes non-existent path

    "/usr/lib/jvm/default/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.



CMake Error at cmake/pcl_targets.cmake:309 (add_executable):
  Target "pcl_face_trainer" links to target "ospray::ospray" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  apps/CMakeLists.txt:76 (PCL_ADD_EXECUTABLE)


CMake Error at cmake/pcl_targets.cmake:309 (add_executable):
  Target "pcl_face_trainer" links to target "OpenVR::OpenVR" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  apps/CMakeLists.txt:76 (PCL_ADD_EXECUTABLE)


CMake Error at cmake/pcl_targets.cmake:309 (add_executable):
  Target "pcl_face_trainer" links to target "mpi4py::mpi4py" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  apps/CMakeLists.txt:76 (PCL_ADD_EXECUTABLE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions