我在 Visual Studio 2010 上使用 OpenCV,它工作正常,但我想知道是否可以进行对 windows 中的所有项目都有效的配置。而不是配置每个项目。
提前致谢
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.
指定每个用户的目录列表
1.在视图菜单上,单击属性管理器。
2.在属性管理器中,单击配置和平台节点;例如,调试 | 赢32。
该节点展开并显示一个用户属性表,例如 Microsoft.Cpp.%platform%user,其中 %platform% 是系统定义的值,例如 Win32 或 X64。%platform% 值和项目的平台必须相同。
3. 双击用户属性表,或单击用户属性表,然后单击快捷菜单中的属性。
将显示 %user Property Sheet%Property Pages 对话框,并突出显示 VC++ Directories 节点。
4. 编辑目录列表,如前面“指定项目目录列表”的步骤 3 中所述。