I was able to build opencv-2.4.7 on CentOS 6 but I had to edit /usr/local/src/opencv-2.4.7/cmake/cl2cpp.cmake and comment out string(MD5 hash "${lines}") on line 50. Otherwise I would get this error:
string does not recognize sub-command MD5
Are there any negative consequences from commenting out that line?