Fix build failures for older cmake versions. #4146