aboutsummaryrefslogtreecommitdiff
path: root/ports/poly2tri
diff options
context:
space:
mode:
authorras0219 <533828+ras0219@users.noreply.github.com>2020-09-09 20:40:15 -0700
committerGitHub <noreply@github.com>2020-09-09 20:40:15 -0700
commitf6df03b4a819bf78bc0cdf8b2369ffffc44cd894 (patch)
treeae3b16c8082f8202e9a01004e4b17cfdcfd52658 /ports/poly2tri
parent32b6c3a134022db7b985ed5f7d1f2ff13a96a140 (diff)
downloadvcpkg-f6df03b4a819bf78bc0cdf8b2369ffffc44cd894.tar.gz
vcpkg-f6df03b4a819bf78bc0cdf8b2369ffffc44cd894.zip
[assimp][irrxml][kubazip][poly2tri][polyclipping] Extract vendored dependencies (#13264)
* [assimp] Fix -config.cmake files * [assimp] Fix linux build and provide backwards-compatible alias * [assimp][irrxml][kubazip][poly2tri][polyclipping] Extract vendored dependencies * [assimp] Use find_dependency(); add ZLIB dependency * [polyclipping] Do not suffix upstream binaries Co-authored-by: Robert Schumacher <roschuma@microsoft.com> Co-authored-by: Stefano Sinigardi <stesinigardi@hotmail.com>
Diffstat (limited to 'ports/poly2tri')
-rw-r--r--ports/poly2tri/CMakeLists.txt57
-rw-r--r--ports/poly2tri/CONTROL5
-rw-r--r--ports/poly2tri/portfile.cmake26
3 files changed, 88 insertions, 0 deletions
diff --git a/ports/poly2tri/CMakeLists.txt b/ports/poly2tri/CMakeLists.txt
new file mode 100644
index 000000000..d3878712a
--- /dev/null
+++ b/ports/poly2tri/CMakeLists.txt
@@ -0,0 +1,57 @@
+cmake_minimum_required(VERSION 3.0)
+
+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}"
+)
diff --git a/ports/poly2tri/CONTROL b/ports/poly2tri/CONTROL
new file mode 100644
index 000000000..21ed149e3
--- /dev/null
+++ b/ports/poly2tri/CONTROL
@@ -0,0 +1,5 @@
+Source: poly2tri
+Version: 2020-07-21
+Homepage: https://github.com/greenm01/poly2tri
+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.
+Supports: !uwp
diff --git a/ports/poly2tri/portfile.cmake b/ports/poly2tri/portfile.cmake
new file mode 100644
index 000000000..278e3d8ee
--- /dev/null
+++ b/ports/poly2tri/portfile.cmake
@@ -0,0 +1,26 @@
+vcpkg_fail_port_install(ON_TARGET "uwp")
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO greenm01/poly2tri
+ REF 88de49021b6d9bef6faa1bc94ceb3fbd85c3c204
+ SHA512 fa256bcf923ad59f42205edf5a7e07cac6cbd9a37cefb9a0961a2e06aea7fa8ffd09d4e26154c0028601c12804483842cb935d9f602385f5f203c9628382c4fb
+ HEAD_REF master
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets()
+
+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)