OpenCV_4.2.0/copy_opencv_files.sh

24 lines
959 B
Bash

#!/bin/bash
# 源目录和目标目录的定义
SOURCE_DIR=/home/autolabor/ThirdParty/opencv-build/build
TARGET_BIN=/usr/bin
TARGET_INCLUDE=/usr/include
TARGET_SHARE=/usr/share
TARGET_LIB=/usr/lib/aarch64-linux-gnu
TARGET_PKGCONFIG=/usr/lib/aarch64-linux-gnu/pkgconfig
TARGET_CMAKE=/usr/lib/aarch64-linux-gnu/cmake
TARGET_PYTHON38=/usr/lib/python3.8/dist-packages/cv2/python3.8
TARGET_PYTHON27=/usr/lib/python2.7/dist-packages/cv2/python2.7
# 拷贝文件和目录
cp -r $SOURCE_DIR/bin/* $TARGET_BIN/
cp -r $SOURCE_DIR/include/opencv4 $TARGET_INCLUDE/
cp -r $SOURCE_DIR/share/opencv4 $TARGET_SHARE/
cp $SOURCE_DIR/lib/*.4.2.0 $TARGET_LIB/
cp $SOURCE_DIR/lib/pkgconfig/opencv4.pc $TARGET_PKGCONFIG/
cp -r $SOURCE_DIR/lib/cmake/opencv4 $TARGET_CMAKE/
cp $SOURCE_DIR/lib/python3.8/dist-packages/cv2/python3.8/*.so $TARGET_PYTHON38/
cp $SOURCE_DIR/lib/python2.7/dist-packages/cv2/python2.7/*.so $TARGET_PYTHON27/
echo "所有文件和目录已成功拷贝。"