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/libtess2 | |
Diffstat (limited to 'vcpkg/ports/libtess2')
| -rw-r--r-- | vcpkg/ports/libtess2/CMakeLists.txt | 35 | ||||
| -rw-r--r-- | vcpkg/ports/libtess2/portfile.cmake | 27 | ||||
| -rw-r--r-- | vcpkg/ports/libtess2/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/libtess2/vcpkg.json | 16 |
4 files changed, 82 insertions, 0 deletions
diff --git a/vcpkg/ports/libtess2/CMakeLists.txt b/vcpkg/ports/libtess2/CMakeLists.txt new file mode 100644 index 0000000..7924eea --- /dev/null +++ b/vcpkg/ports/libtess2/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.21)
+
+project(libtess2)
+
+# Tesselator
+add_library(libtess2 STATIC)
+
+target_sources(libtess2 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Source/bucketalloc.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Source/dict.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Source/geom.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Source/mesh.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Source/priorityq.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Source/sweep.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Source/tess.c")
+
+target_include_directories(libtess2 PUBLIC
+ "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Include>"
+ "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Source>"
+)
+set_target_properties(libtess2 PROPERTIES LINKER_LANGUAGE CXX)
+
+install(TARGETS libtess2 EXPORT unofficial-libtess2-config)
+
+install(
+ FILES "${CMAKE_CURRENT_SOURCE_DIR}/Include/tesselator.h"
+ TYPE INCLUDE
+)
+
+install(
+ EXPORT unofficial-libtess2-config
+ NAMESPACE unofficial::libtess2::
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-libtess2"
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+)
diff --git a/vcpkg/ports/libtess2/portfile.cmake b/vcpkg/ports/libtess2/portfile.cmake new file mode 100644 index 0000000..7566e09 --- /dev/null +++ b/vcpkg/ports/libtess2/portfile.cmake @@ -0,0 +1,27 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO memononen/libtess2 + REF fc52516467dfa124bdd967c15c7cf9faf02a34ca + SHA512 2b3efb8934d1da8c1b3f0a79139275e89d9187e1e881c699f8623993165eae04068ce5927fe2a5e21e1298b79ffc57eb3e9bbc4bc07872d757a91189bc5f1cce + HEAD_REF master +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() + +vcpkg_cmake_config_fixup( + PACKAGE_NAME "unofficial-${PORT}" + CONFIG_PATH "lib/cmake/unofficial-${PORT}" +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/vcpkg/ports/libtess2/usage b/vcpkg/ports/libtess2/usage new file mode 100644 index 0000000..34d5dde --- /dev/null +++ b/vcpkg/ports/libtess2/usage @@ -0,0 +1,4 @@ +The package libtess2 provides CMake targets:
+
+find_package(unofficial-libtess2 CONFIG REQUIRED)
+target_link_libraries(main PUBLIC unofficial::libtess2::libtess2)
diff --git a/vcpkg/ports/libtess2/vcpkg.json b/vcpkg/ports/libtess2/vcpkg.json new file mode 100644 index 0000000..ce54d78 --- /dev/null +++ b/vcpkg/ports/libtess2/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "libtess2", + "version-date": "2021-12-27", + "description": "Game and tools oriented refactored version of GLU tesselator.", + "homepage": "https://github.com/memononen/libtess2", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |