Results 1 to 2 of 2

Thread: `qmake -project` weired output (QT 5)

  1. #1
    Join Date
    Dec 2010
    Location
    Austria
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default `qmake -project` weired output (QT 5)

    I'm using qmake -project to generate the *.pro files by a script on Linux. Worked fine the last 7 years up to qt 4.8. But now I did upgrade to qt 5.7 and the output of qmake -project is pretty nonsense.

    Could be simply verfied by doing this:

    Qt Code:
    1. mkdir foo include
    2. touch foo/main.cpp foo/other.cpp foo/other.h
    3. touch include/sample.h
    4. echo "#include sample.h" > foo/other.cpp
    5. echo "#include other.h" >foo/main.cpp
    To copy to clipboard, switch view to plain text mode 

    now you create the project file:

    Qt Code:
    1. cd foo
    2. qmake -project . ../include
    To copy to clipboard, switch view to plain text mode 

    And the output is like this:

    Qt Code:
    1. ######################################################################
    2. # Automatically generated by qmake (3.0) Wed Mar 1 09:07:42 2017
    3. ######################################################################
    4.  
    5. TEMPLATE = app
    6. TARGET = foo
    7. INCLUDEPATH += .
    8.  
    9. # Input
    10. HEADERS += other.h /other.h /../include/sample.h
    11. SOURCES += main.cpp other.cpp /main.cpp /other.cpp
    To copy to clipboard, switch view to plain text mode 

    So there are source file twice and at one time there is that slash in front of the path.

    If I try something like this:

    Qt Code:
    1. qmake -project `pwd` `pwd`/../include
    To copy to clipboard, switch view to plain text mode 

    I get, what is similar to the output of qmake 2.01a, which is part of qt 4.8

    Qt Code:
    1. ######################################################################
    2. # Automatically generated by qmake (3.0) Wed Mar 1 09:13:38 2017
    3. ######################################################################
    4.  
    5. TEMPLATE = app
    6. TARGET = foo
    7. INCLUDEPATH += .
    8.  
    9. # Input
    10. HEADERS += other.h ../include/sample.h
    11. SOURCES += main.cpp other.cpp
    To copy to clipboard, switch view to plain text mode 

    But still there is no DEPENDPATH and the output of qmake 2.01a called with

    Qt Code:
    1. cd foo
    2. qmake -project . ../include
    To copy to clipboard, switch view to plain text mode 

    looks like this:

    Qt Code:
    1. ######################################################################
    2. # Automatically generated by qmake (2.01a) Wed Mar 1 09:23:53 2017
    3. ######################################################################
    4.  
    5. TEMPLATE = app
    6. TARGET =
    7. DEPENDPATH += . . ../include
    8. INCLUDEPATH += .
    9.  
    10. # Input
    11. HEADERS += other.h ../include/sample.h
    12. SOURCES += main.cpp other.cpp
    To copy to clipboard, switch view to plain text mode 

    So my workaround is to create the project files with qmake 2.01a, because even if I do that weired stuff with `pwd`, I get no satisfying output, as sometimes qmake does not remove that absolute path and so the pro file will just work in my work environment only and the other people here are not supposed to generate pro files, every time I add a new file to our software.

    Is the current version of qmake broken or do I miss something?

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

    Default Re: `qmake -project` weired output (QT 5)

    I can confirm this, looks like a bug.

    Any specific reason you are using that at all?

    You write "our software" so it sounds like this is not some simple quick test you are running this on but a real application or library which should have a project file already, no?

    Cheers,
    _

Similar Threads

  1. Replies: 6
    Last Post: 29th November 2016, 14:27
  2. colorgcc and coloring qmake output
    By lexfridman in forum Qt Programming
    Replies: 1
    Last Post: 10th January 2011, 04:29
  3. Replies: 1
    Last Post: 3rd December 2009, 23:34
  4. qmake, uic and moc output folders
    By gri in forum Qt Programming
    Replies: 2
    Last Post: 30th March 2007, 18:55
  5. qmake and debug output
    By mattie in forum Qt Programming
    Replies: 7
    Last Post: 18th September 2006, 22:33

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.