optimizing cmake files and environment setting files.