Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Creator 2.7 add new disabled

Tags:

qt-creator

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.

Thank you!

like image 695
Gorkadread Avatar asked Jun 11 '13 10:06

Gorkadread


2 Answers

That's because you have to add the file/s in CMakeLists.txt and this makes sense because you explicitly choosing cmake over the internal building system.

like image 112
user2384250 Avatar answered Oct 22 '22 16:10

user2384250


  1. Add the file to the CMakeLists.txt file.

    Note: If you added another file while working on the same project, that new .cpp file would already be added in the same folder structure as your current project. In that case, no changes to CMakeLists.txt are required.

  2. Now simply, right click on the project entry and click on "Run CMake". This will automatically add the newly created .cpp file to the project structure and it will be shown in the project outline view.

like image 42
akshay chawla Avatar answered Oct 22 '22 17:10

akshay chawla