Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.2.0 Beta1
-
None
-
Windows 7
Qt built from qt-everywhere-opensource-src-5.2.0-beta1.zip with MinGW 4.8 and ANGLE enabled. QMAKE_SPEC:win32-g++
CMake 2.8.12, Perl 5.16.3, Python 2.7.3
-
f03fd0d82a50361c0b89165b3f8d98d66b0a4e16
Description
Some of the CMake files generated on Windows contain malformed paths, causing errors when CMake-based projects try to use them. I hope it's not an artefact of my peculiar setup.
The paths are prefixed with a slash (for example: "/C:/Qt/Qt5.2-beta1/qtdeclarative/include"), which causes CMake to fail with "The imported target X references the file Y but this file does not exist."
All the defective paths seem to be in all the files of the type <QT_PREFIX>/qtbase/lib/cmake/<MODULE_NAME>/ExtraSourceIncludes.cmake. The funny thing is that the paths in the other CMake files generated in the same directory are correct and work without problem.
I think I've managed to track the issue:
ExtraSourceIncludes files are generated by <QT_PREFIX>\qtbase\mkspecs\features\create_cmake.prf
It uses functions defined in cmake_functions.prf. I am not sure, because I can't read .prf files well, but it seems that the problem is on line 32 in that file - a slash is prefixed to the path before passing it to another function:
defineReplace(cmakeTargetPath) { SYSR = $$[QT_SYSROOT] !isEmpty(SYSR): path = $$relative_path($$1, $$[QT_SYSROOT]) else: path = $$1 return($$clean_path(/$$path)) }