2020-08-11 06:28:33 +08:00
vcpkg_fail_port_install ( ON_TARGET "LINUX" "OSX" "UWP" "ANDROID" ON_ARCH "arm" )
2021-09-24 08:53:29 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/share/dxsdk-d3dx/copyright" )
message ( FATAL_ERROR "Can't build ${PORT} if dxsdk-d3dx is installed. Please remove dxsdk-d3dx, and try to install ${PORT} again if you need it." )
endif ( )
2021-02-10 05:14:53 +08:00
message ( WARNING "Build ${PORT} is deprecated, untested in CI, and requires the use of the DirectSetup legacy REDIST solution. See https://aka.ms/dxsdk for more information." )
2020-08-11 06:28:33 +08:00
vcpkg_download_distfile ( ARCHIVE
2021-02-21 13:20:27 +08:00
U R L S " h t t p s : / / d o w n l o a d . m i c r o s o f t . c o m / d o w n l o a d / A / E / 7 / A E 7 4 3 F 1 F - 6 3 2 B - 4 8 0 9 - 8 7 A 9 - A A 1 B B 3 4 5 8 E 3 1 / D X S D K _ J u n 1 0 . e x e "
F I L E N A M E " D X S D K _ J u n 1 0 _ S H A 2 5 6 . e x e "
S H A 5 1 2 2 4 e 1 e 9 b d a 3 1 9 b 7 8 0 1 2 4 b 8 6 5 f 4 6 4 0 8 2 2 c f c 4 4 e 4 d 1 8 f b d c c 8 4 5 6 d 4 8 f e 5 4 0 8 1 6 5 2 c e 4 d d b 6 3 d 3 b d 8 5 9 6 3 5 1 0 5 7 c b a e 5 0 f c 8 2 4 b 8 2 9 7 e 9 9 f 0 f 7 c 9 7 5 4 7 1 5 3 1 6 2 5 6 2 b a 7 3 f
2020-08-11 06:28:33 +08:00
)
vcpkg_extract_source_archive_ex (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
A R C H I V E $ { A R C H I V E }
)
2021-02-10 05:14:53 +08:00
# See https://walbourn.github.io/the-zombie-directx-sdk/
set ( INC_DIR "${SOURCE_PATH}/Include" )
2020-08-11 06:28:33 +08:00
set ( LIB_DIR "${SOURCE_PATH}/Lib/${VCPKG_TARGET_ARCHITECTURE}" )
2021-02-10 05:14:53 +08:00
set ( HEADERS
$ { I N C _ D I R } / a u d i o d e f s . h
$ { I N C _ D I R } / c o m d e c l . h
$ { I N C _ D I R } / D 3 D X 1 0 . h
$ { I N C _ D I R } / d 3 d x 1 0 a s y n c . h
$ { I N C _ D I R } / D 3 D X 1 0 c o r e . h
$ { I N C _ D I R } / D 3 D X 1 0 m a t h . h
$ { I N C _ D I R } / D 3 D X 1 0 m a t h . i n l
$ { I N C _ D I R } / D 3 D X 1 0 m e s h . h
$ { I N C _ D I R } / D 3 D X 1 0 t e x . h
$ { I N C _ D I R } / D 3 D X 1 1 . h
$ { I N C _ D I R } / D 3 D X 1 1 a s y n c . h
$ { I N C _ D I R } / D 3 D X 1 1 c o r e . h
$ { I N C _ D I R } / D 3 D X 1 1 t e x . h
$ { I N C _ D I R } / d 3 d x 9 . h
$ { I N C _ D I R } / d 3 d x 9 a n i m . h
$ { I N C _ D I R } / d 3 d x 9 c o r e . h
$ { I N C _ D I R } / d 3 d x 9 e f f e c t . h
$ { I N C _ D I R } / d 3 d x 9 m a t h . h
$ { I N C _ D I R } / d 3 d x 9 m a t h . i n l
$ { I N C _ D I R } / d 3 d x 9 m e s h . h
$ { I N C _ D I R } / d 3 d x 9 s h a d e r . h
$ { I N C _ D I R } / d 3 d x 9 s h a p e . h
$ { I N C _ D I R } / d 3 d x 9 t e x . h
$ { I N C _ D I R } / d 3 d x 9 x o f . h
$ { I N C _ D I R } / D 3 D X _ D X G I F o r m a t C o n v e r t . i n l
$ { I N C _ D I R } / d s e t u p . h
$ { I N C _ D I R } / d x d i a g . h
$ { I N C _ D I R } / D x E r r . h
$ { I N C _ D I R } / d x f i l e . h
$ { I N C _ D I R } / d x s d k v e r . h
$ { I N C _ D I R } / P I X P l u g i n . h
$ { I N C _ D I R } / r m x f g u i d . h
$ { I N C _ D I R } / r m x f t m p l . h
$ { I N C _ D I R } / x a c t 3 . h
$ { I N C _ D I R } / x a c t 3 d 3 . h
$ { I N C _ D I R } / x a c t 3 w b . h
$ { I N C _ D I R } / X D S P . h
$ { I N C _ D I R } / x m a 2 d e f s . h )
2020-08-11 06:28:33 +08:00
set ( DEBUG_LIBS
$ { L I B _ D I R } / d 3 d x 1 0 d . l i b
$ { L I B _ D I R } / d 3 d x 1 1 d . l i b
$ { L I B _ D I R } / d 3 d x 9 d . l i b
)
set ( RELEASE_LIBS
$ { L I B _ D I R } / d 3 d x 1 0 . l i b
$ { L I B _ D I R } / d 3 d x 1 1 . l i b
$ { L I B _ D I R } / d 3 d x 9 . l i b
)
set ( OTHER_LIBS
$ { L I B _ D I R } / d 3 d x o f . l i b
$ { L I B _ D I R } / D x E r r . l i b
)
if ( ${ VCPKG_TARGET_ARCHITECTURE } STREQUAL "x86" )
list ( APPEND OTHER_LIBS ${ LIB_DIR } /dsetup.lib )
endif ( )
2021-02-10 05:14:53 +08:00
set ( XINPUT13_HEADER ${ INC_DIR } /XInput.h )
set ( XINPUT13_LIB ${ LIB_DIR } /XInput.lib )
set ( XAUDIO27_HEADERS
$ { I N C _ D I R } / X 3 D A u d i o . h
$ { I N C _ D I R } / X A P O . h
$ { I N C _ D I R } / X A P O B a s e . h
$ { I N C _ D I R } / X A P O F X . h
$ { I N C _ D I R } / X A u d i o 2 . h
$ { I N C _ D I R } / X A u d i o 2 f x . h )
set ( XAUDIO27_DEBUG_LIBS ${ LIB_DIR } /xapobased.lib )
set ( XAUDIO27_RELEASE_LIBS ${ LIB_DIR } /xapobase.lib )
set ( XAUDIO27_OTHER_LIBS
$ { L I B _ D I R } / X 3 D A u d i o . l i b
$ { L I B _ D I R } / X A P O F X . l i b
)
set ( XP_HEADERS
$ { I N C _ D I R } / D 3 D 1 0 . h
$ { I N C _ D I R } / D 3 D 1 0 e f f e c t . h
$ { I N C _ D I R } / d 3 d 1 0 m i s c . h
$ { I N C _ D I R } / d 3 d 1 0 s d k l a y e r s . h
$ { I N C _ D I R } / D 3 D 1 0 s h a d e r . h
$ { I N C _ D I R } / D 3 D 1 0 _ 1 . h
$ { I N C _ D I R } / D 3 D 1 0 _ 1 s h a d e r . h
$ { I N C _ D I R } / D 3 D 1 1 . h
$ { I N C _ D I R } / D 3 D 1 1 S D K L a y e r s . h
$ { I N C _ D I R } / D 3 D 1 1 S h a d e r . h
$ { I N C _ D I R } / D 3 D c o m m o n . h
$ { I N C _ D I R } / D 3 D c o m p i l e r . h
$ { I N C _ D I R } / D 3 D C S X . h
$ { I N C _ D I R } / D 3 D X _ D X G I F o r m a t C o n v e r t . i n l
$ { I N C _ D I R } / x n a m a t h . h
$ { I N C _ D I R } / x n a m a t h c o n v e r t . i n l
$ { I N C _ D I R } / x n a m a t h m a t r i x . i n l
$ { I N C _ D I R } / x n a m a t h m i s c . i n l
$ { I N C _ D I R } / x n a m a t h v e c t o r . i n l )
set ( XP_DEBUG_LIBS ${ LIB_DIR } /D3DCSXd.lib )
set ( XP_RELEASE_LIBS ${ LIB_DIR } /D3DCSX.lib )
set ( XP_OTHER_LIBS
$ { L I B _ D I R } / d 3 d c o m p i l e r . l i b
$ { L I B _ D I R } / d x g u i d . l i b
)
2020-08-11 06:28:33 +08:00
#install(DIRECTORY "${SOURCE_PATH}/Include" DESTINATION ${CURRENT_PACKAGES_DIR}/include)
2021-02-10 05:14:53 +08:00
file ( COPY ${ HEADERS } DESTINATION ${ CURRENT_PACKAGES_DIR } /include/ ${ PORT } )
2020-08-11 06:28:33 +08:00
file ( COPY ${ RELEASE_LIBS } ${ OTHER_LIBS } DESTINATION ${ CURRENT_PACKAGES_DIR } /lib )
file ( COPY ${ DEBUG_LIBS } ${ OTHER_LIBS } DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/lib )
2021-02-10 05:14:53 +08:00
if ( ( "xinput1-3" IN_LIST FEATURES ) OR ( "xp" IN_LIST FEATURES ) )
file ( COPY ${ XINPUT13_HEADER } DESTINATION ${ CURRENT_PACKAGES_DIR } /include/ ${ PORT } )
file ( COPY ${ XINPUT13_LIB } DESTINATION ${ CURRENT_PACKAGES_DIR } /lib )
file ( COPY ${ XINPUT13_LIB } DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/lib )
endif ( )
if ( ( "xaudio2-7" IN_LIST FEATURES ) OR ( "xp" IN_LIST FEATURES ) )
file ( COPY ${ XAUDIO27_HEADERS } DESTINATION ${ CURRENT_PACKAGES_DIR } /include/ ${ PORT } )
file ( COPY ${ XAUDIO27_RELEASE_LIBS } ${ XAUDIO27_OTHER_LIBS } DESTINATION ${ CURRENT_PACKAGES_DIR } /lib )
file ( COPY ${ XAUDIO27_DEBUG_LIBS } ${ XAUDIO27_OTHER_LIBS } DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/lib )
endif ( )
if ( "xp" IN_LIST FEATURES )
file ( COPY ${ XP_HEADERS } DESTINATION ${ CURRENT_PACKAGES_DIR } /include/ ${ PORT } )
file ( COPY ${ XP_RELEASE_LIBS } ${ XP_OTHER_LIBS } DESTINATION ${ CURRENT_PACKAGES_DIR } /lib )
file ( COPY ${ XP_DEBUG_LIBS } ${ XP_OTHER_LIBS } DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/lib )
endif ( )
2020-08-11 06:28:33 +08:00
# # Handle copyright
file ( INSTALL "${SOURCE_PATH}/Documentation/License Agreements/DirectX SDK EULA.txt" DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )