aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/mcap
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/mcap
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/mcap')
-rw-r--r--vcpkg/ports/mcap/portfile.cmake48
-rw-r--r--vcpkg/ports/mcap/unofficial-mcapConfig.cmake.in24
-rw-r--r--vcpkg/ports/mcap/vcpkg.json22
3 files changed, 94 insertions, 0 deletions
diff --git a/vcpkg/ports/mcap/portfile.cmake b/vcpkg/ports/mcap/portfile.cmake
new file mode 100644
index 0000000..36f2bef
--- /dev/null
+++ b/vcpkg/ports/mcap/portfile.cmake
@@ -0,0 +1,48 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO foxglove/mcap
+ REF "releases/cpp/v${VERSION}"
+ SHA512 846c21bbe4156f6b658825f5d6d9e39ad2d4206869701fe9469fed60ef9904c3ef6bf8f73bcb86ae46120189fcddda7f111674f04bca91a58bb7c6d574f4dc64
+ HEAD_REF main
+)
+
+file(INSTALL
+ "${SOURCE_PATH}/cpp/mcap/include/"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/include"
+)
+
+# Set compile definitions, dependencies, and link libraries based on the configured features
+set(MCAP_COMPILE_DEFINITIONS "")
+set(MCAP_FIND_DEPENDENCIES "")
+set(MCAP_LINK_LIBRARIES "")
+if("lz4" IN_LIST FEATURES)
+ list(APPEND MCAP_LINK_LIBRARIES lz4::lz4)
+ list(APPEND MCAP_FIND_DEPENDENCIES lz4)
+else()
+ list(APPEND MCAP_COMPILE_DEFINITIONS MCAP_COMPRESSION_NO_LZ4)
+endif()
+if("zstd" IN_LIST FEATURES)
+ list(APPEND MCAP_LINK_LIBRARIES zstd::libzstd)
+ list(APPEND MCAP_FIND_DEPENDENCIES zstd)
+else()
+ list(APPEND MCAP_COMPILE_DEFINITIONS MCAP_COMPRESSION_NO_ZSTD)
+endif()
+list(JOIN MCAP_COMPILE_DEFINITIONS " " MCAP_COMPILE_DEFINITIONS)
+list(JOIN MCAP_FIND_DEPENDENCIES " " MCAP_FIND_DEPENDENCIES)
+list(JOIN MCAP_LINK_LIBRARIES " " MCAP_LINK_LIBRARIES)
+
+set(_LIB_NAME unofficial-mcap)
+set(_LIB_TARGET unofficial::mcap::mcap)
+set(_PACKAGE_CONFIG_DIR "${CURRENT_PACKAGES_DIR}/share/${_LIB_NAME}")
+configure_file(
+ ${CMAKE_CURRENT_LIST_DIR}/${_LIB_NAME}Config.cmake.in
+ ${_PACKAGE_CONFIG_DIR}/${_LIB_NAME}Config.cmake
+ @ONLY
+)
+
+vcpkg_install_copyright(
+ FILE_LIST
+ "${SOURCE_PATH}/LICENSE"
+ "${SOURCE_PATH}/cpp/mcap/LICENSE"
+)
+
diff --git a/vcpkg/ports/mcap/unofficial-mcapConfig.cmake.in b/vcpkg/ports/mcap/unofficial-mcapConfig.cmake.in
new file mode 100644
index 0000000..e441dee
--- /dev/null
+++ b/vcpkg/ports/mcap/unofficial-mcapConfig.cmake.in
@@ -0,0 +1,24 @@
+# Template for unofficial-mcapConfig.cmake
+
+include(CMakeFindDependencyMacro)
+foreach(_DEPENDENCY IN ITEMS @MCAP_FIND_DEPENDENCIES@)
+ find_dependency(${_DEPENDENCY})
+endforeach()
+
+# Protect against multiple inclusion
+if (TARGET @_LIB_TARGET@)
+ return ()
+endif ()
+
+# Compute the installation prefix relative to this file, which is located in ${_IMPORT_PREFIX}/share/@_LIB_NAME@
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
+
+# Create imported mcap target
+add_library(@_LIB_TARGET@ INTERFACE IMPORTED)
+target_include_directories(@_LIB_TARGET@ INTERFACE "${_IMPORT_PREFIX}/include")
+if (NOT "@MCAP_LINK_LIBRARIES@" STREQUAL "")
+ target_link_libraries(@_LIB_TARGET@ INTERFACE @MCAP_LINK_LIBRARIES@)
+endif ()
+if (NOT "@MCAP_COMPILE_DEFINITIONS@" STREQUAL "")
+ target_compile_definitions(@_LIB_TARGET@ INTERFACE @MCAP_COMPILE_DEFINITIONS@)
+endif ()
diff --git a/vcpkg/ports/mcap/vcpkg.json b/vcpkg/ports/mcap/vcpkg.json
new file mode 100644
index 0000000..3365b33
--- /dev/null
+++ b/vcpkg/ports/mcap/vcpkg.json
@@ -0,0 +1,22 @@
+{
+ "name": "mcap",
+ "version": "2.1.1",
+ "description": "MCAP is a modular, performant, and serialization-agnostic container file format, useful for pub/sub and robotics applications.",
+ "homepage": "https://mcap.dev/",
+ "documentation": "https://mcap.dev/",
+ "license": "MIT",
+ "features": {
+ "lz4": {
+ "description": "Enable LZ4 compression support.",
+ "dependencies": [
+ "lz4"
+ ]
+ },
+ "zstd": {
+ "description": "Enable ZSTD compression support.",
+ "dependencies": [
+ "zstd"
+ ]
+ }
+ }
+}