Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QMAKE : How to handle literal $ in file name
QtWS25 Last Chance

QMAKE : How to handle literal $ in file name

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 6 Posters 5.5k 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.
  • A Offline
    A Offline
    alkan6
    wrote on last edited by
    #1

    Hello everyone,
    I have the following lines in a .pro file
    @data.files += $$PWD/../data/tof$dirs.bin
    INSTALLS += data@
    It ignores the $d and try to copy "tofirs.bin" which is not exist.
    @copy /y e:\xxx\data\tofirs.bin e:\xxx-build-desktop\plugin\debug\data
    The system cannot find the file specified@

    I tried putting those into quote,",',{,[,double $, back slash escape.... all to no avail.
    Can any one suggest a solution. It is in windows XP environment.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      I wouldn't be surprised if you had to do a double backslash escape.
      @data.files += $$PWD/../data/tof\$dirs.bin
      INSTALLS += data@

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

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

        @
        DOLLAR = $
        foo = bar$${DOLLAR}baz
        @

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alkan6
          wrote on last edited by
          #4

          Thanks for the quick reply, Unfortunately, both solutions don't work for me.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kukuyok
            wrote on last edited by kukuyok
            #5

            I could see no answer yet) It is the secnod ref from google and I've been here a year ago. I've got my solution: backslash + dollar sign twice. For example:

            mkExportFile.commands = "echo 'export LD_LIBRARY_PATH=\$\$LD_LIBRARY_PATH:$${LIB_DIR_PATH}' > export.ini"
            QMAKE_EXTRA_TARGETS += mkExportFile
            POST_TARGETDEPS += mkExportFile

            LD_LIBRARY_PATH - variable, that I want use in run.sh script for my application and I want to to extend it with some qmake variable
            LIB_DIR_PATH - directory with shared libs, which are used to link my app and then run it.

            1 Reply Last reply
            1
            • Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #6

              What if you get rid of the offending character? I mean, maybe you need an extra step about renaming the file externally to Qt but...

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              jsulmJ 1 Reply Last reply
              1
              • Pablo J. RoginaP Pablo J. Rogina

                What if you get rid of the offending character? I mean, maybe you need an extra step about renaming the file externally to Qt but...

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Pablo-J.-Rogina Agree, using special characters in file/directory names is asking for troubles.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                2

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved