Important: Please read the Qt Code of Conduct -

Custom Process Step in Qt Creator Project

  • Using 5.1.1

    Trying to add a command step to the build.

    All I want to do is copy the .h files from one directory to another. However, when I add the following command to Custom Process Steps ...

    Command: copy
    Arguments c:\code\projects\qpgui\qpgui*.h c:\code\projects\include

    ... the Custom Process Step correctly appears as ...

    Custom Process Step: "copy " c:\code\projects\qpgui\qpgui*.h c:\code\projects\include

    .. but the build gives me this error ...
    16:49:10: The process "C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
    16:49:10: Starting: "copy " c:\code\projects\qpgui\qpgui*.h c:\code\projects\include
    qtcreator_ctrlc_stub: Command line failed: "copy " c:\code\projects\qpgui\qpgui*.h c:\code\projects\include
    16:49:10: The process "copy " exited with code -1.
    Error while building/deploying project qpgui (kit: Desktop Qt 5.1.1 MinGW 32bit)
    When executing step 'Custom Process Step'

    I used absolute paths to be sure I was pointing to the right directories.

    What am I missing?

  • hello,

    although i don't use a windows environment, could you try the following?

    a] remove the wildcard char from the source and target dirs and select a specific header

    b] (if a] fails) also add the absolute path for the 'copy' command

    otherwise, if you are using qmake you could add a custom command at the qmake variable

    personally, i prefer to associate the 'install' step with also installing headers by adding in my .pro file

    HDR_DIR = ../include

    hdr_install.path = $${HDR_DIR}
    hdr_install.files = $${HEADERS}
    hdr_install.extra = mkdir -p ${{HDR_DIR}}

    INSTALLS += hdr_install

    so, executing 'make install' also copies my headers.
    although, i don't know if you have 'make' available with your setup,
    which is the required for the above suggestion.

    anyhow, you could also have a look at "qmake variable reference":

Log in to reply