Opening CMake Projects (CLion)

Article Info
Last Updated
(010f10f)
Tags
Howto
Clion

Overview

This guide explains how to open an existing CMake project in CLion.

Before You Start

Before you open an existing cmake project in CLion, ensure:

  • You have installed CLion

  • Clion has a suitable CMake executable available

Opening a CMake Project

1. Launch CLion, click 'Open'

clion welcome

click open

2. Select the root 'CMakeLists.txt' file

cmake open

Navigate to where you have cloned your cmake project to, in my case /tmp/Comp270-As1-Ws1, and select the root CMakeLists.txt file.

Then, click OK

3. If prompted, open as Project

cmake project

If prompted, click Open and Project

4. If prompted, trust the project

cmake trust

If prompted, click Trust Project

5. Set up build configurations

cmake run

Modify the run/build setting if required. The default options should be fine, unless you need/want to make release builds or alter cmake variables.

When happy, click OK

6. Run the Project

The CLion IDE with the project loaded

You can now navigate, edit and run the code as normal.

Graduation Cap Book Open book GitHub Info chevron-right Sticky Note chevron-left Puzzle Piece Lightbulb Video Exclamation Triangle Globe