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. qmake: copy dir or file on each build
Forum Updated to NodeBB v4.3 + New Features

qmake: copy dir or file on each build

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

    I have an extra library ("pri" - project) with dir "android/src/mypackage" and want copy that dir at each build, following works only on clean build or complete rebuild:

    //extra_module.pri
    QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$shell_path($$PWD/android/src/mypackage) $$shell_path($$ANDROID_PACKAGE_SOURCE_DIR/src/mypackage) $$escape_expand(\n\t)
    //...
    

    Qt 5.15.2, QtCreator 4.14.2 on Windows

    K 1 Reply Last reply
    0
    • M morte

      I have an extra library ("pri" - project) with dir "android/src/mypackage" and want copy that dir at each build, following works only on clean build or complete rebuild:

      //extra_module.pri
      QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$shell_path($$PWD/android/src/mypackage) $$shell_path($$ANDROID_PACKAGE_SOURCE_DIR/src/mypackage) $$escape_expand(\n\t)
      //...
      

      Qt 5.15.2, QtCreator 4.14.2 on Windows

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @morte

      Which version of qmake are you using?

      In principle it shall work. I am using a similar command in my qmake files. However, I am not using the undocumented QMAKE_COPY_DIR but an xcopy with switches on windows.

      AFAIK the command will work only after a successful link as the QMAKE_POST_LINK already suggests. A simple restart of qmake later is not working.

      Probably you may get some idea of the logic created in makefile.

      Vote the answer(s) that helped you to solve your issue(s)

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

        It looks like QMAKE_POST_LINK is not suitable for this, as its no executed on each build is there another solution like "INSTALLS" qmake variable?

        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