Skip to content

prittt/opencv-project-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCV Project Generator

OpenCV Project Generator is a template project (including a "CMakeLists" file) which will let you to automatically create a C++ project including OpenCV (they must be already installed on your machine) without having to manually set all configuration parameters. The project is cross platform and will prevent you to waste a lot of time whenever you want to create a new project which requires OpenCV library.

Requirements

To correctly run the OpenCV Project Generator following libraries and utility are required:

  • CMake 3.0.0 or higher;
  • OpenCV (tested with Opencv 3.0 and later versions);
  • One of your favourite IDE/compiler (tested with Visual Studio 2013/2015/2017).

Installation ...

  1. Clone the GitHub repository (HTTPS clone URL: https://github.com/prittt/OpenCV_Project_Generator.git) or simply download the full master branch zip file and extract it wherever you want ("MyProject" folder in the following of this README.md). The extracted or clone project will contain the following folders/files:

    • bin: where to put the project generated by CMake (suggested);

    • doc: where to put project's documentation (empty);

    • include: where to put header (.h, .hpp, ..) files. At the beggining it will contains an empty "example_header.h" file.

    • src: where to put source (.c, .cc, .cpp, ..) files. At the beginning it will contains an example "main.cpp" file to test the entire project and to test if OpenCV are correctly included by the project;

    • tools: where to put scripts files (empty);

    • .gitignore and .git: git's files/folders (useless for your project);

    • CMakeLists.txt: file that CMake will use to create the project.

... using CMake GUI:

  1. Run CMake specifying as source code path "MyProject" (mandatory) and as where to build binaries "MyProject/bin" (suggested).

    step_1
  2. Click on configure and select the desired project generator (Microsoft Visual Studio 14 2015 in this example) click finish and wait until the end of the generation process

    step_2
  3. If the system variable OPENCV_DIR is correctly set CMake will automatically find the OpenCV installation folder, otherwise it will display an error and the OpenCV installation path must be manually set in the "OpenCV_DIR" field

  4. Error example: step_3
  5. From CMake is also possible to specify the output project name (PROJECT_NAME field), and the list of OpenCV's packages required be the project (OpenCV_REQUIRED_PACKAGES). Default packages list contains all the packages required by the example, if your application requires some other packages yuo can add them separated by semicolon. To add all OpenCV's packages leave the list empty

    step_4
  6. When all CMake parameters are correctly set click again on configure button and, if everithing is ok (no more red entry) click on configure button.

  7. In the specified binary dir (MyProject/bin in this README.md example) you can now find the project or the make file depending on the project generator chosen at step 3

... using CMake from command line:

Work in progress

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages