summaryrefslogtreecommitdiffstats
path: root/qmake/project.cpp
Commit message (Collapse)AuthorAgeFilesLines
* make fileFixify() calling convention somewhat saneOswald Buddenhagen2015-04-211-0/+1
| | | | | | | | | | instead of allowing arbitrary input and output base paths, restrict them to the project input and output dirs (in any permutation), which are the only cases ever used anyway. this permits much clearer call sites, and allows later optimizations. Change-Id: I48d149a4417af5c858e66ec57c476a5bc6b17f17 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* remove pointless return value from QMakeParser::read()Oswald Buddenhagen2015-02-041-10/+9
| | | | | | | | | | it always returned true nowadays. an obvious followup effect is that the return value of parsedProBlock() doesn't need to be null-checked any more as well. Change-Id: I782785cab9b721a78a342a010921a73e642ebe7f Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* pass a pointer instead of a reference to initFrom()Oswald Buddenhagen2014-06-201-1/+1
| | | | | | | | | | msvc thinks that it's impossible to create a null reference (because some language lawyer said so) and thus complains about our assert that checks the reference's validity. work around by not dereferencing the pointers we already have. Change-Id: Ife2288d4187860105de12fdebc0e671e0159ace3 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* implement simple VFS to support caching during project parsingOswald Buddenhagen2013-08-071-2/+2
| | | | | | | | | | | | sync up with qt creator - for qmake itself, this is just a minor refactoring. Change-Id: I833253f81c3159056fab2ff888f293b36cc2ef56 Reviewed-by: Daniel Teske <daniel.teske@digia.com> (cherry picked from qtcreator/66802ef8bf7989dc025e34bf91d93576189c483c) (cherry picked from qtcreator/69542826fa643a0fed2fc9e717f072c2852dc017) (cherry picked from qtcreator/196424115338fb9a535810704b7d814d318b0462) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Use QStringList::join(QChar) overload where applicable [qmake]Marc Mutz2012-09-211-1/+1
| | | | | | | | | | This is an automated change performing the following replacements: join\("(.)"\) -> join('\1') join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1')) join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1')) Change-Id: I9c9964703dedfdab6e7bfac80be22bd5570e2e49 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* make error() abort the qmake run, not just the current fileOswald Buddenhagen2012-09-211-5/+18
| | | | | | Change-Id: I82fc55680f9ffb227e25acb39c797596225ba89e Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* don't allow overloading of built-in functionsOswald Buddenhagen2012-09-181-2/+15
| | | | | | | | | | the functions are not versioned or scoped, so user-defined overloads would mess up qmake's own feature files. it seems safer to break user projects than to allow the user to break qmake. Change-Id: I020a2e6416bbb6e2fd2ece339629d848c00c8398 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* port qmake to qt creator's qmake language evaluatorOswald Buddenhagen2012-09-111-3707/+51
| | | | | | | | | | | | | | | | | | | | | this is a monster commit which does the following things: - import the evaluator as-is from qt creator into qmake/library/ - integrate it into qmake's makefiles - overwrite proitems.h with actual special types - remove the parts of Option which are redundant with QMakeGlobals - make QMakeProperty a singleton owned by Option::globals. the dynamic handling so far made no sense. - make QMakeProject a subclass of QMakeEvaluator, with relatively few extensions the changes to existing qmake code outside project.* and option.* are minor. implementing the changes gradually would mean changing a lot of code which will be just replaced in the next commit, so i'm not wasting my time on it. Change-Id: I9746650423b8c5b3fbd8c3979a73228982a46195 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* introduce qmake variable abstractionsOswald Buddenhagen2012-09-071-16/+16
| | | | | | | | this is preparation for adapting to a new evaluator. Change-Id: I6fc59f5525735754a00afa6629fbfe257e84db97 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* remove pretenses of supporting projects on stdinOswald Buddenhagen2012-09-051-12/+6
| | | | | | | | | | this may have worked a decade ago, but now it only produces funny Makefiles (and needs hacking main.cpp). the feature doesn't seem *too* important, so just clean it out. Change-Id: I50a60b0e30341f0b523e4a5731c770c9c1013f8b Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* remove QMAKE_MKSPECS property from qmake -query's viewOswald Buddenhagen2012-09-051-1/+3
| | | | | | | | | | it's a dynamic property which is something between meaningless and misleading when used outside a project file. also, experience from creator shows that people would consistently abuse it (not handling it as the list it is). Change-Id: Id52cd40da5c38c0c74535d0701fdae53dfa39cad Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make $$relative_path() minimize already relative pathsOswald Buddenhagen2012-08-071-4/+5
| | | | | | | | | | QDir::relativeFilePath() doesn't do anything if the path is already relative, so make it absolute first to force a re-calculation. the cleanPath() is gone, as relativeFilePath() already does that. Change-Id: I8f4d0d839db3fe99a608f70916b4b5bd52c56535 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix qmake -projectRafael Roquetto2012-08-061-0/+6
| | | | | | | | qmake -project was always outputting a project with subdirs template, because Option::h_moc_mod was not being properly read, causing addFile() to misbehave. Change-Id: I2c07aea132f9885eabf188de993b0fabfb352886 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* remove second argument from $$eval() (access to global scope)Oswald Buddenhagen2012-07-311-13/+2
| | | | | | | | | | | sam added this based on a vague notion of backwards compatibility when he fixed the function to use the local scope, but it kind of makes no sense - there is very little reason for accessing the global scope from within a function. google doesn't find any relevant hits except our source code, so let's just nuke it. Change-Id: Ie957bb47b531f7e9b5dfcceb4e09f65dd826b422 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* fix host vs. makefile directory separator messOswald Buddenhagen2012-07-281-34/+62
| | | | | | | | | | | | | | | | | the system path separator and shell are bound to the host system (system() will use cmd even on mingw with sh.exe in path). the makefiles otoh may depend on what the qmakespec defines. consequently, add $$system_path() and $$system_quote() (for use with system() & $$system()). $$native_path() is renamed to $$shell_path() and should be used with $$shell_quote() to produce command lines in makefiles. $$QMAKE_DIR_SEP needs to be applied to Option::dir_sep right after parsing the spec, so it is available to $$shell_{path,quote}(). Change-Id: If3db4849e7f96068cf03a32348a24f3a72d6292c Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* ifdef out the "clears variables previously set" warningOswald Buddenhagen2012-07-061-0/+2
| | | | | | | | it produces way too many false positives to be useful. Change-Id: Iefa423f96fa5574267b1468abb5efc8454ab54a3 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* export QMAKESPEC to the projectOswald Buddenhagen2012-07-031-0/+1
| | | | | | | | | | this makes it unnecessary to dump qmakespec to .qmake.cache and qmodule.pri. Task-number: QTBUG-22700 Change-Id: I678c7ee7df2512184b9cd06d7a3be8bbd0b0da15 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* fix bugs surrounding reading super cache when no local cache is presentOswald Buddenhagen2012-06-301-3/+2
| | | | | | | | we would ignore the early read variables and fail to export the super cache's path to the project. Change-Id: I3c467802b4af22f73be05b25dbd8ccb6196d28a8 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* use source root also for finding featuresOswald Buddenhagen2012-06-271-0/+2
| | | | | Change-Id: I108914c6d2c6d06414156584aeb3a1afb0f5838d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* move cachefile_depth calculation out of project evaluatorOswald Buddenhagen2012-06-271-5/+1
| | | | | | | it has no business there Change-Id: I6d1a4b55b5acacc470cc109a6c69a907abbba312 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* remove possibility to request project recursion from within a pro file againOswald Buddenhagen2012-06-271-4/+1
| | | | | | | | | | the feature was implemented for the abld/sbs2 generators only, and is of course undocumented. this reverts most of commit e795e61ef93f8080f9938ac49f2fca306644af85. Change-Id: Ibd1726b036ce6c45f8e678ea996218f774f8aed2 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* reduce a bit of code dupe while assembling feature search pathOswald Buddenhagen2012-06-271-13/+9
| | | | | | | | instead of having a bunch of nested loops, collect into a temporary list and process it at the end. Change-Id: I97e5642f7e13f7c7b69eae00833e61cdf46a02ed Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* repurpose deprecated -E switchOswald Buddenhagen2012-06-271-12/+17
| | | | | | | | | instead of dumping the variables as we are going, dump everything at the end. this is potentially useful, as opposed to the previous functionality which was redundant with -d. Change-Id: Icf14703cb93e03f7079dfc0266b219ad9c902133 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* make a bunch of functions constOswald Buddenhagen2012-06-271-1/+1
| | | | | | | values() and variables() get both const and non-const overloads Change-Id: Idfabea1acc488bf78f24edb831681ee07f0074c4 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* make magicValues() constOswald Buddenhagen2012-06-271-6/+3
| | | | | | | the weird debugging feature is not used anyway Change-Id: I07f481a94f2b2ab2a5b61270f0e00183cefd4cd1 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* don't use backwards compat mapping for generator accessesOswald Buddenhagen2012-06-271-1/+1
| | | | | | | | we can rely on only user code needing variable mapping, so apply it only in the evaluator. Change-Id: I6fc58e7bcf24cf0fa8783d5341ab1e7b9f001c88 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* introduce magicValues() functionOswald Buddenhagen2012-06-271-2/+8
| | | | | | | | | the only place where the two remaining magic values need to be referencable is doVariableReplaceExpand(), so make a separate function and use it only in that place. Change-Id: I6e2fcfa3a4f16727d90ace56eb88fc99ef272ffc Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make $$PWD non-magic on readOswald Buddenhagen2012-06-271-4/+3
| | | | | | | like the other variables, we can just store it in the hash. Change-Id: I49ad39dca8d498119b27f16ea4bdc44ae698d72e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* set $$_DATE_ only on project startupOswald Buddenhagen2012-06-271-3/+1
| | | | | | | | | this changes the semantics a bit - it will be the datetime of qmake startup rather than the time a particular file is processed. i'd argue that this is insignificant. Change-Id: I75918967bef25038ce54aa81ab03c027384c0268 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* deprecate $$IN_PWDOswald Buddenhagen2012-06-271-2/+3
| | | | | | | | it suggests a symmetry to $$OUT_PWD which simply isn't there. the shorter alias $$PWD is much more popular anyway. Change-Id: Iefbfd56f1a3e526f15c9d6cd1bf59778be6f2f8d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* make project-related variables non-magicOswald Buddenhagen2012-06-271-11/+5
| | | | | | | | $$_PRO_FILE_, $$_PRO_FILE_PWD_ and $$OUT_PWD can be cleanly initialized. no need for magic. Change-Id: I2e339d17bae42ecb573c2f82c716f6be15a35b98 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* move initialization of $$TARGET to setupProject()Oswald Buddenhagen2012-06-271-4/+2
| | | | | | | that's what we have it for Change-Id: Ib734b97d337a82c73b086dfeb2b263171f2a02b7 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make $$TEMPLATE magic on write instead of on readOswald Buddenhagen2012-06-271-16/+26
| | | | | Change-Id: I03a68993dd7d4488f8212132a9d492d135295b9e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make a bunch of invariant variables non-magicOswald Buddenhagen2012-06-271-126/+102
| | | | | | | | instead of resolving them on-demand, just initialize the value hash with them. less magic and faster. Change-Id: I28cb6c21ae6ae60a33734f62acdef0794420ba8f Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* don't make $$TEMPLATE_PREFIX available any moreOswald Buddenhagen2012-06-271-4/+0
| | | | | | | | this is a purely internal variable. projects are supposed to query $$TEMPLATE only. Change-Id: I32a3aa7012a4fedcf6e77e2e1302ed978baac700 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* move initialization of numerous variables to spec_pre.prfOswald Buddenhagen2012-06-271-12/+0
| | | | | | | | this is cleaner by design and allows removing some hacks. Change-Id: I3270195b5d62caa476ffde7c1e1ef43cec99c565 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* use real qmakespec as basis for finding featuresOswald Buddenhagen2012-06-271-4/+3
| | | | | | | | | | doesn't make much of a difference on unix (as the default specs are just symlinks). on windows, it makes the gross hack used for finding spec-specific wince default_post.prfs unnecessary. Change-Id: Id403dce5be487e1ae22c1f54b8095a6afdd98bc8 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* resolve real qmakespec name right after loading itOswald Buddenhagen2012-06-271-35/+10
| | | | | | | | this is cleaner than resolving it on-demand, as it avoids statics (with potential side effects on dynamic spec switching). Change-Id: I2bc15a4c3108376e1b4a01351875fe0c445ee5d5 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* remove support for loading features relative to current directoryOswald Buddenhagen2012-06-271-3/+2
| | | | | | | | | | | it's completely counterproductive. just include() the file instead. i don't think anyone knew about this "feature", so just removing it. as a side effect this removes the repeated existence check of already found feature files, as we can use a clean else-if cascade. Change-Id: I5d38d38d0a897f2e8857ac68d5649fd4367941c4 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* revamp handling of qmake target modeOswald Buddenhagen2012-06-271-60/+7
| | | | | | | | | | | the project evaluator becomes oblivious of the target mode. the mode is set up in spec_post.prf according to the spec. $$QMAKE_TARGET contains the feature suffixes to search, and is also contained in $$CONFIG. the target_mode variable itself becomes private to the Makefile class. Change-Id: I3c06d9dab536b753343cec6c5c491d3203e50bd8 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* read spec_pre and spec_post featuresOswald Buddenhagen2012-06-271-0/+2
| | | | | | | | these are read before the qmakespec and before the cache, resp. this will allow moving some hard-wired logic out of qmake. Change-Id: I6a63050d7798bc30a4add8c009bcd801a29a0deb Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* prune feature search paths which don't actually existOswald Buddenhagen2012-06-271-1/+6
| | | | | | | | this should significantly cut down the time wasted looking for files in non-existing directories, in particular on windows. Change-Id: I7ab3523fe8c028e3787ebc78e4543ab04f53448e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* eliminate some use of base_varsOswald Buddenhagen2012-06-271-14/+16
| | | | | | | | | this limits references to this variable to its setup and explicit cache manipulation. Change-Id: I88dd2418051501abea201f223da7759a15f1c249 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* don't let the make spec determine the host mode any moreOswald Buddenhagen2012-06-271-28/+16
| | | | | | | | | | | (some of) the generators are (moderately) x-platform, so it makes no sense to nail the host platform to a generator (and thus a spec). overriding the host platform is only a debugging mesasure anyway, so one can use the (now undocumented) -unix/-macx/-win32 options for that. Change-Id: If2a059f1feeb2c726e5838625ede1c7add829985 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* fix somewhat common edge case in $$shadowed()Oswald Buddenhagen2012-06-261-2/+5
| | | | | | | | | | | | if source and build dir are direct children of the common root and we are shadowing the top-level source dir, there is of course no trailing slash to match. Change-Id: I8a34a6a72d16cb21d77d056e037235af9b32a008 Reviewed-by: Davide Pesavento <davidepesa@gmail.com> Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix return type of isActiveConfig("host_build")Simon Hausmann2012-06-241-1/+1
| | | | | | | | The return type of isActiveConfig is a boolean, so return that when host_build is queried. Change-Id: I6d1420b49b09e51442c4b2d482e2f19b165081d8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>