Skip to content

Commit

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

* [cdt] Fix version type

* [cdt] Fix boost feature

* [cdt] Add boost-link.patch
  • Loading branch information
ex-purple authored Mar 28, 2023
1 parent e85355f commit 9126276
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ports/cdt/boost-link.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CDT/CMakeLists.txt b/CDT/CMakeLists.txt
index 555fb4e..86be850 100644
--- a/CDT/CMakeLists.txt
+++ b/CDT/CMakeLists.txt
@@ -155,7 +155,7 @@ target_compile_definitions(
)

if(CDT_USE_BOOST)
- target_link_libraries(${PROJECT_NAME} INTERFACE Boost::boost)
+ target_link_libraries(${PROJECT_NAME} PUBLIC Boost::boost)
endif()


44 changes: 44 additions & 0 deletions ports/cdt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO artem-ogre/CDT
REF "${VERSION}"
SHA512 811d1fede4960808954bc17f37c8639f52800c98562e9283517c666735ddf3b2f2f8a57992669899be13c40b0fc4439d3cd1a101cb596d2335ef4fc307408c63
HEAD_REF master
PATCHES
boost-link.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"64-bit-index-type" CDT_USE_64_BIT_INDEX_TYPE
"as-compiled-library" CDT_USE_AS_COMPILED_LIBRARY
"boost" CDT_USE_BOOST
)

if (NOT CDT_USE_AS_COMPILED_LIBRARY)
set(VCPKG_BUILD_TYPE "release") # header-only
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/CDT"
OPTIONS
${FEATURE_OPTIONS}
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)

if(CDT_USE_BOOST)
set(CDT_USE_BOOST_STR "#if 1")
else()
set(CDT_USE_BOOST_STR "#if 0")
endif()
foreach(FILE CDTUtils.h Triangulation.hpp)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/${FILE}" "#ifdef CDT_USE_BOOST" "${CDT_USE_BOOST_STR}")
endforeach()

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

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
31 changes: 31 additions & 0 deletions ports/cdt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "cdt",
"version": "1.2.0",
"description": "Constrained Delaunay Triangulation",
"homepage": "https://github.com/artem-ogre/CDT.git",
"license": "MPL-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"64-bit-index-type": {
"description": "64bits are used to store vertex/triangle index types"
},
"as-compiled-library": {
"description": "Templates for float and double will be instantiated and compiled into a library"
},
"boost": {
"description": "Boost is used as a fall-back for features missing in C++98 and performance tweaks",
"dependencies": [
"boost-container"
]
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,10 @@
"baseline": "2.3",
"port-version": 4
},
"cdt": {
"baseline": "1.2.0",
"port-version": 0
},
"celero": {
"baseline": "2.8.5",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/c-/cdt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "d04985a703ae8b9201876879003d44c84f719a3a",
"version": "1.2.0",
"port-version": 0
}
]
}

0 comments on commit 9126276

Please sign in to comment.