Code from CMakeProjectManager the QtCreator plugin developped by Digia and enhanced to add a few features.