@@ -102,7 +102,6 @@ endif()
102102set (SHARPYUV_DEP_LIBRARIES)
103103set (SHARPYUV_DEP_INCLUDE_DIRS)
104104set (WEBP_DEP_LIBRARIES)
105- set (WEBP_DEP_INCLUDE_DIRS)
106105
107106if (NOT CMAKE_BUILD_TYPE )
108107 set (CMAKE_BUILD_TYPE "Release"
@@ -211,7 +210,7 @@ if(ANDROID)
211210 set (cpufeatures_include_dir ${ANDROID_NDK} /sources/android /cpufeatures)
212211 set (SHARPYUV_DEP_INCLUDE_DIRS ${SHARPYUV_DEP_INCLUDE_DIRS}
213212 ${cpufeatures_include_dir} )
214- set (WEBP_DEP_INCLUDE_DIRS ${WEBP_DEP_INCLUDE_DIRS} ${cpufeatures_include_dir} )
213+ include_directories ( AFTER SYSTEM ${cpufeatures_include_dir} )
215214 add_definitions (-DHAVE_CPU_FEATURES_H=1 )
216215 set (HAVE_CPU_FEATURES_H 1)
217216else ()
@@ -379,7 +378,6 @@ if(MSVC)
379378else ()
380379 add_compile_options (-Wall )
381380endif ()
382- include_directories (${WEBP_DEP_INCLUDE_DIRS} )
383381add_library (webpdspdecode OBJECT ${WEBP_DSP_COMMON_SRCS} ${WEBP_DSP_DEC_SRCS} )
384382target_include_directories (webpdspdecode PUBLIC ${CMAKE_CURRENT_BINARY_DIR }
385383 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR } )
@@ -498,12 +496,9 @@ if(NOT WEBP_BUILD_LIBWEBPMUX)
498496 set (WEBP_BUILD_WEBPMUX OFF )
499497endif ()
500498
501- if (WEBP_BUILD_GIF2WEBP AND NOT GIF_FOUND)
502- set (WEBP_BUILD_GIF2WEBP OFF )
503- endif ()
504-
505- if (WEBP_BUILD_ANIM_UTILS AND NOT GIF_FOUND)
499+ if (NOT GIF_FOUND)
506500 set (WEBP_BUILD_ANIM_UTILS OFF )
501+ set (WEBP_BUILD_GIF2WEBP OFF )
507502endif ()
508503
509504# Build the executables if asked for.
@@ -542,14 +537,12 @@ if(WEBP_BUILD_ANIM_UTILS
542537 parse_makefile_am (${CMAKE_CURRENT_SOURCE_DIR } /imageio "IMAGEENC_SRCS"
543538 "imageenc_[^ ]*" )
544539 add_library (imageenc STATIC ${IMAGEENC_SRCS} )
545- target_link_libraries (imageenc imageioutil webp )
540+ target_link_libraries (imageenc imageioutil webp ${WEBP_DEP_IMG_LIBRARIES} )
546541
547542 set_property (
548543 TARGET exampleutil imageioutil imagedec imageenc
549544 PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR } /src
550545 ${CMAKE_CURRENT_BINARY_DIR } /src)
551- target_include_directories (imagedec PRIVATE ${WEBP_DEP_IMG_INCLUDE_DIRS} )
552- target_include_directories (imageenc PRIVATE ${WEBP_DEP_IMG_INCLUDE_DIRS} )
553546endif ()
554547
555548if (WEBP_BUILD_DWEBP)
@@ -589,19 +582,17 @@ endif()
589582
590583if (WEBP_BUILD_GIF2WEBP)
591584 # gif2webp
592- include_directories (${WEBP_DEP_GIF_INCLUDE_DIRS} )
593585 parse_makefile_am (${CMAKE_CURRENT_SOURCE_DIR } /examples "GIF2WEBP_SRCS"
594586 "gif2webp" )
595587 add_executable (gif2webp ${GIF2WEBP_SRCS} )
596588 target_link_libraries (gif2webp exampleutil imageioutil webp libwebpmux
597- ${WEBP_DEP_GIF_LIBRARIES} )
589+ GIF::GIF )
598590 target_include_directories (gif2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR } /src )
599591 install (TARGETS gif2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
600592endif ()
601593
602594if (WEBP_BUILD_IMG2WEBP)
603595 # img2webp
604- include_directories (${WEBP_DEP_IMG_INCLUDE_DIRS} )
605596 parse_makefile_am (${CMAKE_CURRENT_SOURCE_DIR } /examples "IMG2WEBP_SRCS"
606597 "img2webp" )
607598 add_executable (img2webp ${IMG2WEBP_SRCS} )
@@ -615,7 +606,6 @@ if(WEBP_BUILD_VWEBP)
615606 # vwebp
616607 find_package (GLUT )
617608 if (GLUT_FOUND)
618- include_directories (${WEBP_DEP_IMG_INCLUDE_DIRS} )
619609 parse_makefile_am (${CMAKE_CURRENT_SOURCE_DIR } /examples "VWEBP_SRCS" "vwebp" )
620610 add_executable (vwebp ${VWEBP_SRCS} )
621611 target_link_libraries (
@@ -641,7 +631,6 @@ endif()
641631
642632if (WEBP_BUILD_WEBPINFO)
643633 # webpinfo
644- include_directories (${WEBP_DEP_IMG_INCLUDE_DIRS} )
645634 parse_makefile_am (${CMAKE_CURRENT_SOURCE_DIR } /examples "WEBPINFO_SRCS"
646635 "webpinfo" )
647636 add_executable (webpinfo ${WEBPINFO_SRCS} )
@@ -764,7 +753,6 @@ endif()
764753
765754if (WEBP_BUILD_ANIM_UTILS)
766755 # anim_diff
767- include_directories (${WEBP_DEP_IMG_INCLUDE_DIRS} ${WEBP_DEP_GIF_INCLUDE_DIRS} )
768756 parse_makefile_am (${CMAKE_CURRENT_SOURCE_DIR } /examples "ANIM_DIFF_SRCS"
769757 "anim_diff" )
770758 add_executable (anim_diff ${ANIM_DIFF_SRCS} )
@@ -776,11 +764,10 @@ if(WEBP_BUILD_ANIM_UTILS)
776764 imageioutil
777765 webp
778766 webpdemux
779- ${WEBP_DEP_GIF_LIBRARIES} )
767+ GIF::GIF )
780768 target_include_directories (anim_diff PRIVATE ${CMAKE_CURRENT_BINARY_DIR } /src )
781769
782770 # anim_dump
783- include_directories (${WEBP_DEP_IMG_INCLUDE_DIRS} ${WEBP_DEP_GIF_INCLUDE_DIRS} )
784771 parse_makefile_am (${CMAKE_CURRENT_SOURCE_DIR } /examples "ANIM_DUMP_SRCS"
785772 "anim_dump" )
786773 add_executable (anim_dump ${ANIM_DUMP_SRCS} )
@@ -792,7 +779,7 @@ if(WEBP_BUILD_ANIM_UTILS)
792779 imageioutil
793780 webp
794781 webpdemux
795- ${WEBP_DEP_GIF_LIBRARIES} )
782+ GIF::GIF )
796783 target_include_directories (anim_dump PRIVATE ${CMAKE_CURRENT_BINARY_DIR } /src )
797784endif ()
798785
0 commit comments