Use cmake and opencv source code to generate a Visual Studio Project

Source: Internet
Author: User

Opencv1.0 is divided into Windows and Linux. I have always used opencv1.0. This version is being downloaded. After installation, an opencv already exists under the \ opencv \ _ make folder. DSW project files can be opened directly using vc6 or Visual Studio to compile the project. For opencv2.0 and later versions, there is no similar project file. At this time, you need to use the cmake tool to generate a Visual Studio project file. This article is to teach you how to complete this step.

The procedure is as follows:

(1) download the cmake tool, you can directly go to the cmake home page to download the http://www.cmake.org /;

(2) Follow cmake to set everything by default and click "Next;

(3) download opencv2.0 (similar to other versions );

(4) Open the cmake tool, as shown in:


(5) Click the "Browse source..." next to "where is the source code... "button to select the installation path of opencv. For example, the installation path of opencv2.0 is c: \ opencv2.0src \ opencv2.0;

(6) Click the "Browse build..." next to "where to build the binaries... "button to select the path of the project file generated by cmake. For example, the path selected by the author is: C: \ opencv2.0src \ opencv2.0vs2008;

As shown in:

(7) Click the "Configure" button in the lower-left corner and select the compilation platform. For example, if vs2008 is installed on the author's machine, select Visual Studio 9 2008. As shown in:

(8) Click "finsh". The following figure is displayed:

(9) Click "Config" again. The result is as follows:

(10) Click "generate". The result is as follows:


(11) at this point, the Visual Studio project file you need is generated. For example, the path of the project file selected by the author is c: \ opencv2.0src \ opencv2.0vs2008, which is as follows:

How do I see the opencv. sln project?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.