From 74ece24bf30c04f28efbddc9c79944cb3a9b3078 Mon Sep 17 00:00:00 2001 From: Andrew Kornilov Date: Tue, 31 Jan 2023 15:21:52 +0300 Subject: [PATCH 1/4] [cdt] Add new port --- ports/cdt/portfile.cmake | 33 +++++++++++++++++++++++++++++++++ ports/cdt/vcpkg.json | 28 ++++++++++++++++++++++++++++ versions/baseline.json | 4 ++++ versions/c-/cdt.json | 9 +++++++++ 4 files changed, 74 insertions(+) create mode 100644 ports/cdt/portfile.cmake create mode 100644 ports/cdt/vcpkg.json create mode 100644 versions/c-/cdt.json diff --git a/ports/cdt/portfile.cmake b/ports/cdt/portfile.cmake new file mode 100644 index 00000000000000..4a41ae63d8b39f --- /dev/null +++ b/ports/cdt/portfile.cmake @@ -0,0 +1,33 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO artem-ogre/CDT + REF "${VERSION}" + SHA512 811d1fede4960808954bc17f37c8639f52800c98562e9283517c666735ddf3b2f2f8a57992669899be13c40b0fc4439d3cd1a101cb596d2335ef4fc307408c63 + HEAD_REF master +) + +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_AS_COMPILED_LIBRARY) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/cdt/vcpkg.json b/ports/cdt/vcpkg.json new file mode 100644 index 00000000000000..b5cfff044642d4 --- /dev/null +++ b/ports/cdt/vcpkg.json @@ -0,0 +1,28 @@ +{ + "name": "cdt", + "version-semver": "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" + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 1bda4f83223174..f292499210b3e9 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1356,6 +1356,10 @@ "baseline": "2.3", "port-version": 3 }, + "cdt": { + "baseline": "1.2.0", + "port-version": 0 + }, "celero": { "baseline": "2.8.5", "port-version": 0 diff --git a/versions/c-/cdt.json b/versions/c-/cdt.json new file mode 100644 index 00000000000000..8ef50059a1914b --- /dev/null +++ b/versions/c-/cdt.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "217d25a0d73031841511158354a6162f61fb964e", + "version-semver": "1.2.0", + "port-version": 0 + } + ] +} From 6ceb00033ddaaaa8fbf2d48f96e14ab801237117 Mon Sep 17 00:00:00 2001 From: Andrew Kornilov Date: Wed, 1 Feb 2023 12:43:13 +0300 Subject: [PATCH 2/4] [cdt] Fix version type --- ports/cdt/vcpkg.json | 2 +- versions/c-/cdt.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/cdt/vcpkg.json b/ports/cdt/vcpkg.json index b5cfff044642d4..2b7139205ae102 100644 --- a/ports/cdt/vcpkg.json +++ b/ports/cdt/vcpkg.json @@ -1,6 +1,6 @@ { "name": "cdt", - "version-semver": "1.2.0", + "version": "1.2.0", "description": "Constrained Delaunay Triangulation", "homepage": "https://github.com/artem-ogre/CDT.git", "license": "MPL-2.0", diff --git a/versions/c-/cdt.json b/versions/c-/cdt.json index 8ef50059a1914b..5cdc1dbb9db3db 100644 --- a/versions/c-/cdt.json +++ b/versions/c-/cdt.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "217d25a0d73031841511158354a6162f61fb964e", - "version-semver": "1.2.0", + "git-tree": "6c5e64273872865966ab48229f73fe9b69be0dc1", + "version": "1.2.0", "port-version": 0 } ] From 11da2f002fc595bf6574411edf2b9e80cee3015a Mon Sep 17 00:00:00 2001 From: Andrew Kornilov Date: Wed, 15 Feb 2023 22:25:08 +0300 Subject: [PATCH 3/4] [cdt] Fix boost feature --- ports/cdt/portfile.cmake | 9 +++++++++ ports/cdt/vcpkg.json | 5 ++++- versions/c-/cdt.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ports/cdt/portfile.cmake b/ports/cdt/portfile.cmake index 4a41ae63d8b39f..51633a64bb17df 100644 --- a/ports/cdt/portfile.cmake +++ b/ports/cdt/portfile.cmake @@ -26,6 +26,15 @@ vcpkg_cmake_configure( 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() diff --git a/ports/cdt/vcpkg.json b/ports/cdt/vcpkg.json index 2b7139205ae102..64992773672566 100644 --- a/ports/cdt/vcpkg.json +++ b/ports/cdt/vcpkg.json @@ -22,7 +22,10 @@ "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" + "description": "Boost is used as a fall-back for features missing in C++98 and performance tweaks", + "dependencies": [ + "boost-container" + ] } } } diff --git a/versions/c-/cdt.json b/versions/c-/cdt.json index 5cdc1dbb9db3db..153fc32e28dd9e 100644 --- a/versions/c-/cdt.json +++ b/versions/c-/cdt.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "6c5e64273872865966ab48229f73fe9b69be0dc1", + "git-tree": "002b5841cd0600e2104188e9c6d2f27b74caab1a", "version": "1.2.0", "port-version": 0 } From 85eee7cf9ee7440ac880edc094a87023d08bc488 Mon Sep 17 00:00:00 2001 From: Andrew Kornilov Date: Thu, 2 Mar 2023 21:04:14 +0300 Subject: [PATCH 4/4] [cdt] Add boost-link.patch --- ports/cdt/boost-link.patch | 13 +++++++++++++ ports/cdt/portfile.cmake | 2 ++ versions/c-/cdt.json | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ports/cdt/boost-link.patch diff --git a/ports/cdt/boost-link.patch b/ports/cdt/boost-link.patch new file mode 100644 index 00000000000000..41bcb10a06e499 --- /dev/null +++ b/ports/cdt/boost-link.patch @@ -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() + + diff --git a/ports/cdt/portfile.cmake b/ports/cdt/portfile.cmake index 51633a64bb17df..43014fd8ef47d2 100644 --- a/ports/cdt/portfile.cmake +++ b/ports/cdt/portfile.cmake @@ -4,6 +4,8 @@ vcpkg_from_github( REF "${VERSION}" SHA512 811d1fede4960808954bc17f37c8639f52800c98562e9283517c666735ddf3b2f2f8a57992669899be13c40b0fc4439d3cd1a101cb596d2335ef4fc307408c63 HEAD_REF master + PATCHES + boost-link.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/versions/c-/cdt.json b/versions/c-/cdt.json index 153fc32e28dd9e..8d6479fc3d23a9 100644 --- a/versions/c-/cdt.json +++ b/versions/c-/cdt.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "002b5841cd0600e2104188e9c6d2f27b74caab1a", + "git-tree": "d04985a703ae8b9201876879003d44c84f719a3a", "version": "1.2.0", "port-version": 0 }