include_guard(GLOBAL)
block()
    set(datoviz_opts
            -DDVZ_BUILD_CORE=ON
            -DDVZ_BUILD_CONTROLLER=ON
            -DDVZ_BUILD_VK=ON
            -DDVZ_BUILD_CANVAS=ON
            -DDVZ_BUILD_DRP2=ON
            -DDVZ_BUILD_WEBGPU=OFF
            -DDVZ_BUILD_SCENE=ON
            -DDVZ_BUILD_APP=ON
            -DDVZ_BUILD_GUI=OFF
            -DDVZ_BUILD_TESTING=OFF
            -DDVZ_BUILD_EXAMPLES=OFF
            -DDVZ_INSTALL=ON
            -DDVZ_VENDORED_DEPS=ON
            -DDVZ_ENABLE_CUDA=OFF
            -DDVZ_ENABLE_KVAZAAR=OFF
            -DDVZ_ENABLE_QT_BRIDGE=OFF
            -DDVZ_ENABLE_SHADERC=OFF
            -DDVZ_WITH_FREETYPE=OFF
            -DDVZ_WITH_MSDF_ATLAS=OFF
            -DDVZ_WITH_MSDF_SVG=OFF
            -DDVZ_WITH_ZLIB=OFF
            -DDVZ_WITH_GLFW=ON
    )
    _register_git_cmake_library(renderive::datoviz
            "https://github.com/datoviz/datoviz.git"
            "v0.4.0rc2"
    )
    rcl_cmake_library_set_cmake_options(renderive::datoviz ${datoviz_opts})
    if (WIN32 AND NOT MINGW)
        rcl_cmake_library_set_deps(renderive::datoviz renderive::pthreads4w)
    endif ()
    rcl_get_effective_install_dir(renderive::datoviz DATOVIZ_ROOT)
    set(DATOVIZ_CMAKE_DIR "${DATOVIZ_ROOT}/lib/cmake/datoviz")
    rcl_cmake_library_set_other_use_opt(renderive::datoviz
            "-Ddatoviz_DIR=\"${DATOVIZ_CMAKE_DIR}\""
            "-DDatoviz_DIR=\"${DATOVIZ_CMAKE_DIR}\""
    )
    rcl_cmake_library_set_init_script(renderive::datoviz
            "set(DATOVIZ_ROOT \"${DATOVIZ_ROOT}\")"
            "set(datoviz_DIR \"${DATOVIZ_CMAKE_DIR}\")"
            "set(Datoviz_DIR \"${DATOVIZ_CMAKE_DIR}\")"
    )
    rcl_cmake_library_set_clear_script(renderive::datoviz
            "unset(DATOVIZ_ROOT)"
            "unset(datoviz_DIR)"
            "unset(Datoviz_DIR)"
    )
endblock()