title: OpenCV 2.3.1 installation, VS 2010, MEX
body: <p>this is yet another OpenCV installation question, however I wasn't able to find an answer by reading answers to existing ones. I'm trying to set up OpenCV 2.3.1 directories in VS 2010 and migrate several of my projects to this new version from OpenCV 2.2. I followed this <a href="https://stackoverflow.com/questions/7011238/opencv-2-3-c-visual-studio-2010/7014918#7014918">Setup OpenCV-2.3 for Visual Studio 2010</a> post, which is for 2.3 (2.3 and 2.3.1 apparently have the same folder structure), but it doesn't seem accurate. </p>
  
  <p>First of all, if I download and extract OpenCV-2.3.0-win-superpack.exe (version from 2011-07-04 on sourceforge), there aren't <code>build</code> and <code>opencv</code> directories. Also, there aren't any precompiled libraries, I have to use CMake, create VS2010 solution and compile it from scratch.</p>
  
  <p>Second, the three include directories</p>
  
  <pre><code>C:\OpenCV2.3\build\include\opencv
  C:\OpenCV2.3\build\include\opencv2
  C:\OpenCV2.3\include
  </code></pre>
  
  <p>do not contain all the necessary module headers. If I include</p>
  
  <pre><code>#include &lt;opencv/cv.h&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>#include &lt;opencv2/opencv.hpp&gt;
  </code></pre>
  
  <p>and try to build the project, I get C1083 for every module (core, imgproc, ...), as <code>opencv.hpp</code> has these lines</p>
  
  <pre><code>#include "opencv2/core/core_c.h"
  #include "opencv2/core/core.hpp"
  #include "opencv2/flann/miniflann.hpp"
  #include "opencv2/imgproc/imgproc_c.h"
  ...
  </code></pre>
  
  <p>Indeed, the headers of each module are not in any of the three include directories above, they are in <code>modules</code> folder, deeply nested in complicated directory structure as <code>modules\{module}\include\opencv2\{module}\{module}.hpp</code>, so I have to add every include directory manually. This seems to work, but it is very time consuming especially when changing something and it gets very complicated when compiling Matlab MEX programs, because in Matlab there's no such thing as property sheets or simple management of include directories. I don't understand why it gets with each new version more and more difficult to properly configure OpenCV...</p>
  
  <p>So, my question is: am I doing something wrong? Perhaps CMake configuration (I used all the defaults, compiler VS10 x64)? The documentation for newer versions of OpenCV is missing and the posts such as <a href="https://stackoverflow.com/questions/7011238/opencv-2-3-c-visual-studio-2010/7014918#701491">Setup OpenCV-2.3 for Visual Studio 2010</a> describe much simpler procedure and directory structure...</p>