Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find GIT using the following names: git #131

Open
ryandesign opened this issue Mar 27, 2024 · 4 comments
Open

Could not find GIT using the following names: git #131

ryandesign opened this issue Mar 27, 2024 · 4 comments

Comments

@ryandesign
Copy link

When git is not installed, this error occurs when running cmake:

CMake Error at cmake/c4Project.cmake:1042 (find_program):
  Could not find GIT using the following names: git
Call Stack (most recent call first):
  cmake/c4Project.cmake:884 (c4_proj_get_version)
  cmake/c4Project.cmake:825 (c4_set_default_pack_properties)
  CMakeLists.txt:110 (c4_pack_project)

Why would a library of low-level C++ utilities need git to be installed?

If git is only used at build time, I have not cloned your repository; I have downloaded the release tarball from https://github.com/biojppm/c4core/releases/tag/v0.1.11 so there is no information that git would be able to derive from the source directory.

@biojppm
Copy link
Owner

biojppm commented Mar 28, 2024

The call stack indicates the reason: to be able to use the proper version tags in the installed bin. Maybe this could be set up differently, but this is legitimate behavior.

Further, if you configure with -DC4CORE_DEV=ON the project will clone the doctest repo used to run the unit tests.

@ryandesign
Copy link
Author

How would git determine what "the proper version tags" are? I am not building in a git clone.

And I am not configuring with -DC4CORE_DEV=ON.

@biojppm
Copy link
Owner

biojppm commented Apr 19, 2024

Well, ATM git is required to build (edit: install). That's it.

This is a reasonable expectation when cmake is being run - means it's a developer (edit: or a development image) running it, and the likelihood of having git in that situation is really high.

In other words, AFAICT the case of trying to build from the downloaded tarball is rare and special enough that I deem looking at this a bad usage of my limited time.

If you have the need to address this situation and installing git is not a possibility, your PR addressing the problem is very welcome: the logic is all in the cmake function c4_get_proj_version(); if you can find a way to fill it with suitable defaults without using git, I'll gladly accept it. (No irony here, it's doable; it's only that somebody's time must be spent doing it).

@biojppm
Copy link
Owner

biojppm commented Apr 19, 2024

Also, I'm curious: why is it that you can't just install git?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants