summaryrefslogtreecommitdiffstats
path: root/qmake/project.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* normalize $$QMAKE_QMAKEOswald Buddenhagen2012-06-191-3/+2
| | | | | | | | | everything in the projects should be normalized. only the makefile generators need to adjust it to the native form. Change-Id: I06a4e997f32134d13949ec4a9dd1b44367aab7cb Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* look for mkspecs/ even below .qmake.cache/.conf-determined rootOswald Buddenhagen2012-06-191-19/+26
| | | | | | | otherwise a cache/config in an aggregator project may unduly hide the mkspecs/ of the aggregated project from qmake's view. Change-Id: Idb0b124de071822f8f55463d9f8a4d194ef3130e
* add support for a super cacheOswald Buddenhagen2012-06-191-13/+56
| | | | | | | | | | | | | | | | | qmake will now look for .qmake.super, just like it looks for .qmake.cache, and the cache() function has a mode to write this super cache. this allows the creation of aggregator projects like, say, qt5. a notable difference to the normal cache is that this file is *not* added as a dependency of the Makefile. this means that modifications done by later sub-projects will not cause a re-processing of earlier projects, and consequently that one should be cautious regarding what information to store there. another notable difference is that this file is read *before* the spec, so the spec can use the variables from the cache without resorting to $$fromfile() & co. Change-Id: I4807b6d34014261fa9eebd6f0ae128b802d86691 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* look for .qmake.conf filesOswald Buddenhagen2012-06-191-17/+25
| | | | | | | | | this is the source dir equivalent of .qmake.cache and can be checked into the repository. it can be used to make project-wide settings, or just to signal the presence of an mkspecs/ directory. Change-Id: I5f1cebad2aa2a89e78089341b2051613b6b7a613 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* find .qmake.cache for subprojects independentlyOswald Buddenhagen2012-06-191-38/+47
| | | | | | | | | | this allows the creation of aggregator projects, like, say, qt5. this is not expected to have a negative impact, as no project could reasonably expect a nested .qmake.cache to *not* take effect - in fact, if the project was processed stand-alone, it would already use it. Change-Id: I33f2935d309baba7e95465f2fefb8231c4f03eda Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* allow setting QMAKEPATH and QMAKEFEATURES in .qmake.cacheOswald Buddenhagen2012-06-191-0/+24
| | | | | Change-Id: Ie383abb57c06cb49d38345d64750837b8fe14c70 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* don't duplicate project_build_root's calculation needlesslyOswald Buddenhagen2012-06-191-7/+2
| | | | | Change-Id: Id2f343c450149b13b52c2cae8eb6eb4bfd73fc03 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* remove last traces of js supportOswald Buddenhagen2012-06-191-25/+10
| | | | | | | | don't even complain about trying to use js-based feature files. we have been doing that for long enough. Change-Id: Ib58ec204322442c488e8d780989f26b1e32595ed Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make splitPathList() return an empty list for an empty stringOswald Buddenhagen2012-06-191-19/+9
| | | | | | | this makes the user code a bit cleaner Change-Id: I3713c73c5c19cf69341be65480917eda0b967b77 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* introduce /get property variantsOswald Buddenhagen2012-06-191-3/+5
| | | | | | | | | | | | | | | properties are now split into a write location $$[FOO] and a read location $$[FOO/get]. the write locations are hard-coded and configurable via qt.conf/Paths as before, while the read locations are configured via qt.conf/EffectivePaths. this finally provides a clean solution to the problem that during the qt build itself tools and libraries need to be taken from somewhere else than they are installed to. Change-Id: I956c43bd082afd465e690fe75d0bee3c2c0f7c25 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* add $$reverse() functionOswald Buddenhagen2012-06-191-1/+13
| | | | | | | | | returns the list with the order of the elements reversed. one can easily implement this with existing functions, but this is way faster and more readable. Change-Id: I12d306eb9fe58fc332622274ea6b658192529491 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* add $$shell_quote() functionOswald Buddenhagen2012-06-191-1/+71
| | | | | | | | to be used in system() calls and when assembling EXTRA_COMPILER and INSTALLS .commands by hand. Change-Id: Id706cd56aa267a9fb4b14e3416692b4716fafa5b Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$absolute_path() and $$relative_path()Oswald Buddenhagen2012-06-191-1/+19
| | | | | | | just exposes QDir::fooFilePath() wrapped into QDir::cleanPath() Change-Id: I7a7644084825fd8092a9910ac20f695c4d9351f6 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$native_path() functionOswald Buddenhagen2012-06-191-1/+9
| | | | | | | more or less QDir::toNativeSeparators(QDir::cleanPath()) Change-Id: I52deee1e8086559eda5833b387a0cf64d21cbcd9 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$clean_path() functionOswald Buddenhagen2012-06-191-1/+9
| | | | | | | just QDir::cleanPath() Change-Id: I2d51e2385939d8926c00f296537ab7f6757d9a79 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$format_number() functionOswald Buddenhagen2012-06-191-1/+75
| | | | | Change-Id: I04266c1f5fb72af94073f3f508cee59085e365b6 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$shadowed() functionOswald Buddenhagen2012-06-191-1/+10
| | | | | | | | | return the build directory corresponding to a given source directory. this is the identity function if not shadow-building. if input lies outside the source directory, return empty value. Change-Id: I2d2a6b1112bd19989fe29cfe19a12d39a0d208c1 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$val_escape() functionOswald Buddenhagen2012-06-191-1/+13
| | | | | | | | this quotes the elements of a variable in a way suitable for re-parsing as qmake code. Change-Id: I0e6ea2478c43b5aeff45f485a48ac8c86705dd4a Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$enumerate_vars() functionOswald Buddenhagen2012-06-191-1/+5
| | | | | | | this simply returns the keys of all variables in the context. Change-Id: I0092f827744fcd257dfb9e7ca664c87c6f1cc763 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make defined() support testing definedness of variablesOswald Buddenhagen2012-06-191-0/+2
| | | | | Change-Id: I58d2dd402d72ee5a19012a6b5a4ba111717d40cc Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add mkpath() functionOswald Buddenhagen2012-06-191-1/+15
| | | | | Change-Id: I8809b9ee4e85fbe8cec95641d659f237c5f51a26 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add log() functionOswald Buddenhagen2012-06-191-6/+13
| | | | | | | this is a literal print to stderr. Change-Id: Ib0a2f53373ebbc4e0bda07a38d656bce145b31cf Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add touch() functionOswald Buddenhagen2012-06-191-1/+74
| | | | | | | | | this is equivalent to unix "touch --no-create --reference <ref> <file>". QFile has no setLastModified() (even though QFileInfo has lastModified()), so the implementation is low-level. Change-Id: I6783e8f2613e168ad0c24e79e7384d5b2e4901ee Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add write_file() functionOswald Buddenhagen2012-06-191-1/+38
| | | | | | | | | this dumps the contents of a variable into a file. each element of the variable is considered a line; line terminators are added. all missing directories are automatically created. Change-Id: Idafeb873cea64e6705c894b3ab0ef21df69e7170 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add cache() functionOswald Buddenhagen2012-06-191-3/+222
| | | | | | | | | | | this function adds the current contents of the named variable to the cache. this comprises populating base_vars and appending an assignment to .qmake.cache. if no cache file exists yet, it will be created in the current output directory (and inherited by subdirs projects). if called without a variable name, only create the cache file if missing. Change-Id: I1e81c2238aa6a5817a6ebbfb022e2b995c349363 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add "blob" and "lines" modes to $$cat() and $$system()Oswald Buddenhagen2012-06-191-25/+63
| | | | | | | this bypasses the otherwise done insane word splitting Change-Id: Ia9b8980bc0770de3999544a06d239f55fb34f801 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* introduce ability to build projects for the host systemOswald Buddenhagen2012-06-191-24/+57
| | | | | | | | | | | | | | | | | when qmake runs into the new option(host_build) command, it will restart the project evaluation with a host spec. the new default host spec is called default-host (gasp!). it is overridden with the pre-exising -spec / -platform option, while the new -xspec / -xplatform option overrides the pre-existing default spec. specifying -spec but not -xspec will set the xspec, too, so the behavior is backwards-compatible. same for the XQMAKESPEC override read from .qmake.cache and the environment variable. the cleaner solution would be adding -hostspec, to be symmetrical with the override semantics, but that would deviate from configure in turn. Change-Id: I4297c873780af16ab7928421b434ce0f1d3820da Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Revert "make default_pro.prf advertize dynamically created .qmake.cache"Oswald Buddenhagen2012-06-191-2/+0
| | | | | | | | ... and followup fixes. this is not needed any more due to the breaking patch being reverted. Change-Id: Ia3416fcc16ddece680efbd0322286a601879fa0a Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Revert "move .qmake.cache search to Option"Oswald Buddenhagen2012-06-191-6/+59
| | | | | | | | | | | | | | | | We are now moving in the exact opposite direction. This logically reverts commit 059200a44ba7177d0c9ec6bb5e6ee0b7e0c3f017. Some adjustments were necessary to maintain the project root stuff. Conflicts: qmake/main.cpp qmake/option.cpp qmake/option.h qmake/project.cpp Change-Id: Ic14fa571cbbfe9ac159f92493e49741d70a87eff Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Revert "move finding the makespec to Option"Oswald Buddenhagen2012-06-191-0/+43
| | | | | | | | | | | | | | Needed for an upcoming revert. This reverts commit 74a6669fa7c0d6e2cb7d34d56332d620d2a07755. Conflicts: qmake/option.cpp qmake/project.cpp qmake/property.cpp Change-Id: I56088506d27bf1f095f9261c75224f4bee17ec60 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* qmake can not process project file with UTF-8 BOMDebao Zhang2012-05-301-2/+8
| | | | | | | | | Project file contains UTF-8 BOM can't processesed by qmake and will cause subtle errors. Task-number: QTBUG-25848 Change-Id: Id69ed38c6be63a29fa3792a631cb8cb0ac176148 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Don't use the QRegExp methods that modify the object [qmake]Thiago Macieira2012-04-231-1/+1
| | | | | | | | | | | | | QRegExp matching methods modify the object, which we don't want to. In particular, when we receive a QRegExp from the user or we store in a context that might require thread-safety, make sure we make a copy before using it. QRegularExpression has no such shortcoming. Task-number: QTBUG-25064 Change-Id: I6b2d2530238a7e04b44859664a2962f2f466ee30 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Merge remote-tracking branch 'origin/master' into api_changesOswald Buddenhagen2012-04-101-2/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
| * Fix qmake's use of Q_ASSERT with side-effects.Thiago Macieira2012-03-281-2/+4
| | | | | | | | | | | | | | | | The nice side-effect of having Q_ASSERT use the condition twice is that we break code that has side-effects. Change-Id: Ia0b7ed2a8030c8e222612af95eb2d58671433110 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* | Build qmake with QStringBuilder.Olivier Goffart2012-03-161-1/+1
|/ | | | | | | | | | | QStringBuilder will be enabled by default so qmake should build with it. qstringbuiler.cpp has to be compiled in just for the convertFromAscii (The alternative was to build with QT_NO_CAST_FROM_ASCII, but that would be too much work) Change-Id: I1fbeed7ed8a9d3bc38ef591a687c50644980e2fd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Allow qmake to find features when using mkspecs in nested dirsSean Harmer2012-03-121-6/+11
| | | | | | | | | | | | | | | Commit 8e5eb1bddcfc introduced the assumtion that mkspecs are immediately below the mkspecs directory itself. This is not true for e.g. unsupported/blackberry-armv7le-qcc. This commit restores qmake's ability to find the "root" of the mkspecs collection no matter how deeply the actual mkspecs are nested. Task-number: QTBUG-24665 Change-Id: I98faaf8e6ae7b8524277aea6c17e685e507e37b3 Reviewed-by: Sean Harmer <sh@theharmers.co.uk> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QT_RAW_INSTALL_FOO => QT_INSTALL_FOO/rawOswald Buddenhagen2012-03-121-1/+1
| | | | | | | | | | | | this makes the "sysrootable" properties more magic, with the raw versions being omitted from the qmake -query output and automatically falling back to the "cooked" variant if there is no sysroot set. this makes the "normal" qmake -query less noisy. this will become even more obvious when i add more "overloads" of the properties. Change-Id: I08000986427264ec6238c8fe0a77f5cecdbf1201 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* move postProcessProject() call to sane locationOswald Buddenhagen2012-03-071-1/+0
| | | | | | | | | there is totally no reason to call it unless the project is actually used for makefile generation, and the excessive calls actually mess up things. Change-Id: Idb7912a5404f6054010d2f29cce820a167de4f6f Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* de-duplicate feature and mkspec root candidate listsOswald Buddenhagen2012-03-061-0/+1
| | | | | Change-Id: I03f5b5903a133e5386b9ebef640ddbacdf3ebcd4 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* do not re-evaluate spec+cache in build passesOswald Buddenhagen2012-03-061-4/+3
| | | | | | | | | | clean up the somewhat convoluted code paths which forced re-evaluation. now that the spec+cache are evaluated in a completely clean context anyway, there is no point in re-evaluating them for build passes. Change-Id: I12279083238e9ca7028af97f45e2638c8dc715b8 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* make QMakeProject's copy c'tor actually behave like oneOswald Buddenhagen2012-03-061-2/+3
| | | | | | | | | | | | | | | instead of initializing base_vars with the original's vars, initialize vars itself. this has two consequences: - there is no need to call read(0) to initialize vars - one cannot usefully call the complex read() anymore, as that would re-initialize vars from base_vars this is much closer to an actual copy than the previous "seeding with existing project". Change-Id: Ib007bc5b779aedb680a27329aa578f7c604a4308 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>