cmake find_packages 搜索路径与 opencv版本管理

find_packages搜索路径:
设定一个project_DIR变量来指定路径,找到对应库的.cmake,例如:
set(OpenCV_DIR /usr/share/OpenCV)
多版本project:
先用locate projectConfig.cmake定位.cmake位置
后改变project_DIR变量应用
注:但是我编译安装的opencv用locate定位只找到了build里的.cmake路径,安装在usr/locate/share下的opencv的.cmake路径没找到,用这个命令就找全了sudo find / -iname OpenCVConfig.cmake
多版本opencv安装位置:
ros自带opencv,会默认安装到/usr/include(头文件),/usr/lib(动态/静态库),/usr/share(.cmake文件)三个目录。
opencv官网源码编译安装的,会默认安装到usr/local下对应的三个子目录。
opencv指定安装目录
make install DESTDIR= /home/kun/opencv-4.4.0
服务器端jupyter配置:https://www.jianshu.com/p/57c9580a46c2
启动:jupyter notebook --config /root/.jupyter/jupyter_notebook_config.py --allow-root >> jupyter.log 2>&1
cmakelist文件内将cpp11标准改为cpp14标准:
sed -i ‘s/++11/++14/g’ CMakeLists.txt
sudo ln -s /usr/include/eigen3/Eigen /usr/local/include/Eigen

你可能感兴趣的:(opencv,c++)