Based on this stack overflow article
http://stackoverflow.com/questions/19162072/installing-raspberry-pi-cross-compiler/19269715#19269715
Test the hello world program first:
cd /opt/rpi/cmake-hello-world
mkdir build
cd build
cmake -D CMAKE_TOOLCHAIN_FILE=$HOME/raspberrypi/pi.cmake ../
make
scp CMakeHelloWorld [email protected]:/home/pi/
ssh [email protected] ./CMakeHelloWorld
Now run the program from your PI
cd /opt git clone https://github.com/Itseez/opencv cd opencv git checkout 2.4.9 cp /root/build.opencv . ./build.opencv