2021-09-10 12:05:50 +08:00
|
|
|
diff --git a/src/cmake/Config.cmake.in b/src/cmake/Config.cmake.in
|
2022-01-05 12:09:28 +08:00
|
|
|
index b690864..fb45388 100644
|
2021-09-10 12:05:50 +08:00
|
|
|
--- a/src/cmake/Config.cmake.in
|
|
|
|
+++ b/src/cmake/Config.cmake.in
|
|
|
|
@@ -11,6 +11,9 @@ elseif (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 2.4 AND @FOUND_OPENEXR_WITH_CONF
|
|
|
|
HINTS @IlmBase_DIR@ @OpenEXR_DIR@)
|
|
|
|
find_dependency(OpenEXR @OpenEXR_VERSION@
|
|
|
|
HINTS @OpenEXR_DIR@)
|
2021-10-12 01:22:36 +08:00
|
|
|
+ find_dependency(libpng CONFIG REQUIRED)
|
|
|
|
+ find_dependency(libheif CONFIG REQUIRED)
|
|
|
|
+ find_dependency(unofficial-libsquish CONFIG REQUIRED)
|
2021-09-10 12:05:50 +08:00
|
|
|
find_dependency(ZLIB @ZLIB_VERSION@) # Because OpenEXR doesn't do it
|
|
|
|
find_dependency(Threads) # Because OpenEXR doesn't do it
|
|
|
|
endif ()
|
|
|
|
diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
|
2022-01-05 12:09:28 +08:00
|
|
|
index 631035a..9f4d096 100644
|
2021-09-10 12:05:50 +08:00
|
|
|
--- a/src/cmake/externalpackages.cmake
|
|
|
|
+++ b/src/cmake/externalpackages.cmake
|
2021-10-12 01:22:36 +08:00
|
|
|
@@ -148,7 +148,7 @@ find_python()
|
2021-09-10 12:05:50 +08:00
|
|
|
# Dependencies for optional formats and features. If these are not found,
|
|
|
|
# we will continue building, but the related functionality will be disabled.
|
|
|
|
|
|
|
|
-checked_find_package (PNG)
|
|
|
|
+checked_find_package (png PREFER_CONFIG)
|
|
|
|
|
|
|
|
checked_find_package (BZip2) # Used by ffmpeg and freetype
|
|
|
|
if (NOT BZIP2_FOUND)
|
2022-01-05 12:09:28 +08:00
|
|
|
@@ -200,7 +200,8 @@ if (ENABLE_FIELD3D)
|
|
|
|
endif ()
|
2021-09-10 12:05:50 +08:00
|
|
|
|
|
|
|
# For HEIF/HEIC/AVIF formats
|
|
|
|
-checked_find_package (Libheif VERSION_MIN 1.3
|
|
|
|
+checked_find_package (libheif VERSION_MIN 1.3
|
|
|
|
+ PREFER_CONFIG
|
|
|
|
RECOMMEND_MIN 1.7
|
|
|
|
RECOMMEND_MIN_REASON "for AVIF support")
|
|
|
|
if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11)
|
2022-01-05 12:09:28 +08:00
|
|
|
@@ -307,7 +308,8 @@ endmacro()
|
2021-10-12 01:22:36 +08:00
|
|
|
option (USE_EMBEDDED_LIBSQUISH
|
|
|
|
"Force use of embedded Libsquish, even if external is found" OFF)
|
|
|
|
if (NOT USE_EMBEDDED_LIBSQUISH)
|
|
|
|
- checked_find_package (Libsquish)
|
|
|
|
+ checked_find_package (unofficial-libsquish PREFER_CONFIG)
|
2022-01-05 12:09:28 +08:00
|
|
|
+ set(libsquish_FOUND 1)
|
2021-10-12 01:22:36 +08:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
2021-09-10 12:05:50 +08:00
|
|
|
diff --git a/src/ico.imageio/CMakeLists.txt b/src/ico.imageio/CMakeLists.txt
|
2022-01-05 12:09:28 +08:00
|
|
|
index d290625..cff954c 100644
|
2021-09-10 12:05:50 +08:00
|
|
|
--- a/src/ico.imageio/CMakeLists.txt
|
|
|
|
+++ b/src/ico.imageio/CMakeLists.txt
|
|
|
|
@@ -2,9 +2,15 @@
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2022-01-05 12:09:28 +08:00
|
|
|
# https://github.com/OpenImageIO/oiio
|
2021-09-10 12:05:50 +08:00
|
|
|
|
|
|
|
-if (TARGET PNG::PNG)
|
|
|
|
+if (libpng_FOUND)
|
|
|
|
+ if (TARGET png_static)
|
|
|
|
+ set(PNG_TARGET png_static)
|
|
|
|
+ elseif (TARGET png)
|
|
|
|
+ set(PNG_TARGET png)
|
|
|
|
+ endif()
|
|
|
|
+
|
|
|
|
add_oiio_plugin (icoinput.cpp icooutput.cpp
|
|
|
|
- LINK_LIBRARIES PNG::PNG ZLIB::ZLIB)
|
|
|
|
+ LINK_LIBRARIES ${PNG_TARGET} ZLIB::ZLIB)
|
|
|
|
else ()
|
|
|
|
message (WARNING "libpng not found, so ICO support will not work")
|
|
|
|
set (format_plugin_definitions ${format_plugin_definitions} DISABLE_ICO=1 PARENT_SCOPE)
|