Results 1 to 5 of 5

Thread: It is possible to rename file with qmake

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2012
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: It is possible to rename file with qmake

    Hi @all,

    the mentioned approach will work fine using unix/linux. However, what if you want to make the same for Windows?
    Of course I could add a similar section for win32. But then the pathes need backslashes \ rather than forwar slashes / (because of "copy") and if I want to use path-variables, I will have to declare them for unix and win32 separately

    It would be nice, if there would be a possibility to install a (extra) target under a different name, which is not platform dependent ...

    Best,

    Thorsten



    Qt Code:
    1. TEMPLATE = app
    2. TARGET =
    3. DEPENDPATH += .
    4. INCLUDEPATH += .
    5.  
    6. target.path = ../tmp/installpath # will not work for win32
    7. win32: target.path = ..\tmp\installpath # is necessary only due to "copy"
    8.  
    9. extra_install.path =$$target.path
    10. extra_install.files = renamed.txt
    11.  
    12. unix {
    13. extra_install.extra = cp test.txt renamed.txt
    14. }
    15. win32 {
    16. extra_install.extra = copy test.txt renamed.txt
    17. }
    18.  
    19. INSTALLS += target
    20. INSTALLS += extra_install
    21. # Input
    22. SOURCES += main.cpp
    23. OTHER_FILES += test.txt
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: It is possible to rename file with qmake

    You can convert slashes to backslashes using a regular expression in qmake directive if that's the problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2012
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: It is possible to rename file with qmake

    Well - that's it exactly ...

    [CODE]
    $replace(install_gspf.path,'/','\\')\\GSPFKrnl.exe
    [CODE]

    did the job ... Thx

Similar Threads

  1. Rename File
    By lsropia in forum General Programming
    Replies: 3
    Last Post: 22nd October 2011, 11:47
  2. qmake: does no generate .h file from .ui file
    By miodas007 in forum Newbie
    Replies: 7
    Last Post: 18th April 2011, 22:57
  3. rename file name
    By weixj2003ld in forum Qt Programming
    Replies: 11
    Last Post: 8th April 2010, 10:27
  4. File rename detection
    By bunjee in forum Qt Programming
    Replies: 6
    Last Post: 23rd July 2009, 15:22
  5. How to rename a file after opening ?
    By npc in forum Newbie
    Replies: 2
    Last Post: 1st June 2006, 13:36

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.