Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved questions about make install and uninstall

    General and Desktop
    2
    11
    376
    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.
    • T
      Tink last edited by Tink

      Hi,

      I'm wondering how DESTDIR compares with other build systems. Sometimes i see make DESTDIR=/dir install like this . Is that usable with qmake as well?

      Also, i noticed that after qmake and make install and make uninstall, empty top level directories will remain . E.g. make install creates /opt/share/doc/<appname>/<filename>. And after make uninstall, /opt/share/doc/ is still there with nothing else in the directory since it was created by the make install. This seems to happen for every directory that was created to have other directories. Is this expected behaviour?

      T 1 Reply Last reply Reply Quote 0
      • T
        Tink @Tink last edited by

        Can anyone comment on this?
        Or should this be asked in another part of the forum..?

        1 Reply Last reply Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          Please show some patience and allow at least 24 hours before bumping your own thread. This is a voluntary driven forum and people may not even live in the same time zone as you.

          As for your question, you should not try to hard code through qmake where your application should go. That's rather a choice for your users.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          T 1 Reply Last reply Reply Quote 0
          • T
            Tink @SGaist last edited by

            Hey @SGaist

            I will be more patient in the future. And i do appreciate the efforts of people like you responding as much as you do. They should pay you i think. Or give you a free lifelong license at least!

            As for my question, i'm not trying to hard code the final destination. But trying to understand what can be done for packaging. With GNU Autotools i see DESTDIR a lot for a temporary destination.

            The DESTDIR variable can be used to perform a staged installation. The package should be configured as if it was going to be installed in its final location (e.g., --prefix /usr), but when running make install, the DESTDIR should be set to the absolute name of a directory into which the installation will be diverted. From this directory it is easy to review which files are being installed where, and finally copy them to their final location by some means. (https://www.gnu.org/software/automake/manual/html_node/DESTDIR.html)

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              Packaging is even a different thing. Can you explain what kind of package you want to create ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply Reply Quote 0
              • T
                Tink last edited by

                Well for whatever Linux distro is being used. It can be accomplished with cp commands but if it can be done with a make command, it would be the more elegant solution i think. Since all the install sets are already defined in the project file for a make install.

                1 Reply Last reply Reply Quote 0
                • T
                  Tink last edited by Tink

                  Ok, it seems that for this purpose $INSTALL_ROOT exist. https://doc.qt.io/qt-5.9/deployment-android.html

                  The documentation is a bit confusing/lacking at times when one expects to find the info in a certain place only to discover it on stackoverflow first and then on an android specific page...

                  Which leaves the other question of the remaining empty directories, if anyone knows how to fix that?

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    That's were there's something not clear. You are talking about packaging your application, yet you would use make install which implies compiled your code.

                    So which is your use case ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply Reply Quote 0
                    • T
                      Tink last edited by Tink

                      People, end user or packager, can download the code, qmake, make, make install. And in the case of creating a package, they can use make install with INSTALL_ROOT and then use the specific distribution's packaging method. Which uses the temporary install location which has the correct filesystem layout, to create a package.

                      Makes sense?

                      1 Reply Last reply Reply Quote 0
                      • SGaist
                        SGaist Lifetime Qt Champion last edited by

                        Yes it does, in the case if DESTDIR, it's rather for when you use the subdir template. For example to group your libs together. Nowadays, you would use it with OUT_PWD so you can easily use out of source build while having the option to structure your generated applications/libraries.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply Reply Quote 1
                        • T
                          Tink last edited by Tink

                          Ah i see. Well i just use the app template.

                          The other question i had about the empty directories not getting removed, is because the Makefile has a plain rmdir for the DEL_DIR variable. Changing that with rmdir -p fixes it. E.g. make uninstall DEL_DIR='rmdir -p'.

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