CMakeLists.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. # this file makes sure that the 3rd party components miniaudio and stb_vorbis are available to use.
  9. # for licenses of the sub-parts, please see their repos in github, or, licenses.txt in this folder.
  10. include(FetchContent)
  11. FetchContent_Declare(
  12. stb_vorbis
  13. URL https://raw.githubusercontent.com/nothings/stb/5736b15f7ea0ffb08dd38af21067c314d6a3aae9/stb_vorbis.c
  14. URL_HASH MD5=36713ac98e445271e29547cc2d90b01f # from the main branch @ Jan 29 2023
  15. DOWNLOAD_NO_EXTRACT TRUE
  16. DOWNLOAD_NO_PROGRESS TRUE
  17. TLS_VERIFY TRUE
  18. )
  19. FetchContent_Declare(
  20. miniaudio
  21. URL https://raw.githubusercontent.com/mackron/miniaudio/0.11.17/miniaudio.h
  22. URL_HASH MD5=7233fe13f5d42c4df37acff873c72bf5 # from tag 0.11.17
  23. DOWNLOAD_NO_EXTRACT TRUE
  24. DOWNLOAD_NO_PROGRESS TRUE
  25. TLS_VERIFY TRUE
  26. )
  27. FetchContent_MakeAvailable(stb_vorbis miniaudio)
  28. FetchContent_GetProperties(stb_vorbis SOURCE_DIR STB_VORBIS_SOURCE_DIR)
  29. FetchContent_GetProperties(miniaudio SOURCE_DIR MINIAUDIO_SOURCE_DIR)
  30. add_library(3rdParty::miniaudio IMPORTED INTERFACE GLOBAL ${MINIAUDIO_SOURCE_DIR}/miniaudio.h)
  31. target_include_directories(3rdParty::miniaudio SYSTEM INTERFACE ${MINIAUDIO_SOURCE_DIR})
  32. add_library(3rdParty::stb_vorbis IMPORTED INTERFACE GLOBAL ${STB_VORBIS_SOURCE_DIR}/stb_vorbis.c)
  33. target_include_directories(3rdParty::stb_vorbis SYSTEM INTERFACE ${STB_VORBIS_SOURCE_DIR})
  34. message(STATUS "Using miniaudio ${MINIAUDIO_SOURCE_DIR}/miniaudio.h - see ${CMAKE_CURRENT_LIST_DIR}/miniaudio/LICENSE.TXT")
  35. message(STATUS "Using stb_vorbis ${STB_VORBIS_SOURCE_DIR}/stb_vorbis.c - see ${CMAKE_CURRENT_LIST_DIR}/stb_vorbis/LICENSE.TXT")