Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Moved] Deployment including external libraries
Forum Updated to NodeBB v4.3 + New Features

[Moved] Deployment including external libraries

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 4 Posters 4.5k 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.
  • W Offline
    W Offline
    walteste
    wrote on last edited by
    #1

    I would like to know what is the best practice to get the external libraries (not the Qt Libraries) linked against my application into the release folder of me compiled application.

    Step by step:

    • I am compiling my application that includes some external libraries which are also written by myself.
    • If i run the application thru Qt Creator, then it works fine. Thru windows explorer it tells me of course, that the dll's are missing.
    • I would like within my build process, that this libraries are copied to the same folder as my executable is getting created.

    What are the different ways to achieve this or what is the best practice?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      You can define a destination folder in the pro file.

      @
      #define the directory, where the binary is placed
      CONFIG(debug, debug|release) {
      DESTDIR = ../debug
      }
      else {
      DESTDIR = ../release
      }
      @

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • W Offline
        W Offline
        walteste
        wrote on last edited by
        #3

        Thanks Gerolf, but this will specify the location of the executeable created. But this does not copy my linked libraries to the same folder.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          AFAIK there is no means in qmake to achieve this directly. But you can get there with a little trick:

          • write a script that copies everything into the right place
          • add QMAKE_POST_LINK=/path/to/your/script to the .pro file

          This will call your script every time your application is built (after the link step).

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • W Offline
            W Offline
            walteste
            wrote on last edited by
            #5

            That worked perfect, thank you very much.

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qxoz
              wrote on last edited by
              #6

              [quote author="Volker" date="1322649165"]AFAIK there is no means in qmake to achieve this directly. But you can get there with a little trick:

              • write a script that copies everything into the right place
              • add QMAKE_POST_LINK=/path/to/your/script to the .pro file

              This will call your script every time your application is built (after the link step).[/quote]

              [quote author="Stefan Walter" date="1323093437"]That worked perfect, thank you very much.[/quote]

              Can you are give more information about scripting for this case?

              1 Reply Last reply
              0
              • W Offline
                W Offline
                walteste
                wrote on last edited by
                #7

                [quote author="qxoz" date="1323098620"]
                [quote author="Volker" date="1322649165"]AFAIK there is no means in qmake to achieve this directly. But you can get there with a little trick:

                • write a script that copies everything into the right place
                • add QMAKE_POST_LINK=/path/to/your/script to the .pro file

                This will call your script every time your application is built (after the link step).[/quote]

                [quote author="Stefan Walter" date="1323093437"]That worked perfect, thank you very much.[/quote]

                Can you are give more information about scripting for this case?
                [/quote]
                What i did is that i've used a variable "LIBS_TO_PUBLISH". In all my libraries include (*.pri) files, i am adding the required libraries (based on release or debug, windows, linux or macos).

                Then in my project file i created the following entry:
                QMAKE_POST_LINK=copy_libs.bat ${TARGET_PATH} ${LIBS_TO_PUBLISH}

                i hope that explains enough, feel free to try it yourself :-)

                1 Reply Last reply
                0
                • Q Offline
                  Q Offline
                  qxoz
                  wrote on last edited by
                  #8

                  Thanks a lot!

                  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