Mastering Development

Installing only clang and cmake, CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set

I’m trying to use clang with CMake. Here’s my Dockerfile. You can see that I did not install build-essentials, only clang, because I dont want GNU compilers to be made default.

My Dockerfile:

FROM ubuntu:bionic

WORKDIR /home/project

RUN export DEBIAN_FRONTEND=noninteractive && apt-get update\
    && apt-get install -y clang wget

RUN wget && ls

RUN mkdir -p /usr/local/cmake \
&& chmod +x \
&& ./ --skip-license --prefix=/usr/local/cmake

ENV PATH="/usr/local/cmake/bin:${PATH}"


cmake_minimum_required (VERSION 3.10)
project(libsmoltcp_cpp LANGUAGES CXX)

Here’s what I get when running cmake .:

root@275dbeaae123:/home/project# cmake .
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/project/CMakeFiles/CMakeOutput.log".

In update-alternatives there’s just clang:

root@275dbeaae123:/home/project# update-alternatives --config cc
There is only one alternative in link group cc (providing /usr/bin/cc): /usr/bin/clang
Nothing to configure.

Leave a Reply

Your email address will not be published. Required fields are marked *