'How to get list of all object files?

I generated an empty project with Qt Creator. There is .pro-file:

QT       += core gui
QT += widgets
TARGET = untitled2
TEMPLATE = app
CONFIG += c++11
SOURCES += \
        main.cpp \
        mainwindow.cpp
HEADERS += \
        mainwindow.h
FORMS += \
        mainwindow.ui
write_file("objects", OBJECTS)

According documentation, OBJECTS variable is automatically populated from the SOURCES variable. But actually this variable is empty.

How to get list of all object files, including mocs? For this .pro-file list must be like this:

debug/main.o
debug/mainwindow.o
debug/moc_mainwindow.o

Qmake (3.1) (Qt 5.15.2)



Solution 1:[1]

Once you build QT source in Release / Debug mode then you can check generated Directory on Parent Folder of your Source Code. In that you can see release and debug folders formed, where you will get list of all object files for SOURCES variable.

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 Amol Saindane