From 5e6c7089d86387fff4690ccdb896b9dacbbe7e76 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 7 Apr 2022 14:52:16 +0200 Subject: [PATCH] Doc: Describe how to declare files in projects Including using OTHER_FILES for qmake projects. Fixes: QTCREATORBUG-27157 Change-Id: I802000c90472464430d1335b9e962c6691cc567a Reviewed-by: Eike Ziller --- .../src/editors/creator-locator.qdoc | 7 ++-- .../creator-only/creator-beautifier.qdoc | 3 +- doc/qtcreator/src/editors/creator-search.qdoc | 6 +++ .../creator-deployment-embedded-linux.qdoc | 1 + .../creator-projects-creating.qdoc | 40 ++++++++++++++----- .../user-interface/creator-projects-view.qdoc | 3 ++ 6 files changed, 44 insertions(+), 16 deletions(-) diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index d649442309e..f3e82ea396c 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -230,9 +230,10 @@ \endlist - If locator does not find some files, you can add them to the \c DISTFILES - variable in the \c .pro file to include them into the distribution tarball - of your project and thus make them known to \QC as well. + \if defined(qtcreator) + If locator does not find some files, see \l{Specifying Project Contents} + for how to make them known to the locator. + \endif \section1 Configuring Locator Filters diff --git a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc index 011ada3307c..dca905d6120 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc @@ -121,8 +121,7 @@ \li Select \uicontrol {Use file *.astylerc defined in project files} or \uicontrol {Use file uncrustify.cfg defined in project files}, - to use the configuration file - \l{Displaying Additional File Types in Projects View} + to use the configuration file \l{Specifying Project Contents} {defined in the project file} as the configuration file for the selected tool. diff --git a/doc/qtcreator/src/editors/creator-search.qdoc b/doc/qtcreator/src/editors/creator-search.qdoc index 7a1e7dd9de3..5d4315b8610 100644 --- a/doc/qtcreator/src/editors/creator-search.qdoc +++ b/doc/qtcreator/src/editors/creator-search.qdoc @@ -142,6 +142,12 @@ \image qtcreator-search-allprojects.png + \if defined(qtcreator) + If you cannot find some files, see + \l{Specifying Project Contents} for how + to declare them as a part of the project. + \endif + \li \uicontrol {Current Project} searches from the project you are currently editing. diff --git a/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc b/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc index db241e9c60d..d1880588a00 100644 --- a/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc +++ b/doc/qtcreator/src/linux-mobile/creator-deployment-embedded-linux.qdoc @@ -56,6 +56,7 @@ \section1 Adding Missing Files The process to add files to deploy depends on the build system you use. + For more information, see \l{Specifying Project Contents}. \section2 CMake Builds diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc index a3ad3bb15dd..c89efd5a465 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc @@ -239,21 +239,33 @@ \include creator-python-project.qdocinc python project wizards - \section1 Displaying Additional File Types in Projects View + \section1 Specifying Project Contents + + A project can contain files that should be: + + \list + \li Compiled or otherwise handled by the build + \li Installed + \li Not installed, but included in a source package created with + \c {make dist} + \li Not installed, nor be part of a source package, but still be known + to \QC + \endlist \QC displays all files that are declared to be part of the project by the project files in the \l Projects view. The files are sorted into categories by file type (.cpp, .h, .qrc, and so on). To display additional files, edit - the project file. + the project file. Alternatively, you can see all the files in a project + directory in the \l {File System} view. - Alternatively, you can see all the files in a project in the - \l {File System} view. + Declaring files as a part of the project also makes them visible to the + \l{Searching with the Locator}{locator} and \l{Advanced Search} + {project-wide search}. \section2 CMake Projects - When using CMake, you can specify additional files to display in the - \uicontrol Projects view by either adding them as sources or installing - them. + When using CMake, you can specify additional files for a project by either + adding them as sources or installing them. In the CMakeLists.txt file, define the files as values of the \l{CMake: target_sources command}{target_sources} command using @@ -273,11 +285,17 @@ \section2 qmake Projects - When using qmake, add filenames as values of the \c {DISTFILES} variable - in the .pro file. You can also use wildcards. + Use the following variables in the .pro file: - For example, the following value specifies that text files are part of the - project: + \list + \li \c SOURCES and \c HEADERS for files to compile + \li \c INSTALLS for files to install + \li \c DISTFILES for files to include in a source package + \li \c OTHER_FILES for files to manage with \QC without + installing them or including them in source packages + \endlist + + For example, the following value includes text files in the source package: \badcode diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 94acded57c3..be9ba3530d8 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -155,6 +155,9 @@ allows to specify exactly where a new file should be placed in the build system. + If you cannot see some files, they might not be declared as part of the + project. For more information, see \l{Specifying Project Contents}. + If the project is under version control, information from the version control system might be displayed in brackets after the project name. This is currently implemented for Git (the branch name or a tag is