CMake: Load cache if using PRINT_STRING and variable isn't found

This commit is contained in:
Vicki Pfau 2022-04-10 19:20:34 -07:00
parent 8090c03dfb
commit 7093d083dd

View File

@ -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)