Compiling Software with Cmake on Linux (Basic Steps)

Steps for installing cmake and dependencies to compile and build source code from a tarball. Tested on OpenSUSE Tumbleweed +mentions for Deb-based packages.

Installing Cmake

Check Availability

cmake --version

OpenSUSE Tumbleweed

sudo zypper in cmake

Debian and Ubuntu Derivatives

sudo apt install cmake

C++ Dependencies

OpenSUSE Tumbleweed

sudo zypper in patterns-devel-base-devel_basis

Debian and Ubuntu Derivatives

sudo apt install build-essential

Compiling The Tarball

  1. Extract tarball.
  2. In the extracted folder:
    mkdir build && cd build
  3. cmake ..
  4. make
  5. If there are no source-specific dependencies (monitor compiler verbose), binary should be ready to run.

Did this solve your issue?