Important: Please read the Qt Code of Conduct -

Qt Creator 2.7 non-qt project can't add files

  • Hi.

    I'm sitting in Ubuntu 12.04 with Qt Creator v2.7 (tried new one aswell, 2.8 beta) and when I create a Non-Qt Project / Plain C++ Project (CMake Build) all seems well. But when I right-click on the project to Add New, that option is disabled. So is Add Existing Files..., New Subproject and Add Library.

    Am I missing something obvious? I think I've been through pretty much all of the menus but I can't find anything seemingly related to this issue.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    IFAIK the cmake support is not as complete as the qmake one. You still need to add things manually.

  • I've been working with Cmake for a while now with Qt Creator, and you do have to do most of the work manually, at least for now. The file structure of your project must be managed manually. Loading a Cmake project with Qt Creator creates a Project structure (in the Projects view) that will only contain files declared in the Cmake files, which might not reflect what is actually in your project folders on the file system. After adding new files to both the file system and cmake files, you should run cmake again to make them appear in Qt Creator.

  • Thank you both for your answers. It seems I have not really understood what Cmake is and what it does :) I'll start reading up on how to use it tonight. Thanks again!

  • Moderators

    Creator does indeed only support adding files to qmake projects for now. There are no plans to add this feature to other build systems (with the exception of qbs at some point) as we just do not have enough information on where (which file and or the position in the file) the new file names need to be inserted.

    Some build systems are just not made with IDEs in mind... there is little we can do about that. Sorry.

Log in to reply