applied cmake into simple factory