fixed cmake function ordering