Files
morris 59ee3c2756 fix(cmake): make the repo dir argument of git_describe optional
GetGitRevisionDescription.cmake is a vendored copy of a file that many
third-party CMake projects ship too. The copies are not interchangeable:
this one takes git_describe(<var> <repo dir>) while the upstream one
takes
git_describe(<var>).

Whichever copy is included first sets the include guard variable and
every
later include returns early. Since this build system includes its copy
from the top level of the project, a component that vendors the upstream
variant and calls git_describe(<var>) ends up calling this function
without
the repository argument and fails to configure with "Function invoked
with
incorrect arguments". Components currently work around it by clearing
the
guard variable, which only works if they know about it.

Accept the one-argument form and resolve it against
CMAKE_CURRENT_SOURCE_DIR,
which is the directory of the caller, so the vendored copy describes the
repository it actually lives in. The argument list is unchanged, so the
existing git_describe(<var> <repo dir> [<extra git args>...]) calls keep
working, and no public function is renamed.
2026-10-12 09:32:36 +08:00
..
2026-06-05 15:59:04 +08:00
2025-09-30 15:28:55 +02:00