title: How does CMake command find_package work with variable <name>_DIR
body: <p>I have a question about the CMake command <code>find_package</code>.</p>
  
  <p>For example, when I want use OpenCV, I can set the variable <code>OpenCV_DIR</code>. <code>OpenCV_DIR</code> also has a default value. But which command generates this variable <code>OpenCV_DIR</code>,  and when?</p>