aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@qt.io>2021-12-03 16:18:31 +0100
committerLeena Miettinen <riitta-leena.miettinen@qt.io>2021-12-08 15:46:40 +0000
commitc12b09e5437ffac70d7083904dda676f0d156d27 (patch)
tree4f9db0766722dae7988d34a0bfb68289c6f41782
parentc1ca2a71034a84885fe461c64b107179dfba1ae5 (diff)
Doc: Describe showing additional files in Projects view
...when using CMake. Add link targets for CMake command and property docs, because at least the "install" command is needed in several places in the manual. Task-number: QTCREATORBUG-26616 Change-Id: I204325741925080532e8944578464cf4e1cb648f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--doc/qtcreator/src/external-resources/external-resources.qdoc18
-rw-r--r--doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc47
2 files changed, 54 insertions, 11 deletions
diff --git a/doc/qtcreator/src/external-resources/external-resources.qdoc b/doc/qtcreator/src/external-resources/external-resources.qdoc
index f3d2f69d92..b905a23632 100644
--- a/doc/qtcreator/src/external-resources/external-resources.qdoc
+++ b/doc/qtcreator/src/external-resources/external-resources.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -113,3 +113,19 @@
\externalpage https://doc.qt.io/QtApplicationManager/
\title Qt Application Manager
*/
+/*!
+ \externalpage https://cmake.org/cmake/help/latest/command/install.html
+ \title CMake: install command
+*/
+/*!
+ \externalpage https://cmake.org/cmake/help/latest/command/set_property.html
+ \title CMake: set_property command
+*/
+/*!
+ \externalpage https://cmake.org/cmake/help/latest/command/target_sources.html
+ \title CMake: target_sources command
+*/
+/*!
+ \externalpage https://cmake.org/cmake/help/latest/prop_sf/HEADER_FILE_ONLY.html
+ \title CMake: HEADER_FILE_ONLY
+*/
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 43d5ab1c94..fb2124935e 100644
--- a/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc
+++ b/doc/qtcreator/src/projects/creator-only/creator-projects-creating.qdoc
@@ -440,22 +440,49 @@
\section2 Displaying Additional File Types in Projects View
- \QC determines whether to display files from the project folder
- in the \uicontrol Projects view depending on the file type (.pro, .pri, .cpp,
- .h, .qrc, and so on). To display other types of files, edit the
- project file. Add filenames as values of the \c {DISTFILES} variable.
- You can also use wildcards.
+ \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.
- For example, the following code specifies that text files are displayed
- in the \uicontrol Projects view:
+ Alternatively, you can see all the files in a project in the
+ \l {File System} view.
- \code
+ \section3 CMake Projects
- DISTFILES += *.txt
+ When using CMake, you can specify additional files to display in the
+ \uicontrol Projects view 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
+ the \c PRIVATE property, for example.
+
+ You can prevent CMake from handling some files, such as a .cpp
+ file that should not be compiled. Use the \l{CMake: set_property command}
+ {set_property} command and the \l{CMake: HEADER_FILE_ONLY}
+ {HEADER_FILE_ONLY} property to specify such files. For example:
+ \badcode
+ set_property(SOURCE "${files}" PROPERTY HEADER_FILE_ONLY ON)
\endcode
- This also makes the files available in the \uicontrol Locator.
+ Alternatively, to install the files, use the \l {CMake: install command}
+ {install} command with the \c FILES or \c DIRECTORY property.
+
+ \section3 qmake Projects
+
+ When using qmake, add filenames as values of the \c {DISTFILES} variable
+ in the .pro file. You can also use wildcards.
+
+ For example, the following value specifies that text files are part of the
+ project:
+
+ \badcode
+
+ DISTFILES += *.txt
+
+ \endcode
\section1 Adding Subprojects to Projects