diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/ztd-static-containers | |
Diffstat (limited to 'vcpkg/ports/ztd-static-containers')
| -rw-r--r-- | vcpkg/ports/ztd-static-containers/fix-cmake.patch | 68 | ||||
| -rw-r--r-- | vcpkg/ports/ztd-static-containers/portfile.cmake | 18 | ||||
| -rw-r--r-- | vcpkg/ports/ztd-static-containers/vcpkg.json | 19 |
3 files changed, 105 insertions, 0 deletions
diff --git a/vcpkg/ports/ztd-static-containers/fix-cmake.patch b/vcpkg/ports/ztd-static-containers/fix-cmake.patch new file mode 100644 index 0000000..cef15e5 --- /dev/null +++ b/vcpkg/ports/ztd-static-containers/fix-cmake.patch @@ -0,0 +1,68 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 32371d4..22223ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,6 +33,8 @@ project(ztd.static_containers + VERSION 0.5.0 + DESCRIPTION "A library for a fixed-capacity vector." + LANGUAGES C CXX) ++include(CMakePackageConfigHelpers) ++include(GNUInstallDirs) + + if(ZTD_STATIC_CONTAINERS_READTHEDOCS) + # ReadTheDocs seems unable to handle the include at the project level: something must be going wrong? +@@ -113,10 +115,7 @@ option(ZTD_STATIC_CONTAINERS_BENCHMARKS "Enable build of benchmarks" OFF) + + # # Dependencies + # ztd.idk +-FetchContent_Declare(ztd.idk +- GIT_REPOSITORY https://github.com/soasis/idk.git +- GIT_TAG main) +-FetchContent_MakeAvailable(ztd.idk) ++find_package(ztd.idk CONFIG REQUIRED) + + file(GLOB_RECURSE ztd.static_containers.sources + LIST_DIRECTORIES FALSE +@@ -126,7 +125,6 @@ file(GLOB_RECURSE ztd.static_containers.sources + + add_library(ztd.static_containers INTERFACE) + add_library(ztd::static_containers ALIAS ztd.static_containers) +-target_sources(ztd.static_containers INTERFACE ${ztd.static_containers.sources}) + target_link_libraries(ztd.static_containers + INTERFACE + ztd::idk +@@ -155,6 +153,18 @@ export(TARGETS ztd.static_containers + FILE + "${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.static_containers/ztd.static_containers-targets.cmake") + ++install(TARGETS ztd.static_containers ++ EXPORT ztd.static_containers-targets) ++install(EXPORT ztd.static_containers-targets ++ FILE ztd.static_containers-targets.cmake ++ DESTINATION share/ztd.static_containers ++) ++install(FILES ++ ${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.static_containers/ztd.static_containers-config.cmake ++ ${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.static_containers/ztd.static_containers-config-version.cmake ++ DESTINATION share/ztd.static_containers ++) ++ + # # Benchmarks, Tests, Examples + if(ZTD_STATIC_CONTAINERS_TESTS) + enable_testing() +diff --git a/cmake/ztd.static_containers-config.cmake.in b/cmake/ztd.static_containers-config.cmake.in +index f96ace2..94340c1 100644 +--- a/cmake/ztd.static_containers-config.cmake.in ++++ b/cmake/ztd.static_containers-config.cmake.in +@@ -1,6 +1,9 @@ + @PACKAGE_INIT@ +- +-if (TARGET ztd::static_containers) ++include(CMakeFindDependencyMacro) ++find_dependency(ztd.idk CONFIG) ++include("${CMAKE_CURRENT_LIST_DIR}/ztd.static_containers-targets.cmake") ++if (TARGET ztd.static_containers) ++ add_library(ztd::static_containers ALIAS ztd.static_containers) + get_target_property(ZTD_STATIC_CONTAINERS_INCLUDE_DIRS + ztd.static_containers INTERFACE_INCLUDE_DIRECTORIES) + set_and_check(ZTD_STATIC_CONTAINERS_INCLUDE_DIRS "${ZTD_STATIC_CONTAINERS_INCLUDE_DIRS}") diff --git a/vcpkg/ports/ztd-static-containers/portfile.cmake b/vcpkg/ports/ztd-static-containers/portfile.cmake new file mode 100644 index 0000000..797aaf0 --- /dev/null +++ b/vcpkg/ports/ztd-static-containers/portfile.cmake @@ -0,0 +1,18 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO soasis/static_containers + REF e1a21217b6dba3028e6cc6bf0f9562972ea1c43d + SHA512 b108b1e206854ddb4ceed9780c89c8db717c87bd010ee5ff1f176b79a26192dcc46a68b3d9b254b469f3869ec46738c0aabb0ccf0621444bb50bee306bdbe2fc + HEAD_REF main + PATCHES fix-cmake.patch +) + +set(VCPKG_BUILD_TYPE release) # header-only + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/ztd-static-containers/vcpkg.json b/vcpkg/ports/ztd-static-containers/vcpkg.json new file mode 100644 index 0000000..eb53ae7 --- /dev/null +++ b/vcpkg/ports/ztd-static-containers/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "ztd-static-containers", + "version-date": "2022-12-12", + "port-version": 2, + "description": "Containers of fixed capacity", + "homepage": "https://github.com/soasis/static_containers", + "license": "CC0-1.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "ztd-idk" + ] +} |