14

After installing a package, vcppkg very helpfully displays the relevant CMake targets...

The package libwebp:x64-windows provides CMake targets:

find_package(WebP CONFIG REQUIRED)
target_link_libraries(main PRIVATE WebP::webp WebP::webpdemux WebP::libwebpmux WebP::webpdecoder)

But if you don't copy them then you may never see them again. At least I can't find them. Does anyone know how to retrieve this information for an installed package?

Thomas Sharpless
  • 949
  • 1
  • 8
  • 14

1 Answers1

6

If you installed libwebp via:

$ ./vcpkg install libwebp

Then simply running it a second time will show you the usage information:

$ ./vcpkg install libwebp
Computing installation plan...
The following packages are already installed:
    libwebp[core,nearlossless,simd]:x64-linux -> 1.1.0#3
Package libwebp:x64-linux is already installed

Total elapsed time: 12.88 us

The package libwebp:x64-linux provides CMake targets:

    find_package(WebP CONFIG REQUIRED)
    target_link_libraries(main PRIVATE WebP::webp WebP::webpdemux WebP::libwebpmux WebP::webpdecoder)

This works for all packages that show usage information in the first place.

Alex Reinking
  • 16,724
  • 5
  • 52
  • 86
  • https://stackoverflow.com/questions/71734004/how-to-know-the-name-of-a-library-installed-with-vcpkg?noredirect=1#comment126773490_71734004 – KcFnMi Apr 04 '22 at 10:21
  • 1
    It doesn't show all the targets though, for ex with opencv4, I have this: ```The package opencv4 provides CMake targets: find_package(OpenCV CONFIG REQUIRED) # note: 59 targets were omitted. target_link_libraries(main PRIVATE opencv_ml opencv_dnn opencv_dpm opencv_hdf)``` However, I found the targets in vcpkg\installed\x64-windows\share\opencv\*cmake files. – Octo Poulos Apr 21 '22 at 05:31