From 7093d083dd4545e7d07bbb062078822ecc140b7b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 10 Apr 2022 19:20:34 -0700 Subject: [PATCH] CMake: Load cache if using PRINT_STRING and variable isn't found --- version.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/version.cmake b/version.cmake index d199e3410..e66142fbd 100644 --- a/version.cmake +++ b/version.cmake @@ -49,6 +49,9 @@ if(NOT GIT_BRANCH) endif() if(DEFINED PRINT_STRING) + if(NOT DEFINED ${PRINT_STRING}) + load_cache($ENV{PWD} READ_WITH_PREFIX "" ${PRINT_STRING}) + endif() execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${${PRINT_STRING}}") elseif(NOT VERSION_STRING_CACHE OR NOT VERSION_STRING STREQUAL VERSION_STRING_CACHE) set(VERSION_STRING_CACHE ${VERSION_STRING} CACHE STRING "" FORCE)