Finally fixed cmake mode rule.