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?



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? Sep 16 '18 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
    Sep 16 '18 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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