qmake generates wrong path to qrc qmlcache
-
After I installed mingw32 5.14.2 Qt I started to get strange bug in generated Makefile. My project includes a pri that has qrc file like this:
RESOURCES += $$PWD/kbpcomponents.qrc
In Makefile I now have this buggy line:Makefile: E:/projects/git/dep32/askroclient/askroclient.pro ../../../../Qt/5.14.2/mingw73_64/mkspecs/features/spec_pre.prf \ <skipped alot of lines> E:_projects_git_dep32_qmlutils_KbpComponents_kbpcomponents_qmlcache.qrc \ askroclient_qmlcache.qrc $(QMAKE) -o Makefile E:/projects/git/dep32/askroclient/askroclient.pro -spec win32-g++ CONFIG+=qtquickcompiler
There should not be full path to qmlcache as it is located in build directory and all slashes are replaced with underscores.
I did not have this problem with 5.13.2. Also it does not happen with linux version of 5.14.2. -
-
Ok, apparently Qt version is not a problem. The problem is caused by combination of two facts:
- qrc file included by path, not just name, because it's not in main project directory
- Build directory and project directory are on different drives (build directory is on C: and source code is on E:)
If I switch build directory to the same drive then the problem is gone. Perhaps qmake under Windows should also replace colons with underscores, not only slashes.
-
Hi,
If this worked before then you may have found a regression.
Can you reproduce that with a minimal compilable project ?
-
I don't believe this is a regression, I just didn't try build my project on a different drive before. qmake replaces all slashes with underscores when generating qmlcache file for a qrc because file name can not contain slashes, but it forgets that under Windows there may be also a colon in the path which should be replaced too. But the colon appears only if the build directory is on a different drive, otherwise generated path is relative and does not start with drive letter.
-
Good point
In any case, it still is a bug, you should check the bug report system to see if it's something known. If not, please open a new report providing a minimal compilable example.
-
-
Thanks !