vcpkg/ports/directxmesh/portfile.cmake

57 lines
2.2 KiB
CMake
Raw Normal View History

2017-01-11 22:42:37 +08:00
# Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
set(VCPKG_LIBRARY_LINKAGE static)
endif()
2017-01-11 22:42:37 +08:00
if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic")
message(FATAL_ERROR "DirectXMesh only supports dynamic CRT linkage")
endif()
2017-01-11 22:42:37 +08:00
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/DirectXMesh-oct2016)
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/Microsoft/DirectXMesh/archive/oct2016.tar.gz"
FILENAME "DirectXMesh-oct2016.tar.gz"
SHA512 8aaf9749766afd23709ce6c6f8d74b008fe9f96789e4d97cb387633dad34b4132ef28dfe028d13c779ea366428d53076a881c0d63c4f0c2c74d552293c8d6bf1
)
vcpkg_extract_source_archive(${ARCHIVE})
IF (TRIPLET_SYSTEM_ARCH MATCHES "x86")
2017-01-13 18:21:16 +08:00
SET(BUILD_ARCH "Win32")
ELSE()
2017-01-13 18:21:16 +08:00
SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH})
2017-01-11 22:42:37 +08:00
ENDIF()
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2015.sln
2017-01-13 18:21:16 +08:00
PLATFORM ${BUILD_ARCH}
2017-01-11 22:42:37 +08:00
)
file(INSTALL
2017-01-13 18:21:16 +08:00
${SOURCE_PATH}/DirectXMesh/DirectXMesh.h
${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl
DESTINATION ${CURRENT_PACKAGES_DIR}/include
2017-01-11 22:42:37 +08:00
)
file(INSTALL
2017-01-13 18:21:16 +08:00
${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Debug/DirectXMesh.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(INSTALL
2017-01-13 18:21:16 +08:00
${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2015/${BUILD_ARCH}/Release/DirectXMesh.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
2017-01-11 22:42:37 +08:00
set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools)
file(INSTALL
2017-01-13 18:21:16 +08:00
${SOURCE_PATH}/Meshconvert/Bin/Desktop_2015/${BUILD_ARCH}/Release/Meshconvert.exe
DESTINATION ${TOOL_PATH})
2017-01-11 22:42:37 +08:00
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/directxmesh)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/directxmesh/LICENSE ${CURRENT_PACKAGES_DIR}/share/directxmesh/copyright)