Changeset 561 for trunk/qmake/generators/metamakefile.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/qmake/generators/metamakefile.cpp
r363 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the qmake application of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 61 61 class BuildsMetaMakefileGenerator : public MetaMakefileGenerator 62 62 { 63 private: 63 64 bool init_flag; 64 private:65 65 struct Build { 66 66 QString name, build; … … 137 137 build->name = name; 138 138 build->makefile = createMakefileGenerator(project, false); 139 makefiles += build; 139 if (build->makefile){ 140 makefiles += build; 141 }else { 142 delete build; 143 return false; 144 } 140 145 } 141 146 return true; … … 259 264 class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator 260 265 { 266 protected: 261 267 bool init_flag; 262 private:263 268 struct Subdir { 264 269 Subdir() : makefile(0), indent(0) { } … … 287 292 return false; 288 293 init_flag = true; 294 bool hasError = false; 289 295 290 296 if(Option::recursive) { 291 QString old_output_dir = QDir::cleanPath(Option::output_dir); 292 if(!old_output_dir.endsWith('/')) 293 old_output_dir += '/'; 297 QString old_output_dir = Option::output_dir; 294 298 QString old_output = Option::output.fileName(); 295 QString oldpwd = QDir::cleanPath(qmake_getpwd()); 296 if(!oldpwd.endsWith('/')) 297 oldpwd += '/'; 299 QString oldpwd = qmake_getpwd(); 300 QString thispwd = oldpwd; 301 if(!thispwd.endsWith('/')) 302 thispwd += '/'; 298 303 const QStringList &subdirs = project->values("SUBDIRS"); 299 304 static int recurseDepth = -1; … … 315 320 if(!subdir.isRelative()) { //we can try to make it relative 316 321 QString subdir_path = subdir.filePath(); 317 if(subdir_path.startsWith( oldpwd))318 subdir = QFileInfo(subdir_path.mid( oldpwd.length()));322 if(subdir_path.startsWith(thispwd)) 323 subdir = QFileInfo(subdir_path.mid(thispwd.length())); 319 324 } 320 325 … … 333 338 qmake_setpwd(sub->input_dir); 334 339 Option::output_dir = sub->output_dir; 335 if(Option::output_dir.at(Option::output_dir.length()-1) != QLatin1Char('/')) 336 Option::output_dir += QLatin1Char('/'); 337 sub_proj->read(subdir.fileName()); 340 bool tmpError = !sub_proj->read(subdir.fileName()); 338 341 if(!sub_proj->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) { 339 342 fprintf(stderr, "Project file(%s) not recursed because all requirements not met:\n\t%s\n", … … 342 345 delete sub; 343 346 delete sub_proj; 347 Option::output_dir = old_output_dir; 348 qmake_setpwd(oldpwd); 344 349 continue; 350 } else { 351 hasError |= tmpError; 345 352 } 346 353 sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name); … … 350 357 const QString output_name = Option::output.fileName(); 351 358 Option::output.setFileName(sub->output_file); 352 sub->makefile->write(sub->output_dir);359 hasError |= !sub->makefile->write(sub->output_dir); 353 360 delete sub; 354 361 qmakeClearCaches(); … … 374 381 self->makefile->init(); 375 382 subs.append(self); 376 return true; 383 384 return !hasError; 377 385 } 378 386 … … 428 436 #include "msvc_dsp.h" 429 437 #include "msvc_vcproj.h" 438 #include "symmake_abld.h" 439 #include "symmake_sbsv2.h" 430 440 QT_END_INCLUDE_NAMESPACE 431 441 … … 442 452 QString gen = proj->first("MAKEFILE_GENERATOR"); 443 453 if(gen.isEmpty()) { 444 fprintf(stderr, " No generator specified in config file: %s\n",454 fprintf(stderr, "MAKEFILE_GENERATOR variable not set as a result of parsing : %s. Possibly qmake was not able to find files included using \"include(..)\" - enable qmake debugging to investigate more.\n", 445 455 proj->projectFile().toLatin1().constData()); 446 456 } else if(gen == "UNIX") { … … 466 476 } else if(gen == "BMAKE") { 467 477 mkfile = new BorlandMakefileGenerator; 478 } else if(gen == "SYMBIAN_ABLD") { 479 mkfile = new SymbianAbldMakefileGenerator; 480 } else if(gen == "SYMBIAN_SBSV2") { 481 mkfile = new SymbianSbsv2MakefileGenerator; 468 482 } else { 469 483 fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData()); … … 477 491 478 492 MetaMakefileGenerator * 479 MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op )493 MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op, bool *success) 480 494 { 481 495 MetaMakefileGenerator *ret = 0; 482 if ((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||483 Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) {484 if (proj->first("TEMPLATE").endsWith("subdirs"))496 if ((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || 497 Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) { 498 if (proj->first("TEMPLATE").endsWith("subdirs")) 485 499 ret = new SubdirsMetaMakefileGenerator(proj, name, op); 486 500 } 487 if (!ret)501 if (!ret) 488 502 ret = new BuildsMetaMakefileGenerator(proj, name, op); 489 ret->init(); 503 bool res = ret->init(); 504 if (success) 505 *success = res; 490 506 return ret; 491 507 }
Note:
See TracChangeset
for help on using the changeset viewer.