diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc index 718e3784dd0fd69ec5dc496ad2af0f582bd6fbb1..a0f6464763ee9cedbb57df24b5275bff947fd2c3 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}. + */