refine cmake scripts