Questions about qmake and the project file
-
The .pro file is generated by following command:
@
qmake -project
@
Run qmake -h to get more help.Then the created .pro file shoule be edited manually or through IDE such as QtCreator.
-
Regarding #1:
If you call@qmake -project@
your .pro file is wiped out and replaced by the newly generated one. Be careful!
If you just call
@qmake@
then qmake just reads the .pro file and generates Makefile (and probably Makefile.Debug and Makefile.Release) for you.
Regarding #2:
You can add your own target in the .pro file, just replace APP_QML_FILES with something you like and adjust the file list. -
Thanks, Volker. So: is a symbol like APP_QML_FILES something I can just make on-the-fly, or is this a reserved keyword in qmake?
Can I just duplicate those lines rather than replace them? Like APP_COEFF_FILES?
-
That's something you can make on the fly. You must make sure to choose a name that's not used elsewhere, so using an application or organization specific prefix for the name - like MYCOMP_ - will be a good idea.
-
Good point. So, when does this extra stuff get processed: when qmake is run, or when you push "build" in Creator?
-
When you run build in Creator - or call make on the command line, which is basically the same that Creator does for you :)
-
OK, so it's truly part of the make process then. Excellent. I'll go try it now, and come back to ask more questions when I screw it up. Thanks!
-
Is there a way to put multiple files on a single line? Like:
@APP_COEFF_FILES.files = coeffdemodshaper.txt coeffmodnyquist.txt
APP_COEFF_FILES.path = Contents/MacOSQMAKE_BUNDLE_DATA += APP_COEFF_FILES
@I've tried it with and without a comma, and both give me a build error:
bq. make: *** No rule to make target
coeffmodnyquist.txt', needed by
simulatorGUI.app/Contents/MacOS/coeffmodnyquist.txt'. Stop.Thanks.
EDIT:
OK, I can see why this wouldn't work. So, can I specify a subdirectory's entire contents as part of the bundle?
-
Yes you can. Just put the path of the subdir into the .files section. That will copy that directory and all its contents and subdirectories into the app bundle.
-
Oh, that's pretty slick. Thanks, Volker.