瀏覽代碼

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
Jimi Huotari 8 年之前
父節點
當前提交
068874bc3e
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      libobs/CMakeLists.txt

+ 2 - 0
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)