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. INSTALLS Paths/Files Cannot Be Empty ?

INSTALLS Paths/Files Cannot Be Empty ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 1.3k 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.
  • D Offline
    D Offline
    deleted605
    wrote on last edited by deleted605
    #1

    Hi all,

    Trying to define some installation (make install) steps for my project but got stuck in one point. There is a .pro file which gathers all the sub-projects together by using SUBDIRS. Here is the main idea,

    • All sub-projects will put their builds under $main_project_path/sub_project_path/output/binary/
    • After a successful build, all outputs will be copied under $main_project_path/output/ folder.

    So I wrote following lines in the SUBDIR template .pro file.

    public_builds.path = $$PWD/output/
    public_builds.files += "$$PWD/projects/sub-project-1/output/binary/*"
    public_builds.files += "$$PWD/projects/sub-project-2/output/binary/*"
    INSTALLS += public_builds
    

    Then I ran qmake, make and make install commands but the make install was failed. I ran qmake again without calling make clean, then ran the make install and it started working.

    I saw that, if the public_builds.files are not existing, qmake does not populate corresponding install lines in Makefile. The output files are being created after building the project, this is why it was worked on the 2. time when I run qmake after building.

    Is there any way to force the qmake to add install paths into the Makefile even the directories are empty?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      I think you should rather put the binary copying code in your subprojects. You can write it once, put into some .pri file and then include() in each subproject - should work.

      (Z(:^

      1 Reply Last reply
      0
      • D Offline
        D Offline
        deleted605
        wrote on last edited by
        #3

        Yep, it is working, I tested it. Isn't it possible to make it in the template pro file?

        sierdzioS 1 Reply Last reply
        0
        • D deleted605

          Yep, it is working, I tested it. Isn't it possible to make it in the template pro file?

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @canavaroski said in INSTALLS Paths/Files Cannot Be Empty ?:

          Yep, it is working, I tested it. Isn't it possible to make it in the template pro file?

          I don't see such option at the moment, but maybe I'm missing something.

          (Z(:^

          1 Reply Last reply
          0
          • D Offline
            D Offline
            deleted605
            wrote on last edited by
            #5

            Can you explain why this is happening? Or at least can you refer any technical document?

            sierdzioS 1 Reply Last reply
            0
            • D deleted605

              Can you explain why this is happening? Or at least can you refer any technical document?

              sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              @canavaroski said in INSTALLS Paths/Files Cannot Be Empty ?:

              Can you explain why this is happening? Or at least can you refer any technical document?

              Why what is happening? Why you need to build your project twice?

              The installation target is run when you compile (make) your project. But the Makefile is generated before that - when you run qmake. So at the time qmake is run, the files don't exist (the '*' wildcard does not match anything) and qmake skips it.

              INSTALLS command docs are here https://doc.qt.io/qt-5/qmake-advanced-usage.html#installing-files not sure if they will help with anything here, though.

              (Z(:^

              1 Reply Last reply
              0
              • D Offline
                D Offline
                deleted605
                wrote on last edited by
                #7

                So how "INSTALLS" works when I put it into the .pro file of the subproject instead of the template .pro file? Isn't qmake work in the same way? There will be no binary file at the time qmake works and they will be created after the compilation finishes and make install should fail.

                sierdzioS 1 Reply Last reply
                0
                • D deleted605

                  So how "INSTALLS" works when I put it into the .pro file of the subproject instead of the template .pro file? Isn't qmake work in the same way? There will be no binary file at the time qmake works and they will be created after the compilation finishes and make install should fail.

                  sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  @canavaroski said in INSTALLS Paths/Files Cannot Be Empty ?:

                  So how "INSTALLS" works when I put it into the .pro file of the subproject instead of the template .pro file? Isn't qmake work in the same way? There will be no binary file at the time qmake works and they will be created after the compilation finishes and make install should fail.

                  Indeed. I suppose the subdirs template handling in qmake just does not take it into account. You may suggest a change on Qt bugtracker, but it almost certainly won't be fixed (qmake is not actively developed anymore, only kept alive).

                  (Z(:^

                  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