PDA

View Full Version : QMake app bundle name w/parentheses



zaphod.b
27th August 2014, 16:59
Hi all,

I successfully build and deploy an app bundle on OS X with a name all letters and possibly spaces.

Now if I try to include parentheses in the app name like


TARGET = x(y)z

the build fails with


/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `test -d ../../bin/x(y)z.app/Contents || mkdir -p ../../bin/x(y)z.app/Contents'
make[2]: *** [../../bin/x(y)z.app/Contents/PkgInfo] Error 2
make[1]: *** [sub-app-make_first-ordered] Error 2
make: *** [sub-src-make_first] Error 2
17:15:02: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project ribmetender (kit: Desktop Qt 5.3 clang 32bit)
When executing step 'Make'

Ok, mkdir in bash needs parentheses escaped or quoted, too. I tried these:


TARGET = x\(y\)z #same
TARGET = "x(y)z" #same
TARGET = "x\(y\)z" #same
TARGET = "x\\\(y\\\)z" #almost same: /bin/sh: -c: line 0: `test -d ../../bin/x/(y/)z.app/Contents || mkdir -p ../../bin/x/(y/)z.app/Contents'
TARGET = $$quote(x(y)z) #builds, Frameworks/ and PlugIns/ missing inside bundle, *but* MacOS/x(y)z is there!
TARGET = $$shell_quote(x(y)z) #same
TARGET = $$system_quote(x(y)z) #same


If I build the bundle to a TARGET without parentheses, then rename the executable afterwards by hand, the app runs just as well as before.

Any ideas how to automate this with qmake?

bouchebeu
22nd September 2014, 16:04
Hey,

Try the following:


TARGET = $$re_escape(x(y)z)

re_espace is one of QMAKE's replace functions (http://qt-project.org/doc/qt-5/qmake-function-reference.html)

Hope this helps.