Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Setup the Build directory through variable in *.pro file. How?
Forum Update on Monday, May 27th 2025

Setup the Build directory through variable in *.pro file. How?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 3.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote on 30 Jan 2020, 12:43 last edited by
    #1

    Hello all!
    Is there any way to set the build directory through the variable in *.pro file?

    I need to define this:

    Screenshot 2020-01-30 at 15.40.57.png

    J 1 Reply Last reply 30 Jan 2020, 12:49
    0
    • B bogong
      30 Jan 2020, 12:43

      Hello all!
      Is there any way to set the build directory through the variable in *.pro file?

      I need to define this:

      Screenshot 2020-01-30 at 15.40.57.png

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 30 Jan 2020, 12:49 last edited by
      #2

      @bogong Is there a reason why you want to do this?
      Build directory is the directory where you call qmake, there is usually no need to specify build directory in pro file (especially not absolute paths).
      You can specify directory for build artefacts using DESTDIR.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply 30 Jan 2020, 12:56
      2
      • J jsulm
        30 Jan 2020, 12:49

        @bogong Is there a reason why you want to do this?
        Build directory is the directory where you call qmake, there is usually no need to specify build directory in pro file (especially not absolute paths).
        You can specify directory for build artefacts using DESTDIR.

        B Offline
        B Offline
        bogong
        wrote on 30 Jan 2020, 12:56 last edited by bogong
        #3

        @jsulm DESTDIR - DO NOT define build directory. It's for result, where to put application out. This is not what I've been asking about. I am perfectly aware of:

        DESTDIR = $$PWD/../../builds/$${BUILD_NAME}/$${BUILD_TYPE}_$${BUILD_PLATFORM}
        OBJECTS_DIR = $${DESTDIR}/.objects
        MOC_DIR = $${DESTDIR}/.moc
        RCC_DIR = $${DESTDIR}/.rcc
        UI_DIR = $${DESTDIR}/.ui
        

        I am seeking what I've been asking about.

        J 1 Reply Last reply 30 Jan 2020, 13:01
        -1
        • B bogong
          30 Jan 2020, 12:56

          @jsulm DESTDIR - DO NOT define build directory. It's for result, where to put application out. This is not what I've been asking about. I am perfectly aware of:

          DESTDIR = $$PWD/../../builds/$${BUILD_NAME}/$${BUILD_TYPE}_$${BUILD_PLATFORM}
          OBJECTS_DIR = $${DESTDIR}/.objects
          MOC_DIR = $${DESTDIR}/.moc
          RCC_DIR = $${DESTDIR}/.rcc
          UI_DIR = $${DESTDIR}/.ui
          

          I am seeking what I've been asking about.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 30 Jan 2020, 13:01 last edited by
          #4

          @bogong said in Setup the Build directory through variable in *.pro file. How?:

          DO NOT define build directory

          I didn't say it does...

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • S Offline
            S Offline
            sierdzio
            Moderators
            wrote on 30 Jan 2020, 13:07 last edited by
            #5

            You can't define that directory in .pro. Qt Creator will always override it, that's the whole point.

            So either:

            • use DESTDIR and disable shadow build in Qt creator
            • or specify the destination dir in Qt Creator (you can modify the default one in settings)

            (Z(:^

            B 1 Reply Last reply 30 Jan 2020, 13:30
            3
            • S sierdzio
              30 Jan 2020, 13:07

              You can't define that directory in .pro. Qt Creator will always override it, that's the whole point.

              So either:

              • use DESTDIR and disable shadow build in Qt creator
              • or specify the destination dir in Qt Creator (you can modify the default one in settings)
              B Offline
              B Offline
              bogong
              wrote on 30 Jan 2020, 13:30 last edited by
              #6

              Issue closed.

              1 Reply Last reply
              0

              1/6

              30 Jan 2020, 12:43

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved