Results 1 to 8 of 8

Thread: Shadow build directory relative to the project file?

  1. #1
    Join Date
    Jul 2009
    Location
    Italy, Pieve Ligure (GE)
    Posts
    55
    Thanks
    7
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Shadow build directory relative to the project file?

    Hi,

    is there a way to set the directory of the shadow build setting to be relative to the project file itself?

    I need it for accessing the same .pro from multiple platforms (XP and Ubuntu in my case). Obviously the directory where the .pro resides has completely different names under the two OS's and I would need to (remember to) change it each time I switch from one to the other.

    So, the possibility to set the shadow build directory to something like $$PWD/../build would be VERY useful.

    Thanks,

    M.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Shadow build directory relative to the project file?

    cd to the directory where you want the build to take place and call qmake with the relative directory to the project file. You really don't have to do everything in Creator... And besides, you can adjust the build steps freely in Qt Creator so even there it should be possible to obtain.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2009
    Location
    Italy, Pieve Ligure (GE)
    Posts
    55
    Thanks
    7
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: Shadow build directory relative to the project file?

    Thanks for the reply.

    I know it can be done manually, and that manually it is possible to do more, but this is precisely what I'm trying to avoid as much as possible.

    The code-compile-debug cycle is already complex enough and there are already so many things to remember that, at least for the compile step, I preferjust to have to press a button (if this means spending 1 or 2 days for configuring what stands behind that button, it's still time well spent), without having to remember a number of paths, different for each project and for each platform, and a number of command line syntaxes...

    Maybe I'm spoiled by almost two decades of VC6 - VisualStudio7-8-9 usage, maybe it is my aging brain, maybe it is simply a different perspective... who knows...

    But thanks anyway,

    M.

    P.S.: I take your answer as a polite "No, it is not possible", isn't it? (Customizations of qmake/make steps in Qt Creator are shared by all platforms, so this is not viable for me).

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Shadow build directory relative to the project file?

    Sure it's possible. Qt Creator is Open Source - feel free to change it. Adding support for using environment variables in the proper place or even a full-blown per-platform configuration should be pretty easy.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jul 2009
    Location
    Italy, Pieve Ligure (GE)
    Posts
    55
    Thanks
    7
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Shadow build directory relative to the project file?

    Quote Originally Posted by wysota View Post
    Qt Creator is Open Source - feel free to change it. Adding support for using environment variables in the proper place or even a full-blown per-platform configuration should be pretty easy.
    This is definitely a possibility, once I have finished my current projects and met a few deadlines and once I have got familiarized with the few code lines of its source code...

    Seriously, thanks for your reply: different perspective and attitudes are always an enrichment, particularly when they come from a far greater experience than I have.

    M.

  6. #6
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Shadow build directory relative to the project file?

    I had the same problem, and although 'Guru' wysota is - of course - right, I did find a *workable* solution for a newbie (like me).

    You can edit the .pro file, and add the following lines:

    OBJECTS_DIR=$$builddir
    DESTDIR=$$builddir

    I tested this with a lib build. This will make sure that the binaries will go into the ./release and ./debug directories respectively (if nothing else edited).

    Another option is to set these variables conditionally in the .pro file:
    win32: { DESTDIR = dir1 }
    linux: { DESTDIR = dir1 }
    ...

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Shadow build directory relative to the project file?

    Ok, but your solution has nothing to do with shadow build.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Nov 2009
    Posts
    2
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Shadow build directory relative to the project file?

    You are right - and it doesn't even work (the first 'solution' that is). I messed up my settings so that it seemed to work. Sorry about that...

Similar Threads

  1. Replies: 3
    Last Post: 29th June 2007, 09:32
  2. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 16:21
  3. QApplication: No such file or directory
    By Dolinski in forum Newbie
    Replies: 4
    Last Post: 24th May 2007, 06:13
  4. .h file for each form in QT 3.3.5 project??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 23rd March 2006, 12:59
  5. create file in another directory
    By raphaelf in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2006, 11:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.