Under the hood of qmake

As we said earlier, qmake is the foundation of the Qt framework compilation system. In Qt Creator, when you click on the Build button, qmake is invoked. Let's study what qmake is doing by calling it ourselves on the command-line interface (CLI).

Create a temporary directory where you will store the generated files. We are working on a Linux box, but this is transposable on any OS. We will choose /tmp/sysinfo. Using the CLI, navigate to this new directory and execute the following command:

/path/to/qt/installation/5.7/gcc_64/bin/qmake -makefile -o Makefile /path/to/sysinfoproject/ch02-sysinfo.pro

This command will execute qmake in the -makefile mode to generate a Makefile based on your sysinfo.pro file. If you skim ...

Get Mastering Qt 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.