我在C++中为一个项目编写了一个C++,该项目使用OpenCV库。当我尝试使用cmake创建项目时,会遇到下一个配置问题:
CMake Error at CMakeLists.txt:15 (find_package):
Could not find module FindOpenCV.cmake or a configuration file for package
OpenCV.
Adjust CMAKE_MODULE_PATH to find FindOpenCV.cmake or set OpenCV_DIR to the
directory containing a
所以我一直在尝试构建一个github项目,但是它需要opencv,所以我根据它的网站安装了它。
在我尝试构建但是它得到了这个错误之后:
CMake Error at CMakeLists.txt:41 (find_package):
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation p
我正在尝试使用Windows10上的CMake图形用户界面来构建。
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
MSBuild.exe
to get the value of VCTargetsPath:
Configuring incomplete, errors occurred!
我将CMake配置为使用Visual Studio15 2017编译器。
我该如何解决这个问题呢?
如果需要,下面是CMakeLists.txt文件
cmake_minimum_requi
这是一个带有opencv的测试程序。它不应该做任何事。
#include <opencv2/opencv.hpp>
int main (){
cv::Mat src;
Mat dst; // <---- compile error (Mat not declared, suggested alternatives cv::)
cvNamedWindow("A", CV_WINDOW_AUTOSIZE);
cv::namedWindow("B", CV_WINDOW_AUTOSIZE);
median
来自以下示例:
CMakeList.txt文件:
include_directories(inc)
# Grab all the cpp and h files to be compile.
file(GLOB SOURCES
inc/*.h
inc/*.hpp
src/*.cpp
)
add_library(MyStaticLib STATIC ${SOURCES} )
target_link_libraries(MyStaticLib PUBLIC "${OPENCV_LIBS}/opencv_world410.lib" )
targ
我已经成功地在覆盆子圆周率上编译了opencv 3.1。随着图书馆的发展,一切都很顺利。现在我想建立另一个与opencv相同的raspberry,并且为了节省编译时间,我的想法是将二进制文件复制到第二个raspberry。
因此,我复制了opencv目录,包括构建文件夹,并尝试运行sudo make install。使用cmake编译不再使用已经编译的文件,而是重新开始编译。
我如何能让第二个树莓的构建环境相信没有必要重新编译所有的东西?在我最初的覆盆子上,我可以在完全相同的文件上运行sudo make install,而无需重新编译。在这两个系统上安装的开发库是相同的。这是一个cmake,m