From 347a546d9dfb3210bcf907c3c622d6843d2ae9ce Mon Sep 17 00:00:00 2001 From: Alex Kent Hajnal Date: Fri, 17 May 2024 18:16:23 -0400 Subject: Adds WebP read support to kimgio Signed-off-by: Alex Kent Hajnal --- CMakeLists.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 631e7a5a7..d03faf8aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,7 @@ option( WITH_IMAGETOPS_BINARY "Enable installation of imagetops binary" ${WITH_A option( WITH_LUA "Enable LUA support" ${WITH_ALL_OPTIONS} ) option( WITH_TIFF "Enable tiff support" ${WITH_ALL_OPTIONS} ) option( WITH_JASPER "Enable jasper (jpeg2k) support" ${WITH_ALL_OPTIONS} ) +option( WITH_WEBP "Enable WebP support" ${WITH_ALL_OPTIONS} ) option( WITH_OPENEXR "Enable openexr support" ${WITH_ALL_OPTIONS} ) option( WITH_UTEMPTER "Use utempter for utmp management" ${WITH_ALL_OPTIONS} ) option( WITH_AVAHI "Enable AVAHI support" ${WITH_ALL_OPTIONS} ) @@ -891,6 +892,32 @@ if( WITH_JASPER ) endif( WITH_JASPER ) +##### check for webp ############################ + +if( WITH_WEBP ) + pkg_search_module( WEBP libwebp ) + if( WEBP_FOUND ) + set( HAVE_WEBP 1 ) + else ( NOT WEBP_FOUND ) + check_include_file( "webp/decode.h" HAVE_WEBP_DECODE_H) + if ( HAVE_WEBP_DECODE_H ) + check_library_exists( webp WebPGetInfo "" HAVE_WEBP__WEBPGETINFO ) + check_library_exists( webp WebPDecodeARGBInto "" HAVE_WEBP__WEBPDECODEARGBINTO ) + check_library_exists( webp WebPDecodeBGRAInto "" HAVE_WEBP__WEBPDECODEBGRAINTO ) + if( HAVE_WEBP__WEBPGETINFO AND HAVE_WEBP__WEBPDECODEARGBINTO AND HAVE_WEBP__WEBPDECODEBGRAINTO ) + set( HAVE_WEBP 1 ) + endif( ) + endif( HAVE_WEBP_DECODE_H ) + endif( WEBP_FOUND ) + if ( HAVE_WEBP ) + set( WEBP_LIBRARIES webp ) + message( STATUS "WebP support enabled" ) + else ( NOT HAVE_WEBP ) + tde_message_fatal( "WebP support requested, but not found on your system" ) + endif( HAVE_WEBP) +endif( WITH_WEBP ) + + ##### check for openexr ######################### if( WITH_OPENEXR ) -- cgit v1.2.1