I'm building a Vala app that uses youtube-dl command line. How do I make sure that it is installed when someone installs the app?

In other words: Looking at the CMake build documentation, what is the best way to add a command line dependency?


1 Answer 1


Use find_program to look for the executable, then check the result. So something like

find_program(YOUTUBE_DL youtube-dl)
  message(FATAL_ERROR "youtube-dl is required")
  • Is there a way to install the executable if the program is not found? Commented Sep 16, 2018 at 1:59
  • Nothing built in. You could conceivably write some code to do it, but obviously it would vary by package manager, and I don't know what you'd do on Windows.
    – nemequ
    Commented Sep 16, 2018 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.