Reputation: 5432
I'm working with OpenCV on Visual Studio 2010, it works fine, but I'm wondring if it's possible to make a configuration that will be valid for all projects in windows . instead of configuring every project.
thanks in advance
Upvotes: 2
Views: 445
Reputation: 22245
Yes it is. You need to use CMake. Make a folder that contains all the projects of OpenCV in different subfolders. You will need a cmakelists.txt file in the top folder that includes all the subfolders. On each subfolder you will need to have your source codes in src folder and your headers in a include folder. CMake will create a VS studio project for all your opencv different projects and will find authomatically the libs and link them.
Now, how to create the cmakelists.txt of each OpenCV project? Something like this:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT( project_name )
FIND_PACKAGE( OpenCV REQUIRED )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} {OpenCV_LIBS} )
Also check this links to set your cmake opencv projects. It is a pain the first time, but believe me that then is realy easy to create your projects, it is automatic.
Upvotes: 5
Reputation: 1392
To specify a per-user directory list
1.On the View menu, click Property Manager.
2.In Property Manager, click a configuration-and-platform node; for example, Debug | Win32.
The node expands and displays a user property sheet such as Microsoft.Cpp.%platform%user, where %platform% is a system-defined value such as Win32 or X64. The %platform% value and the platform for the project must be the same.
3. Either double-click the user property sheet, or click the user property sheet and then click Properties in the shortcut menu.
The %user Property Sheet%Property Pages dialog box is displayed, and the VC++ Directories node is highlighted.
4. Edit the directory lists, as described earlier in step 3 of "To specify a project directory list".
Upvotes: 0