PDA

View Full Version : QMake Problem when Installing resources with whitespaces or +- symbols



superpacko
30th August 2011, 17:07
I need to install a few resources so i used INSTALLS in .pro file.
The problem is that i have a few resources with whitespaces in their names, and also some symbols. Im working on Windows 7.

I have tried using quote() but it does work, it doesnt add " " nor ' ' to the string.


Documentation.path = $$DISTDIR/docs/
Documentation.files = $$quote(docs/*)

Mingw.path = $$BINDIR
Mingw.files = $$quote($$PWD/$$THIRDPARTY/mingw/lib/libstdc++-6.dll) \
$$quote($$PWD/$$THIRDPARTY/mingw/lib/libgcc_s_dw2-1.dll)

INSTALLS += Documentation Mingw


I've tried adding quotes inside the $$quote(), wrapping it with double and single quotes, still nothing. The result is just the same as without using the $$quote(). I get the : "The system cannot find the file specified."

Any idea how can i solve this? because i could change a pdf filename, but not the mingw dll.

wysota
31st August 2011, 11:16
Did you try just using quotes (that is: the " character)? Moreover if you're trying to do what I think you are then you shouldn't do that. Instead use a proper installer for your app.

superpacko
31st August 2011, 16:07
I've tried all this things:


Documentation.files = $$quote(docs/*)
Documentation.files = $$quote("docs/*")
Documentation.files = $$quote(""docs/*"")
Documentation.files = "$$quote(docs/*)"
Documentation.files = ""$$quote(docs/*)""


Same error all the time, qmake is removing every quote that i add. I have to make this installation since the executable that we are building needs some external dlls, executables and config files to run. So I'm moving the dlls that i need to startup the program and also the exec files that are used later since the run directory used is "."
Since we are moving those files i decided to move the documentation as well.

The only think i can think of is to generate a custom make with only the install option. So i'll add it as a second make step in Qt Creator and there i can avoid using qmake.

any other ideas?

wysota
31st August 2011, 17:48
Do you have a file called "*"? If not, then what's a quote good for? If you want a wildcard, the writing D.files = docs/* is enough. However all those files need to exist in the moment qmake is ran.

superpacko
31st August 2011, 19:42
Ok, so i thougth i could use $$quote(docs/*) and it would process each file. Doesnt matter in this case, i can add "_" instead of whitespace, for each filename
The big problem is in the libstdc++-6.dll file, here the "+" is messing things up and i cant get qmake to quote (with ") the path of the file. since im using windows, when installing it uses COPY command, and the '+' is not supported unless you wrap the path with quotes.

wysota
31st August 2011, 22:23
You can override the command used for installing if you really want to. However I suggest you rethink your approach.

alpo
21st June 2012, 16:22
It's confirmed bug https://bugreports.qt-project.org/browse/QTBUG-16372 and I have workaround.
I have used backslashed quotes in .pro file.
like \"C:\\MinGW\\bin\\libstdc++-6.dll\"

wysota
21st June 2012, 20:37
It's not a confirmed bug. Read the comments under the report.