Specify project contents | Qt Creator Documentation

- Qt Creator Documentation
- Specify project contents
- Qt Creator 19.0.0

Specify editor settings ◦ Specify settings for quick fixes

# Specify project contents

A project can have files that should be:

- Compiled or otherwise handled by the build
- Installed
- Not installed, but included in a source package created with `make dist`
- Not installed, nor be part of a source package, but still be known to Qt Creator

The Projects view shows all files that you declare to be part of the project in the project files. It sorts the files into categories by file type (`.cpp`, `.h`, `.qrc`, and so on).

To display additional files:

- Edit the project file.
- Select Add to project from a notification that tells you a file is not part of any project.

Go to the File System view to see all the files in a project directory.

Declaring files as a part of the project also makes them visible to the locator and project-wide search.

## CMake projects

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 target_sources command using the `PRIVATE` property, for example.

You can prevent CMake from handling some files, such as a `.cpp` file that should not be compiled. Use the set_property command and the HEADER_FILE_ONLY property to specify such files. For example:

     set_property(SOURCE "${files}" PROPERTY HEADER_FILE_ONLY ON)

Alternatively, to install the files, use the install command with the `FILES` or `DIRECTORY` property.

## qmake projects

Use the following variables in the `.pro` file:

- `SOURCES` and `HEADERS` for files to compile
- `INSTALLS` for files to install
- `DISTFILES` for files to include in a source package
- `OTHER_FILES` for files to manage with Qt Creator without installing them or including them in source packages

For example, the following value includes text files in the source package:

     DISTFILES += *.txt

See also How to: Create projects, Creating projects, and Projects.

Specify editor settings ◦ Specify settings for quick fixes