[cmake] fix override/final check