[whereami] Add new port (#49023)

This commit is contained in:
Paul Lemire
2026-01-13 07:50:45 +01:00
committed by GitHub
parent 6e7c3fbab5
commit 58bb677868
6 changed files with 95 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
cmake_minimum_required(VERSION 3.25)
project(whereami)
set(PROJECT_VERSION ${PROJECT_VERSION_STRING})
add_library(whereami STATIC src/whereami.c src/whereami.h)
add_library(whereami::whereami ALIAS whereami)
target_include_directories(whereami PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
set_target_properties(whereami PROPERTIES PUBLIC_HEADER "src/whereami.h")
include(GNUInstallDirs)
install(TARGETS whereami
EXPORT whereamiTargets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
# Create and install package files
include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/unofficial-whereamiConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/unofficial-whereamiConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-whereami
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/unofficial-whereamiConfigVersion.cmake
COMPATIBILITY SameMajorVersion
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/unofficial-whereamiConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/unofficial-whereamiConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-whereami
)
# Export Targets and install that to unofficial-whereamiTargets.cmake
install(
EXPORT whereamiTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-whereami
NAMESPACE unofficial::whereami::
FILE unofficial-whereamiTargets.cmake
)

View File

@@ -0,0 +1,21 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gpakosz/whereami
REF dcb52a058dc14530ba9ae05e4339bd3ddfae0e0e
SHA512 afd5999316c398218d8a401b6dc6a9885c9e474bde6804f464d55eca42fdee126329856da5b337bdfad5582e6ed1364fc86a47c92b49b6d57f1bea4e3d5120e0
HEAD_REF master
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-whereamiConfig.cmake.in" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DPROJECT_VERSION_STRING=${VERSION})
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-whereami CONFIG_PATH "lib/cmake/unofficial-whereami")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.MIT" "${SOURCE_PATH}/LICENSE.WTFPLv2")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

View File

@@ -0,0 +1,3 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-whereamiTargets.cmake")

17
ports/whereami/vcpkg.json Normal file
View File

@@ -0,0 +1,17 @@
{
"name": "whereami",
"version-date": "2024-08-26",
"description": "A drop-in two files library to locate the current executable and the current module on the file system.",
"homepage": "https://github.com/gpakosz/whereami",
"license": "MIT OR WTFPL",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@@ -10564,6 +10564,10 @@
"baseline": "2019-08-13",
"port-version": 2
},
"whereami": {
"baseline": "2024-08-26",
"port-version": 0
},
"whisper-cpp": {
"baseline": "1.8.2",
"port-version": 0

View File

@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "4256f3652c35f4756569b8c241d09f7bf05bf48e",
"version-date": "2024-08-26",
"port-version": 0
}
]
}