aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/triangle
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/triangle')
-rw-r--r--vcpkg/ports/triangle/CMakeLists.txt47
-rw-r--r--vcpkg/ports/triangle/enable_64bit_architecture.patch418
-rw-r--r--vcpkg/ports/triangle/exports.def3
-rw-r--r--vcpkg/ports/triangle/portfile.cmake41
-rw-r--r--vcpkg/ports/triangle/triangleConfig.cmake6
-rw-r--r--vcpkg/ports/triangle/usage4
-rw-r--r--vcpkg/ports/triangle/vcpkg.json24
7 files changed, 543 insertions, 0 deletions
diff --git a/vcpkg/ports/triangle/CMakeLists.txt b/vcpkg/ports/triangle/CMakeLists.txt
new file mode 100644
index 0000000..4ee1382
--- /dev/null
+++ b/vcpkg/ports/triangle/CMakeLists.txt
@@ -0,0 +1,47 @@
+cmake_minimum_required(VERSION 3.5...3.30)
+project(triangle)
+
+option(BUILD_TOOL "Build the command line tool" OFF)
+
+include(GNUInstallDirs)
+
+add_library(triangle triangle.c exports.def)
+set_target_properties(triangle PROPERTIES PUBLIC_HEADER "${CMAKE_SOURCE_DIR}/triangle.h")
+target_compile_definitions(triangle PRIVATE -DTRILIBRARY)
+
+add_executable(triangle_exe triangle.c)
+set_target_properties(triangle_exe PROPERTIES OUTPUT_NAME "triangle")
+
+foreach(target IN ITEMS triangle triangle_exe)
+ target_compile_definitions(${target} PRIVATE -DANSI_DECLARATORS)
+ target_include_directories(${target} PUBLIC
+ "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
+ )
+ if(WIN32)
+ target_compile_definitions(${target} PRIVATE -DNO_TIMER)
+ endif()
+ if(UNIX AND NOT APPLE AND NOT ANDROID)
+ target_link_libraries(${target} PRIVATE m)
+ endif()
+endforeach()
+
+install(TARGETS triangle
+ EXPORT triangle-targets
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
+
+install(EXPORT triangle-targets
+ FILE unofficial-triangle-config.cmake
+ NAMESPACE unofficial::triangle::
+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-triangle"
+)
+
+if(BUILD_TOOL)
+ install(TARGETS triangle_exe DESTINATION tools/triangle)
+else()
+ set_target_properties(triangle_exe PROPERTIES EXCLUDE_FROM_ALL 1)
+endif()
diff --git a/vcpkg/ports/triangle/enable_64bit_architecture.patch b/vcpkg/ports/triangle/enable_64bit_architecture.patch
new file mode 100644
index 0000000..9ad7b80
--- /dev/null
+++ b/vcpkg/ports/triangle/enable_64bit_architecture.patch
@@ -0,0 +1,418 @@
+ triangle.c | 116 ++++++++++++++++++++++++++-----------------------------------
+ triangle.h | 29 +++++++++-------
+ 2 files changed, 66 insertions(+), 79 deletions(-)
+
+diff --git a/triangle.c b/triangle.c
+index f7a5700..084902e 100644
+--- a/triangle.c
++++ b/triangle.c
+@@ -194,27 +194,8 @@
+ /* */
+ /*****************************************************************************/
+
+-/* For single precision (which will save some memory and reduce paging), */
+-/* define the symbol SINGLE by using the -DSINGLE compiler switch or by */
+-/* writing "#define SINGLE" below. */
+-/* */
+-/* For double precision (which will allow you to refine meshes to a smaller */
+-/* edge length), leave SINGLE undefined. */
+-/* */
+-/* Double precision uses more memory, but improves the resolution of the */
+-/* meshes you can generate with Triangle. It also reduces the likelihood */
+-/* of a floating exception due to overflow. Finally, it is much faster */
+-/* than single precision on 64-bit architectures like the DEC Alpha. I */
+-/* recommend double precision unless you want to generate a mesh for which */
+-/* you do not have enough memory. */
+-
+-/* #define SINGLE */
+-
+-#ifdef SINGLE
+-#define REAL float
+-#else /* not SINGLE */
+ #define REAL double
+-#endif /* not SINGLE */
++#define VOID void
+
+ /* If yours is not a Unix system, define the NO_TIMER compiler switch to */
+ /* remove the Unix-specific timing code. */
+@@ -308,12 +289,6 @@
+ #define DEADVERTEX -32768
+ #define UNDEADVERTEX -32767
+
+-/* The next line is used to outsmart some very stupid compilers. If your */
+-/* compiler is smarter, feel free to replace the "int" with "void". */
+-/* Not that it matters. */
+-
+-#define VOID int
+-
+ /* Two constants for algorithms based on random sampling. Both constants */
+ /* have been chosen empirically to optimize their respective algorithms. */
+
+@@ -340,6 +315,7 @@
+
+ #define ONETHIRD 0.333333333333333333333333333333333333333333333333333333333333
+
++#include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -938,16 +914,16 @@ int minus1mod3[3] = {2, 0, 1};
+ /* extracted from the two least significant bits of the pointer. */
+
+ #define decode(ptr, otri) \
+- (otri).orient = (int) ((unsigned long) (ptr) & (unsigned long) 3l); \
++ (otri).orient = (int) ((uintptr_t) (ptr) & (uintptr_t) 3l); \
+ (otri).tri = (triangle *) \
+- ((unsigned long) (ptr) ^ (unsigned long) (otri).orient)
++ ((uintptr_t) (ptr) ^ (uintptr_t) (otri).orient)
+
+ /* encode() compresses an oriented triangle into a single pointer. It */
+ /* relies on the assumption that all triangles are aligned to four-byte */
+ /* boundaries, so the two least significant bits of (otri).tri are zero. */
+
+ #define encode(otri) \
+- (triangle) ((unsigned long) (otri).tri | (unsigned long) (otri).orient)
++ (triangle) ((uintptr_t) (otri).tri | (uintptr_t) (otri).orient)
+
+ /* The following handle manipulation primitives are all described by Guibas */
+ /* and Stolfi. However, Guibas and Stolfi use an edge-based data */
+@@ -1111,16 +1087,16 @@ int minus1mod3[3] = {2, 0, 1};
+
+ #define infect(otri) \
+ (otri).tri[6] = (triangle) \
+- ((unsigned long) (otri).tri[6] | (unsigned long) 2l)
++ ((uintptr_t) (otri).tri[6] | (uintptr_t) 2l)
+
+ #define uninfect(otri) \
+ (otri).tri[6] = (triangle) \
+- ((unsigned long) (otri).tri[6] & ~ (unsigned long) 2l)
++ ((uintptr_t) (otri).tri[6] & ~ (uintptr_t) 2l)
+
+ /* Test a triangle for viral infection. */
+
+ #define infected(otri) \
+- (((unsigned long) (otri).tri[6] & (unsigned long) 2l) != 0l)
++ (((uintptr_t) (otri).tri[6] & (uintptr_t) 2l) != 0l)
+
+ /* Check or set a triangle's attributes. */
+
+@@ -1158,16 +1134,16 @@ int minus1mod3[3] = {2, 0, 1};
+ /* are masked out to produce the real pointer. */
+
+ #define sdecode(sptr, osub) \
+- (osub).ssorient = (int) ((unsigned long) (sptr) & (unsigned long) 1l); \
++ (osub).ssorient = (int) ((uintptr_t) (sptr) & (uintptr_t) 1l); \
+ (osub).ss = (subseg *) \
+- ((unsigned long) (sptr) & ~ (unsigned long) 3l)
++ ((uintptr_t) (sptr) & ~ (uintptr_t) 3l)
+
+ /* sencode() compresses an oriented subsegment into a single pointer. It */
+ /* relies on the assumption that all subsegments are aligned to two-byte */
+ /* boundaries, so the least significant bit of (osub).ss is zero. */
+
+ #define sencode(osub) \
+- (subseg) ((unsigned long) (osub).ss | (unsigned long) (osub).ssorient)
++ (subseg) ((uintptr_t) (osub).ss | (uintptr_t) (osub).ssorient)
+
+ /* ssym() toggles the orientation of a subsegment. */
+
+@@ -3891,7 +3867,7 @@ struct memorypool *pool;
+ #endif /* not ANSI_DECLARATORS */
+
+ {
+- unsigned long alignptr;
++ uintptr_t alignptr = 0;
+
+ pool->items = 0;
+ pool->maxitems = 0;
+@@ -3899,11 +3875,11 @@ struct memorypool *pool;
+ /* Set the currently active block. */
+ pool->nowblock = pool->firstblock;
+ /* Find the first item in the pool. Increment by the size of (VOID *). */
+- alignptr = (unsigned long) (pool->nowblock + 1);
++ alignptr = (uintptr_t) (pool->nowblock + 1);
+ /* Align the item on an `alignbytes'-byte boundary. */
+ pool->nextitem = (VOID *)
+- (alignptr + (unsigned long) pool->alignbytes -
+- (alignptr % (unsigned long) pool->alignbytes));
++ (alignptr + (uintptr_t) pool->alignbytes -
++ (alignptr % (uintptr_t) pool->alignbytes));
+ /* There are lots of unallocated items left in this block. */
+ pool->unallocateditems = pool->itemsfirstblock;
+ /* The stack of deallocated items is empty. */
+@@ -4008,7 +3984,7 @@ struct memorypool *pool;
+ {
+ VOID *newitem;
+ VOID **newblock;
+- unsigned long alignptr;
++ uintptr_t alignptr = 0;
+
+ /* First check the linked list of dead items. If the list is not */
+ /* empty, allocate an item from the list rather than a fresh one. */
+@@ -4033,11 +4009,11 @@ struct memorypool *pool;
+ pool->nowblock = (VOID **) *(pool->nowblock);
+ /* Find the first item in the block. */
+ /* Increment by the size of (VOID *). */
+- alignptr = (unsigned long) (pool->nowblock + 1);
++ alignptr = (uintptr_t) (pool->nowblock + 1);
+ /* Align the item on an `alignbytes'-byte boundary. */
+ pool->nextitem = (VOID *)
+- (alignptr + (unsigned long) pool->alignbytes -
+- (alignptr % (unsigned long) pool->alignbytes));
++ (alignptr + (uintptr_t) pool->alignbytes -
++ (alignptr % (uintptr_t) pool->alignbytes));
+ /* There are lots of unallocated items left in this block. */
+ pool->unallocateditems = pool->itemsperblock;
+ }
+@@ -4092,16 +4068,16 @@ struct memorypool *pool;
+ #endif /* not ANSI_DECLARATORS */
+
+ {
+- unsigned long alignptr;
++ uintptr_t alignptr = 0;
+
+ /* Begin the traversal in the first block. */
+ pool->pathblock = pool->firstblock;
+ /* Find the first item in the block. Increment by the size of (VOID *). */
+- alignptr = (unsigned long) (pool->pathblock + 1);
++ alignptr = (uintptr_t) (pool->pathblock + 1);
+ /* Align with item on an `alignbytes'-byte boundary. */
+ pool->pathitem = (VOID *)
+- (alignptr + (unsigned long) pool->alignbytes -
+- (alignptr % (unsigned long) pool->alignbytes));
++ (alignptr + (uintptr_t) pool->alignbytes -
++ (alignptr % (uintptr_t) pool->alignbytes));
+ /* Set the number of items left in the current block. */
+ pool->pathitemsleft = pool->itemsfirstblock;
+ }
+@@ -4129,7 +4105,7 @@ struct memorypool *pool;
+
+ {
+ VOID *newitem;
+- unsigned long alignptr;
++ uintptr_t alignptr = 0;
+
+ /* Stop upon exhausting the list of items. */
+ if (pool->pathitem == pool->nextitem) {
+@@ -4141,11 +4117,11 @@ struct memorypool *pool;
+ /* Find the next block. */
+ pool->pathblock = (VOID **) *(pool->pathblock);
+ /* Find the first item in the block. Increment by the size of (VOID *). */
+- alignptr = (unsigned long) (pool->pathblock + 1);
++ alignptr = (uintptr_t) (pool->pathblock + 1);
+ /* Align with item on an `alignbytes'-byte boundary. */
+ pool->pathitem = (VOID *)
+- (alignptr + (unsigned long) pool->alignbytes -
+- (alignptr % (unsigned long) pool->alignbytes));
++ (alignptr + (uintptr_t) pool->alignbytes -
++ (alignptr % (uintptr_t) pool->alignbytes));
+ /* Set the number of items left in the current block. */
+ pool->pathitemsleft = pool->itemsperblock;
+ }
+@@ -4197,16 +4173,16 @@ int subsegbytes;
+ #endif /* not ANSI_DECLARATORS */
+
+ {
+- unsigned long alignptr;
++ uintptr_t alignptr = 0;
+
+ /* Set up `dummytri', the `triangle' that occupies "outer space." */
+ m->dummytribase = (triangle *) trimalloc(trianglebytes +
+ m->triangles.alignbytes);
+ /* Align `dummytri' on a `triangles.alignbytes'-byte boundary. */
+- alignptr = (unsigned long) m->dummytribase;
++ alignptr = (uintptr_t) m->dummytribase;
+ m->dummytri = (triangle *)
+- (alignptr + (unsigned long) m->triangles.alignbytes -
+- (alignptr % (unsigned long) m->triangles.alignbytes));
++ (alignptr + (uintptr_t) m->triangles.alignbytes -
++ (alignptr % (uintptr_t) m->triangles.alignbytes));
+ /* Initialize the three adjoining triangles to be "outer space." These */
+ /* will eventually be changed by various bonding operations, but their */
+ /* values don't really matter, as long as they can legally be */
+@@ -4226,10 +4202,10 @@ int subsegbytes;
+ m->dummysubbase = (subseg *) trimalloc(subsegbytes +
+ m->subsegs.alignbytes);
+ /* Align `dummysub' on a `subsegs.alignbytes'-byte boundary. */
+- alignptr = (unsigned long) m->dummysubbase;
++ alignptr = (uintptr_t) m->dummysubbase;
+ m->dummysub = (subseg *)
+- (alignptr + (unsigned long) m->subsegs.alignbytes -
+- (alignptr % (unsigned long) m->subsegs.alignbytes));
++ (alignptr + (uintptr_t) m->subsegs.alignbytes -
++ (alignptr % (uintptr_t) m->subsegs.alignbytes));
+ /* Initialize the two adjoining subsegments to be the omnipresent */
+ /* subsegment. These will eventually be changed by various bonding */
+ /* operations, but their values don't really matter, as long as they */
+@@ -4586,7 +4562,7 @@ int number;
+ {
+ VOID **getblock;
+ char *foundvertex;
+- unsigned long alignptr;
++ uintptr_t alignptr = 0;
+ int current;
+
+ getblock = m->vertices.firstblock;
+@@ -4603,9 +4579,9 @@ int number;
+ }
+
+ /* Now find the right vertex. */
+- alignptr = (unsigned long) (getblock + 1);
+- foundvertex = (char *) (alignptr + (unsigned long) m->vertices.alignbytes -
+- (alignptr % (unsigned long) m->vertices.alignbytes));
++ alignptr = (uintptr_t) (getblock + 1);
++ foundvertex = (char *) (alignptr + (uintptr_t) m->vertices.alignbytes -
++ (alignptr % (uintptr_t) m->vertices.alignbytes));
+ return (vertex) (foundvertex + m->vertices.itembytes * (number - current));
+ }
+
+@@ -4883,6 +4859,7 @@ struct osub *newsubseg;
+ /* */
+ /*****************************************************************************/
+
++static
+ void exactinit()
+ {
+ REAL half;
+@@ -4956,6 +4933,7 @@ void exactinit()
+ /* */
+ /*****************************************************************************/
+
++static
+ #ifdef ANSI_DECLARATORS
+ int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h)
+ #else /* not ANSI_DECLARATORS */
+@@ -5050,6 +5028,7 @@ REAL *h;
+ /* */
+ /*****************************************************************************/
+
++static
+ #ifdef ANSI_DECLARATORS
+ int scale_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h)
+ #else /* not ANSI_DECLARATORS */
+@@ -5106,6 +5085,7 @@ REAL *h;
+ /* */
+ /*****************************************************************************/
+
++static
+ #ifdef ANSI_DECLARATORS
+ REAL estimate(int elen, REAL *e)
+ #else /* not ANSI_DECLARATORS */
+@@ -5303,6 +5283,7 @@ vertex pc;
+ /* */
+ /*****************************************************************************/
+
++static
+ #ifdef ANSI_DECLARATORS
+ REAL incircleadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL permanent)
+ #else /* not ANSI_DECLARATORS */
+@@ -5882,6 +5863,7 @@ REAL permanent;
+ return finnow[finlength - 1];
+ }
+
++static
+ #ifdef ANSI_DECLARATORS
+ REAL incircle(struct mesh *m, struct behavior *b,
+ vertex pa, vertex pb, vertex pc, vertex pd)
+@@ -5964,6 +5946,7 @@ vertex pd;
+ /* */
+ /*****************************************************************************/
+
++static
+ #ifdef ANSI_DECLARATORS
+ REAL orient3dadapt(vertex pa, vertex pb, vertex pc, vertex pd,
+ REAL aheight, REAL bheight, REAL cheight, REAL dheight,
+@@ -6389,6 +6372,7 @@ REAL permanent;
+ return finnow[finlength - 1];
+ }
+
++static
+ #ifdef ANSI_DECLARATORS
+ REAL orient3d(struct mesh *m, struct behavior *b,
+ vertex pa, vertex pb, vertex pc, vertex pd,
+@@ -7649,7 +7633,7 @@ struct otri *searchtri;
+ char *firsttri;
+ struct otri sampletri;
+ vertex torg, tdest;
+- unsigned long alignptr;
++ uintptr_t alignptr = 0;
+ REAL searchdist, dist;
+ REAL ahead;
+ long samplesperblock, totalsamplesleft, samplesleft;
+@@ -7721,11 +7705,11 @@ struct otri *searchtri;
+ population = totalpopulation;
+ }
+ /* Find a pointer to the first triangle in the block. */
+- alignptr = (unsigned long) (sampleblock + 1);
++ alignptr = (uintptr_t) (sampleblock + 1);
+ firsttri = (char *) (alignptr +
+- (unsigned long) m->triangles.alignbytes -
++ (uintptr_t) m->triangles.alignbytes -
+ (alignptr %
+- (unsigned long) m->triangles.alignbytes));
++ (uintptr_t) m->triangles.alignbytes));
+
+ /* Choose `samplesleft' randomly sampled triangles in this block. */
+ do {
+diff --git a/triangle.h b/triangle.h
+index 9df1f39..8d9c754 100644
+--- a/triangle.h
++++ b/triangle.h
+@@ -248,16 +248,20 @@
+ /* */
+ /*****************************************************************************/
+
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ struct triangulateio {
+- REAL *pointlist; /* In / out */
+- REAL *pointattributelist; /* In / out */
++ double *pointlist; /* In / out */
++ double *pointattributelist; /* In / out */
+ int *pointmarkerlist; /* In / out */
+ int numberofpoints; /* In / out */
+ int numberofpointattributes; /* In / out */
+
+ int *trianglelist; /* In / out */
+- REAL *triangleattributelist; /* In / out */
+- REAL *trianglearealist; /* In only */
++ double *triangleattributelist; /* In / out */
++ double *trianglearealist; /* In only */
+ int *neighborlist; /* Out only */
+ int numberoftriangles; /* In / out */
+ int numberofcorners; /* In / out */
+@@ -267,23 +271,22 @@ struct triangulateio {
+ int *segmentmarkerlist; /* In / out */
+ int numberofsegments; /* In / out */
+
+- REAL *holelist; /* In / pointer to array copied out */
++ double *holelist; /* In / pointer to array copied out */
+ int numberofholes; /* In / copied out */
+
+- REAL *regionlist; /* In / pointer to array copied out */
++ double *regionlist; /* In / pointer to array copied out */
+ int numberofregions; /* In / copied out */
+
+ int *edgelist; /* Out only */
+ int *edgemarkerlist; /* Not used with Voronoi diagram; out only */
+- REAL *normlist; /* Used only with Voronoi diagram; out only */
++ double *normlist; /* Used only with Voronoi diagram; out only */
+ int numberofedges; /* Out only */
+ };
+
+-#ifdef ANSI_DECLARATORS
+ void triangulate(char *, struct triangulateio *, struct triangulateio *,
+ struct triangulateio *);
+-void trifree(VOID *memptr);
+-#else /* not ANSI_DECLARATORS */
+-void triangulate();
+-void trifree();
+-#endif /* not ANSI_DECLARATORS */
++void trifree(void *memptr);
++
++#ifdef __cplusplus
++}
++#endif
+\ No newline at end of file
diff --git a/vcpkg/ports/triangle/exports.def b/vcpkg/ports/triangle/exports.def
new file mode 100644
index 0000000..5c4ba32
--- /dev/null
+++ b/vcpkg/ports/triangle/exports.def
@@ -0,0 +1,3 @@
+EXPORTS
+ triangulate
+ trifree \ No newline at end of file
diff --git a/vcpkg/ports/triangle/portfile.cmake b/vcpkg/ports/triangle/portfile.cmake
new file mode 100644
index 0000000..630b2dd
--- /dev/null
+++ b/vcpkg/ports/triangle/portfile.cmake
@@ -0,0 +1,41 @@
+vcpkg_download_distfile(ARCHIVE_FILE
+ URLS "http://www.netlib.org/voronoi/triangle.zip"
+ FILENAME "triangle.zip"
+ SHA512 c9c1ac527c4bf836ed877b1c5495abf9fd2c453741f4c9698777e23cde939ebf0dd73c84cec64f35a93ca01bff4b86ce32ec559da33e570a0744a764e46d2186
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ NO_REMOVE_ONE_LEVEL
+ ARCHIVE "${ARCHIVE_FILE}"
+ PATCHES
+ "enable_64bit_architecture.patch"
+)
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/exports.def" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS options
+ FEATURES
+ tool BUILD_TOOL
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${options}
+ OPTIONS_DEBUG
+ -DBUILD_TOOL=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-triangle)
+
+# migration polyfill
+file(COPY "${CURRENT_PORT_DIR}/triangleConfig.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/triangle")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools")
+
+file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/triangle")
+file(INSTALL "${SOURCE_PATH}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/triangle/triangleConfig.cmake b/vcpkg/ports/triangle/triangleConfig.cmake
new file mode 100644
index 0000000..531d136
--- /dev/null
+++ b/vcpkg/ports/triangle/triangleConfig.cmake
@@ -0,0 +1,6 @@
+file(READ "${CMAKE_CURRENT_LIST_DIR}/usage" usage)
+message(WARNING "find_package(${CMAKE_FIND_PACKAGE_NAME}) is deprecated.\n${usage}")
+
+include(CMakeFindDependencyMacro)
+find_dependency(unofficial-triangle)
+add_library(triangleLib ALIAS unofficial::triangle::triangle)
diff --git a/vcpkg/ports/triangle/usage b/vcpkg/ports/triangle/usage
new file mode 100644
index 0000000..b065965
--- /dev/null
+++ b/vcpkg/ports/triangle/usage
@@ -0,0 +1,4 @@
+triangle provides CMake targets:
+
+ find_package(unofficial-triangle CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE unofficial::triangle::triangle)
diff --git a/vcpkg/ports/triangle/vcpkg.json b/vcpkg/ports/triangle/vcpkg.json
new file mode 100644
index 0000000..a4eaefa
--- /dev/null
+++ b/vcpkg/ports/triangle/vcpkg.json
@@ -0,0 +1,24 @@
+{
+ "name": "triangle",
+ "version": "1.6",
+ "port-version": 4,
+ "description": "A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator.",
+ "homepage": "http://www.cs.cmu.edu/~quake/triangle.html",
+ "license": null,
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "tool": {
+ "description": "Build the command line tool."
+ }
+ }
+}