SUBDIRS template with common libraries used in multiple projects
I have the following directory layout for my three independent Qt applications:
All three applications are using myCommonLib. I would like to use the SUBDIRS template for my individual project files. The project file for app1 looks as follows:
TEMPLATE = subdirs
SUBDIRS = app1 myCommonLib
app1.file = ./app1.pro
myCommonLib.file = ../myCommonLib/myCommonLib.pro
app1.depends = myCommonLib
This works fine and I can build the project. However, as I am using "Shadow Build", Qt Creator will create the build folder of myCommonLib outside of my "Shadow Build folder". I guess this is because of the relative path. I understand that the "SUBDIRS"-Template might only be suitable for projects which actually do consist of subdirectories. That's not the case in my directory-layout, as myCommonLib is not a subdirectory of app1.
However, is there a way how I can prevent Qt Creator from creating the build-files for myCommonLib outside the actual "Shadow-Build-directory"?
Thanks in advance and with best regards,
What's the pro file of myCommonLib ?
Well, it's just a normal project file starting with
@TEMPLATE = lib
CONFIG += staticlib@
I might have misunderstood your initial setup. So you have something like
Hi, yes that's right.
Then AFAIK, it's not a setup supported by the subdirs template. Two options I can see: make a real subdirs project with all your apps and commonLib in it or treat commonLib like other dev library and have it installed in a known place and link to it the usual way