Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-27629

qmake can not properly deal with file name which contans space.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.8.3, 5.0.0
    • Fix Version/s: 4.8.5, 5.0.0 Beta 2
    • Component/s: Build tools: qmake
    • Labels:
      None
    • Environment:
      Linux, MacOS
    • Commits:
      b340e40f9185d2f4ec59ce3313447419580fe6ee,38cb37f0516ba03b062f4256bc3349c84a9da869

      Description

      In shadow build mode, we usually need to copy files from source folder to build folder.

      For example, we want to copy "a b.txt" to build directory, the contents of *.pro is

      #test.pro
      
      QMAKE_LINK = @:
      
      FILES = "a b.txt"
      
      copy2build.input = FILES
      copy2build.output = build/${QMAKE_FILE_IN}
      copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
      copy2build.variable_out = PRE_TARGETDEPS
      copy2build.name = COPY ${QMAKE_FILE_IN}
      copy2build.CONFIG += no_link
      
      QMAKE_EXTRA_COMPILERS += copy2build
      

      Then we can run qmake to generate Makefile.

      compiler_copy2build_make_all: build/a\ b.txt
      compiler_copy2build_clean:
      	-$(DEL_FILE) build/a\ b.txt
      build/a\ b.txt: a\ b.txt
      	cp -f a\ b.txt build/a/\ b.txt
      

      As you can see, last line is wrong, which should be

      	cp -f a\ b.txt build/a\ b.txt
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            buddenha Oswald Buddenhagen
            Reporter:
            dbzhang800 debao zhang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes