I had previously used OpenCV 2.4.5 with some certain configs and packages on Ubuntu 12.04.1 but had issues upgrading to OpenCV 2.4.6.1 on Ubuntu 12.04.2
Here is my blog post on installing OpenCV with it's many dependencies ie Cuda, OpenNI, Gstreamer, ffmpeg, QT5, ... ect.
http://drewski1992.blogspot.com/2014/04/install-opencv-24x-with-cuda-55-or-6.html
Following this should give you a full OpenCV build.