# OpenCV CMake config file sets OpenCV\_FOUND to FALSE

**URL:** <https://forum.opencv.org/t/opencv-cmake-config-file-sets-opencv-found-to-false/24488>\
**Category:** C++\
**Tags:** build, cmake, cuda\
**Created:** [April 30, 2026, 10:01am UTC](https://forum.opencv.org/t/opencv-cmake-config-file-sets-opencv-found-to-false/24488 "2026-04-30T10:01:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dr\_Nic](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dr\_Nic](https://forum.opencv.org/u/Dr_Nic)\
**Post date:** [April 30, 2026, 10:01am UTC](https://forum.opencv.org/t/opencv-cmake-config-file-sets-opencv-found-to-false/24488/1 "2026-04-30T10:01:42Z")

</div>

I’m using CMake to build [Depth-Anything-TensorRT](https://github.com/spacewalk01/depth-anything-tensorrt/blob/main/docs/INSTALL.md)  
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:
> 
> ```auto
> 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?
