improve cmake version detection and build warning