Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve cmake target names from vcpkg?

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?

like image 532
Thomas Sharpless Avatar asked Oct 20 '20 22:10

Thomas Sharpless


Video Answer


1 Answers

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.

like image 76
Alex Reinking Avatar answered Oct 20 '22 22:10

Alex Reinking