2024-03-15 18:38:47 -07:00
|
|
|
|
2023-01-10 22:57:50 +01:00
|
|
|
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled)
|
2021-04-15 13:20:18 -07:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2022-11-02 13:58:41 -07:00
|
|
|
URLS "https://www.nuget.org/api/v2/package/Microsoft.XAudio2.Redist/${VERSION}"
|
|
|
|
FILENAME "xaudio2redist.${VERSION}.zip"
|
2023-01-25 12:15:57 -08:00
|
|
|
SHA512 5eae9c94710ba6e51045e6f9dbe381bdfe76184a4272f561976582e8f585ef8343df9f6eaa2d391bfda06796000bc13ccb0f5bf112d7f2c7865f75ab0e89ab56
|
2021-04-15 13:20:18 -07:00
|
|
|
)
|
|
|
|
|
2022-06-06 12:38:56 -07:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
PACKAGE_PATH
|
2021-04-15 13:20:18 -07:00
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
NO_REMOVE_ONE_LEVEL
|
|
|
|
)
|
|
|
|
|
2024-08-01 23:49:47 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
2024-07-29 23:02:11 -07:00
|
|
|
set(XAUDIO_ARCH x86)
|
|
|
|
else()
|
|
|
|
set(XAUDIO_ARCH x64)
|
|
|
|
endif()
|
|
|
|
|
2021-10-25 14:34:38 -07:00
|
|
|
file(GLOB HEADER_FILES "${PACKAGE_PATH}/build/native/include/*.h")
|
|
|
|
file(INSTALL ${HEADER_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}")
|
2021-04-15 13:20:18 -07:00
|
|
|
|
2024-07-29 23:02:11 -07:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${XAUDIO_ARCH}/xaudio2_9redist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
2021-10-25 14:34:38 -07:00
|
|
|
|
2023-01-10 22:57:50 +01:00
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
2024-07-29 23:02:11 -07:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${XAUDIO_ARCH}/xapobaseredist_md.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
2023-01-10 22:57:50 +01:00
|
|
|
set(lib_suffix "_md")
|
2021-10-25 14:34:38 -07:00
|
|
|
else()
|
2024-07-29 23:02:11 -07:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/release/lib/${XAUDIO_ARCH}/xapobaseredist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
2023-01-10 22:57:50 +01:00
|
|
|
set(lib_suffix "")
|
2021-10-25 14:34:38 -07:00
|
|
|
endif()
|
2021-04-15 13:20:18 -07:00
|
|
|
|
2024-07-29 23:02:11 -07:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/release/bin/${XAUDIO_ARCH}/xaudio2_9redist.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
2024-03-15 18:38:47 -07:00
|
|
|
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
2024-07-29 23:02:11 -07:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${XAUDIO_ARCH}/xaudio2_9redist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
2024-03-15 18:38:47 -07:00
|
|
|
|
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
2024-07-29 23:02:11 -07:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${XAUDIO_ARCH}/xapobaseredist_md.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
2024-03-15 18:38:47 -07:00
|
|
|
else()
|
2024-07-29 23:02:11 -07:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/debug/lib/${XAUDIO_ARCH}/xapobaseredist.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
2024-03-15 18:38:47 -07:00
|
|
|
endif()
|
|
|
|
|
2024-07-29 23:02:11 -07:00
|
|
|
file(INSTALL "${PACKAGE_PATH}/build/native/debug/bin/${XAUDIO_ARCH}/xaudio2_9redist.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2024-03-15 18:38:47 -07:00
|
|
|
endif()
|
2021-04-15 13:20:18 -07:00
|
|
|
|
2024-03-15 18:38:47 -07:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/xaudio2redist-config.cmake.in"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake"
|
|
|
|
@ONLY)
|
2021-04-15 13:20:18 -07:00
|
|
|
|
2024-03-15 18:38:47 -07:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${PACKAGE_PATH}/LICENSE.txt")
|