Home > database >  CMake: Can't find git for clone of FetchContent dependency
CMake: Can't find git for clone of FetchContent dependency

Time:01-31

I'm using FetchContent to get the targets of another github cmake project. Locally everything builds fine, but in my github workflow, I'm getting this cmake error: "error: could not find git for clone of ppcdisasm-populate" (full logs here https://github.com/em-eight/aipg/actions/runs/4036584360/jobs/6939279457)

My CMakeLists (https://github.com/em-eight/aipg/blob/main/CMakeLists.txt) is seemingly very simple and I'm even maually setting GIT_EXECUTABLE. which git returns /usr/bin/git as expected. What am I doing wrong?

CodePudding user response:

From your logs, it has been observed that HorstBaerbel/action-ctest is using a container i.e. check your logs for the docker run command; and, see https://github.com/HorstBaerbel/action-ctest/blob/master/Dockerfile#L1.

That container itself doesn't include git. See https://github.com/HorstBaerbel/ccpp-cmake-build-and-test/blob/main/Dockerfile.

So, you need to create an issue there and get it included to make this work.

Here's a relevant issue from the CMake repo: https://gitlab.kitware.com/cmake/cmake/-/issues/23102

  • Related