--- src/bankdata/CMakeLists.txt.orig	2024-01-05 07:31:23 UTC
+++ src/bankdata/CMakeLists.txt
@@ -23,6 +23,7 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/ch_data.cmake "
     file(DOWNLOAD \"${CH_RAW_DATA_URL}\" \"${CH_RAW_DATA_PATH}\")
 ")
 
+if(ENABLE_BANKDATA_DOWNLOAD)
 # fetch validity date from bank's website
 function(extract_date ARG)
     file(DOWNLOAD ${BANK_WEBSITE_URL} ${TEMP_FILE})
@@ -57,10 +58,10 @@ add_custom_command(
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "Download raw bank data file to ${CH_RAW_DATA_PATH}"
 )
+endif()
 
 # store the validity date in VALID_DATE
-set(VALID_DATE "")
-extract_date(VALID_DATE)
+set(VALID_DATE "%%BANKDATA_DATE%%")
 
 if(NOT "${VALID_DATE}" STREQUAL "")
 add_custom_command(
