[dxsdk-d3dx, xaudio2redist] ports updated to use config find (#24054)

* [dxsdk-d3dx, xaudio2redist] ports updated to use config find

* Update baseline

* Update license to indicate proprietary

* Refresh baseline

* Code review feedback based on the dstorage port

* Refresh baseline
This commit is contained in:
Chuck Walbourn 2022-04-12 10:35:25 -07:00 committed by GitHub
parent bf43f7d00f
commit ac4636dd92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 102 additions and 71 deletions

View File

@ -0,0 +1,48 @@
get_filename_component(_d3dx_root "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_d3dx_root "${_d3dx_root}" PATH)
get_filename_component(_d3dx_root "${_d3dx_root}" PATH)
set(_d3dx_root_lib "${_d3dx_root}/lib/d3dx9.lib")
if (EXISTS "${_d3dx_root_lib}")
add_library(Microsoft::D3DX9 SHARED IMPORTED)
set_target_properties(Microsoft::D3DX9 PROPERTIES
IMPORTED_LOCATION_RELEASE "${_d3dx_root}/bin/D3DX9_43.dll"
IMPORTED_IMPLIB_RELEASE "${_d3dx_root_lib}"
IMPORTED_LOCATION_DEBUG "${_d3dx_root}/debug/bin/D3DX9d_43.dll"
IMPORTED_IMPLIB_DEBUG "${_d3dx_root}/debug/lib/d3dx9d.lib"
INTERFACE_INCLUDE_DIRECTORIES "${_d3dx_root}/include/dxsdk-d3dx"
IMPORTED_CONFIGURATIONS "Debug;Release"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
add_library(Microsoft::D3DX10 SHARED IMPORTED)
set_target_properties(Microsoft::D3DX10 PROPERTIES
IMPORTED_LOCATION_RELEASE "${_d3dx_root}/bin/d3dx10_43.dll"
IMPORTED_IMPLIB_RELEASE "${_d3dx_root}/lib/d3dx10.lib"
IMPORTED_LOCATION_DEBUG "${_d3dx_root}/debug/bin/D3DX10d_43.dll"
IMPORTED_IMPLIB_DEBUG "${_d3dx_root}/debug/lib/d3dx10d.lib"
INTERFACE_INCLUDE_DIRECTORIES "${_d3dx_root}/include/dxsdk-d3dx"
IMPORTED_CONFIGURATIONS "Debug;Release"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
add_library(Microsoft::D3DX11 SHARED IMPORTED)
set_target_properties(Microsoft::D3DX11 PROPERTIES
IMPORTED_LOCATION_RELEASE "${_d3dx_root}/bin/d3dx11_43.dll"
IMPORTED_IMPLIB_RELEASE "${_d3dx_root}/lib/d3dx11.lib"
IMPORTED_LOCATION_DEBUG "${_d3dx_root}/debug/bin/D3DX11d_43.dll"
IMPORTED_IMPLIB_DEBUG "${_d3dx_root}/debug/lib/d3dx11d.lib"
INTERFACE_INCLUDE_DIRECTORIES "${_d3dx_root}/include/dxsdk-d3dx"
IMPORTED_CONFIGURATIONS "Debug;Release"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
set(dxsdk-d3dx_FOUND TRUE)
else()
set(dxsdk-d3dx_FOUND FALSE)
endif()
unset(_d3dx_root_lib)
unset(_d3dx_root)

View File

@ -36,3 +36,5 @@ file(GLOB DEBUG_DLL_FILES "${PACKAGE_PATH}/build/native/debug/bin/${VCPKG_TARGET
file(INSTALL ${DEBUG_DLL_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin/")
file(INSTALL "${PACKAGE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/dxsdk-d3dx-config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake" COPYONLY)

View File

@ -1,8 +1,9 @@
{
"name": "dxsdk-d3dx",
"version": "9.29.952.8",
"port-version": 2,
"port-version": 3,
"description": "Redistributable package for the legacy DirectX SDK's D3DX9, D3DX10, and/or D3DX11 utility libraries.",
"homepage": "https://walbourn.github.io/legacy-d3dx-on-nuget/",
"license": null,
"supports": "windows & !arm & !uwp & !static"
}

View File

@ -1,54 +0,0 @@
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
set(XAUDIO2REDIST_VERSION "1.2.8")
if(NOT xaudio2redist_INCLUDE_DIR)
find_path(xaudio2redist_INCLUDE_DIR
NAMES xaudio2redist.h
PATH_SUFFIXES xaudio2redist)
endif()
find_package_handle_standard_args(xaudio2redist
REQUIRED_VARS xaudio2redist_INCLUDE_DIR
VERSION_VAR XAUDIO2REDIST_VERSION)
mark_as_advanced(xaudio2redist_INCLUDE_DIR)
string(REPLACE "/include/xaudio2redist" "/lib" xaudio2redist_LIB_DIR ${xaudio2redist_INCLUDE_DIR})
string(REPLACE "/include/xaudio2redist" "/bin" xaudio2redist_BIN_DIR ${xaudio2redist_INCLUDE_DIR})
string(REPLACE "/include/xaudio2redist" "/debug/lib" xaudio2redist_DEBUG_LIB_DIR ${xaudio2redist_INCLUDE_DIR})
string(REPLACE "/include/xaudio2redist" "/debug/bin" xaudio2redist_DEBUG_BIN_DIR ${xaudio2redist_INCLUDE_DIR})
if(XAUDIO2REDIST_FOUND AND NOT TARGET Microsoft::XAudio2Redist)
set(XAUDIO2_RELEASE_LIB "${xaudio2redist_LIB_DIR}/xaudio2_9redist.lib")
set(XAUDIO2_RELEASE_DLL "${xaudio2redist_BIN_DIR}/xaudio2_9redist.dll")
set(XAUDIO2_DEBUG_LIB "${xaudio2redist_DEBUG_LIB_DIR}/xaudio2_9redist.lib")
set(XAUDIO2_DEBUG_DLL "${xaudio2redist_DEBUG_BIN_DIR}/xaudio2_9redist.dll")
add_library(Microsoft::XAudio2Redist SHARED IMPORTED)
set_target_properties(Microsoft::XAudio2Redist PROPERTIES
IMPORTED_LOCATION_RELEASE "${XAUDIO2_RELEASE_DLL}"
IMPORTED_IMPLIB_RELEASE "${XAUDIO2_RELEASE_LIB}"
IMPORTED_LOCATION_DEBUG "${XAUDIO2_DEBUG_DLL}"
IMPORTED_IMPLIB_DEBUG "${XAUDIO2_DEBUG_LIB}"
INTERFACE_INCLUDE_DIRECTORIES "${xaudio2redist_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS "Debug;Release"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
endif()
if(XAUDIO2REDIST_FOUND AND NOT TARGET Microsoft::XApoBase)
set(XAPOBASE_RELEASE_LIB "${xaudio2redist_LIB_DIR}/xapobaseredist_md.lib")
set(XAPOBASE_DEBUG_LIB "${xaudio2redist_DEBUG_LIB_DIR}/xapobaseredist_md.lib")
if(NOT EXISTS ${XAPOBASE_RELEASE_LIB})
set(XAPOBASE_RELEASE_LIB "${xaudio2redist_LIB_DIR}/xapobaseredist.lib")
set(XAPOBASE_DEBUG_LIB "${xaudio2redist_DEBUG_LIB_DIR}/xapobaseredist.lib")
endif()
add_library(Microsoft::XApoBase STATIC IMPORTED)
set_target_properties(Microsoft::XApoBase PROPERTIES
IMPORTED_LOCATION_RELEASE "${XAPOBASE_RELEASE_LIB}"
IMPORTED_LOCATION_DEBUG "${XAPOBASE_DEBUG_LIB}"
INTERFACE_INCLUDE_DIRECTORIES "${xaudio2redist_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS "Debug;Release")
endif()

View File

@ -31,5 +31,4 @@ file(COPY "${PACKAGE_PATH}/build/native/debug/bin/${VCPKG_TARGET_ARCHITECTURE}/x
file(INSTALL "${PACKAGE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/Findxaudio2redist.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/xaudio2redist-config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake" COPYONLY)

View File

@ -1,11 +0,0 @@
message(STATUS "Using VCPKG Findxaudio2redist")
set(XAUDIO2_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
list(REMOVE_ITEM ARGS "NO_MODULE")
list(REMOVE_ITEM ARGS "CONFIG")
list(REMOVE_ITEM ARGS "MODULE")
_find_package(${ARGS})
set(CMAKE_MODULE_PATH ${XAUDIO2_PREV_MODULE_PATH})

View File

@ -1,8 +1,9 @@
{
"name": "xaudio2redist",
"version": "1.2.8",
"port-version": 1,
"port-version": 2,
"description": "Redistributable version of XAudio 2.9 for Windows 7 SP1 or later",
"homepage": "https://aka.ms/XAudio2Redist",
"license": null,
"supports": "windows & !arm & !uwp & !static"
}

View File

@ -0,0 +1,35 @@
get_filename_component(_xaudio2_root "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_xaudio2_root "${_xaudio2_root}" PATH)
get_filename_component(_xaudio2_root "${_xaudio2_root}" PATH)
set(_xaudio2_root_lib "${_xaudio2_root}/lib/xaudio2_9redist.lib")
if (EXISTS "${_xaudio2_root_lib}")
add_library(Microsoft::XAudio2Redist SHARED IMPORTED)
set_target_properties(Microsoft::XAudio2Redist PROPERTIES
IMPORTED_LOCATION_RELEASE "${_xaudio2_root}/bin/xaudio2_9redist.dll"
IMPORTED_IMPLIB_RELEASE "${_xaudio2_root_lib}"
IMPORTED_LOCATION_DEBUG "${_xaudio2_root}/debug/bin/xaudio2_9redist.dll"
IMPORTED_IMPLIB_DEBUG "${_xaudio2_root}/debug/lib/xaudio2_9redist.lib"
INTERFACE_INCLUDE_DIRECTORIES "${_xaudio2_root}/include/xaudio2redist"
IMPORTED_CONFIGURATIONS "Debug;Release"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
add_library(Microsoft::XApoBase STATIC IMPORTED)
set_target_properties(Microsoft::XApoBase PROPERTIES
IMPORTED_LOCATION_RELEASE "${_xaudio2_root}/lib/xapobaseredist_md.lib"
IMPORTED_LOCATION_DEBUG "${_xaudio2_root}/debug/lib/xapobaseredist_md.lib"
INTERFACE_INCLUDE_DIRECTORIES "${_xaudio2_root}/include/xaudio2redist"
IMPORTED_CONFIGURATIONS "Debug;Release")
set(xaudio2redist_FOUND TRUE)
else()
set(xaudio2redist_FOUND FALSE)
endif()
unset(_xaudio2_root_lib)
unset(_xaudio2_root)

View File

@ -1970,7 +1970,7 @@
},
"dxsdk-d3dx": {
"baseline": "9.29.952.8",
"port-version": 2
"port-version": 3
},
"dxut": {
"baseline": "11.26",
@ -7526,7 +7526,7 @@
},
"xaudio2redist": {
"baseline": "1.2.8",
"port-version": 1
"port-version": 2
},
"xbyak": {
"baseline": "6.00",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4f9cac012452363e92e36d5978972cee3b9154e5",
"version": "9.29.952.8",
"port-version": 3
},
{
"git-tree": "3f16a0560a2beb7205ed033b5ac2e5d5d2223161",
"version": "9.29.952.8",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8ae7aaec9ebb9859356736f91710e8d9727d7a81",
"version": "1.2.8",
"port-version": 2
},
{
"git-tree": "4fe6eda4ff7a68db79013f5c5632e6e1a87b98e9",
"version": "1.2.8",