Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.260

Navigation: Build Managers in winIDEA IDE > CMake

Scroll Prev Top Next More

CMake Window

In this topic:

Context menu

 

 

Introduction

winIDEA offers a CMake window, which displays the structure of your CMake project. To open the CMake window select View | Workspace | CMake.

 

CMakeWindow

 

The CMake window tree is organized into:

Directories

Targets (e.g., CPUn)

 

Only directories containing CMake files and source files are shown. Each source file is associated with a target, and the type of each target (Executable, Static library, etc.) is displayed. Header files typically do not appear in the tree unless they are explicitly specified as sources for a target. If targets or files are located outside of the project root hierarchy, they will be displayed separately as External directory, as seen above.

 

It is possible to use the FOLDER target property in CMake to organize your targets.

 

 

Context menu

Right-click on an item inside the CMake window to access the Context menu.

 

When right-clicking on a target you have the options:

Build - to build only on that particular target.

Find definition - to jump to the location where the target is defined inside a CMakeLists.txt file.

 

CMakeWindowMenu1

 

 

When right-clicking on a source file, you have the option to compile only that particular source file by clicking on the Build button. Note that this is only supported with the Ninja generator.

 

CMakeWindowMenu2

 

 

There are also three available actions when right-clicking on the root of the CMake tree:

Choose source directory - Use a different CMake source directory, instead of the winIDEA workspace folder.

Clean build files - Remove object files in the binary directory.

Remove cache - Remove cached CMake variables.

 

CMakeWindowMenu3

 

 

Copyright © 2024 TASKING