forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[poly2tri] Switch to maintained repo and adjust description (microsof…
…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
Showing
14 changed files
with
128 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters