Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    3
    6
    1070
    Loading More Posts
    • 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
      bogong last edited by

      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

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @bogong last edited by

        @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 Reply Quote 2
        • B
          bogong @jsulm last edited by 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.

          jsulm 1 Reply Last reply Reply Quote -1
          • jsulm
            jsulm Lifetime Qt Champion @bogong last edited by

            @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 Reply Quote 2
            • sierdzio
              sierdzio Moderators last edited by

              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 Reply Quote 3
              • B
                bogong @sierdzio last edited by

                Issue closed.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post