This is optional. However, if you are applying for an academic job the forewarning that the candidate has a family, and the general ages of the children, is very useful for both the chair of the hiring committee and for the local housing office, as they will know what information to send you about housing, schools, family amenities, etc. You would probably leave this information off a c.v. that was for a purpose which did not involve housing/schooling and you can leave it off anyway, if you feel that it is nobody’s business but your own. People with alternative families also need to consider to where the c.v. is going. This is unfortunate, but still largely true.