Hi Rahul,
read this post: http://www.imxcv.blogspot.com.br/2014/02/building-opencv-24x-for-freescales-imx6.html
at the end you can find a sample code link (github) and instructions on how to build, you also can check the makefile inside "src" folder for more information.
regards,
Andre