Results 1 to 3 of 3

Thread: Make qmake just run arbitrary shell command then finish?

  1. #1
    Join Date
    Oct 2011
    Location
    Australia
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Make qmake just run arbitrary shell command then finish?

    Hi

    I have a subdirs build, and in one subdir I just want to run an arbitrary shell script. No compiling, it would be just a *really* simple makefile. How can I do this?

    FYI This question is academic. I'm testing how subdirs works and I just want test stubs that succeed and print "~Hello", instead of telling me they can't find a main()... Still it might be useful too.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Make qmake just run arbitrary shell command then finish?


  3. #3
    Join Date
    Oct 2011
    Location
    Australia
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Make qmake just run arbitrary shell command then finish?

    I figured out a couple of solutions. At first I tried this:

    TARGET = foo
    foo.commands = echo foo

    Which seem logical to me but does not override the built-in auto generated target rules. Its seems qmake stubbornly refuses to not to be a compiler of stuff - which is quite annoying. But this gets around it, just printing a warning:

    TARGET = foo
    foo.commands = echo foo
    QMAKE_EXTRA_TARGETS += foo

    You could also use

    REQUIRES = VARIABLE_THAT_DNE

    to make the qmake succeed with a warningn message.

Similar Threads

  1. qmake / make: automatic command execution before compilation start ?
    By Comer352l in forum Installation and Deployment
    Replies: 1
    Last Post: 27th June 2014, 01:04
  2. QProcess Shell Command (Linux) Elevate Privileges?
    By m3rlin in forum Qt Programming
    Replies: 13
    Last Post: 7th April 2013, 11:38
  3. How to run shell command after compile finished in pro file?
    By hashb in forum Installation and Deployment
    Replies: 1
    Last Post: 11th May 2011, 15:10
  4. Shell command from Qt 4.5.2 by QProcess
    By Rajeshsan in forum Newbie
    Replies: 5
    Last Post: 21st December 2009, 16:03
  5. running shell command from C++ code problem
    By alex chpenst in forum Qt Programming
    Replies: 4
    Last Post: 31st July 2008, 10:41

Tags for this Thread

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.