How to add the whole catalog to the QT creator project

I have an existing QT Creator project. I want to add the entire directory to this directory. I see that I can right-click in the browser tree of the project file and "Add existing files ..." However, through this dialog box I can add only individual files. How to enable the full catalog?

+6
source share
2 answers

The easiest way is to directly edit your .pro file, add HEADERS += mydir/*.h and SOURCES += mydir/*.cpp , and the contents of the entire directory will appear in QT Creator. Further link: http://qt-project.org/doc/qt-5/qmake-project-files.html

+11
source

Open a terminal, navigate to the folder in which you want to create the project file, and then run the command

 qmake -project 

This will search for the current directory and all subdirectories for files with extensions such as .c , .cpp , .h , etc. (a complete list is found by typing man qmake ).

But keep in mind that it will overwrite your current .pro file if you already have a project.

+6
source

Source: https://habr.com/ru/post/947049/


All Articles