1、修改平台文件opencv/platforms/linux/arm-gnueabihf.toolchain.cmake
set(GCC_COMPILER_VERSION "" CACHE STRING "GCC Compiler version")
set(GNU_MACHINE "arm-linux-gnueabihf" CACHE STRING "GNU compiler triple")
set(CMAKE_C_COMPILER /usr/local/lib/gcc-linaro-7.5/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER /usr/local/lib/gcc-linaro-7.5/bin/arm-linux-gnueabihf-g++)
include("${CMAKE_CURRENT_LIST_DIR}/arm.toolchain.cmake")
2、编译
新建build执行一下命令
cmake .. -D CMAKE_BUILD_TYPE=Release -D CUDA_nppi_LIBRARY=true -D WITH_CUDA=OFF -D BUILD_TIFF=ON -D CMAKE_INSTALL_PREFIX=../output -D OPENCV_ENABLE_NONFREE=True -DCMAKE_TOOLCHAIN_FILE=../platforms/linux/arm-gnueabihf.toolchain.cmake
make -j2
make install
标签:gnueabihf,set,CMAKE,编译,openCV,linux,cmake,arm From: https://www.cnblogs.com/linux-learn/p/18183077