Hi,
in ITK we have some third-party modules that we checkout using CMake’s ExternalProject_Add()
function’s git
capabilities:
https://cmake.org/cmake/help/latest/module/ExternalProject.html
Specifically, we donwload DCMTK
:
https://github.com/InsightSoftwareConsortium/ITK/blob/9baa34b6998cfb4034d64f0c4f37072e05db356e/Modules/ThirdParty/DCMTK/CMakeLists.txt#L304
using a given git commit hash:
https://github.com/InsightSoftwareConsortium/ITK/blob/9baa34b6998cfb4034d64f0c4f37072e05db356e/Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake
which results in git
telling us that we are in detached HEAD status:
CDash
In order to silence the warning, we would pass the -c advice.detachedHead=false
flag to the git checkout
command.
However, it is not evident to me how CMake allows us to do so: I found this post where a GIT_CONFIG
field is specified with the exact flag that we would require. However, I’m wondering whether this effectively applies to the git checkout
step.
Thanks