I have multiple applications that will use one or more common libraries. Even my libraries could depend on each other.
Here is the files tree:
Libaries/
Library1/
Library1.pro
Library1.cpp
Library1.h
Library2/
Library2.pro
Library2.cpp
Library2.h
Applications/
App1/
App1.pro
main.cpp
App2/
App2.pro
main.cpp
App1 depends on Library1. App2 depends on Library1 and Library2.
I'd like to be able to develop in Qt creator in an easy way, when I open Application1 I have the following behavior:
- Application1 code available in Qt creator
- Library1 code available in Qt creator
- Compiling Application1 automatically compiles Library1 and puts the output .dll/.so file in the same directory than Application1 .exe.
This is basically what Visual Studio is able to do for years and seems such a basic thing to me that I don't understand I'm the only one having this problem.
Do you have any clue on how to do this ? I tried different solutions based on SUBDIRS, but I never reach all the 3 points above.
EDIT:To clarify a little, I would like to be able to do something like:
Application1.pro
include("Library1")
Application2.pro
include("Library1")
include("Library2")
And having all working automatically. I found solution which requires files in libraries to know what is the "parent" doing some includes, which is a non-sense to me, a library should not be aware of the program using it.