if (NOT DEFINED OUTPUT_HEADER OR NOT DEFINED OUTPUT_SOURCE OR NOT DEFINED VERSION)
    message(FATAL_ERROR "OUTPUT_HEADER, OUTPUT_SOURCE and VERSION are required")
endif ()
#string(TIMESTAMP build_time "%Y%m%dT%H%M%SZ" UTC)

string(TIMESTAMP build_time "%Y-%m-%d %H:%M:%S")

get_filename_component(output_directory "${OUTPUT_SOURCE}" DIRECTORY)
file(MAKE_DIRECTORY "${output_directory}")
file(WRITE "${OUTPUT_HEADER}" "#pragma once\ninline constexpr char ecap_build_version[] = \"${VERSION} 【${build_time}】\";\n")
file(WRITE "${OUTPUT_SOURCE}" "#include \"Build_Version.h\"\n#include \"Local_Server/Build_Version_Api.h\"\nstd::string_view get_ecap_build_version() {\n    return ecap_build_version;\n}\n")
