With Qt 6.10.1 and CMake, configuring a simple QML application fails when source code is in a folder with whitespaces
-
Hi,
It seems there are still some cmake snippets (at least) in the Qt6QML portion which do not use double quotes around variable expansions.
Sample code which reproduces the error is available here: https://github.com/anttikes/usb-fm-radio
If you check out this source code to e.g. "E:\usb-fm-radio" folder, then everything works. But, if you clone it to a folder such as "E:\USB FM" then it fails at the CMake configure stage.
To fix the issue, I went to the reported row 1100 in "C:\Qt\6.10.1\mingw_64\lib\cmake\Qt6QML\Qt6QmlMacros.cmake" and modified the "cmake_language(DEFER DIRECTORY" portion so that the ${CMAKE_BINARY_DIR} is surrounded by escaped double quotes i.e.
\"${CMAKE_BINARY_DIR}\".A screenshot of the modification for reference:

There seems to be a similar kind of problem looming on row 1090. I believe escaped double-quotes would do the trick here as well. This line did not cause any errors for me, possibly due to the way my simple application is structured.

Any chance of getting this included in some patch version?
-
Hi,
There's two things you can do to make that happen:
- check the bug report system to see if there's already something about this issue (and if not please create a ticket)
- submit a patch since you already have the solution at hand :-)
-
Hi,
There's two things you can do to make that happen:
- check the bug report system to see if there's already something about this issue (and if not please create a ticket)
- submit a patch since you already have the solution at hand :-)
@SGaist Thanks for the tip, and sorry for not responding sooner.
I'm afraid I'm not too familiar with the Qt sources and how they're organized so I'm far from certain whether my pull request or suggestion would even be considered.
On the other hand one week ago I installed Qt 6.10.2 by deleting the entire Qt directory before installing the new version. Thus any manual changes I made were most certainly gone.
The problem does not reproduce in Qt 6.10.2 so I can only assume the issue was reported and fixed by someone else.
-
A AnttiK has marked this topic as solved
-
@SGaist Thanks for the tip, and sorry for not responding sooner.
I'm afraid I'm not too familiar with the Qt sources and how they're organized so I'm far from certain whether my pull request or suggestion would even be considered.
On the other hand one week ago I installed Qt 6.10.2 by deleting the entire Qt directory before installing the new version. Thus any manual changes I made were most certainly gone.
The problem does not reproduce in Qt 6.10.2 so I can only assume the issue was reported and fixed by someone else.
@AnttiK said in With Qt 6.10.1 and CMake, configuring a simple QML application fails when source code is in a folder with whitespaces:
I'm afraid I'm not too familiar with the Qt sources and how they're organized so I'm far from certain whether my pull request or suggestion would even be considered.
Don't be, every contributor had to start somewhere. It does not require a big complicated patch to get on the train :-)