Skip to content

Commit

Permalink
[clipper2] Add new port (#29303)
Browse files Browse the repository at this point in the history
* [clipper2] Add new port

* [clipper2] Add usage. Static-only for windows

* [clipper2] Update hash
  • Loading branch information
ex-purple committed Feb 3, 2023
1 parent ff666f8 commit bb9766f
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ports/clipper2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO AngusJohnson/Clipper2
REF "Clipper2_${VERSION}"
SHA512 e996ef8a2ec412189f0ba95a6f200c0818f9755930b05cd20b630d33760dec619c6a735ac056f5dfbaccf793bf6ebeb7b6c102fd9ff83b0d297a4d660389d8d9
HEAD_REF main
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/CPP"
OPTIONS
-DCLIPPER2_EXAMPLES=OFF
-DCLIPPER2_TESTS=OFF
-DCLIPPER2_UTILS=OFF
)
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
12 changes: 12 additions & 0 deletions ports/clipper2/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The package clipper2 can be imported via CMake FindPkgConfig module:

# Clipper2
find_package(PkgConfig REQUIRED)
pkg_check_modules(Clipper2 REQUIRED IMPORTED_TARGET Clipper2)
target_link_libraries(main PkgConfig::Clipper2)

# Clipper2Z
find_package(PkgConfig REQUIRED)
pkg_check_modules(Clipper2Z REQUIRED IMPORTED_TARGET Clipper2Z)
target_link_libraries(main PkgConfig::Clipper2Z)

13 changes: 13 additions & 0 deletions ports/clipper2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "clipper2",
"version": "1.1.1",
"description": "Polygon Clipping and Offsetting",
"homepage": "http://www.angusj.com/clipper2",
"license": "BSL-1.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,10 @@
"baseline": "2019-04-30",
"port-version": 2
},
"clipper2": {
"baseline": "1.1.1",
"port-version": 0
},
"clockutils": {
"baseline": "1.1.1",
"port-version": 1
Expand Down
9 changes: 9 additions & 0 deletions versions/c-/clipper2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "3768ef634c9d40c4bb981380ed16756c16eab600",
"version": "1.1.1",
"port-version": 0
}
]
}

0 comments on commit bb9766f

Please sign in to comment.