Results 1 to 4 of 4

Thread: Configuring qmake to put files inside proper folder

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Configuring qmake to put files inside proper folder

    Hello!

    For better organization, I'ld like to put all files generated by QtCreator in a build command inside a "build" folder in my projects' folder. I've learned how to do most of this part - by configuring the .pro file of a project with the lines

    Qt Code:
    1. MOC_DIR = build/moc
    2. OBJECTS_DIR = build/obj
    3. UI_DIR = build/ui
    4. RCC_DIR = build/
    To copy to clipboard, switch view to plain text mode 

    and this part runs OK. The problem is that no matter how I try, when I run qmake it still insists in creating a "debug" and a "release" folder in my projects' base folder instead of creating them inside the "build" folder. I tried to correct this by configuring the DESTDIR variable:

    Qt Code:
    1. win32
    2. {
    3. debug: DESTDIR = build/debug
    4. release: DESTDIR = build/release
    5. }
    To copy to clipboard, switch view to plain text mode 

    and although this was enough to make QtCreator put the executables and related in the correct place, qmake still insists in creating a "debug" and "release" folder in my projects' base folder (now always empty). How do I change this? It's interesting that, when configuring the project at the time of creating, I wrote that I wanted de build and release directories to be inside a "build" folder, but still Qt Creator didn't obey me


    So how do I stop qmake from creating this two unecessary folders in my projects' base directory?


    Thanks,

    Momergil
    May the Lord be with you. Always.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Configuring qmake to put files inside proper folder

    The easiest way to create a build folder is to run qmake from there.
    I usually have build at the same level as the project folder itself, i.e. outside the version controlled source folder

    Something like
    Qt Code:
    1. projectfolder
    2. build
    3. install
    4. source
    To copy to clipboard, switch view to plain text mode 
    and I would initialize the build like this
    Qt Code:
    1. cd build
    2. qmake ../source/project.pro PREFIX=../install
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Momergil (10th May 2014)

  4. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Configuring qmake to put files inside proper folder

    This means you use the Qt command prompt to compile the project? o.O
    May the Lord be with you. Always.

  5. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Configuring qmake to put files inside proper folder

    No, just to create initialize the build directory.

    When configuring the project in QtCreator I point it to that build so it can use it as well.

    Cheers,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    Momergil (11th May 2014)

Similar Threads

  1. Proper way to use qmake and moc?
    By mossen in forum Newbie
    Replies: 1
    Last Post: 6th May 2011, 03:52
  2. Replies: 6
    Last Post: 3rd December 2010, 21:51
  3. Replies: 0
    Last Post: 13th October 2010, 05:27
  4. What's inside the installed Qt folder
    By rosenth in forum Installation and Deployment
    Replies: 1
    Last Post: 7th October 2010, 17:02
  5. Proper way to clean before re configuring
    By hubbobubbo in forum Installation and Deployment
    Replies: 1
    Last Post: 22nd January 2010, 12:18

Tags for this Thread

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.