Fix some cmake issues from NMI. #4146