-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Description
System Information
OpenCV version: 4.12.0 (d12fa37)
Operating System / Platform: Windows 11 24H2 26100.2605
Compiler & compiler version: Visual Studio 2022 (v143)
Detailed description
I git clone the code directly, and then directly in powershell via cmake ... generated the .sln file, and then when building, I noticed that when compiling the opencv_imgcodecs module, it would fail to compile because the avif library read failed.
I realized that avif.dll is loaded incorrectly in the dependencies, where the correct load should be avif.lib. this file is found by OpenCVFindAVIF.cmake. I don't know if this has something to do with my environment variable configuration or if this is a cmake bug.
Related Code (where AVIF_LIBRARY is set):
opencv/cmake/OpenCVFindAVIF.cmake
Lines 13 to 32 in d12fa37
| unset(AVIF_FOUND) | |
| find_package(libavif QUIET) | |
| if(TARGET avif) | |
| MARK_AS_ADVANCED(AVIF_INCLUDE_DIR) | |
| MARK_AS_ADVANCED(AVIF_LIBRARY) | |
| SET(AVIF_FOUND TRUE) | |
| GET_TARGET_PROPERTY(AVIF_LIBRARY avif LOCATION) | |
| GET_TARGET_PROPERTY(AVIF_INCLUDE_DIR1 avif INCLUDE_DIRECTORIES) | |
| GET_TARGET_PROPERTY(AVIF_INCLUDE_DIR2 avif INTERFACE_INCLUDE_DIRECTORIES) | |
| set(AVIF_INCLUDE_DIR) | |
| if(AVIF_INCLUDE_DIR1) | |
| LIST(APPEND AVIF_INCLUDE_DIR ${AVIF_INCLUDE_DIR1}) | |
| endif() | |
| if(AVIF_INCLUDE_DIR2) | |
| LIST(APPEND AVIF_INCLUDE_DIR ${AVIF_INCLUDE_DIR2}) | |
| endif() | |
| else() |
Steps to reproduce
git clone https://github.com/opencv/opencv.git
cd opencv
mkdir build
cd build
cmake ..
open opencv.sln
build opencv_imgcodecs
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)

