In this article we are going to show how to use cross compile from CMake. In order to do that we should follow carefully the Cross Compile guide to make sure the environmnet is properly set.
There are few dependencies should be installed on your local system before running CMake:
sudo apt install \
At this point our libraries are ready to be used.
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ cmake -B build_imx
The build_imx folder will be created and the project will use the respective compiler assigned to CC or CXX. After this step, we are ready to build our executable by calling:
cmake --build build_imx
target_link_libraries(detect videostream vaal deepview-rt)
install(TARGETS detect RUNTIME DESTINATION bin)