diff --git a/extern/vcpkg-overlays/stb/FindStb.cmake b/extern/vcpkg-overlays/stb/FindStb.cmake new file mode 100644 index 000000000..4ffa8b1ff --- /dev/null +++ b/extern/vcpkg-overlays/stb/FindStb.cmake @@ -0,0 +1,29 @@ +# Distributed under the OSI-approved BSD 3-Clause License. + +#.rst: +# FindStb +# ------------ +# +# Find the Stb include headers. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# This module defines the following variables: +# +# ``Stb_FOUND`` +# True if Stb library found +# +# ``Stb_INCLUDE_DIR`` +# Location of Stb headers +# + +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) +include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) + +if(NOT Stb_INCLUDE_DIR) + find_path(Stb_INCLUDE_DIR NAMES stb_image.h PATHS ${Stb_DIR} PATH_SUFFIXES include) +endif() + +find_package_handle_standard_args(Stb DEFAULT_MSG Stb_INCLUDE_DIR) +mark_as_advanced(Stb_INCLUDE_DIR) diff --git a/extern/vcpkg-overlays/stb/portfile.cmake b/extern/vcpkg-overlays/stb/portfile.cmake new file mode 100644 index 000000000..f449804f7 --- /dev/null +++ b/extern/vcpkg-overlays/stb/portfile.cmake @@ -0,0 +1,16 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO nothings/stb + REF f75e8d1cad7d90d72ef7a4661f1b994ef78b4e31 # committed on 2024-07-29 + SHA512 4a733aefb816a366c999663e3d482144616721b26c321ee5dd0dce611a34050b6aef97d46bd2c4f8a9631d83b097491a7ce88607fd9493d880aaa94567a68cce + HEAD_REF master +) + +file(GLOB HEADER_FILES "${SOURCE_PATH}/*.h" "${SOURCE_PATH}/stb_vorbis.c") +file(COPY ${HEADER_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/FindStb.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/extern/vcpkg-overlays/stb/usage b/extern/vcpkg-overlays/stb/usage new file mode 100644 index 000000000..ac75766bf --- /dev/null +++ b/extern/vcpkg-overlays/stb/usage @@ -0,0 +1,4 @@ +The package stb provides CMake targets: + + find_package(Stb REQUIRED) + target_include_directories(main PRIVATE ${Stb_INCLUDE_DIR}) \ No newline at end of file diff --git a/extern/vcpkg-overlays/stb/vcpkg-cmake-wrapper.cmake b/extern/vcpkg-overlays/stb/vcpkg-cmake-wrapper.cmake new file mode 100644 index 000000000..e787d29f0 --- /dev/null +++ b/extern/vcpkg-overlays/stb/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,6 @@ +set(STB_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) + +_find_package(${ARGS}) + +set(CMAKE_MODULE_PATH ${STB_PREV_MODULE_PATH}) diff --git a/extern/vcpkg-overlays/stb/vcpkg.json b/extern/vcpkg-overlays/stb/vcpkg.json new file mode 100644 index 000000000..07b7d65b1 --- /dev/null +++ b/extern/vcpkg-overlays/stb/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "stb", + "version-date": "2024-07-29", + "port-version": 1, + "description": "public domain header-only libraries", + "homepage": "https://github.com/nothings/stb", + "license": "MIT OR CC-PDDC" +}