From b5c3fd34b394fca1ca066361461a5577a871ad90 Mon Sep 17 00:00:00 2001 From: Andrei Astafev Date: Wed, 2 Aug 2023 14:31:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=BB=D0=B0=D0=B3=20AUTOPULL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyxCMake/lib/DownloadContent.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MyxCMake/lib/DownloadContent.cmake b/MyxCMake/lib/DownloadContent.cmake index aecca67..44bdc40 100644 --- a/MyxCMake/lib/DownloadContent.cmake +++ b/MyxCMake/lib/DownloadContent.cmake @@ -16,6 +16,8 @@ myx_download_content загрузить с помощью git. Параметр `GIT_TAG` содержит используемые метку, идентификатор коммита или ветку в загружаемом репозитории. +Если указана опция `AUTOPULL`, то загруженный репозиторий будет +обновляться автоматически. #]=======================================================================] @@ -24,7 +26,7 @@ find_package(Git QUIET) option(ENABLE_DOWNLOAD_CONTENT "Enable download content" ON) function(myx_download_content NAME) - set(options) + set(options AUTOPULL) set(oneValueArgs) set(multiValueArgs DOWNLOAD_DIR GIT_REPOSITORY GIT_TAG) cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -65,8 +67,10 @@ function(myx_download_content NAME) execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${ARG_GIT_TAG} WORKING_DIRECTORY ${ARG_DOWNLOAD_DIR}/${NAME}) else() - execute_process(COMMAND ${GIT_EXECUTABLE} pull - WORKING_DIRECTORY ${ARG_DOWNLOAD_DIR}/${NAME}) + if(ARG_AUTOPULL) + execute_process(COMMAND ${GIT_EXECUTABLE} pull + WORKING_DIRECTORY ${ARG_DOWNLOAD_DIR}/${NAME}) + endif() endif() endif()