Install Cocos2d-x on Ubuntu 12.04

If you can, please switch to 14.04...

Download cmake binary from https://cmake.org/download/
Extract to /opt

sudo tar -xzf cmake*.tar.gz -C /opt

Make symlink

sudo ln -f -s /opt/cmake*/bin/cmake /usr/bin/cmake

Check version

cmake --version

Download glfw3 source code from http://www.glfw.org/download.html

unzip glfw*.zip -d ~/
cd ~/glfw*
cmake -G "Unix Makefiles"
sudo make install

Then you can follow the instructions at http://www.cocos2d-x.org/wiki/Linux_Installation_and_Setup

Running cpp-tests got this error
./cpp-tests: error while loading shared libraries: libfmod.so.6: cannot open shared object file: No such file or directory

Make symlink to fix

cd <*COCOS FOLDER LOCATION*>/external/linux-specific/fmod/prebuilt/64-bit
ln -s libfmod.so libfmod.so.6
ln -s libfmodL.so libfmodL.so.6

ref:
http://stackoverflow.com/questions/17768008/how-to-build-install-glfw-3-and-use-it-in-a-linux-project
http://askubuntu.com/questions/355565/how-to-install-latest-cmake-version-in-linux-ubuntu-from-command-line
https://github.com/cocos2d/cocos2d-x/issues/14961