Cmake Command Not Found Error [Solved]

CMake is an open-source platform that cuts across build systems. CMake is composed of a group of tools designed to build, test, and package software. However, while trying to work, you may get an error message stating, “CMake command not found’.

This error message can be frustrating. However, to help, we have provided information on all you need to know about CMake and how to fix the Error.

CMake Command Not Found Error

Individuals have complained of getting the CMake command not found error massage. You May encounter the error in the formats and actual price now. For the first option:

[!] /bin/bash -c

set -e

echo `pwd`

sed -i ” ‘s/include <\(cmark.*\)>/include “\1″/’ src/cmark.h

mkdir -p build; cd build && cmake -G Xcode ..


/bin/bash: line 4: CMake: command not foundGitHub

OR ‘cmake’ is not recognized as an internal or external command, operable program or batch file. GitHub

How Can I Resolve CMake is not Found Error?

Fix 1: The first step we would advise you to take is checking if you have Cmake installed. If you do, then you should check if it was properly installed.

Fix 2: Enter the command line include_directories{$CEGUI_INCLUDE_DIR} / . . / 

Installing CMake

-C <initial-cache> – Pre-load a script to populate the cache.

 When CMake is first to run in an empty build tree, it creates a CMakeCache.txt file and populates it with customizable project settings. These customizable options may be used to specify a file from which to load cache entries before passing through the project’s cmake list files.

Loaded order entries are prioritized over all other default values in the project. The given file must be a CMake script that contains SET commands, use the CACHE option, and not a cache-format file.

What are the Different Functions of cmake?

  1. Create a cmake cache entry – When cmake is run first in an empty build tree, it creates a CMakeCache.txt file. This text tile is further populated by settings that can be customized to suit your project. You can use this option to specify what settings should be prioritized above your project’s default value. The option can be repeated for as many cache entries as desired.

-U <globbing_expr>

  1. Remove matching entries from CMake cache – In some cases, we may need to remove the specified product. Running Cmake can opt to remove one or more variables from the CMakeCache.txt file, globbing expressions using *irrelevant, and queries are supported. You can repeat the option for as many cache entries as desired.
  2. Send Text Messages – CMakeCache.txt non-working.

-G <generator-name> – With cmake, you can specify a system generator build. CMake may sometimes allow multiple native system build on specified platforms and generate a specific build of the system. You will find suggestions for possible generator names specified in the Generators section.

  1. -T <toolset-name> – Specify the toolset name if it is supported by generator. Some CMake generators support a toolset name given to the native build system to choose a compiler. The feature is supported only on specific generators:

Visual Studio >= 10

Xcode >= 3.0

  1. Check the native build system documentation for recommended toolset names – A <platform-name> – Specify platform name if supported by generator. Some CMake generators support a platform name given to the native build system to choose a compiler or SDK. The feature is supported only on specific generators:

Visual Studio >= 8: See native build system documentation for allowed platform names.


  1. Suppress developer warnings – Suppress warnings are for the author of the CMakeLists.txt files.


You can alter the settings to make some changes possible. For instance, you can 

Allow developer warnings in settings.

Twerk settings enable warnings meant for the author of the CMakeLists.txt files.

-E <command> [<options>…]


How Can I List Out Non-Advanced Cached Variables?

List cache variables run CMake and list the CMake cache variables that are not marked as INTERNAL or ADVANCED. Effectively, this will display the current CMake settings, which can then be changed with the -D option.

Tampering with a few of the variables may cause more variables to be created. If for example, A is specified, then the display will also include advanced variables. If it is H that is specified, then help options for each of the variables will be displayed.

Working With Cmake on Linux

Some of the steps you should take to work with cmake on Linux will be to download cmake first. Once the download has been completed, you will need to configure, test, compile, and install CMake on a Linux device. These instructions work on Debian/Ubuntu Linux distributions as well as Linux machines that have compilers and make utilities installed. 

Please ensure you check the integrity of the downloaded file before unzipping it. The ‘#’ (without quotes) in front of commands mean you should run the command as a root user (or make use of sudo instead if your operating system permits that).

How Can I Configure Cmake On A Device?

Step 1: Enter the command: $ wget to download the file.

Step 2: Start the extraction of the source code for cmake from the downloaded file. Do this by entering the code:

$ tar xzf cmake-2.8.3.tar.gz

$ cd cmake-2.8.3. Cmake

Step 3: Select the configuration options. If you want to see the available configuration options, run the command below. Ensure you hit enter after every line inputted.

$ ./configure –help

Step 4: It is important to configure cmake before installing it. For this purpose, enter this command: $ ../configure –prefix=/opt/cmake

This code tells the install script to install CMake in /opt/cmake.

Step 5: Compilation

Use this command: $ make

Please ensure you check the integrity of the downloaded file before you unzip it. ‘#’ (without quotes) in front of the commands means that you have to run the command as root user (or use sudo instead if your system supports that).

Step 6: Download

For downloads, enter the following codes

$ wget


You can add CMake to the PATH by entering the command line:



Or, to install symlinks to ‘/usr/local/bin’, run:

sudo “/Applications/” –install

Or, to install symlinks to another directory, run:

 sudo “/Applications/” –install=/path/to/bin

Pick any of the methods listed below to add to Cmake. cmake

Method 1. Add an environment variable          

Method 2. Install symlinks

Open the terminal to execute:

 sudo “/Applications/” –install


AppledeiMac: apple$ 

sudo “/Applications/” –install


Linked: ‘/usr/local/bin/cmake’ -> ‘/Applications/’

Linked: ‘/usr/local/bin/ctest’ -> ‘/Applications/’

Linked: ‘/usr/local/bin/cpack’ -> ‘/Applications/’

Linked: ‘/usr/local/bin/cmake-gui’ -> ‘/Applications/’

Linked: ‘/usr/local/bin/ccmake’ -> ‘/Applications/’

AppledeiMac apple$ cmake –version

cmake version 3.12.3GitHub Community

Method 3. Install symlinks to other paths

In fact, it is a variant of Method 2, but it is installed to other paths.


CMake is a cross-platform build system generator. Sometimes, you may encounter the error message, Cmake not found while working on your system. It is important not to panic. Check if you have Cmake installed on the device and if it is installed correctly.