Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Should *.pro file be part of my project?
Absurd last edited by Absurd
What's the common use with the .pro file that's created by qmake?
- Use it once, just to create the Makefile, discard it, and from now on edit the Makefile? (so the *.pro will not be tracked by git)
- Maintain it is part of my git repository, and every change I want to do in my Makefile should be originated from the *.pro file (by generating new Makefile from *.pro)?
I've been doing option 2 above up until now but it has a side effect;
When I clone my git repository from one server to another and then compile (with 'make') - since the make recognize that the file is new - it regenerates the Makefile from the *.pro file, and by that changing it.
What's the convention?
Definitely, 100% option 2.
When I clone my git repository from one server to another and then compile (with 'make')
You should always run
qmakeon such new clone, then
Do not store
Absurd last edited by
So, git should not track my Makefile, got it.
How should the build process look like then? Should I have a "build script" that does:
make clean && make
and the user will execute if they want to build?
That's not needed. People should rather use out of source builds or will use Qt Creator, just document things properly or point them to the Qt documentation.
Absurd last edited by
"use out of source builds" - you mean use the *.pro file?
I should have probably mention earlier what I mean when I say "user";
We have an automated system that builds a project with many (mostly CLI) tools, which are used internally in the company.
My qt project is a submodule in that project, and I need to give the guy who's in charge of that automated system the set of commands that he need to integrate into his build process in order to produce the ultimate binary which is my qt application.
For now, we only need that binary for Unix (maybe in the future for Win as well).
So that's why I was thinking about giving him something along the lines of what I wrote above.
"out of source" means something like:
cd .. mkdir build cd build qmake ../source/my_project.pro make
It is a build which does not pollute the source directory with any extra files.
Usually, automated systems like GitLab provide a mean to write these scripts.
Does your system provide that ?