[poly2tri] Switch to maintained repo and adjust description (#26301)

* [poly2tri ]Switch to maintained repo and adjust description

* Rename to jhasse-poly2tri

* Also update version and fix header installation.

* Remove double nested headers.

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Matthias Kuhn 2024-02-01 21:31:29 +01:00 committed by GitHub
parent 527fc34c68
commit f7c5a7c8fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 128 additions and 130 deletions

View File

@ -1,15 +1,15 @@
{
"name": "assimp",
"version": "5.3.1",
"port-version": 3,
"port-version": 4,
"description": "The Open Asset import library",
"homepage": "https://github.com/assimp/assimp",
"license": "BSD-3-Clause",
"dependencies": [
"draco",
"jhasse-poly2tri",
"kubazip",
"minizip",
"poly2tri",
"polyclipping",
"pugixml",
"rapidjson",

View File

@ -0,0 +1,56 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a237b9..374e7e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,15 +1,32 @@
cmake_minimum_required(VERSION 3.12)
+if(POLICY CMP0063)
+ cmake_policy(SET CMP0063 NEW)
+endif()
+
+set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
+
project(poly2tri LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
+set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed")
+set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed")
+set(INSTALL_INCLUDE_DIR "include/${PROJECT_NAME}" CACHE PATH "Path where headers will be installed")
+set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed")
+
option(P2T_BUILD_TESTS "Build tests" OFF)
option(P2T_BUILD_TESTBED "Build the testbed application" OFF)
file(GLOB SOURCES poly2tri/common/*.cc poly2tri/sweep/*.cc)
file(GLOB HEADERS poly2tri/*.h poly2tri/common/*.h poly2tri/sweep/*.h)
+
add_library(poly2tri ${SOURCES} ${HEADERS})
-target_include_directories(poly2tri INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(${PROJECT_NAME} PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/poly2tri>
+ $<INSTALL_INTERFACE:include>
+ $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
+)
get_target_property(poly2tri_target_type poly2tri TYPE)
if(poly2tri_target_type STREQUAL SHARED_LIBRARY)
@@ -26,3 +43,17 @@ endif()
if(P2T_BUILD_TESTBED)
add_subdirectory(testbed)
endif()
+
+install(DIRECTORY poly2tri DESTINATION include FILES_MATCHING PATTERN "*.h")
+
+install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets
+ RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
+ LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
+ ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
+)
+
+install (EXPORT ${PROJECT_NAME}Targets
+ FILE ${PROJECT_NAME}Config.cmake
+ NAMESPACE ${PROJECT_NAME}::
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+)

View File

@ -0,0 +1,22 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jhasse/poly2tri
REF 0171f030bd3d5c6747c29d93403546eed668a1b6
SHA512 b55d543ae7f9b447d3e0e39b66cf1ce55a48ed7949819db01d8adc0972182519c4b6b533e704a282da45a4d64f510fd33cd81ccb52307dc0e63622e83bcf0192
HEAD_REF master
PATCHES
cmake.patch
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME poly2tri)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -0,0 +1,4 @@
jhasse-poly2tri provides CMake targets:
find_package(poly2tri CONFIG REQUIRED)
target_link_libraries(main PRIVATE poly2tri::poly2tri)

View File

@ -0,0 +1,17 @@
{
"name": "jhasse-poly2tri",
"version-date": "2023-12-27",
"description": "Sweep-line algorithm for constrained Delaunay triangulation",
"homepage": "https://github.com/jhasse/poly2tri",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -1,64 +0,0 @@
cmake_minimum_required(VERSION 3.0)
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif()
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
project(poly2tri LANGUAGES C CXX)
set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed")
set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed")
set(INSTALL_INCLUDE_DIR "include/${PROJECT_NAME}" CACHE PATH "Path where headers will be installed")
set(INSTALL_CMAKE_DIR "share/${PROJECT_NAME}" CACHE PATH "Path where cmake configs will be installed")
set(${PROJECT_NAME}_HEADERS
"poly2tri/poly2tri.h"
)
set(${PROJECT_NAME}_COMMON_HEADERS
"poly2tri/common/shapes.h"
"poly2tri/common/utils.h"
)
set(${PROJECT_NAME}_SWEEP_HEADERS
"poly2tri/sweep/advancing_front.h"
"poly2tri/sweep/cdt.h"
"poly2tri/sweep/sweep.h"
"poly2tri/sweep/sweep_context.h"
)
set(${PROJECT_NAME}_SOURCES
"poly2tri/common/shapes.cc"
"poly2tri/sweep/advancing_front.cc"
"poly2tri/sweep/cdt.cc"
"poly2tri/sweep/sweep.cc"
"poly2tri/sweep/sweep_context.cc"
)
add_library(${PROJECT_NAME} "${${PROJECT_NAME}_HEADERS}" "${${PROJECT_NAME}_COMMON_HEADERS}" "${${PROJECT_NAME}_SWEEP_HEADERS}" "${${PROJECT_NAME}_SOURCES}")
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${${PROJECT_NAME}_HEADERS}")
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/poly2tri>
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
)
install(FILES ${${PROJECT_NAME}_COMMON_HEADERS} DESTINATION "${INSTALL_INCLUDE_DIR}/common")
install(FILES ${${PROJECT_NAME}_SWEEP_HEADERS} DESTINATION "${INSTALL_INCLUDE_DIR}/sweep")
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}"
COMPONENT dev
)
install (EXPORT ${PROJECT_NAME}Targets
FILE ${PROJECT_NAME}Config.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION "${INSTALL_CMAKE_DIR}"
)

View File

@ -1,13 +0,0 @@
diff --git a/poly2tri/sweep/sweep.h b/poly2tri/sweep/sweep.h
index f62c4cc..af8af69 100644
--- a/poly2tri/sweep/sweep.h
+++ b/poly2tri/sweep/sweep.h
@@ -33,7 +33,7 @@
* Zalik, B.(2008)'Sweep-line algorithm for constrained Delaunay triangulation',
* International Journal of Geographical Information Science
*
- * "FlipScan" Constrained Edge Algorithm invented by Thomas Åhlén, thahlen@gmail.com
+ * "FlipScan" Constrained Edge Algorithm invented by Thomas, thahlen@gmail.com
*/
#ifndef SWEEP_H

View File

@ -1,25 +0,0 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO greenm01/poly2tri
REF 88de49021b6d9bef6faa1bc94ceb3fbd85c3c204
SHA512 fa256bcf923ad59f42205edf5a7e07cac6cbd9a37cefb9a0961a2e06aea7fa8ffd09d4e26154c0028601c12804483842cb935d9f602385f5f203c9628382c4fb
HEAD_REF master
PATCHES
fix-sweep-h-codepage.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,18 +0,0 @@
{
"name": "poly2tri",
"version-date": "2020-07-21",
"port-version": 3,
"description": "The Clipper library performs clipping and offsetting for both lines and polygons. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Polygons can be of any shape including self-intersecting polygons.",
"homepage": "https://github.com/greenm01/poly2tri",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -1,12 +1,12 @@
{
"name": "qtpositioning",
"version": "6.6.1",
"port-version": 1,
"port-version": 2,
"description": "Qt Positioning",
"homepage": "https://www.qt.io/",
"license": null,
"dependencies": [
"poly2tri",
"jhasse-poly2tri",
{
"name": "qtbase",
"default-features": false

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "379f3ceb0d492f5d41bd9320cfd519da9b94bfa8",
"version": "5.3.1",
"port-version": 4
},
{
"git-tree": "76ae4b01818ee27c5beac4d0b18cb566f94f27ec",
"version": "5.3.1",

View File

@ -274,7 +274,7 @@
},
"assimp": {
"baseline": "5.3.1",
"port-version": 3
"port-version": 4
},
"async-mqtt": {
"baseline": "4.0.0",
@ -3668,6 +3668,10 @@
"baseline": "5.3.0",
"port-version": 1
},
"jhasse-poly2tri": {
"baseline": "2023-12-27",
"port-version": 0
},
"jinja2cpplight": {
"baseline": "2018-05-08",
"port-version": 3
@ -6764,10 +6768,6 @@
"baseline": "2021-09-26",
"port-version": 0
},
"poly2tri": {
"baseline": "2020-07-21",
"port-version": 3
},
"polyclipping": {
"baseline": "6.4.2",
"port-version": 12
@ -7270,7 +7270,7 @@
},
"qtpositioning": {
"baseline": "6.6.1",
"port-version": 1
"port-version": 2
},
"qtquick3d": {
"baseline": "6.6.1",

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "f66a3f7e61a71546a6aeb3dafddaa1bde7681468",
"version-date": "2023-12-27",
"port-version": 0
}
]
}

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "40a0c9a9db2b270e73edaae7f96073f764ad2078",
"version": "6.6.1",
"port-version": 2
},
{
"git-tree": "61988bd841be21af4ae3bf2748ac8f6ec071e56c",
"version": "6.6.1",