vcpkg/ports/directxmesh/portfile.cmake

63 lines
1.9 KiB
CMake
Raw Normal View History

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXMesh
REF feb2022
SHA512 7a34ff8a484e5693efbc3e3f1ecb32978b32d71c6d795c0de14ee29fc61230213448039ac30f74d9836e1703cbcd6026b285e85984f0e30d8005c034d5419809
HEAD_REF main
2017-01-11 22:42:37 +08:00
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
dx12 BUILD_DX12
2017-01-11 22:42:37 +08:00
)
if (VCPKG_HOST_IS_LINUX)
message(WARNING "Build ${PORT} requires GCC version 9 or later")
endif()
if(VCPKG_TARGET_IS_UWP)
set(EXTRA_OPTIONS -DBUILD_TOOLS=OFF)
else()
set(EXTRA_OPTIONS -DBUILD_TOOLS=ON)
endif()
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS ${FEATURE_OPTIONS} ${EXTRA_OPTIONS}
2017-01-11 22:42:37 +08:00
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
2017-01-11 22:42:37 +08:00
if((VCPKG_HOST_IS_WINDOWS) AND (VCPKG_TARGET_ARCHITECTURE MATCHES x64))
vcpkg_download_distfile(
MESHCONVERT_EXE
URLS "https://github.com/Microsoft/DirectXMesh/releases/download/feb2022/meshconvert.exe"
FILENAME "meshconvert-feb2022.exe"
SHA512 687bec9c9f6c5fc08fc86370bb5b247f751c96fbbf047293364c75c43ec63a769ad737898a3b36acd95f7c3f6b0e97c756043d7a7ccdf750090594e1e2b97271
)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxmesh/")
file(INSTALL
${MESHCONVERT_EXE}
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/directxmesh/)
file(RENAME ${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert-feb2022.exe ${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert.exe)
elseif((VCPKG_TARGET_IS_WINDOWS) AND (NOT VCPKG_TARGET_IS_UWP))
vcpkg_copy_tools(
TOOL_NAMES meshconvert
SEARCH_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/CMake
)
endif()
2017-01-11 22:42:37 +08:00
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)