vcpkg/ports/uvatlas/portfile.cmake
Chuck Walbourn fa4685031d
[directxtk, directxtk12, directxmesh, directxtex, uvatlas] ports updates March 2022 (#23791)
* [directxtk, directxtk12, directxmesh, directxtex, uvatlas] ports updated for March 2022 releases

* Update baseline
2022-03-28 13:52:09 -07:00

63 lines
1.9 KiB
CMake

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/UVAtlas
REF mar2022
SHA512 8e532a754d1b07108c98e099221a1c6eb39e1386e2e61d8694e041fcdf0556d1aeaed703018b18aa0cc2972c1b874fedd4d7b5e5694c504e70d623a78e6eb421
HEAD_REF main
)
if (VCPKG_HOST_IS_LINUX)
message(WARNING "Build ${PORT} requires GCC version 9 or later")
endif()
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
eigen ENABLE_USE_EIGEN
)
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}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
if((VCPKG_HOST_IS_WINDOWS) AND (VCPKG_TARGET_ARCHITECTURE MATCHES x64) AND (NOT ("eigen" IN_LIST FEATURES)))
vcpkg_download_distfile(
UVATLASTOOL_EXE
URLS "https://github.com/Microsoft/UVAtlas/releases/download/mar2022/uvatlastool.exe"
FILENAME "uvatlastool-mar2022.exe"
SHA512 d4179b755a9f8d81c180c86ae7e2d177dd0842f78fc81d96b87fa6551407a038edb8250529e45a9b783514e27cbe2a806bac4af47c3db5c34a6e4adc602f5ff4
)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/uvatlas/")
file(INSTALL
${UVATLASTOOL_EXE}
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/uvatlas/)
file(RENAME ${CURRENT_PACKAGES_DIR}/tools/uvatlas/uvatlastool-mar2022.exe ${CURRENT_PACKAGES_DIR}/tools/uvatlas/uvatlastool.exe)
elseif((VCPKG_TARGET_IS_WINDOWS) AND (NOT VCPKG_TARGET_IS_UWP))
vcpkg_copy_tools(
TOOL_NAMES uvatlastool
SEARCH_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/CMake
)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)