PDA

View Full Version : Why doesn't qmake automatically include relevant modules in project file?



skypuppy
30th December 2015, 09:31
1. I mean, we have to use the #include directive in our code, so why doesn't qmake pick up on that and put them in the project file? Unnecessary pain in the patoot to duplicate that effort, even though it is only a small effort, it can eat up several half-hours doing redundant chores. Isn't that why we use computers in the first place?

2. Along that line, if we did QT += <every module out there> in every single project file, we'd cover all the bases wouldn't we? What is the downside? Would the final executable be hugely bloated in size or does the compiler only add what is actually used?

anda_skoa
30th December 2015, 10:46
qmake can generate a project file from a directory's content, because at this point there is no file yet and thus cannot contain manual entries.
Once you potentially have to deal with manual code, e.g. compiler/platform specific sections, then it is often no longer possible to find the correct insertion point.

There would be a lot of code needed for very little gain, adding a module manually is trivial and only happens very rarely during project life time.

It might be possible to add such functionality to QtCreator though, but I guess nobody has really felt a need for that yet.

Cheers,
_