Added support for gcc 4.6 and old cmake versions