Skip to content

second cmake or make call fails

I am on ubuntu 22.04 and did a fresh clone followed by

cd mantle-api
mkdir build
cd build
cmake ..
make

This works just fine but if I issue another cmake .. I get

gmake: *** [Makefile:91: all] Error 2

CMake Error at /usr/share/cmake-3.22/Modules/FetchContent.cmake:1087 (message):
  Build step for units failed: 2
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FetchContent.cmake:1216:EVAL:2 (__FetchContent_directPopulate)
  /usr/share/cmake-3.22/Modules/FetchContent.cmake:1216 (cmake_language)
  build/cmake/CPM_0.36.0.cmake:967 (FetchContent_Populate)
  build/cmake/CPM_0.36.0.cmake:773 (cpm_fetch_package)
  CMakeLists.txt:61 (CPMAddPackage)

(The reason why I wanted to do this is that I changed a variable in CMakeCache.txt and wanted to redo the configuration. But the error occurs also if I do not change the CMakeCache.txt)

I can also trigger the error by doing

touch CMakeCache.txt
make

Probably because this just triggers another cmake call.