Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Custom Build Process on Windows
Qt 6.11 is out! See what's new in the release blog

Custom Build Process on Windows

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 6.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RickF
    wrote on last edited by
    #1

    I'm trying to write a custom build step that will copy a config file to the application's directory.

    I have Enable custom process step checked
    Name: Custom Process Step
    Command: cmd
    Working Directory: $BUILDDIR
    Command arguments PostBuild.bat

    My .bat file is:

    @
    copy copy.xml $DESTDIR
    echo Copied copy.xml
    exit
    @

    When I build the build process hangs with the output:

    The process "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited normally.
    Starting: "C:/Windows/system32/cmd.exe" PostBuild.bat
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    It never exits. Does anyone know what I might be doing wrong?

    Thanks

    1 Reply Last reply
    0
    • L Offline
      L Offline
      ludde
      wrote on last edited by
      #2

      Have you tried running the same thing from a command prompt? If you do, you will notice that exactly the same thing happens - a new command prompt is started and your .bat file is not used at all. The reason is that cmd simply does not work the way you think - to pass a .bat file you have to use the /c command line option. So changing the command arguments to /c PostBuild.bat should do what you want (if PostBuild.bat is placed where cmd expects to find it).

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        There is another problem:

        you batch file will not work.
        You should try out the batch file from a command propt to verify it's usage. $DESTDIR is a qMake and perhaps QtCreator variable, but none for a batch file. Inside batch files, you must use windows syntzax for variables: %VARNAME%

        perhaps some of the following pages might help:

        • "Win XP Command Line Syntax":http://ss64.com/nt/syntax.html
        • "An A-Z Index of the Windows CMD command line":http://ss64.com/nt/
        • "wikipedia: Batch File":http://en.wikipedia.org/wiki/Batch_file

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved