QMAKE_MKDIR_CMD How To ?



  • There are qt specs.
    mkspecs\common\shell-unix.conf:
    @QMAKE_TAR = tar -cf
    QMAKE_GZIP = gzip -9f

    QMAKE_COPY = cp -f
    QMAKE_COPY_FILE = $$QMAKE_COPY
    QMAKE_COPY_DIR = $$QMAKE_COPY -R
    QMAKE_MOVE = mv -f
    QMAKE_DEL_FILE = rm -f
    QMAKE_DEL_DIR = rmdir
    QMAKE_CHK_EXISTS = test -e %1 ||
    QMAKE_CHK_DIR_EXISTS = test -d # legacy
    QMAKE_MKDIR = mkdir -p # legacy
    QMAKE_MKDIR_CMD = test -d %1 || mkdir -p %1
    QMAKE_STREAM_EDITOR = sed@

    mkspecs\common\shell-win32.conf:
    @
    QMAKE_ZIP = zip -r -9

    QMAKE_COPY = copy /y
    QMAKE_COPY_DIR = xcopy /s /q /y /i
    QMAKE_MOVE = move
    QMAKE_DEL_FILE = del
    QMAKE_DEL_DIR = rmdir
    QMAKE_CHK_EXISTS = if not exist %1
    QMAKE_CHK_DIR_EXISTS = if not exist # legacy
    QMAKE_MKDIR = mkdir # legacy
    QMAKE_MKDIR_CMD = if not exist %1 mkdir %1 & if not exist %1 exit 1@

    I try use it:
    @my.commands=$$quote($$QMAKE_MKDIR_CMD mydir && $$QMAKE_COPY file1 mydir/file2 $$escape_expand(\n\t))@

    And so I'm getting the result:
    @test -d %1 || mkdir -p %1 mydir && cp -f file1 mydir/file2 @

    But I want:
    @test -d mydir || mkdir -p mydir && cp -f file1 mydir/file2 @

    How do i make it was this?



  • $$sprintf($$QMAKE_MKDIR_CMD, "mydir")



  • $$sprintf($$QMAKE_MKDIR_CMD, "mydir")


Log in to reply
 

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