Results 1 to 4 of 4

Thread: visual studio project files - adding extra files

  1. #1
    Join Date
    Apr 2006
    Location
    Denmark / Norway
    Posts
    67
    Thanks
    3
    Thanked 12 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default visual studio project files - adding extra files

    Hi

    I'm wondering if anyone knows how to add extra non source files to a vcproj when running qmake -t vcapp (or vclib).

    Resources, header and cpp files get added using HEADERS, SOURCES and RESOURCES, but that also means they will be compiled.

    I'm wondering if it's an option in the .pro files to include files that are needed in a project, but not compiled?

    For instance I would like the .pro and some .txt files to show up in the vcproj.

    Cheers,
    Leif

  2. The following 3 users say thank you to luf for this useful post:

    ebirdseystew (18th December 2013)

  3. #2
    Join Date
    Apr 2006
    Location
    Minsk, Belarus
    Posts
    33
    Thanks
    2
    Thanked 6 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: visual studio project files - adding extra files

    Well, according to qmake source code in msvc_vcproj.cpp only the following predefined folders could appear in vsproject:
    "Header Files"
    "Generated Files"
    "Lex / Yacc Files"
    "Translation Files"
    "Form Files"
    "Resource Files"

    So the easiest way is to add in .pro file a string like

    GENERATED_FILES+= ./MyTextFile.txt

    In that case "MyTextFile.txt" will appear in "Generated Files". It will not be compiled, but will always be visible from VS Solution Explorer

  4. The following 4 users say thank you to Conel for this useful post:

    ebirdseystew (18th December 2013), luf (12th June 2008)

  5. #3
    Join Date
    Apr 2006
    Location
    Denmark / Norway
    Posts
    67
    Thanks
    3
    Thanked 12 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: visual studio project files - adding extra files

    Thanks!

    Works like a charm... I added the CONFIG -= flat and put it in a dir, so that the files get in a "logical" folder...

    Features that would be nice to have in the .pro files:
    MYFILES = file1 file2
    MYFILES.foldername = myfolder
    ADDPROJECTFILES (MYFILES)


    Q_PRE_BUILD
    Q_POST_BUILD
    pre/post link already exists, but sometimes you need features before building, before prelink and after the build... I know it's possible to make .prf, but that's more hassle than:

    Q_PRE_BUILD = myscript...

  6. The following 3 users say thank you to luf for this useful post:

    ebirdseystew (18th December 2013)

  7. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: visual studio project files - adding extra files

    Quote Originally Posted by luf View Post
    Features that would be nice to have
    Feel free to send your suggestions to the task-tracker.
    J-P Nurmi

  8. The following 3 users say thank you to jpn for this useful post:

    ebirdseystew (18th December 2013)

Similar Threads

  1. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 07:51
  2. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 09:17
  3. Replies: 3
    Last Post: 18th April 2007, 16:31
  4. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 14:15
  5. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 22:41

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.