Adapted CMakeLists.txt to enable building with cake.