cmake: fixes for old cmake 2.8.12