Check for CMake policy before setting.