# Copyright (c) 2021 Dominic Msters
# 
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT

include(FetchContent)

# GLM
FetchContent_Declare(
  glm
  GIT_REPOSITORY  https://github.com/g-truc/glm.git
  GIT_TAG         bf71a834948186f4097caa076cd2663c69a10e1e
)
FetchContent_MakeAvailable(glm)

# JSON
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)

# GLAD
add_subdirectory(glad)

# GLFW
FetchContent_Declare(glfw URL https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip)
FetchContent_MakeAvailable(glfw)

# LibArchive
FetchContent_Declare(libarchive URL https://github.com/libarchive/libarchive/releases/download/v3.7.6/libarchive-3.7.6.tar.xz)
FetchContent_MakeAvailable(libarchive)

# FreeType
FetchContent_Declare(freetype URL https://psychz.dl.sourceforge.net/project/freetype/freetype2/2.13.3/freetype-2.13.3.tar.xz?viasf=1)
FetchContent_MakeAvailable(freetype)

# if(DAWN_TARGET_OPENAL)
#   set(LIBTYPE "STATIC")
#   add_subdirectory(openal-soft)

#   set(BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE)
#   set(BUILD_EXAMPLES OFF CACHE BOOL "Build examples" FORCE) 
#   add_subdirectory(AudioFile)
# endif()