Results 1 to 9 of 9

Thread: qmake: Can't Get DISTFILES to Work

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default qmake: Can't Get DISTFILES to Work

    I have a src.pro file (unix app) that works fine for the target program. Today, following the definition for DISTFILES in the qmake documents, I tried to add:

    DISTFILES += ./perl_tools/read.pl

    where 'read.pl' is a utility Perl script I wrote in the 'perl_tools' subdirectory.

    When I run qmake and look at the Makefile I see the file listed under 'DIST'.

    When I run make, the target builds and is placed in the DESTDIR location, but the Perl script doesn't show up there.

    What am I doing wrong?

    Thanks.

  2. #2
    Join Date
    May 2008
    Posts
    155
    Thanked 15 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake: Can't Get DISTFILES to Work

    If I remember correctly, DISTFILES is only used when running 'make dist'.

  3. #3
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake: Can't Get DISTFILES to Work

    You're correct--thanks.

    This morning I've tried very hard to get qmake to do what I want (using advanced features), but have failed to do so. I'm trying to get some extra files copied to the build destination but I don't think it can be done. I have to do some more playing around with the INSTALLS variable, but my experiments so far have been disappointing.

    My current solution is to have a separate Makefile (not named 'Makefile') that does the copy.

    To me. one of the real drawbacks to Qt is qmake--it needs to be more extensible by the user.

    For instance, a year or so ago I submitted a suggestion to Trolltech that during installation (at least in a unix environment) the fairly standard environment variables CC and CXX should be checked for the user's desired compiler, but as of 4.4 that doesn't happen (so I edit mkspecs manually). To be fair, I haven't checked all their installation variables--I'll try to remember to check when I get to work tomorrow,

    And, at least in a unix environment, qmake should allow command line arguments to be passed to make.

    I do use my own makespecs features (.prf) file, but it doesn't solve all needs.

    An immediate fix would be to allow multiple build targets in a single pro file and define different build actions for each target. The limited documentation implies that it can be done, but I haven't had any success yet. Suggestions welcome.

    Thanks for listening to my rant.

    (I guess I'll have to see what qmake source looks like--yuck!)

  4. #4
    Join Date
    May 2008
    Posts
    155
    Thanked 15 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake: Can't Get DISTFILES to Work

    http://paulf.free.fr/undocumented_qmake.html gives a few very interesting hints. But in general I agree, qmake documentation could be better, and it's
    not very consistent in general ;-}

  5. #5
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake: Can't Get DISTFILES to Work

    Quote Originally Posted by ktk View Post
    http://paulf.free.fr/undocumented_qmake.html gives a few very interesting hints. But in general I agree, qmake documentation could be better, and it's
    not very consistent in general ;-}
    Thanks, ktk, interesting link.

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

    Default Re: qmake: Can't Get DISTFILES to Work

    For qmake features you can have a look at our wiki.

    As for copying files - I think you can do it by providing a separate target and stating it as a post dependency of the main target. Your dummy target should have a commands attribute with a script that performs the copy.

    And, at least in a unix environment, qmake should allow command line arguments to be passed to make.
    I'm not sure what do you mean here... qmake doesn't call make - you do.

    An immediate fix would be to allow multiple build targets in a single pro file and define different build actions for each target.
    This is possible. There's even an article on labs that describes it.

  7. #7
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake: Can't Get DISTFILES to Work

    Quote Originally Posted by wysota View Post
    For qmake features you can have a look at our wiki.

    As for copying files - I think you can do it by providing a separate target and stating it as a post dependency of the main target. Your dummy target should have a commands attribute with a script that performs the copy.
    I've tried that, but no luck so far. I'll be glad to post my effort for critique.

    Quote Originally Posted by wysota View Post
    I'm not sure what do you mean here... qmake doesn't call make - you do.
    Well, since I script the calls to qmake, I would like to control arguments on a case-by-case basis, i.e., pass the arguments to qmake which would then be embedded in the generated Makefile.

    Quote Originally Posted by wysota View Post
    This is possible. There's even an article on labs that describes it.
    Thanks, I'll try to find it.

  8. #8
    Join Date
    Aug 2008
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake: Can't Get DISTFILES to Work

    Quote Originally Posted by wysota View Post
    This is possible. There's even an article on labs that describes it.
    I found the article. There's just one problem: the extra targets are not put with the "all" target, so the user would have to execute multiple make commands.

    I can do that now with my own hand-made Makefile.

    My qmake enhancement would allow the extra target to be added to the "all" target.

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

    Default Re: qmake: Can't Get DISTFILES to Work

    Quote Originally Posted by tbrowder View Post
    I found the article. There's just one problem: the extra targets are not put with the "all" target, so the user would have to execute multiple make commands.
    Not really. You can make the new target a pre or post dependency of the original one hence it will be built with the original.

    My qmake enhancement would allow the extra target to be added to the "all" target.
    As far as I know qmake will be history soon (don't ask me when, I don't know, probably "soon" is "some undefined time in future"), so maybe the new mechanism will have what you require.

Similar Threads

  1. Flex, Bison and qmake
    By Hydragyrum in forum Qt Programming
    Replies: 5
    Last Post: 2nd May 2011, 15:52
  2. qmake -project does not work
    By Caius Aérobus in forum Installation and Deployment
    Replies: 2
    Last Post: 7th February 2008, 17:55
  3. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  4. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  5. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

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
  •  
Qt is a trademark of The Qt Company.