'How to use qmake.conf?

https://doc.qt.io/qt-5/qmake-environment-reference.html mentions qmake.conf, but how can I use it? What is the format? What would be one use case for it?

I'm currently using Windows environment variables on a Qt5 project, to set path to external libraries. This is good because allow other developers of the project to install the dependencies on their machines in possibly different locations.

I'm wondering if there is a file QtCreator reads, besides .pro.user, from which it would be possible to load variables into the project, so being an alternative to using windows environment variables.



Solution 1:[1]

qmake.conf as the name suggests (and as the documentation you link says) is a file containing persistent build configuration information for your project. Each toolchain will contain a mkspecs directory with a series of subdirectories for each target that toolchain can build for.

You generally don't need to modify qmake.conf yourself. If you're using qmake for your project, you will have a .pro file in which you can put whatever you need. Generally, Qt Creator's project wizard will give you a good start.

Note that if you're using CMake, QMake is irrelevant.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mzimmers