# DiligentCore
# https://github.com/DiligentGraphics/DiligentCore

include(FetchContent)

FetchContent_Declare(diligent
  URL     ${CMAKE_CURRENT_LIST_DIR}/DiligentCore-2c518aabd56e51b08d1e1f71c074a46284811d2a.zip
  URL_MD5 6f2bd4cca5e7dceb2c2e73b5b1f8bde2
)

FetchContent_GetProperties(diligent)
if(NOT diligent_POPULATED)
  FetchContent_Populate(diligent)

  add_subdirectory(${diligent_SOURCE_DIR} ${diligent_BINARY_DIR} EXCLUDE_FROM_ALL)

  # Diligent does not ALIAS itself as an imported target
  add_library(Diligent::GraphicsEngine ALIAS Diligent-GraphicsEngine)
  add_library(Diligent::GraphicsEngineD3D11 ALIAS Diligent-GraphicsEngineD3D11-static)
  add_library(Diligent::GraphicsEngineVk ALIAS Diligent-GraphicsEngineVk-static)
  add_library(Diligent::Common ALIAS Diligent-Common)
  add_library(Diligent::GraphicsTools ALIAS Diligent-GraphicsTools)
endif()
