Fix cmake configuration issue.

More cmake automation, has discussed in various mails.