diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index f0eb594..3f22a8f 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3257,10 +3257,19 @@ void Configure::generateMakefiles()
                     QString dirPath = fixSeparators( it->directory + "/" );
                     QString projectName = it->proFile;
                     QString makefileName = buildPath + "/" + dirPath + it->target;
+
+                    if (sourcePath != buildPath)
+                        QDir().mkpath(buildPath + "/" + dirPath);
+
                     QStringList args;
 
                     args << fixSeparators( buildPath + "/bin/qmake" );
-                    args << projectName;
+
+                    if (sourcePath != buildPath)
+                        args << fixSeparators(sourcePath + "/" + dirPath + projectName);
+                    else
+                        args << projectName;
+
                     args << dictionary[ "QMAKE_ALL_ARGS" ];
 
                     cout << "For " << qPrintable(dirPath + projectName) << endl;
