2

I couldn't find a better way to word the title, so let me explain.

I'm using vcpkg for a project that requires OpenCV, so at some point before building my project I need to do vcpkg install opencv. That part is easy. The problem is what happens when you run vcpkg install opencv. OpenCV has it's own dependencies that I need to install before installing. Otherwise, you get a build error from vcpkg, so I can't just run the command and have OpenCV. Instead, I have to do:

  1. Run vcpkg install opencv
  2. Check for build errors.
  3. Install missing dependencies.
  4. Repeat steps 1-3 until there are no more missing dependencies and everything builds.

This is a huge pain. Best case scenario, vcpkg should just install what it needs somewhere, but I would gladly settle for being able to do sudo apt install <ALL dependencies> && vcpkg install <package>. The question is where can I find that list of "ALL dependencies" for a package.

LLSv2.0
  • 501
  • 6
  • 20
  • 1
    If there are build errors because of missing dependencies I believe this is a bug in the opencv port file for vcpkg, You should file a bug report. vcpkg is supposed to build all of the dependent libraries before it builds a package. – drescherjm Jan 25 '22 at 23:50
  • 1
    That's what I would have thought, but I've run across a few similar github issues where they were eventually closed because "It's not a bug. You just have to install this thing first." https://github.com/microsoft/vcpkg/issues/21524#issuecomment-984366235 – LLSv2.0 Jan 25 '22 at 23:58

1 Answers1

1

The command to [recursively] view dependencies of a package with vcpkg
is depend-info <package-name>:

>vcpkg depend-info llfio

vcpkg-cmake:
vcpkg-cmake-config:
ned14-internal-quickcpplib: vcpkg-cmake, vcpkg-cmake-config
status-code: vcpkg-cmake, vcpkg-cmake-config
outcome: ned14-internal-quickcpplib, status-code, vcpkg-cmake, vcpkg-cmake-config
llfio: outcome, vcpkg-cmake, vcpkg-cmake-config
Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
  • 2
    This answer doesn't answer the question. You answered the question on how to see which dependencies vcpkg itself will build in the process of building a port (llfio) but not what system dependencies are required to do so (e.g. libmesa, libx11 and so on) which this question is about. – Alexander Neumann Feb 12 '23 at 11:04
  • @AlexanderNeumann: maybe you're right, but most questions are two-fold: there's what the author actually wanted at the time, and then there's what other people want who come and look at this question later. I was searching for a way to view dependencies with `vcpkg`, and this unanswered question was the only one I found. So I spent some more time looking for a solution, and then I added an answer with that solution. – Violet Giraffe Feb 12 '23 at 13:29