PDA

View Full Version : visual studio project files - adding extra files



luf
11th June 2008, 10:40
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

Conel
12th June 2008, 12:32
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

luf
12th June 2008, 14:42
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...

jpn
13th June 2008, 21:05
Features that would be nice to have
Feel free to send your suggestions to the task-tracker.