applied cmake into Template Pattern