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. [SOLVED]Multi-destinations for Qt project
QtWS25 Last Chance

[SOLVED]Multi-destinations for Qt project

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 2.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.
  • M Offline
    M Offline
    mbnoimi
    wrote on last edited by
    #1

    Howdy,

    How can I set multi-destinations option for Qt project?

    I tried to use the following in .pro file but it just execute the first destination only!
    @DESTDIR += ./installer
    DESTDIR += ./bin@

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      What are you expecting to achieve with this? Your linker can only output to a single location anyway.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbnoimi
        wrote on last edited by
        #3

        bq. What are you expecting to achieve with this? Your linker can only output to a single location anyway.

        I want to copy my application's binary to many paths this ease deplyment process.

        P.S. I can use system() but don't want to write 3 system functions for each operating system (specially I'm not Windows & Mac user)

        1 Reply Last reply
        0
        • C Offline
          C Offline
          code_fodder
          wrote on last edited by
          #4

          Not sure you can re-direct to more then one destination, but you can add copy steps to the post link stage (which is effectively the same thing!)

          In your case something like:
          @QMAKE_POST_LINK += cp ./installer/* ./bin@

          Or for windows:
          @QMAKE_POST_LINK += copy ./installer/* ./bin@

          (I think... I am not on my code machine so syntax might be a little out!, try the command first in a terminal/dos promt)

          1 Reply Last reply
          0
          • C Offline
            C Offline
            code_fodder
            wrote on last edited by
            #5

            oh yeah... only one annoying thing about that is if you have not changed any source code the compile/link stage never occurs and therefore the QMAKE_POST_LINK commands are never run.

            I have not found a way to do commands all the time regardless of linker stage. So when I want to force the issue I either re-build all, or modify a file comment...

            (edit: that line goes into your .pro file ... I think I did not mention that) :)

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mbnoimi
              wrote on last edited by
              #6

              [quote author="code_fodder" date="1371809569"]Not sure you can re-direct to more then one destination, but you can add copy steps to the post link stage (which is effectively the same thing!)

              In your case something like:
              @QMAKE_POST_LINK += cp ./installer/* ./bin@

              Or for windows:
              @QMAKE_POST_LINK += copy ./installer/* ./bin@

              (I think... I am not on my code machine so syntax might be a little out!, try the command first in a terminal/dos promt)[/quote]

              As I mentioned above, this solution not what I'm looking for because I don't want to call different commands for each operating system. I'm looking for a real cross-platform solution.

              1 Reply Last reply
              0
              • C Offline
                C Offline
                code_fodder
                wrote on last edited by
                #7

                well... its really not a huge effort :o

                somthink like:

                windows {
                QMAKE_POST_LINK += copy ./installer/* ./bin
                }
                linux {
                QMAKE_POST_LINK += cp ./installer/* ./bin
                }

                most multi platform projects have some things that are different and you need a few if's and but's.... This IS a multi-platform solution... but it is entirely up to you :)

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mbnoimi
                  wrote on last edited by
                  #8

                  bq. This IS a multi-platform solution… but it is entirely up to you :)

                  This isn't a pure cross-platform solution it may work under some platforms (as number of ifs you type).

                  My question is crystal clear, I don't want to add any IF statement I'm looking for "copy" command works on all available platforms for Qt.

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    ChrisW67
                    wrote on last edited by
                    #9

                    bq. My question is crystal clear, I don’t want to add any IF statement I’m looking for “copy” command works on all available platforms for Qt.

                    There is no such beast.

                    qmake defines some variables for its internal use that you could try to use: QMAKE_COPY, QMAKE_COPY_DIR, QMAKE_MOVE, QMAKE_DEL_FILE, QMAKE_DEL_DIR, QMAKE_CHK_DIR_EXISTS, QMAKE_MKDIR
                    Bear in mind these are not documented (and differ from Qt4 to Qt5 I think).

                    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