rpavlik / cmake-modules

My collection of CMake modules
http://academic.cleardefinition.com
Boost Software License 1.0
1.02k stars 213 forks source link

`get_git_head_revision` does not work on submodule #81

Open diggit opened 8 months ago

diggit commented 8 months ago

Here variable ${GIT_EXECUTABLE} is used, but find_package(Git QUIET) is not called beforehand, thus it's empty resulting in empty ${out} and so on.

rpavlik commented 8 months ago

Can you just add find_package(Git QUIET) in your CMake scripts? For some reason I assumed that was already required.

diggit commented 8 months ago

That is probably also an option, but for example git_describe, git_describe_working_tree, git_local_changes,.. handle this by themselves. Thus it's a bit non systematic to auto find git in some function a not in others. IMO this should be unified - none or all.