.cmake

How to open a .cmake file

Quick, free ways to open CMake on any system.

A .cmake file is a CMake Script File. If double-clicking does nothing, your computer simply does not have an app that reads CMake yet. Here is how to fix that on each operating system, using free software wherever possible.

Open a .cmake file step by step

  1. Confirm the file really is a .cmake. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
  2. On Windows, open it with VS Code (CMake Tools) or Visual Studio.
  3. On Mac, use VS Code (CMake Tools) or CLion.
  4. On Linux, try VS Code (CMake Tools) or CLion.
  5. Still stuck? Search for a dedicated CMake viewer.

Best apps to open .cmake files

Windows

  • VS Code (CMake Tools)
  • Visual Studio
  • any text editor

macOS

  • VS Code (CMake Tools)
  • CLion
  • any text editor

Linux

  • VS Code (CMake Tools)
  • CLion
  • any text editor
!
Before you open it: Caution. CMake scripts execute commands during configuration and can run arbitrary processes. Review third-party build scripts before configuring a project with them.

Frequently asked questions

Why can't I open my .cmake file?

Almost always because no installed app understands CMake. Install one of the apps above, or convert the file to a format your existing software already reads.

What is the difference between CMakeLists.txt and a .cmake file?

CMakeLists.txt is the entry point CMake looks for in each directory; .cmake files are modules, toolchains and helpers that those lists include() or that CMake loads as Find modules.

Does CMake compile my code?

No. It generates the build system (Ninja, Makefiles, IDE projects) that then compiles the code, which is why it is called a build-system generator.

Learn more about .cmake