vcpkg/ports/directxmesh/portfile.cmake
Alexander Karatarakis 6ad96b7e7a 2018.05.17 updates
2018-05-17 22:56:05 -07:00

51 lines
1.7 KiB
CMake

include(vcpkg_common_functions)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
set(VCPKG_LIBRARY_LINKAGE static)
endif()
if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic")
message(FATAL_ERROR "DirectXMesh only supports dynamic CRT linkage")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXMesh
REF may2018
SHA512 33fe4a680f274b1e7a643cc1a49762d7c9528e1fefab8ec41010c8b3b094cad56731c23e4d098b0684689050a62a89186557cf448075e73b9f592bad22cb0ca0
HEAD_REF master
)
IF (TRIPLET_SYSTEM_ARCH MATCHES "x86")
SET(BUILD_ARCH "Win32")
ELSE()
SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH})
ENDIF()
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/DirectXMesh_Desktop_2017.sln
PLATFORM ${BUILD_ARCH}
)
file(INSTALL
${SOURCE_PATH}/DirectXMesh/DirectXMesh.h
${SOURCE_PATH}/DirectXMesh/DirectXMesh.inl
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
file(INSTALL
${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2017/${BUILD_ARCH}/Debug/DirectXMesh.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(INSTALL
${SOURCE_PATH}/DirectXMesh/Bin/Desktop_2017/${BUILD_ARCH}/Release/DirectXMesh.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
set(TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools)
file(INSTALL
${SOURCE_PATH}/Meshconvert/Bin/Desktop_2017/${BUILD_ARCH}/Release/Meshconvert.exe
DESTINATION ${TOOL_PATH})
# 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)