refine config.cmake and example cmakes