PDA

View Full Version : Info.plist is not copied



DanKolle
9th December 2014, 13:42
Hello,

I searched the whole internet and tried every hack that I could find but I simply cannot get qmake to copy the Info.plist file.

I tried disabling shadow copy and adding the plist file as an install.

Nothing really helps.

-------------
macx {
QMAKE_INFO_PLIST = ../../Source/Info.plist
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6

# try to copy the file manually
plist.path = "$$DESTDIR/$$join(TARGET,,,.app)/Contents"
plist.files = ../../Source/Info.plist
INSTALLS += plist
}
-------------

I am using Qt 5.4 and the Qt Creator.

Is it correct that the option "Build -> Deploy project" is not available?

Thanks
Dan

jefftee
10th December 2014, 06:37
I searched the whole internet and tried every hack that I could find but I simply cannot get qmake to copy the Info.plist file.

The following works for me:


QMAKE_INFO_PLIST = recode.plist
plist.target = Info.plist
plist.depends = recode.plist "$${DESTDIR}/$${TARGET}.app/Contents/Info.plist"
plist.commands = $(DEL_FILE) \"$${DESTDIR}/$${TARGET}.app/Contents/Info.plist\" $$escape_expand(\n\t) \
$(COPY_FILE) recode.plist \"$${DESTDIR}/$${TARGET}.app/Contents/Info.plist\"
QMAKE_EXTRA_TARGETS = plist
PRE_TARGETDEPS += $$plist.target

recode.plist is the name of my custom app plist file. If I recall correctly, qmake will not replace Info.plist if it exists, which is why the plist.commands deletes Info.plist from the app bundle, etc.

Hope that helps,

Jeff

DanKolle
11th December 2014, 08:56
Hello Jeff,

thank you for your reply.

When I use the suggested code I get the following error:

error: No rule to make target `/MyApp.app/Contents/Info.plist', needed by `Info.plist'. Stop.

My plist file is in another folder, could this cause problems?


QMAKE_INFO_PLIST = ../../Source/Info.plist
plist.target = Info.plist
plist.depends = ../../Source/Info.plist "$${DESTDIR}/$${TARGET}.app/Contents/Info.plist"
plist.commands = $(DEL_FILE) \"$${DESTDIR}/$${TARGET}.app/Contents/Info.plist\" $$escape_expand(\n\t) \
$(COPY_FILE) ../../Source/Info.plist \"$${DESTDIR}/$${TARGET}.app/Contents/Info.plist\"
QMAKE_EXTRA_TARGETS = plist
PRE_TARGETDEPS += $$plist.target

jefftee
11th December 2014, 17:20
My plist file is in another folder, could this cause problems?

Hi, my first guess would be that plist.target needs to also point to the actual Info.plist file, so:


plist.target = ../../Source/Info.plist

I would try that and if that doesn't work, please show the build/compile output here.

Thanks,

jthomps

DanKolle
11th December 2014, 20:28
I got it working with the following code:



QMAKE_INFO_PLIST = ../../Source/CustomInfo.plist
plist.target = ".$${DESTDIR}/$${TARGET}.app/Contents/Info.plist"
plist.depends = ../../Source/CustomInfo.plist
plist.commands = $(DEL_FILE) \".$${DESTDIR}/$${TARGET}.app/Contents/Info.plist\" $$escape_expand(\n\t) \
$(COPY_FILE) ../../Source/CustomInfo.plist \".$${DESTDIR}/$${TARGET}.app/Contents/Info.plist\"
QMAKE_EXTRA_TARGETS = plist
PRE_TARGETDEPS += $$plist.target