August 11, 2011

ajm24 ajm24
Lab Rat
1 posts

Using Subdirs

 

Hi, I have a project structured in the following way

  1. Root /
  2.    Server /
  3.       Library /
  4.          build /
  5.             debug/
  6.             release/
  7.          code /
  8.             .cpp, .h, .pro files
  9.          resources /
  10.             resource files
  11.       Process /
  12.          build /
  13.             debug/
  14.             release/
  15.          code /
  16.             .cpp, .h, .pro files
  17.          resources /
  18.             resource files
  19.    Client /
  20.       API /
  21.          build /
  22.             debug/
  23.             release/
  24.          code /
  25.             .cpp, .h, .pro files
  26.          resources /
  27.             resource files
  28.       Client /
  29.          build /
  30.             debug/
  31.             release/
  32.          code /
  33.             .cpp, .h, .pro files
  34.          resources /
  35.             resource files

I am wondering if it possible to keep this structure and use a subdirs template at the same time. From what I have seen I can’t find a way to change the target of where the subdirs build too. For example I have the following in my .pro file(which is in my root directory):

  1. TEMPLATE = subdirs
  2. SUBDIRS = \
  3.              Server/Library/code/Library.pro \
  4.              Server/Process/code/Process.pro \
  5.              Client/API/code/API.pro \
  6.              Client/API/code/Client.pro \
  7.  
  8. Library.subdir = Server/Library/code/Library.pro
  9.  
  10. Process.subdir = Server/Process/code/Process.pro
  11. Process.depends = Library
  12.  
  13. API.subdir = Client/API/code/API.pro
  14. API.depends = Library
  15.  
  16. Client.subdir = Client/API/code/Client.pro
  17. Client.depends  = Library API

When I run something like this, the debug and release folder are created in the same directory as the .pro file of each project(the code folder), is there a way I can tell it to build everything in the build folder? If not is there an easy way to make a something that will compile each of my projects in the correct order?

Thanks!

3 replies

August 12, 2011

ucomesdag ucomesdag
Lab Rat
243 posts

Hope someone has an idea, looking for something similar.

 Signature 

Write “Qt”, not “QT” (QuickTime).

August 17, 2011

dword dword
Lab Rat
22 posts

What I understand (correct me if I’m wrong) is that you want to specify a common build directory for each sub-target. Have you tried to specify a DESTDIR (like ../../build) in each sub-target .PRO file?

January 31, 2014

zakarrrr zakarrrr
Lab Rat
9 posts

Did you try using Shadow-Build?

 Signature 

If a person is doing things behind you, he s clearly an ...
Because he is an ..., he will tell any stories, which will make you think he is ok! -.-

 
  ‹‹ [SOLVED] pushButton causing my program to freeze      [solved] manage sqlite database ››

You must log in to post a reply. Not a member yet? Register here!