qmake vc(x)proj generator: don't create bogus directories
authorJoerg Bornemann <joerg.bornemann@nokia.com>
Mon, 16 Apr 2012 14:09:18 +0000 (16:09 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 17 Apr 2012 01:26:32 +0000 (03:26 +0200)
When creating the temporary project object,
Option::output_dir must be adjusted temporarily.

Task-number: QTBUG-22788
Change-Id: Ibf8897a46b63f48b9e33d7e2168b09e559cecec7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
qmake/generators/win32/msvc_vcproj.cpp

index c2482b5..951784e 100644 (file)
@@ -476,10 +476,13 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
                         // and to be able to extract all the dependencies
                         Option::QMAKE_MODE old_mode = Option::qmake_mode;
                         Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING;
+                        QString old_output_dir = Option::output_dir;
+                        Option::output_dir = QFileInfo(fileFixify(dir, qmake_getpwd(), Option::output_dir)).canonicalFilePath();
                         VcprojGenerator tmp_vcproj;
                         tmp_vcproj.setNoIO(true);
                         tmp_vcproj.setProjectFile(&tmp_proj);
                         Option::qmake_mode = old_mode;
+                        Option::output_dir = old_output_dir;
                         if(Option::debug_level) {
                             debug_msg(1, "Dumping all variables:");
                             QHash<QString, QStringList> &vars = tmp_proj.variables();