[poppler] CMakeLists.txt
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Dec 1 21:52:58 UTC 2022
CMakeLists.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
New commits:
commit df3746fa4c9413422bb70dbbb61108922a7fddc9
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Jul 29 00:58:42 2022 +0200
cmake: Check we have a new enough libjpeg
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9861a436..42dad3ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -154,6 +154,23 @@ macro_optional_find_package(TIFF)
macro_optional_find_package(NSS3)
if(ENABLE_DCTDECODER STREQUAL "libjpeg")
if(JPEG_FOUND)
+ include(CheckCSourceCompiles)
+ set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
+ set(CMAKE_REQUIRED_LIBRARIES JPEG::JPEG)
+ check_c_source_compiles("
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <jpeglib.h>
+ int main() { struct jpeg_decompress_struct info; jpeg_mem_src(&info, 0, 0); return 0; }" HAVE_JPEG_MEM_SRC)
+ set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}")
+
+ if(NOT HAVE_JPEG_MEM_SRC)
+ message(FATAL_ERROR "Your libjpeg is too old. Poppler needs one that provides jpeg_mem_src. That is provided in libjpeg >= 8 or libjpeg-turbo >= 1.1.0. You can \
+also decide to use the internal unmaintained DCT decoder or none at all.\n\
+Possible options are: -DENABLE_DCTDECODER=libjpeg, -DENABLE_DCTDECODER=none, \
+-DENABLE_DCTDECODER=unmaintained")
+ endif()
+
set(ENABLE_LIBJPEG ${JPEG_FOUND})
else()
message(STATUS "Could NOT find libjpeg.")
More information about the poppler
mailing list