Check for CMake version older than 3; Fix recursion error