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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.8.5, 5.0.0 Beta 2
    • 4.8.3, 5.0.0
    • Build tools: qmake
    • None
    • Linux, MacOS
    • b340e40f9185d2f4ec59ce3313447419580fe6ee,38cb37f0516ba03b062f4256bc3349c84a9da869

      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
      

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes