I finally solved my problem using .pri files for my libs and using the following command in my .pro file:
include(path/to/my/lib/mylib.pri)
My project hierarchy is as follow:
root
\app
\app1
\app2
\libs
\lib1
- class1.h
- class1.cpp
- class2.h
- class2.cpp
\lib2