diff --git a/qmake/option.cpp b/qmake/option.cpp index 52f9cb8a0e1..4da2a1ae2c9 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -462,7 +462,9 @@ Option::init(int argc, char **argv) void Option::prepareProject(const QString &pfile) { - QString srcpath = QDir::cleanPath(QFileInfo(pfile).absolutePath()); + // Canonicalize only the directory, otherwise things will go haywire + // if the file itself is a symbolic link. + const QString srcpath = QFileInfo(QFileInfo(pfile).absolutePath()).canonicalFilePath(); globals->setDirectories(srcpath, output_dir); }