https://github.com/opencv/opencv/blob/85669309222191ccf9ed8767ec9f14f0e790eee4/cmake/OpenCVGenPkgconfig.cmake#L113 [1157/1198] cd /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64 && /usr/bin/cmake -DCMAKE_HELPER_SCRIPT=/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64/OpenCVGenPkgConfig.info.cmake -P /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/cmake/OpenCVGenPkgconfig.cmake FAILED: unix-install/opencv4.pc /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64/unix-install/opencv4.pc cd /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64 && /usr/bin/cmake -DCMAKE_HELPER_SCRIPT=/var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0_build-abi_x86_64.amd64/OpenCVGenPkgConfig.info.cmake -P /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/cmake/OpenCVGenPkgconfig.cmake CMake Error at /var/tmp/portage/media-libs/opencv-4.10.0/work/opencv-4.10.0/cmake/OpenCVGenPkgconfig.cmake:113 (cmake_minimum_required): Compatibility with CMake < 3.5 has been removed from CMake. Update the VERSION argument <min> value. Or, use the <min>...<max> syntax to tell CMake that the project requires at least <min> but has been updated to work with policies introduced by <max> or earlier. Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. Reproducible: Always
Created attachment 921589 [details] compressed build log
Reported upstream at https://github.com/opencv/opencv/issues/27122
Failure is with USE="contrib contribdnn eigen features2d ffmpeg jpeg opengl openmp png qt6 tiff truetype vaapi webp -atlas -avif -contribcvv -contribfreetype -contribhdf (-contribovis) -contribsfm -contribxfeatures2d -cuda -cudnn -debug -dnnsamples -doc -examples -gdal -gflags -glog -gphoto2 -gstreamer -gtk3 -ieee1394 -jasper -java -jpeg2k -lapack -mkl -non-free -opencl -opencvapps -openexr -python -quirc -tbb -tesseract -test -testprograms -v4l -vtk -xine" Looking at the code, I suspect there will be more failures, but they don't manifest with this configuration.
Created attachment 924407 [details, diff] CMake-4.x patch Tnis patch solves the issue with CMake 4.x.x. Checked with CMake-4.0.1. For quick fix create folder /etc/portage/patches/media-libs/opencv and put it there.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de005c58db7f4b0cfff3f5c0df46e69b8eec3ac1 commit de005c58db7f4b0cfff3f5c0df46e69b8eec3ac1 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2025-04-13 19:25:57 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2025-04-14 18:00:33 +0000 media-libs/opencv: Fix build w/ >=cmake-4 Closes: https://bugs.gentoo.org/951724 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> media-libs/opencv/files/opencv-4.10.0-cmake4.patch | 165 +++++++++++++++++++++ media-libs/opencv/opencv-4.10.0.ebuild | 1 + 2 files changed, 166 insertions(+)