mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 22:58:37 -05:00
5e941a545b
In ac6a4d4884 (ExternalProject: Improve robustness of update step,
2020-10-17), the method used to check whether we already have a
commit or not was changed from using git rev-list to git rev-parse.
The new logic assumed rev-parse would output nothing if given a commit
hash it didn't know about, but it simply prints the hash again without
raising an error in this scenario. Amend that logic by adding ^{commit} to
the ref to ensure we do get an error if that ref is not currently known.
Fixes: #22166
16 lines
353 B
CMake
16 lines
353 B
CMake
cmake_minimum_required(VERSION 3.19)
|
|
project(FetchTags LANGUAGES NONE)
|
|
|
|
include(ExternalProject)
|
|
|
|
# repoDir and gitTag are expected to be set as cache variables
|
|
|
|
ExternalProject_Add(fetcher
|
|
GIT_REPOSITORY ${repoDir}
|
|
GIT_TAG ${gitTag}
|
|
GIT_REMOTE_UPDATE_STRATEGY CHECKOUT
|
|
CONFIGURE_COMMAND ""
|
|
BUILD_COMMAND ""
|
|
INSTALL_COMMAND ""
|
|
)
|