Qmake Mac resources
-
Does anybody know how to use "Mac resource compiler":https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/Rez.1.html with qmake ? Basically I need to build some *.r mac resource files. I know for windows qmake exist RC_FILE variable. Am I missing something from qmake documentation ?
-
Do you need to use this compiler before compilation of your code, or is it enough to run it after? If so, you can use "QMAKE_POST_LINK":http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html#qmake-post-link to pass a custom script, which would run the tool.
-
Hi @sierdzio. I know about QMAKE_POST_LINK but with this, Rez will produce say "rez.out". How can I link this output with my application ? I thought there is a simpler solution like RC_FILE for windows ...
-
I don't know if there is any built-in solution. You can probably use QMAKE_PRE_LINK to get the .o file, and then add it to linker options somehow.
-
Ok, thanks. Other solution I think would be:
@
MACREZ.target = rez.out
MACREZ.commands = Rez inputFile.r -i includePaths ... etc ... all flags
PRE_TARGETDEPS += rez.out
@If other simple solutions (like RC_FILE) don't exist I'll try these, although is less ugly ...
-
Assume we are creating an application named MyApp in a folder named MyFolder which is at the same level as the folder containing the .pro file.
Assume that the Rez input file, MacResources.r, is in src/Resources relative to the .pro file.
Then these qmake commands will compile the Rez input file and store the output in the application bundle.
REZ_SOURCE_DIR = $${PWD}/src/Resources
APP_BUNDLE_DIR = $${PWD}/../MyFolder/MyApp.app
RezSource = $${REZ_SOURCE_DIR}/MacResources.r
RezDest = $${APP_BUNDLE_DIR}/Contents/Resources/MyApp.rsrc
QMAKE_POST_LINK += Rez $${RezSource} -o $${RezDest} -
Hi, thanks for your input. In the meantime I solved the problem with XCode project. But, for sure I'll test your solution.
-
@hrodstein
I am really quite new to the mac and QT. I need some brief explanation on the same. I have project out as "dylib" so can I link the rez output to directly to "dylib" file?
Quick reply will be appropriated.Thanks & Regards,
-Harshil