OpenCV CMake config file sets OpenCV_FOUND to FALSE

I’m using CMake to build Depth-Anything-TensorRT
I’ve changed the paths to the corresponding path to OpenCV & TensorRT but CMkae keeps throwing the following error (full trace),

– Building for: Visual Studio 17 2022
– Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.22631.
– The C compiler identification is MSVC 19.44.35226.0
– The CXX compiler identification is MSVC 19.44.35226.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:23 (find_package):
Policy CMP0146 is not set: The FindCUDA module is removed. Run “cmake
–help-policy CMP0146” for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.0 (found version “12.0”)
– OpenCV ARCH: x64
– OpenCV RUNTIME:
– OpenCV STATIC: OFF
CMake Warning at C:/Program Files/Open CV/build/OpenCVConfig.cmake:190 (message):
Found OpenCV Windows Pack but it has no binaries compatible with your
configuration.

You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:28 (find_package)

CMake Error at CMakeLists.txt:28 (find_package):
Found package configuration file:

C:/Program Files/Open CV/build/OpenCVConfig.cmake

but it set OpenCV_FOUND to FALSE so package “OpenCV” is considered to be
NOT FOUND.

Any idea what’s going on here?