Skip to content

Commit

Permalink
[poly2tri] Switch to maintained repo and adjust description (microsof…
Browse files Browse the repository at this point in the history
…t#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 <[email protected]>
  • Loading branch information
2 people authored and TomKatom committed Feb 23, 2024
1 parent 65797d9 commit 97c16f9
Show file tree
Hide file tree
Showing 14 changed files with 128 additions and 130 deletions.
4 changes: 2 additions & 2 deletions ports/assimp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
56 changes: 56 additions & 0 deletions ports/jhasse-poly2tri/cmake.patch
Original file line number Diff line number Diff line change
@@ -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}"
+)
22 changes: 22 additions & 0 deletions ports/jhasse-poly2tri/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 4 additions & 0 deletions ports/jhasse-poly2tri/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
jhasse-poly2tri provides CMake targets:

find_package(poly2tri CONFIG REQUIRED)
target_link_libraries(main PRIVATE poly2tri::poly2tri)
17 changes: 17 additions & 0 deletions ports/jhasse-poly2tri/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
64 changes: 0 additions & 64 deletions ports/poly2tri/CMakeLists.txt

This file was deleted.

13 changes: 0 additions & 13 deletions ports/poly2tri/fix-sweep-h-codepage.patch

This file was deleted.

25 changes: 0 additions & 25 deletions ports/poly2tri/portfile.cmake

This file was deleted.

18 changes: 0 additions & 18 deletions ports/poly2tri/vcpkg.json

This file was deleted.

4 changes: 2 additions & 2 deletions ports/qtpositioning/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions versions/a-/assimp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "379f3ceb0d492f5d41bd9320cfd519da9b94bfa8",
"version": "5.3.1",
"port-version": 4
},
{
"git-tree": "76ae4b01818ee27c5beac4d0b18cb566f94f27ec",
"version": "5.3.1",
Expand Down
12 changes: 6 additions & 6 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
},
"assimp": {
"baseline": "5.3.1",
"port-version": 3
"port-version": 4
},
"async-mqtt": {
"baseline": "4.0.0",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -6768,10 +6772,6 @@
"baseline": "2021-09-26",
"port-version": 0
},
"poly2tri": {
"baseline": "2020-07-21",
"port-version": 3
},
"polyclipping": {
"baseline": "6.4.2",
"port-version": 12
Expand Down Expand Up @@ -7274,7 +7274,7 @@
},
"qtpositioning": {
"baseline": "6.6.1",
"port-version": 1
"port-version": 2
},
"qtquick3d": {
"baseline": "6.6.1",
Expand Down
9 changes: 9 additions & 0 deletions versions/j-/jhasse-poly2tri.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "f66a3f7e61a71546a6aeb3dafddaa1bde7681468",
"version-date": "2023-12-27",
"port-version": 0
}
]
}
5 changes: 5 additions & 0 deletions versions/q-/qtpositioning.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "40a0c9a9db2b270e73edaae7f96073f764ad2078",
"version": "6.6.1",
"port-version": 2
},
{
"git-tree": "61988bd841be21af4ae3bf2748ac8f6ec071e56c",
"version": "6.6.1",
Expand Down

0 comments on commit 97c16f9

Please sign in to comment.