QMAKE : How to handle literal $ in file name

  • 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.

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

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

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

  • 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.

  • 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...

  • Moderators

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

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.