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 Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 3.8k Views 1 Watching
  • 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 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

    jsulmJ 1 Reply Last reply
    0
    • B bogong

      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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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
      2
      • jsulmJ jsulm

        @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 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.

        jsulmJ 1 Reply Last reply
        -1
        • B bogong

          @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.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on 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
            3
            • sierdzioS sierdzio

              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 last edited by
              #6

              Issue closed.

              1 Reply Last reply
              0

              • Login

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