Results 1 to 2 of 2

Thread: Possible bug in qt creator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Possible bug in qt creator

    Qt Creator extracts the source file names from the SOURCES and HEADERS in pro and pri files by parsing the files. It understands explicitly named files, globs, and some variable expansions. If there are no files listed there, as is the case here, then there are no files in the project. With your attempt at a completely dynamic setup the only way that Qt Creator could possibly know which files qmake would ultimately include in SOURCES/HEADERS with your dynamic setup would be to 'run' the PRO file internally and intercept the end result.


    The globbing and expansion functionality may help you here. This, for example, works:
    Qt Code:
    1. TEMPLATE = app
    2. someothersources = ../other.cpp
    3. SOURCES += *.cpp $${someothersources}
    4. HEADERS += *.h
    To copy to clipboard, switch view to plain text mode 
    picking up all the CPP and H files in the directory but it will not notice new files created outside until you force it to reparse the pro file.

    If I understand what you are trying to achieve:
    qmake Code:
    1. ##top.pro
    2. TEMPLATE = app
    3.  
    4. include(headers/headers.pri)
    5. include(sources/sources.pri)
    6.  
    7. ##headers/headers.pri
    8. HEADERS += $${PWD}/*.h
    9.  
    10. ##sources/sources.pri
    11. SOURCES += $${PWD}/*.cpp
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 18th October 2012 at 13:19. Reason: reformatted to look better

  2. The following user says thank you to ChrisW67 for this useful post:

    themean (18th October 2012)

Similar Threads

  1. Replies: 2
    Last Post: 22nd November 2011, 00:09
  2. QT creator +SDL
    By ShapeShiftme in forum Qt Tools
    Replies: 2
    Last Post: 19th December 2010, 11:44
  3. QT creator
    By tertius in forum Newbie
    Replies: 7
    Last Post: 21st June 2010, 10:41
  4. QT Creator
    By vinod sharma in forum Qt Tools
    Replies: 2
    Last Post: 22nd January 2010, 08:34
  5. Qt Creator on Mac OS X
    By stephenju in forum Qt Tools
    Replies: 2
    Last Post: 12th March 2009, 21:51

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