2023-04-14 05:50:45 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2024-08-27 16:57:13 +08:00
|
|
|
index aca5d6f..48a26c3 100644
|
2023-04-14 05:50:45 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2024-08-27 16:57:13 +08:00
|
|
|
@@ -156,7 +156,10 @@ if(AVIF_LOCAL_LIBYUV)
|
|
|
|
set(libyuv_FOUND TRUE)
|
|
|
|
message(STATUS "libavif: local libyuv found; libyuv-based fast paths enabled.")
|
|
|
|
else(AVIF_LOCAL_LIBYUV)
|
|
|
|
- find_package(libyuv QUIET) # not required
|
|
|
|
+ find_package(libyuv_config NAMES libyuv CONFIG REQUIRED)
|
|
|
|
+ set(LIBYUV_INCLUDE_DIR "${libyuv_INCLUDE_DIRS}")
|
|
|
|
+ set(LIBYUV_LIBRARY "yuv")
|
|
|
|
+ find_package(libyuv MODULE REQUIRED)
|
|
|
|
if(libyuv_FOUND)
|
|
|
|
# libyuv 1755 exposed all of the I*Matrix() functions, which libavif relies on.
|
|
|
|
# libyuv 1774 exposed ScalePlane_12 function, which libavif can use for some additional optimizations.
|
|
|
|
@@ -660,7 +663,7 @@ endif()
|
2023-04-14 05:50:45 +08:00
|
|
|
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
|
|
|
install(
|
|
|
|
TARGETS avif
|
|
|
|
- EXPORT ${PROJECT_NAME}-config
|
|
|
|
+ EXPORT ${PROJECT_NAME}-targets
|
|
|
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
|
|
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
2024-08-27 16:57:13 +08:00
|
|
|
@@ -668,7 +671,7 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
2023-04-14 05:50:45 +08:00
|
|
|
|
|
|
|
# Enable CMake configs in VCPKG mode
|
|
|
|
if(BUILD_SHARED_LIBS OR VCPKG_TARGET_TRIPLET)
|
|
|
|
- install(EXPORT ${PROJECT_NAME}-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
|
|
|
+ install(EXPORT ${PROJECT_NAME}-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
|
|
|
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
write_basic_package_version_file(
|
2024-08-27 16:57:13 +08:00
|
|
|
@@ -677,6 +680,28 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
2023-04-14 05:50:45 +08:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
|
|
|
)
|
|
|
|
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in "@PACKAGE_INIT@\n")
|
2024-08-27 16:57:13 +08:00
|
|
|
+ if(NOT BUILD_SHARED_LIBS)
|
2023-04-14 05:50:45 +08:00
|
|
|
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in "
|
|
|
|
+ include(CMakeFindDependencyMacro)
|
2024-08-27 16:57:13 +08:00
|
|
|
+ find_dependency(libyuv CONFIG)
|
2023-04-14 05:50:45 +08:00
|
|
|
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
+ find_dependency(Threads)
|
|
|
|
+ ")
|
|
|
|
+ endif()
|
|
|
|
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in "include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}-targets.cmake)")
|
|
|
|
+
|
|
|
|
+ # Install CMake configuration export file.
|
|
|
|
+ configure_package_config_file(
|
|
|
|
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in
|
|
|
|
+ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
|
|
|
|
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
|
|
|
+ NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
|
|
|
+ )
|
|
|
|
+ install(
|
|
|
|
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
|
|
|
|
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
|
|
|
|
+ )
|
|
|
|
endif()
|
|
|
|
|
2023-10-05 03:52:44 +08:00
|
|
|
# Handle both relative and absolute paths (e.g. NixOS) for a relocatable package
|