mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 03:10:57 +08:00
[directxtk12] Use CMake build system (#13975)
* [directxtk12] Use CMake build system Use the provided CMake file instead of the VS solutions to build the library, as recommended in the maintainer guidelines. * [directxtk12] Fix wrong port version * [directxtk12] Use ninja
This commit is contained in:
parent
15ec0792d8
commit
83f88c7a62
@ -1,4 +1,5 @@
|
||||
Source: directxtk12
|
||||
Version: sept2020
|
||||
Port-Version: 1
|
||||
Homepage: https://walbourn.github.io/directx-tool-kit-for-directx-12
|
||||
Description: A collection of helper classes for writing DirectX 12 code in C++.
|
||||
|
@ -8,46 +8,19 @@ vcpkg_from_github(
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
IF (TRIPLET_SYSTEM_ARCH MATCHES "x86")
|
||||
SET(BUILD_ARCH "Win32")
|
||||
ELSE()
|
||||
SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH})
|
||||
ENDIF()
|
||||
|
||||
if (VCPKG_PLATFORM_TOOLSET STREQUAL "v140")
|
||||
set(VS_VERSION "2015")
|
||||
elseif (VCPKG_PLATFORM_TOOLSET STREQUAL "v141")
|
||||
set(VS_VERSION "2017")
|
||||
elseif (VCPKG_PLATFORM_TOOLSET STREQUAL "v142")
|
||||
set(VS_VERSION "2019")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported platform toolset.")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_UWP)
|
||||
set(SLN_NAME "Windows10_${VS_VERSION}")
|
||||
else()
|
||||
set(SLN_NAME "Desktop_${VS_VERSION}_Win10")
|
||||
endif()
|
||||
|
||||
vcpkg_build_msbuild(
|
||||
PROJECT_PATH ${SOURCE_PATH}/DirectXTK_${SLN_NAME}.sln
|
||||
PLATFORM ${TRIPLET_SYSTEM_ARCH}
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS -DBUILD_XAUDIO_WIN10=ON
|
||||
)
|
||||
|
||||
file(INSTALL
|
||||
${SOURCE_PATH}/Inc/
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/include/DirectXTK12
|
||||
)
|
||||
vcpkg_build_cmake()
|
||||
|
||||
file(INSTALL
|
||||
${SOURCE_PATH}/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/DirectXTK12.lib
|
||||
${SOURCE_PATH}/Bin/${SLN_NAME}/${BUILD_ARCH}/Release/DirectXTK12.pdb
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
||||
file(INSTALL ${SOURCE_PATH}/Inc/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/DirectXTK12)
|
||||
|
||||
file(INSTALL
|
||||
${SOURCE_PATH}/Bin/${SLN_NAME}/${BUILD_ARCH}/Debug/DirectXTK12.lib
|
||||
${SOURCE_PATH}/Bin/${SLN_NAME}/${BUILD_ARCH}/Debug/DirectXTK12.pdb
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
||||
file(GLOB_RECURSE DEBUG_LIB ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bin/CMake/*.lib)
|
||||
file(GLOB_RECURSE RELEASE_LIB ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/CMake/*.lib)
|
||||
file(INSTALL ${DEBUG_LIB} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
||||
file(INSTALL ${RELEASE_LIB} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
|
Loading…
x
Reference in New Issue
Block a user