1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge pull request #29553 from mvanhorn/fix/26746-warn-external-grfmt-fallback

cmake: warn when external image-codec library is requested but not found 🤖🤖🤖
This commit is contained in:
Abhishek Gola
2026-07-30 16:38:23 +05:30
committed by GitHub
+27
View File
@@ -45,6 +45,11 @@ else()
endif()
if(NOT ZLIB_FOUND)
if(NOT BUILD_ZLIB)
message(WARNING "ZLIB library has not been found, falling back to built-in version. "
"Set ZLIB_ROOT or ZLIB_DIR variable so that find_package(ZLIB) would be able to find it. "
"See find_package and FindZLIB cmake documentation for details.")
endif()
ocv_clear_vars(ZLIB_LIBRARY ZLIB_LIBRARIES ZLIB_INCLUDE_DIR)
set(ZLIB_LIBRARY zlib CACHE INTERNAL "")
@@ -83,6 +88,12 @@ if(WITH_JPEG)
endif()
if(NOT JPEG_FOUND)
if(NOT BUILD_JPEG)
message(WARNING "JPEG library has not been found, falling back to built-in version. "
"Add the external installation prefix to CMAKE_PREFIX_PATH, or set JPEG_INCLUDE_DIR "
"and JPEG_LIBRARY, so that FindJPEG can locate it. "
"See FindJPEG cmake documentation for details.")
endif()
ocv_clear_vars(JPEG_LIBRARY JPEG_INCLUDE_DIR)
if(NOT BUILD_JPEG_TURBO_DISABLE)
@@ -153,6 +164,12 @@ if(WITH_TIFF)
endif()
if(NOT TIFF_FOUND)
if(NOT BUILD_TIFF)
message(WARNING "TIFF library has not been found, falling back to built-in version. "
"Add the external installation prefix to CMAKE_PREFIX_PATH, or set TIFF_INCLUDE_DIR "
"and TIFF_LIBRARY, so that FindTIFF can locate it. "
"See FindTIFF cmake documentation for details.")
endif()
ocv_clear_vars(TIFF_LIBRARY TIFF_LIBRARIES TIFF_INCLUDE_DIR)
set(TIFF_LIBRARY libtiff CACHE INTERNAL "")
@@ -201,6 +218,11 @@ endif()
if(WITH_WEBP AND NOT WEBP_FOUND
AND (NOT ANDROID OR HAVE_CPUFEATURES)
)
if(NOT BUILD_WEBP)
message(WARNING "WebP library has not been found, falling back to built-in version. "
"Set WEBP_INCLUDE_DIR and WEBP_LIBRARY, or add the external installation prefix to "
"CMAKE_PREFIX_PATH, so that the external WebP can be located.")
endif()
ocv_clear_vars(WEBP_LIBRARY WEBP_INCLUDE_DIR)
set(WEBP_LIBRARY libwebp CACHE INTERNAL "")
set(WEBP_LIBRARIES ${WEBP_LIBRARY})
@@ -353,6 +375,11 @@ if(NOT HAVE_SPNG AND WITH_PNG)
endif()
if(NOT PNG_FOUND)
if(NOT BUILD_PNG)
message(WARNING "PNG library has not been found, falling back to built-in version. "
"Set PNG_ROOT or PNG_DIR variable so that find_package(PNG) would be able to find it. "
"See find_package and FindPNG cmake documentation for details.")
endif()
ocv_clear_vars(PNG_LIBRARY PNG_LIBRARIES PNG_INCLUDE_DIR PNG_DEFINITIONS)
set(PNG_LIBRARY libpng CACHE INTERNAL "")