diff options
Diffstat (limited to 'vcpkg/ports/nanobind')
| -rw-r--r-- | vcpkg/ports/nanobind/portfile.cmake | 25 | ||||
| -rw-r--r-- | vcpkg/ports/nanobind/usage | 8 | ||||
| -rw-r--r-- | vcpkg/ports/nanobind/vcpkg.json | 15 |
3 files changed, 48 insertions, 0 deletions
diff --git a/vcpkg/ports/nanobind/portfile.cmake b/vcpkg/ports/nanobind/portfile.cmake new file mode 100644 index 0000000..fdf6558 --- /dev/null +++ b/vcpkg/ports/nanobind/portfile.cmake @@ -0,0 +1,25 @@ +# nanobind distributes source code to build on-demand. +# The source code is installed into the 'share/${PORT}' directory with +# subdirectories for source `src` and header `include` files +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +set(VCPKG_BUILD_TYPE release) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO wjakob/nanobind + REF "v${VERSION}" + SHA512 05b2541896e64bb513f915ebc09820b2d3659efa9a1a4bdda9da79a761a23d84e41db22031c02ae816b1f729dab95efcb7c888e926dbb89fb4b34c8a329d59bf + HEAD_REF master +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DNB_USE_SUBMODULE_DEPS:BOOL=OFF + -DNB_TEST:BOOL=OFF +) + +vcpkg_cmake_install() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/vcpkg/ports/nanobind/usage b/vcpkg/ports/nanobind/usage new file mode 100644 index 0000000..81a3259 --- /dev/null +++ b/vcpkg/ports/nanobind/usage @@ -0,0 +1,8 @@ +The package nanobind provides CMake functions and source code rather than +libraries: + + find_package(nanobind REQUIRED) + nanobind_add_module(my_ext source.cpp) + + # See docs for more configuration options + # https://nanobind.readthedocs.io/en/latest/api_cmake.html diff --git a/vcpkg/ports/nanobind/vcpkg.json b/vcpkg/ports/nanobind/vcpkg.json new file mode 100644 index 0000000..0976570 --- /dev/null +++ b/vcpkg/ports/nanobind/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "nanobind", + "version-semver": "2.9.2", + "description": "Tiny and efficient C++/Python bindings", + "homepage": "https://nanobind.readthedocs.io/en/latest/", + "license": "BSD-3-Clause", + "dependencies": [ + "python3", + "robin-map", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |