diff options
Diffstat (limited to 'vcpkg/ports/jhasse-poly2tri')
| -rw-r--r-- | vcpkg/ports/jhasse-poly2tri/cmake.patch | 56 | ||||
| -rw-r--r-- | vcpkg/ports/jhasse-poly2tri/portfile.cmake | 22 | ||||
| -rw-r--r-- | vcpkg/ports/jhasse-poly2tri/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/jhasse-poly2tri/vcpkg.json | 18 |
4 files changed, 100 insertions, 0 deletions
diff --git a/vcpkg/ports/jhasse-poly2tri/cmake.patch b/vcpkg/ports/jhasse-poly2tri/cmake.patch new file mode 100644 index 0000000..22e0605 --- /dev/null +++ b/vcpkg/ports/jhasse-poly2tri/cmake.patch @@ -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}" ++) diff --git a/vcpkg/ports/jhasse-poly2tri/portfile.cmake b/vcpkg/ports/jhasse-poly2tri/portfile.cmake new file mode 100644 index 0000000..b9f1853 --- /dev/null +++ b/vcpkg/ports/jhasse-poly2tri/portfile.cmake @@ -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}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/jhasse-poly2tri/usage b/vcpkg/ports/jhasse-poly2tri/usage new file mode 100644 index 0000000..80497d2 --- /dev/null +++ b/vcpkg/ports/jhasse-poly2tri/usage @@ -0,0 +1,4 @@ +jhasse-poly2tri provides CMake targets: + + find_package(poly2tri CONFIG REQUIRED) + target_link_libraries(main PRIVATE poly2tri::poly2tri) diff --git a/vcpkg/ports/jhasse-poly2tri/vcpkg.json b/vcpkg/ports/jhasse-poly2tri/vcpkg.json new file mode 100644 index 0000000..ac71935 --- /dev/null +++ b/vcpkg/ports/jhasse-poly2tri/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "jhasse-poly2tri", + "version-date": "2023-12-27", + "port-version": 2, + "description": "Sweep-line algorithm for constrained Delaunay triangulation", + "homepage": "https://github.com/jhasse/poly2tri", + "license": "BSD-3-Clause", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |