From beb4af4bce091da04b1f6e6deb307c4e7942d2ee Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 30 Sep 2010 14:41:52 +0200 Subject: [PATCH] Doc - Using SUBDIRS variable Task-number: QTCREATORBUG-2430 Reviewed-by: hjk Reviewed-by: Jarek Kobus --- doc/qtcreator.qdoc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 718e3784dd0..a0f6464763e 100644 --- a/doc/qtcreator.qdoc +++ b/doc/qtcreator.qdoc @@ -1927,6 +1927,35 @@ This also makes the files available in the \gui Locator. + \section1 Adding Subprojects to Projects + + When you create a new project, you can add it to another project as a subproject + in the \gui{Project Management} dialog. However, you first have to edit the + .pro file of the parent project to specify that qmake uses the \c subdirs template + to build the project. + + The \c subdirs template creates a Makefile for building subprojects. They can be + located either in subdirectories of the project directory or in any other directory. + The location of the targets is specified using the SUBDIRS variable. If the project file + has the same name as the directory, you can just specify the directory name. If the project + name and directory name are different, you must specify the project file name (.pro). + + For more information on the SUBDIRS variable, see the + \l{http://doc.qt.nokia.com/4.7/qmake-variable-reference.html#subdirs}{qmake Variable Reference}. + + For example, the following code specifies that plugin_coreplugin/plugin_coreplugin.pro + and mylogin.pro belong to the project: + + \code + TEMPLATE = subdirs + + SUBDIRS = plugin_coreplugin \ + ../another/plugin/myplugin.pro + \endcode + + To specify dependencies, use the \gui{Add Library} wizard. For more information, + see \l{Adding Libraries to qmake Projects}. + */