mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
The git version should not change while CMake is running. When using FetchContent with many dependencies, the repeated calls to get the git version every time ExternalProject is used can be measurable on some platforms. This commit queries that version only once and then caches it in a global property for the rest of that run. The git version can still safely change between runs because it is not cached, only the GIT_EXECUTABLE location is cached. Relates: #21703
28 lines
985 B
CMake
28 lines
985 B
CMake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
cmake_minimum_required(VERSION ${CMAKE_VERSION})
|
|
|
|
# We name the project and the target for the ExternalProject_Add() call
|
|
# to something that will highlight to the user what we are working on if
|
|
# something goes wrong and an error message is produced.
|
|
|
|
project(${contentName}-populate NONE)
|
|
|
|
@__FETCHCONTENT_CACHED_INFO@
|
|
|
|
include(ExternalProject)
|
|
ExternalProject_Add(${contentName}-populate
|
|
${ARG_EXTRA}
|
|
SOURCE_DIR "${ARG_SOURCE_DIR}"
|
|
BINARY_DIR "${ARG_BINARY_DIR}"
|
|
CONFIGURE_COMMAND ""
|
|
BUILD_COMMAND ""
|
|
INSTALL_COMMAND ""
|
|
TEST_COMMAND ""
|
|
USES_TERMINAL_DOWNLOAD YES
|
|
USES_TERMINAL_UPDATE YES
|
|
)
|
|
|
|
@__FETCHCONTENT_COPY_FILE@
|