I am not sure I follow what you are attempting to do, but mention of the private-dev packages perked my ears.
In a "Debian/Ubuntu"-esque environment, there are multiple *-private-dev packages, some of which are required for compiling additional libraries like QtMqtt.
apt search "private-dev"for a long list for both Qt5 and Qt6. This may be the one you are looking for.
qtbase5-private-dev/jammy-updates,now 5.15.3+dfsg-2ubuntu0.2 amd64 [installed] Qt 5 base private development files