我的环境:
- 视窗 7 64
- CMake 2.8.10.2
- Opencv 2.4.4
- 视觉工作室速成版 2012
我的问题:
我有一个使用 Opencv 并在 vs11 下构建的 CMake 项目。一切都适用于预先构建的二进制文件(在我的例子中来自 c:/opencv/build)。我想更改一些 Opencv 设置,所以我必须从源代码(在 c:/opencv/build2 中)构建它。一切都在 c:/opencv/built2 中正确构建和安装,但我的 IDE 出现此错误:
错误 LNK1104:无法打开文件 'C:\opencv\build2\lib\Debug\Debug\opencv_objdetect244d.lib'
确实,没有这样的文件。似乎我的 CMakeLists.txt 脚本通过在每次调用中添加 Debug\(或 Release)子目录来破坏 OpenCV_LIBS 变量:
MESSAGE ( STATUS "OpenCV_LIBS = ${OpenCV_LIBS}" )
FIND_PACKAGE ( OpenCV COMPONENTS core highgui imgproc objdetect REQUIRED )
MESSAGE ( STATUS "OpenCV_LIBS = ${OpenCV_LIBS}" )
FIND_PACKAGE ( OpenCV COMPONENTS core highgui imgproc objdetect REQUIRED )
MESSAGE ( STATUS "OpenCV_LIBS = ${OpenCV_LIBS}" )
FIND_PACKAGE ( OpenCV COMPONENTS core highgui imgproc objdetect REQUIRED )
MESSAGE ( STATUS "OpenCV_LIBS = ${OpenCV_LIBS}" )
输出:
OpenCV_LIBS = 调试;C:/opencv/build2/lib/Debug/opencv_contrib244d.lib;(...)
OpenCV_LIBS = 调试;C:/opencv/build2/lib/Debug/Debug/opencv_objdetect244d.lib;(...)
OpenCV_LIBS = debug;C:/opencv/build2/lib/Debug/Debug/Debug/opencv_objdetect244d.lib;(...)
OpenCV_LIBS = debug;C:/opencv/build2/lib/Debug/Debug/Debug/Debug/opencv_objdetect244d.lib;(...)
OpenCV_LIBS = debug;C:/opencv/build2/lib/Debug/Debug/Debug/Debug/Debug/opencv_objdetect244d.lib;(...)
我的 CMake 脚本有问题吗?