c4core
c4core copied to clipboard
Could not find GIT using the following names: git
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.
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.
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.
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).
Also, I'm curious: why is it that you can't just install git?