title: Cmake can not find local version of opencv on ubuntu 18.04
body: <p>I have a version of OpenCV ((3.4.1) compiled and installed in /home/m/locals/opencv</p>
  
  <p>the content of /home/m/locals/opencv is:</p>
  
  <pre><code>bin
  include
  lib
  share
  </code></pre>
  
  <p>I have an eniroment pointing to this directory:</p>
  
  <pre><code>echo $OPENCV_ROOT
  /home/m/locals/opencv
  </code></pre>
  
  <p>I have a cmake that tries to add opencv to project:</p>
  
  <pre><code> file(TO_CMAKE_PATH $ENV{OPENCV_ROOT} OpenCV_DIR)
   set(BUILD_SHARED_LIBS OFF)
   find_package(OpenCV  COMPONENTS core highgui imgproc imgcodecs videoio photo stitching flann ml features2d calib3d objdetect REQUIRED)
  </code></pre>
  
  <p>when I run cmake, I am getting this error:</p>
  
  <pre><code>CMake Error at /usr/local/share/OpenCV/OpenCVModules.cmake:399 (message):
  The imported target "opencv_core" references the file
  
       "/usr/local/lib/libopencv_core.so.3.4.0"
  
     but this file does not exist.  Possible reasons include:
  
     * The file was deleted, renamed, or moved to another location.
  
     * An install or uninstall procedure did not complete successfully.
  
     * The installation package was faulty and contained
  
        "/usr/local/share/OpenCV/OpenCVModules.cmake"
  
     but not all the files it references.
  </code></pre>
  
  <p>My questions:</p>
  
  <ol>
  <li>Why it is trying to find OpenbCV 3.4.0, when the one that i installed is 3.4.1</li>
  <li>How can I fix it and make msure that it points to the correct copy of openCV?</li>
  </ol>