Skip to content

get_git_head_revision() fails due to unfound git #72

@multiplemonomials

Description

@multiplemonomials

I was seeing an error like this (anonymized):

CMake Error: File XXX/MyProject/SubmodulesInThisDir/.git/modules/SubmodulesInThisDir/Submodule/HEAD does not exist.
CMake Error at SubmodulesInThisDir/Submodule/cmake/GetGitRevisionDescription.cmake:161 (configure_file):
  configure_file Problem configuring file

Finally tracked it down to the fact that, for some reason, the get_git_head_revision() function of GetGitRevisionDescription does not include the

    if(NOT GIT_FOUND)
        find_package(Git QUIET)
    endif()

block that all the other public functions have. So, if this is the first GetGitRevisionDescription function you call, it takes the wrong code paths due to the inability to call Git and tries to configure the wrong file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions