0

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?

https://elementary.io/docs/code/getting-started#the-build-system

1 Answer 1

0

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

find_program(YOUTUBE_DL youtube-dl)
if(NOT YOUTUBE_DL)
  message(FATAL_ERROR "youtube-dl is required")
endif()
2
  • Is there a way to install the executable if the program is not found? 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
    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.