diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp
index 3c3de8fd0e03b6607712b4ca863c0c0b29ede738..f1b9b956021ec94c7bed16aa8ba68b5028190b81 100644
--- a/src/plugins/qt4projectmanager/qtversionmanager.cpp
+++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp
@@ -1075,7 +1075,7 @@ void QtVersion::updateMkSpec() const
                 if (line.startsWith("QMAKESPEC_ORIGINAL")) {
                     const QList<QByteArray> &temp = line.split('=');
                     if (temp.size() == 2) {
-                        mkspec = temp.at(1);
+                        mkspec = temp.at(1).trimmed();
                     }
                     break;
                 }