Qt Forum

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

    Forum Updated on Feb 6th

    [Moved] Deployment including external libraries

    Mobile and Embedded
    4
    8
    4096
    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.
    • W
      walteste last edited by

      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 Reply Quote 0
      • G
        giesbert last edited by

        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 Reply Quote 0
        • W
          walteste last edited by

          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 Reply Quote 0
          • G
            goetz last edited by

            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 Reply Quote 0
            • W
              walteste last edited by

              That worked perfect, thank you very much.

              1 Reply Last reply Reply Quote 0
              • Q
                qxoz last edited by

                [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 Reply Quote 0
                • W
                  walteste last edited by

                  [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 Reply Quote 0
                  • Q
                    qxoz last edited by

                    Thanks a lot!

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