Results 1 to 7 of 7

Thread: Custom Process Step...how?

  1. #1
    Join Date
    Nov 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Custom Process Step...how?

    I'm trying to figure out how to add a Custom Process Step in QT Creator on OSX. Here are my assumptions and confusions:
    • "Command" is the path to the shell script? At the moment the test_shell.sh is:
      Qt Code:
      1. echo WEEE!
      To copy to clipboard, switch view to plain text mode 
    • "Working Directory"...not sure if this should be the build or the project directory?


    All I know is that the compiler throws errors when trying to run this step.

    Any ideas?
    Last edited by wysota; 3rd December 2010 at 00:53.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Custom Process Step...how?

    Command is the actual command. In your case the shell script.
    Working directory is the directory where the command is run in. Most likely you want the build dir here: %{buildDir}
    Command arguments are any arguments you want to use when running the command.

    Make sure you add the complete path of the command.
    Make sure that any results are being output in the correct working directory. In other words, if you need to generate a file called generated.h in a specific folder, make sure that the command and the working directory actually generate this file in the expected place.

    Tip: check the compile output pane to see if there are problems when running the script.

  3. #3
    Join Date
    Nov 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Custom Process Step...how?

    Thanks for the input.
    Here's the step:


    Command is the actual command. In your case the shell script.
    OK. This looks like it's set correctly. It's not in red so I'm assuming Qt likes (found) it.

    Working directory is the directory where the command is run in. Most likely you want the build dir here: %{buildDir}
    OK. Used %{buildDir}. It's in red so I'm not sure Qt likes it. I tried with the full path to the build directory also and still the same issues as before.

    Command arguments are any arguments you want to use when running the command.
    OK. I have none at the moment just to keep things simple.

    Make sure you add the complete path of the command.
    OK, did.

    Tip: check the compile output pane to see if there are problems when running the script.
    OK, here's the error I'm getting:
    Qt Code:
    1. The process "/usr/bin/make" exited normally.
    2. Could not start process "/Users/me/Documents/Software and Web Development/FMOD Practice/03/03/link_libs.sh"
    3. Error while building project 03 (target: Desktop)
    4. When executing build step 'Custom Process Step'
    To copy to clipboard, switch view to plain text mode 
    I'm not sure why it says "(target: Desktop)".

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Custom Process Step...how?

    Quote Originally Posted by My3rdGradeShirt View Post
    OK. Used %{buildDir}. It's in red so I'm not sure Qt likes it. I tried with the full path to the build directory also and still the same issues as before.
    In a recent git checkout of Qt Creator, that's the standard text already filled in in the text box. In an older Qt Creator you might need to fill in the complete build dir. But I'm not sure.
    But that's not the problem here, see below.

    OK, here's the error I'm getting:
    Qt Code:
    1. Could not start process "/Users/me/Documents/Software and Web Development/FMOD Practice/03/03/link_libs.sh"
    To copy to clipboard, switch view to plain text mode 
    That tells you that your custom script could not be run.
    It might be because of the use of spaces, but that's just a wild guess.

    I'm not sure why it says "(target: Desktop)".
    It means that the target application or library is an application or library for a normal desktop computer.

  5. #5
    Join Date
    Nov 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Custom Process Step...how?

    That tells you that your custom script could not be run.
    It might be because of the use of spaces, but that's just a wild guess.
    My script only is one line:
    Qt Code:
    1. echo 'WEEEE!'
    To copy to clipboard, switch view to plain text mode 
    So I'm assuming you mean the spaces in the path to the script. I moved the script file and tried with the script path as "/Users/me/Desktop/link_libs.sh" and the working directory as "/Users/me/Desktop". As you can see no spaces in the path. Still get the same error. I run this script in the terminal so I know it works and is executable (correct permission).

    It means that the target application or library is an application or library for a normal desktop computer.
    Ahh.

  6. #6
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Custom Process Step...how?

    this is broken for me too.. anyone have any ideas?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Custom Process Step...how?

    Add the following line at the beginning of your script:
    bash Code:
    1. #!/bin/sh
    To copy to clipboard, switch view to plain text mode 
    and chmod the script to be executable.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qt Creator Debugging step by step through else rich code does not work
    By Terjoqu in forum Qt Tools
    Replies: 1
    Last Post: 11th March 2010, 22:44
  2. Pass custom events to another process
    By TTGator in forum Qt Programming
    Replies: 9
    Last Post: 14th January 2009, 23:02
  3. learn how to install QT with msvc2005 step by step
    By coder1985 in forum Installation and Deployment
    Replies: 6
    Last Post: 20th December 2007, 20:56
  4. Video Tutorials or step by step guides?
    By Dumbledore in forum Newbie
    Replies: 2
    Last Post: 10th October 2007, 09:33
  5. Step by Step MySQL Plugin... what's next step?
    By chaosgeorge in forum Qt Programming
    Replies: 20
    Last Post: 5th November 2006, 16:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.