libobs: Stop configure if ImageMagick is preferred, but not found

With certain combinations of CMake (<3.9) and ImageMagick (>=7),
configure will silently fail setting up support for ImageMagick,
even if the user requested for it, and the build will move on
(as long as FFMPEG_AVCODEC is found).  This commit adds a check
that will stop configure in such cases.

Closes jp9000/obs-studio#1018
This commit is contained in:
Jimi Huotari
2017-09-06 00:20:37 +03:00
committed by jp9000
parent fef71c4b7c
commit 068874bc3e

View File

@@ -32,6 +32,8 @@ find_package(ImageMagick QUIET COMPONENTS MagickCore)
if(NOT ImageMagick_MagickCore_FOUND AND NOT FFMPEG_AVCODEC_FOUND)
message(FATAL_ERROR "Either MagickCore or Libavcodec is required, but both were not found")
elseif(NOT ImageMagick_MagickCore_FOUND AND LIBOBS_PREFER_IMAGEMAGICK)
message(FATAL_ERROR "ImageMagick support was requested, but was not found.")
endif()
option(LIBOBS_PREFER_IMAGEMAGICK "Prefer ImageMagick over ffmpeg for image loading" OFF)