title: cmake find_package specify path
body: <p>I have 2 versions of OpenCV installed on my machine. One is in <code>/usr/local/opencv3.1</code>. I presume the install location of the other one (version 3.4) is <code>/usr/local</code>. Anyway, <code>find_package(OpenCV 3.0 REQUIRED)</code> sets <code>OpenCV_DIR:PATH=/usr/local/share/OpenCV</code>. This folder contains:</p>
  
  <pre><code>haarcascades  OpenCVConfig.cmake          OpenCVModules-release.cmake
  java          OpenCVConfig-version.cmake  valgrind_3rdparty.supp
  lbpcascades   OpenCVModules.cmake         valgrind.supp
  </code></pre>
  
  <p>In this case, version 3.4 is used. How can I specify in CMakeLists.txt to use the other version (3.1) knowing its install location? I've tried:</p>
  
  <pre><code>find_package(OpenCV 3.0 REQUIRED PATH /usr/local/opencv3.1)
  </code></pre>
  
  <p>Which returns an error:</p>
  
  <pre><code>Could NOT find OpenCV (missing: PATH /usr/local/opencv3.1) (found suitable version "3.4.1", minimum required is "3.0")
  </code></pre>
  
  <p>and</p>
  
  <pre><code>set(OpenCV_DIR /usr/local/opencv3.1/OpenCV/*) # also tried OpenCV_ROOT_DIR, OPENCV_ROOT_DIR
  find_package(OpenCV 3.0 REQUIRED)
  </code></pre>
  
  <p>Which does nothing. It still finds version 3.4. I'd be grateful for any help. Thank you.</p>