diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2010-02-26 15:13:54 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2010-03-01 09:07:17 (GMT) |
commit | 3d50a8049b20e01b8a2cb9b954b14302dc6144c6 (patch) | |
tree | 80f65aef23c0aa17055fbe86ef1d174bb3f02e34 | |
parent | 8113f2d94afd4e25caf12edf9716b7e0a82de1a8 (diff) | |
download | Qt-3d50a8049b20e01b8a2cb9b954b14302dc6144c6.zip Qt-3d50a8049b20e01b8a2cb9b954b14302dc6144c6.tar.gz Qt-3d50a8049b20e01b8a2cb9b954b14302dc6144c6.tar.bz2 |
Added .condition modifier to SUBDIRS.
In Symbian, it is now possible to set certain subdirs to be built
only when specified define is true when bld.inf is parsed.
For example, compile a subdir only when building for emulator:
SUBDIRS += winscw_lib
winscw_lib.condition = WINSCW
Also improved SUBDIRS variable documentation; the modifiers were
completely undocumented.
Task-number: QT-3017
Reviewed-by: axis
-rw-r--r-- | doc/src/development/qmake-manual.qdoc | 28 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_qmake-manual.qdoc | 14 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 13 |
3 files changed, 54 insertions, 1 deletions
diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index b3d6f72..3157536 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -2968,6 +2968,34 @@ For example: \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 51 + It is possible to modify this default behavior of \c SUBDIRS by giving + additional modifiers to \c SUBDIRS elements. Supported modifiers are: + + \table + \header \o Modifier \o Effect + \row \o .subdir \o Use the specified subdirectory instead of \c SUBDIRS value. + \row \o .file \o Specify the subproject \c pro file explicitly. Cannot be + used in conjunction with \c .subdir modifier. + \row \o .condition \o Specifies a \c bld.inf define that must be true for + subproject to be built. Available only on Symbian platform. + \row \o .depends \o This subproject depends on specified subproject. + Available only on platforms that use makefiles. + \row \o .makefile \o The makefile of subproject. + Available only on platforms that use makefiles. + \row \o .target \o Base string used for makefile targets related to this + subproject. + Available only on platforms that use makefiles. + \endtable + + For example, define two subdirectories, both of which reside in a different directory + than the \c SUBDIRS value, and one of the subdirectories must be built before the other: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 149 + + For example, define a subdirectory that is only build for emulator builds in Qt for Symbian: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 150 + \target TARGET \section1 TARGET diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 5a04420..e8c00d3 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -982,3 +982,17 @@ MYVARIABLES = LIB addMMPRules(MYCONDITIONS, MYVARIABLES) //! [148] + +//! [149] +SUBDIRS += my_executable my_library +my_executable.subdir = app +my_executable.depends = my_library +my_library.subdir = lib +//! [149] + +//! [150] +symbian { + SUBDIRS += emulator_dll + emulator_dll.condition = WINSCW +} +//! [150] diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index b5a0696..9ade699 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -1317,6 +1317,10 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy fixedItem = item; } + QString condition; + if (!project->isEmpty(item + ".condition")) + condition = project->first(item + ".condition"); + QFileInfo subdir(fileInfo(fixedItem)); QString relativePath = directory.relativeFilePath(fixedItem); QString subdirFileName = subdir.completeBaseName(); @@ -1345,9 +1349,16 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy bldinfDefine = bldinfDefine.toUpper(); removeSpecialCharacters(bldinfDefine); + if (!condition.isEmpty()) + t << "#if defined(" << condition << ")" << endl; + t << "#ifndef " << bldinfDefine << endl; t << "\t#include \"" << bldinfFilename << "\"" << endl; - t << "#endif // " << bldinfDefine << endl; + t << "#endif" << endl; + + if (!condition.isEmpty()) + t << "#endif" << endl; + } // Add supported project platforms |