0
I’m developing a project and would like to start separating things into smaller parts and also to be able to test those parts, so researching found something about using the *.pri files to be able to make a chain of projects and subprojects, but I was confused how this can be organized and would like some more accessible explanation being that I am still beginner in the area.
Previously the files were all inside: "myapp > core"
I organized the files and folders as follows. NOTE: Just one example, there are many files to organize.
├── core/
│ ├── myMath.h
│ ├── myMath.cpp
│ ├── quadTree.h
│ ├── quadTree.cpp
│ ├── bvh.h
│ ├── bvh.cpp
│ ├── myVec2.h
│ └── myVec2.cpp
├── gui/
│ ├── MainWindow.h
│ ├── MainWindow.cpp
│ ├── Explorer.h
│ ├── Explorer.cpp
│ └── gl/
│ ├── glView.h
│ ├── glView.cpp
│ ├── shaders/
│ ├── vertex.vert
│ └── fragment.frag
├── main.cpp
├── myApp.pro
├── Doxyfile
├── README.md
└── resources.qrc
Apparently I need to create a *.pro type file like this in the project root: myapp.pro
TEMPLATE = subdirs
SUBDIRS += core Gui \
Then in each printer I must create a *.pri file that lists the files inside that printer.
HEADERS += myMath. h myVec2.h \
SOURCES += myMath.cpp myVec2.cpp \
But there are some situations that I want/need to get around.
Where should I declare *.pro with myapp configs? That is *.pro which must contain the complete configs. Today my file is more or less like this https://pastebin.com/5msdv8YA
1º: Begin to separate the implementation files from the things of the graphical interface, in the matter of the files, because of the implementation I already do this, I try to leave the GUI the least connected to the code possible.
2º: To be able to test the project in smaller parts. For example: I created a Math class and need to test all functions and returns. For this today I create a separate project and do the tests and when it is apparently all right I throw the files there in the final project.
Three, it’s the same as the second, but it happens with widgets. I created a custom widget and needed to test, so I didn’t want to put it in the final GUI and have to compile the software every single change I made, so I created a simplified separate project where I did the testing, but this I think ends up being bad because the steps of change I end up omitting in the git commit, because it is in another project.
These last two I think could create each part a filter inside the TEST and put a mini design. Example
├── core/
│ ├── myMath.h
│ ├── myMath.cpp
│ ├── myVec2.h
│ └── myVec2.cpp
│ ├── Test/
│ ├── Math /
│ ├── math.pro
│ ├── main.cpp
│ ├── Vec2 /
│ ├── vec2.pro
│ ├── main.cpp
I accept suggestions!