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. [SOLVED] Copy a directory recursively by qmake.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Copy a directory recursively by qmake.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.5k Views 2 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.
  • CKurduC Offline
    CKurduC Offline
    CKurdu
    wrote on last edited by CKurdu
    #1

    I want to copy a directory that has many subdirectories and javascript and css files. it works as expected on Linux. Unfortunatly my code doesn't work on windows 7 when I compile.

    Related code in my pro file

    tdestdir = $$clean_path($$PWD/../installer/ClientInstaller/packages/TemasClient/data)
        DESTDIR = $$tdestdir
        RESDIR = $$clean_path($$PWD/../resources/share)
    
        resourcedata.commands = $(COPY_DIR) \"$$RESDIR\" \"$$DESTDIR\"
        first.depends = $(first) resourcedata
        export(first.depends)
        export(resourcedata.commands)
        QMAKE_EXTRA_TARGETS += first resourcedata
    

    I got compile error "Invalid Parameter". But I test related command in windows console, it works.

    xcopy /s /q /y /i "C:/Qt/projects/temasframework_clients/temasframework_clients/resources/share" "C:/Qt/projects/temasframework_clients/temasframework_clients/installer/ClientInstaller/packages/TemasClient/data"

    What is the problem? Thank you for advance.

    You reap what you sow it

    1 Reply Last reply
    0
    • CKurduC Offline
      CKurduC Offline
      CKurdu
      wrote on last edited by
      #2

      I found the solution. Problem is related to windows path separator. It should be backslash. So I wrote and added these lines of code.

          tdestdir = $$clean_path($$PWD/../installer/ClientInstaller/packages/TemasClient/data)
          DESTDIR = $$tdestdir
          tdestdir = $$shell_quote($$tdestdir)
          RESDIR = $$shell_quote($$clean_path($$PWD/../resources/share))
      
      win32{
              tdestdir = $$system_path($$tdestdir)
              RESDIR = $$system_path($$RESDIR)
      }
      
          resourcedata.commands = $(COPY_DIR) $$RESDIR $$tdestdir
          first.depends = $(first) resourcedata
          export(first.depends)
          export(resourcedata.commands)
          QMAKE_EXTRA_TARGETS += first resourcedata
      

      You reap what you sow it

      1 Reply Last reply
      2
      • C Offline
        C Offline
        cp_mark
        wrote on last edited by
        #3

        Thanks @CKurdu
        For others: Specifically what I needed was $$system_path(...)
        See qmake replace functions.

        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