Wednesday, January 20, 2010

Using CMake to configure OpenCV 2.0 for use with Visual Studio 2008

I use CMake 2.8.0 to configure OpenCV 2.0 so that I could build the library files needed to develop software using Visual Studio (C++) 2008 Professional Edition.
CMake can be downloaded from http://www.cmake.org/cmake/resources/software.html .
After having CMake installedin your computer, I did the following steps:
  1. Run CMake (cmake-gui).
  2. Enter C:/OpenCV2.0 as the source code folder.
  3. Enter C:/OpenCV2.0/vs2008 as the folder where I want to build the binaries.
  4. Click Configure.
  5. Choose Visual Studio 9 2008, and choose Use default native compilers. Click Finish.
  6. Click Generate. It will generate the required files in C:/OpenCV2.0/vs2008
  7. Open the file OpenCV.sln in the folder C:\OpenCV2.0\vs2008 with Visual Studio 2008.
  8. Choose menu Build, Configuration Manager. Choose Active solution configuration: Debug.
  9. Choose menu Build, Build solution. Wait for a while until it finished.
  10. Verify that the following library files are created and located in C:\OpenCV2.0\vs2008\lib\Debug :
    • cv.lib
    • cv200d.lib
    • cvaux200d.lib
    • cvhaartraining.lib
    • cxcore200d.lib
    • cxts200d.lib
    • highgui200d.lib
    • ml200d.lib
    • opencv_ffmpeg200d.lib
  11. Choose menu Build, Configuration Manager. Choose Active solution configuration: Release.
  12. Choose menu Build, Build solution. Wait for a while until it finished.
  13. Verify that the following library files are created and located in C:\OpenCV2.0\vs2008\lib\Release :
    • cv.lib
    • cv200.lib
    • cvaux200.lib
    • cvhaartraining.lib
    • cxcore200.lib
    • cxts200.lib
    • highgui200.lib
    • ml200.lib
    • opencv_ffmpeg200.lib
  14. Now we have had the needed library files for building computer vision application with OpenCV 2.0 and Visual C++ 2008.

No comments:

Post a Comment