[Qt-creator] SUBDIRS template with common libraries used in multiple projects
Markus Franke
Markus.Franke at linguwerk.de
Thu Mar 5 15:00:10 CET 2015
Dear Eike,
thanks for your detailed reply. The setup you suggest indeed works fine.
The only thing is that the "app*_solution.pro" files cannot reside
inside the "app*" project folders. It means that you would have some
dangling solution files in a toplevel directory, but better than nothing.
Best regards,
Markus
Am 05.03.2015 um 13:01 schrieb Ziller Eike:
>> TEMPLATE = subdirs
>>
>> SUBDIRS = app1 myCommonLib
>>
>> app1.file = ./app1.pro
>> myCommonLib.file = ../myCommonLib/myCommonLib.pro
>>
>> app1.depends = myCommonLib
>
>
> myCommonLib.file = ../myCommonLib/myCommonLib.pro
>
> I think that ../ might be a problem already for qmake.
> I’m not sure what you mean with different shadowbuild directories. Qt Creator creates a single shadowbuild directory for each .pro file that you open as a toplevel project in Qt Creator.
>
> src/app1/app1.pro
> src/commonlib/commonlib.pro
> and
> src/app1_solution.pro with
>
> TEMPLATE = subdirs
> SUBDIRS = app1 commonlib
> app1.depends = commonlib
>
> Open src/app1_solution.pro in Qt Creator (not app1.pro nor commonlib.pro) & building results in a single shadowbuild directory where it builds commonlib in commonlib/ and app1 in app1/
>
>> On Mar 5, 2015, at 12:01 PM, André Hartmann <andre.hartmann at iseg-hv.de> wrote:
>>
>> Hi Markus,
>>
>> I must admit I'm no expert when it comes to subdirs projects.
>>
>>> well, disabling shadow-building is actually not an option as this
>>> would spoil my SVN directory with temporary build files.
>>
>> I understand.
>>
>>> I don't have a clue why, because I thought that the *.pro.shared
>>> settings should be superior to the *.pro.user settings.
>>
>> There have been (multiple) discussions on the mailing list regarding the
>> sharing of build settings.
>>
>> IMHO, the crux is to have exactly the same Kits on all developing
>> computers. This should be achivable by using sdktool.
>>
>> But that would, unlike you want, place the build files within the source
>> folders.
>>
>>> As you can see from the naming of my "solutions" - I am looking for
>>> something like the well known Visual Studio Solutions (*.sln) in Qt
>>> Creator.
>>
>> If you get one step further, I'd like to know. I'm also interested in
>> such setups.
>>
>> Best regards,
>> André
>>
>> Am 05.03.2015 um 09:26 schrieb Markus Franke:
>>> Dear André,
>>>
>>> Am 04.03.2015 um 15:34 schrieb André Hartmann:
>>>> So the only way I see (if you can't change the project structure) is to
>>>> disable shadow-building by hand.<
>>>>
>>>> I'm not sure if it works with the shadow build option, but you could try
>>>> to disable shadow build by setting up a pro.shared file. You just need
>>>> to figure out the correct key from the pro.user file.
>>>>
>>>> http://qt-project.org/doc/qtcreator-3.0/creator-sharing-project-settings.html
>>>>
>>>
>>> well, disabling shadow-building is actually not an option as this would
>>> spoil my SVN directory with temporary build files.
>>>
>>> Thanks for the link to the setup of shared project settings. I did some
>>> experiments with it, however after a new user does a clean check out of
>>> the project together with the *.pro.shared file, the relevant settings
>>> get marked "sticky" in the newly created *.pro.user file. I don't have a
>>> clue why, because I thought that the *.pro.shared settings should be
>>> superior to the *.pro.user settings.
>>>
>>> So the only way I see to use the SUBDIRS template with my common library
>>> would be to have the following filesystem layout:
>>>
>>> /GenericCodeFolder/
>>> ——app1 (using commonlib)
>>> ——app1.pro (TEMPLATE=app)
>>> ——app2 (using commonlib)
>>> ——app2.pro (TEMPLATE=app)
>>> ——app3 (using commonlib)
>>> ——app3.pro (TEMPLATE=app)
>>> ——commonlib
>>> ——commonlib.pro (TEMPLATE=lib)
>>> ——app1_solution.pro (TEMPLATE=SUBDIRS)
>>> ——app2_solution.pro (TEMPLATE=SUBDIRS)
>>> ——app3_solution.pro (TEMPLATE=SUBDIRS)
>>>
>>> As you can see from the naming of my "solutions" - I am looking for
>>> something like the well known Visual Studio Solutions (*.sln) in Qt
>>> Creator.
>>>
>>> Best regards,
>>> Markus
>>>
>>> Btw: I am using Qt Creator 3.3.1.
>>>
>>>>
>>>>
>>>> Best regards,
>>>> Andre
>>>>
>>>> Am 04.03.2015 um 14:10 schrieb Markus Franke:
>>>>> Hi André,
>>>>>
>>>>> Am 04.03.2015 um 13:53 schrieb André Hartmann:
>>>>>> Markus, as far as I can see you already use yyy.depends=xxx,
>>>>>> but the problem is, that the library is build in a different folder due
>>>>>> to shadow-building?
>>>>>
>>>>> Yes you are right. Due to the fact that I am referencing the library
>>>>> through relativ paths like "../../" in my SUBDIRS project, it won't get
>>>>> built inside the shadow build folder. The build files will rather be
>>>>> stored two levels above the shadow build folder because of the relative
>>>>> paths. Everything compiles fine but I don't like the fact that my built
>>>>> files will be stored "somewhere in the wild".
>>>>>
>>>>> Best regards,
>>>>> Markus
>>>>>
>>>>>>
>>>>>> Best regards,
>>>>>> Andre
>>>>>>
>>>>>> Am 04.03.2015 um 12:46 schrieb Diego Iastrubni:
>>>>>>> Maybe you need a specific build order? See this:
>>>>>>>
>>>>>>> http://stackoverflow.com/questions/11079398/how-to-set-build-order-in-qt-subdir-project
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> And add this to your pro file
>>>>>>>
>>>>>>> |CONFIG += ordered|
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Feb 25, 2015 at 2:59 PM, Markus Franke
>>>>>>> <Markus.Franke at linguwerk.de <mailto:Markus.Franke at linguwerk.de>>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Dear all,
>>>>>>>
>>>>>>> I am struggeling with using the SUBDIRS template within my
>>>>>>> project. I
>>>>>>> already opened up a thread on the Qt Project Forum
>>>>>>>
>>>>>>> https://qt-project.org/forums/viewthread/53340/
>>>>>>>
>>>>>>> My problem is described over there. I wanted to ask on this
>>>>>>> list if
>>>>>>> anybody of you have some more suggestions regarding this issue.
>>>>>>>
>>>>>>> Thanks and with best regards,
>>>>>>> Markus Franke
>>>>>>> _______________________________________________
>>>>>>> Qt-creator mailing list
>>>>>>> Qt-creator at qt-project.org <mailto:Qt-creator at qt-project.org>
>>>>>>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Qt-creator mailing list
>>>>>>> Qt-creator at qt-project.org
>>>>>>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>> --
>> Best regards / Mit freundlichen Grüßen
>> André Hartmann, Dipl.-Ing. (FH)
>> Software Project Manager
>>
>> iseg Spezialelektronik GmbH | phone: ++49 (0)351 26996-43
>> Bautzner Landstr. 23 | fax: ++49 (0)351 26996-21
>> D-01454 Radeberg / Rossendorf | web: www.iseg-hv.com
>>
>> Geschäftsführer / Managing director: Dr. F. Gleisberg, Dr. J. Pöthig
>> Amtsgericht / Lower district court: Dresden HRB 16250
>> Ust.-Id.-Nr. / VAT-ID: DE812508942
>>
>> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
>> Informationen. Wenn Sie nicht der richtige Adressat sind oder
>> diese E-Mail irrtümlich erhalten haben, informieren Sie bitte
>> sofort den Absender und vernichten Sie diese Mail.
>> Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser
>> Mail ist nicht gestattet.
>>
>> This e-mail may contain confidential and/or privileged information.
>> If you are not the intended recipient (or have received this e-mail
>> in error) please notify the sender immediately and delete this e-mail.
>> Any unauthorized copying, disclosure or distribution of the material
>> in this e-mail is strictly forbidden.
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
>
--
------------------------------------------------------------
Dipl.-Inf. Markus Franke
Embedded Systems Engineering (ES)
Linguwerk GmbH Office: +49 351 6533-6967
Schnorrstraße 70 Fax: +49 351 6533-6965
01069 Dresden E-Mail: Markus.Franke at linguwerk.de
Germany Web: www.linguwerk.de
------------------------------------------------------------
Linguwerk GmbH; Geschäftsführer (Managing Directors): Dr. Rico Petrick,
Dr. Horst-Udo Hain, Karina Matthes; Sitz (Registered Office): Dresden;
HRB (Commercial Register No.): 29862; Registergericht (Registration
Court): Dresden
This email and any attachments are intended only for the person to whom
this email is addressed and may contain confidential and/or privileged
information. If you received this email in error, please do not disclose
the contents to anyone, but notify the sender by return email and delete
this email (and any attachments) from your system.
More information about the Qt-creator
mailing list