Skip to content

[VTK] CMake usage printed by vcpkg is wrong #19035

@jjjkkyz

Description

@jjjkkyz

Describe the bug
vtk can't be correct used in cmakelist

Environment

  • OS: Windows
  • Compiler: MSVC2019
    To Reproduce
    Steps to reproduce the behavior:
  1. ./vcpkg install vtk:x64-windows
  2. See error
    I use vtk in cmakelist as vcpkg told me in below:
    The package vtk:x64-windows provides CMake targets:
  find_package(3.13 CONFIG REQUIRED)
  target_link_libraries(main PRIVATE ZLIB::ZLIB)

  find_package(3.16 CONFIG REQUIRED)
  target_link_libraries(main PRIVATE PostgreSQL::PostgreSQL)

  find_package(99 CONFIG REQUIRED)
  # Note: 36 target(s) were omitted.
  target_link_libraries(main PRIVATE X11::SM X11::Xi X11::Xt X11::Xv)

  find_package(vtk CONFIG REQUIRED)
  # Note: 159 target(s) were omitted.
  target_link_libraries(main PRIVATE LZ4::LZ4 OGG::OGG VTK::lz4 VTK::ogg)

but i got a error in my complier:

CMake Error at D:/cmake/vcpkg/scripts/buildsystems/vcpkg.cmake:764 (_find_package):
  Could not find a package configuration file provided by "3.13" with any of
  the following names:

    3.13Config.cmake
    3.13-config.cmake

Next, I just use the last find_packge and it work.
But I can't import vtk head file in my project.
Last, I use below code im cmakelist to make it down.

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
target_link_libraries(Reconstruction PRIVATE ${VTK_LIBRARIES})

Metadata

Metadata

Labels

category:port-bugThe issue is with a library, which is something the port should already support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions