Ask Your Question
0

Cross Compile for Axis camera.

asked 2014-08-26 14:04:46 -0600

Hello. I'm trying to build OpenCV for an Axis camera (embedded app). I've copied arm-gnueabi.toolchain.cmake and edit several lines:

set(CMAKE_C_COMPILER /usr/local/mipsisa32r2el/r12/mipsisa32r2el-axis-linux-gnu/bin/gcc) set(CMAKE_CXX_COMPILER /usr/local/mipsisa32r2el/r12/mipsisa32r2el-axis-linux-gnu/bin/g++) set(ARM_LINUX_SYSROOT /usr/local/arm/r11 CACHE PATH "ARM cross compilation system root")

when I try run cmake

cmake . -DCMAKE_TOOLCHAIN_FILE=/home/alibaba/axis/toolchain.cmake

It uses /usr/bin/cc

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-10-28 01:30:23 -0600

Hello this is what I got:

OpenCV

prefix2=~/build_artpec4/install#CHANGE THIS PATH TO THE ONE YOU HAVE!! prefix1=~/build_artpec4#CHANGE THIS PATH TO THE ONE YOU HAVE!!

exec_prefix=${prefix2} libdir= includedir_old=${prefix2}/include/opencv includedir_new=${prefix2}/include

OpenCV (Note no linebreak)

LIBS += ${exec_prefix}/lib/libopencv_ml.a ${exec_prefix}/lib/libopencv_stitching.a ${exec_prefix}/lib/libopencv_objdetect.a ${exec_prefix}/lib/libopencv_calib3d.a ${exec_prefix}/lib/libopencv_features2d.a ${exec_prefix}/lib/libopencv_highgui.a ${exec_prefix}/lib/libopencv_flann.a ${prefix1}/lib/libopencv_ts.a ${exec_prefix}/lib/libopencv_imgproc.a ${exec_prefix}/lib/libopencv_core.a ${prefix1}/3rdparty/lib/libzlib.a -lrt -lpthread -lm -ldl -lstdc++ ${exec_prefix}/lib/libopencv_nonfree.a

OpenCV

CFLAGS +=-I${includedir_old} -I${includedir_new} CXXFLAGS +=-I${includedir_old} -I${includedir_new} $(PROGS):$(OBJS) $(CXX) $(LDFLAGS) $^ $(LIBS)$(LDLIBS) -o $@

#Note you need to link with c++

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-08-26 14:04:46 -0600

Seen: 865 times

Last updated: Oct 28 '17