From 068874bc3eca92f980457d2999c5f47bd5494881 Mon Sep 17 00:00:00 2001 From: Jimi Huotari Date: Wed, 6 Sep 2017 00:20:37 +0300 Subject: [PATCH] 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 --- libobs/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt index 45ee587f8..b207107d1 100644 --- a/libobs/CMakeLists.txt +++ b/libobs/CMakeLists.txt @@ -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)