vcpkg/ports/ecsutil/portfile.cmake
2019-12-02 17:21:18 -08:00

56 lines
2.0 KiB
CMake

include(vcpkg_common_functions)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(PLATFORM x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(PLATFORM x64)
else()
message(FATAL_ERROR "Unsupported architecture")
endif()
if(VCPKG_CMAKE_SYSTEM_NAME)
message(FATAL_ERROR "Unsupported platform. ECSUTIL currently only supports windows desktop.")
endif()
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(ECSUtil_CONFIGURATION_RELEASE Release)
set(ECSUtil_CONFIGURATION_DEBUG Debug)
else()
if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
set(ECSUtil_CONFIGURATION_RELEASE "Release Lib")
set(ECSUtil_CONFIGURATION_DEBUG "Debug Lib")
else()
set(ECSUtil_CONFIGURATION_RELEASE "Release Lib Static")
set(ECSUtil_CONFIGURATION_DEBUG "Debug Lib Static")
endif()
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO EMCECS/ecs-object-client-windows-cpp
REF v1.0.7.8
SHA512 33b15e16e8568db57a670c91e77b7624e3b70e02e18a8b337f4967b3aca4a36d3f6d87ddab60720a93fb5a4798948ec264eb273d8f31fb7e4bf4a86c1e89579a
HEAD_REF master
)
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH ECSUtil.sln
PLATFORM ${PLATFORM}
LICENSE_SUBPATH license.txt
TARGET ECSUtil
RELEASE_CONFIGURATION ${ECSUtil_CONFIGURATION_RELEASE}
DEBUG_CONFIGURATION ${ECSUtil_CONFIGURATION_DEBUG}
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(COPY ${SOURCE_PATH}/ECSUtil DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/ECSUtil/res ${CURRENT_PACKAGES_DIR}/tools)
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/NatvisAddIn.dll ${CURRENT_PACKAGES_DIR}/debug/bin/NatvisAddIn.dll)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()