[minitrace] Add new port (#5534)

* [minitrace] Add new port

* [minitrace] Install header into separate directory
This commit is contained in:
Connor Fitzgerald 2019-03-05 03:32:42 -05:00 committed by Phil Christensen
parent db043276c3
commit 70847e191a
3 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.8)
project(minitrace C)
set(minitrace_HEADERS minitrace.h)
set(minitrace_SOURCES minitrace.c)
add_library(minitrace ${minitrace_SOURCES})
# Install headers
install(FILES ${minitrace_HEADERS} DESTINATION include/minitrace)
# Install minitrace
install(
TARGETS minitrace EXPORT minitraceConfig
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)
# Export config file for minitrace
export(
TARGETS minitrace
NAMESPACE minitrace::
FILE "${CMAKE_CURRENT_BINARY_DIR}/minitrace-config.cmake"
)
# Install config file
install(
EXPORT minitraceConfig
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/minitrace"
NAMESPACE minitrace::
)

3
ports/minitrace/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: minitrace
Version: 2019.02.06
Description: Simple C/C++ library for producing JSON traces suitable for Chrome's built-in trace viewer.

View File

@ -0,0 +1,28 @@
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO hrydgard/minitrace
REF a48215c409dd848fa0a76c5eb4dfaba4ca3bca39
SHA512 591fa52132b6bbe8e7e121526a43d07056deff8fe026227c1a4c26bebf95536e5d68750fa8551d23afebf048fe8b8503017b9a93650e18a992cf2e5678d46135
HEAD_REF master
)
file(COPY ${CURRENT_PORT_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/minitrace RENAME copyright)
vcpkg_test_cmake(PACKAGE_NAME minitrace)