CLion
 
Get CLion
Join the CLion 2025.1 Early Access Program and try out new features before they are released! Find out more

CMakeLists.txt

Last modified: 26 May 2024

CMakeLists.txt file contains a set of directives and instructions describing the project's source files and targets (executable, library, or both).

When you create a new project, CLion generates CMakeLists.txt file automatically and places it in the project root directory. To open a project, you can point CLion to the top-level CMakeLists.txt and choose Open as Project.

Example below shows the CMakeLists.txt file of a simple "Hello, World" project:

You can edit CMakeLists.txt files right in the editor. Make sure to reload the project after editing. Automatic reload feature is disabled by default, you can turn it on by setting the Automatically reload CMake project on editing checkbox in Settings | Build, Execution, Deployment | CMake.