get_filename_component(renderive_package_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
set(renderive_package_includes "^.*$")
set(renderive_package_build_output
        "${CMAKE_CURRENT_BINARY_DIR}/package/renderive_package.zip")
set(renderive_package_excludes
        "^data/.*$"
        "^performance/.*$"
        "^third_party/datoviz/.*$"
        "^cmake-build-[^/]*/.*$"
        "^(.*/)?node_modules/.*$"
        "^(.*/)?.git/.*$"
        "^(.*/)?wwwroot/.*$"
        "^(.*/)?dist/.*$"
        "^(.*/)?htdocs/.*$"
        "^(.*/)?model/.*$"
        "^(.*/)?.idea/.*$"
        "^(.*/)?.playwright-cli/.*$"
        "^(.*/)?performance/.*$"
        "^(.*/)?dll_source_lzy/.*$"
        "^.*[.]tsbuildinfo$"
        "^.*[.]zip$"
        "^.*[.]otf$"
)
_add_project_zip_target(
        renderive_package_zip
        "${renderive_package_build_output}"
        "${renderive_package_root}"
        renderive_package_includes
        renderive_package_excludes
)
add_custom_command(
        TARGET renderive_package_zip POST_BUILD
        COMMAND "${CMAKE_COMMAND}" -E copy_if_different
                "${renderive_package_build_output}"
                "${renderive_package_root}/renderive_package.zip"
        COMMENT "Publishing ${renderive_package_root}/renderive_package.zip"
)
