QT5.2.1 :-1: error: Unknown module(s) in QT: serialport

Hi,
I am trying to work with serial port communication in a little console application on linux and after some research i saw that the module for serialport is in the basic installation qt5.1 or superior.

I checked in the installation folder of qt5.2.1 and i found files related to this module but it seems qt don't find them. Also, when including <QtSerialPort/QtSerialPort> it don't find it but it seems to be able to find <QtSerialPort/QSerialPortInfo>.

Do i have to transfert files to my application folder or am i missing a line somewhere in my .pro/.cpp files ?

I know this topic is very old and I'm sure everyone on here has figured out a solution, but I wanted to post my solution to this problem. I did the following things for linking QSerialPort to an application using the static build of Qt 5.11.2: