diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/qhull | |
Diffstat (limited to 'vcpkg/ports/qhull')
| -rw-r--r-- | vcpkg/ports/qhull/fix-missing-symbols.patch | 29 | ||||
| -rw-r--r-- | vcpkg/ports/qhull/fix-qhullcpp-cpp20-support.patch | 93 | ||||
| -rw-r--r-- | vcpkg/ports/qhull/include-qhullcpp-shared.patch | 26 | ||||
| -rw-r--r-- | vcpkg/ports/qhull/noapp.patch | 266 | ||||
| -rw-r--r-- | vcpkg/ports/qhull/portfile.cmake | 77 | ||||
| -rw-r--r-- | vcpkg/ports/qhull/usage | 9 | ||||
| -rw-r--r-- | vcpkg/ports/qhull/vcpkg.json | 23 |
7 files changed, 523 insertions, 0 deletions
diff --git a/vcpkg/ports/qhull/fix-missing-symbols.patch b/vcpkg/ports/qhull/fix-missing-symbols.patch new file mode 100644 index 0000000..a1e0b6e --- /dev/null +++ b/vcpkg/ports/qhull/fix-missing-symbols.patch @@ -0,0 +1,29 @@ +From 02ba907908ccf5ed0d40a2251272b67cb05c23ea Mon Sep 17 00:00:00 2001 +From: Francisco Facioni <fran6co@gmail.com> +Date: Sat, 31 Jul 2021 22:30:45 +0100 +Subject: [PATCH] Missing symbols in the export + +--- + src/libqhull_r/qhull_r-exports.def | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/libqhull_r/qhull_r-exports.def b/src/libqhull_r/qhull_r-exports.def +index 4c5e17c..b789673 100644 +--- a/src/libqhull_r/qhull_r-exports.def ++++ b/src/libqhull_r/qhull_r-exports.def +@@ -183,6 +183,7 @@ qh_maxouter + qh_maxsimplex + qh_maydropneighbor + qh_memalloc ++qh_memcheck + qh_memfree + qh_memfreeshort + qh_meminit +@@ -351,6 +352,7 @@ qh_setdelnth + qh_setdelnthsorted + qh_setdelsorted + qh_setduplicate ++qh_setendpointer + qh_setequal + qh_setequal_except + qh_setequal_skip diff --git a/vcpkg/ports/qhull/fix-qhullcpp-cpp20-support.patch b/vcpkg/ports/qhull/fix-qhullcpp-cpp20-support.patch new file mode 100644 index 0000000..1c30e60 --- /dev/null +++ b/vcpkg/ports/qhull/fix-qhullcpp-cpp20-support.patch @@ -0,0 +1,93 @@ +From bdd99371b995e02d6b39acc93221c477aafd284a Mon Sep 17 00:00:00 2001 +From: Jeremy Nimmer <jeremy.nimmer@tri.global> +Date: Thu, 22 Sep 2022 17:39:19 -0700 +Subject: [PATCH] Fix build errors when in C++20 mode + +--- + src/libqhullcpp/QhullLinkedList.h | 12 +++++++----- + src/libqhullcpp/QhullSet.h | 22 +++++++++++----------- + 2 files changed, 18 insertions(+), 16 deletions(-) + +diff --git a/src/libqhullcpp/QhullLinkedList.h b/src/libqhullcpp/QhullLinkedList.h +index 9f145ee..7c7104d 100644 +--- a/src/libqhullcpp/QhullLinkedList.h ++++ b/src/libqhullcpp/QhullLinkedList.h +@@ -62,16 +62,18 @@ private: + + #//!\name Constructors + public: +- QhullLinkedList<T>(T b, T e) : begin_node(b), end_node(e) {} ++ ++ QhullLinkedList(T b, T e) : begin_node(b), end_node(e) {} + //! Copy constructor copies begin_node and end_node, but not the list elements. Needed for return by value and parameter passing. +- QhullLinkedList<T>(const QhullLinkedList<T> &other) : begin_node(other.begin_node), end_node(other.end_node) {} ++ ++ QhullLinkedList(const QhullLinkedList<T> &other) : begin_node(other.begin_node), end_node(other.end_node) {} + //! Copy assignment copies begin_node and end_node, but not the list elements. +- QhullLinkedList<T> & operator=(const QhullLinkedList<T> &other) { begin_node= other.begin_node; end_node= other.end_node; return *this; } +- ~QhullLinkedList<T>() {} ++ QhullLinkedList & operator=(const QhullLinkedList &other) { begin_node= other.begin_node; end_node= other.end_node; return *this; } ++ ~QhullLinkedList() {} + + private: + //!disabled since a sentinel must be allocated as the private type +- QhullLinkedList<T>() {} ++ QhullLinkedList() {} + + public: + +diff --git a/src/libqhullcpp/QhullSet.h b/src/libqhullcpp/QhullSet.h +index f6b248a..803e703 100644 +--- a/src/libqhullcpp/QhullSet.h ++++ b/src/libqhullcpp/QhullSet.h +@@ -110,17 +110,17 @@ public: + typedef typename QhullSet<T>::const_iterator ConstIterator; + + #//!\name Constructors +- QhullSet<T>(const Qhull &q, setT *s) : QhullSetBase(q, s) { } +- QhullSet<T>(QhullQh *qqh, setT *s) : QhullSetBase(qqh, s) { } ++ QhullSet(const Qhull &q, setT *s) : QhullSetBase(q, s) { } ++ QhullSet(QhullQh *qqh, setT *s) : QhullSetBase(qqh, s) { } + //Conversion from setT* is not type-safe. Implicit conversion for void* to T + //Copy constructor copies pointer but not contents. Needed for return by value. +- QhullSet<T>(const QhullSet<T> &other) : QhullSetBase(other) {} +- QhullSet<T> & operator=(const QhullSet<T> &other) { QhullSetBase::operator=(other); return *this; } +- ~QhullSet<T>() {} ++ QhullSet(const QhullSet &other) : QhullSetBase(other) {} ++ QhullSet<T> & operator=(const QhullSet &other) { QhullSetBase::operator=(other); return *this; } ++ ~QhullSet() {} + + private: + //!Disable default constructor. See QhullSetBase +- QhullSet<T>(); ++ QhullSet(); + public: + + #//!\name Conversion +@@ -136,8 +136,8 @@ public: + using QhullSetBase::count; + using QhullSetBase::isEmpty; + // operator== defined for QhullSets of the same type +- bool operator==(const QhullSet<T> &other) const { return qh_setequal(getSetT(), other.getSetT()); } +- bool operator!=(const QhullSet<T> &other) const { return !operator==(other); } ++ bool operator==(const QhullSet &other) const { return qh_setequal(getSetT(), other.getSetT()); } ++ bool operator!=(const QhullSet &other) const { return !operator==(other); } + + #//!\name Element access + // Constructs T. Cannot return reference. +@@ -294,9 +294,9 @@ private: + + public: + #//!\name Constructors +- QhullSetIterator<T>(const QhullSet<T> &s) : i(s.data()), begin_i(i), end_i(s.endData()), qh_qh(s.qh()) {} +- QhullSetIterator<T>(const QhullSetIterator<T> &o) : i(o.i), begin_i(o.begin_i), end_i(o.end_i), qh_qh(o.qh_qh) {} +- QhullSetIterator<T> &operator=(const QhullSetIterator<T> &o) { i= o.i; begin_i= o.begin_i; end_i= o.end_i; qh_qh= o.qh_qh; return *this; } ++ QhullSetIterator(const QhullSet<T> &s) : i(s.data()), begin_i(i), end_i(s.endData()), qh_qh(s.qh()) {} ++ QhullSetIterator(const QhullSetIterator<T> &o) : i(o.i), begin_i(o.begin_i), end_i(o.end_i), qh_qh(o.qh_qh) {} ++ QhullSetIterator &operator=(const QhullSetIterator &o) { i= o.i; begin_i= o.begin_i; end_i= o.end_i; qh_qh= o.qh_qh; return *this; } + + #//!\name ReadOnly + countT countRemaining() { return static_cast<countT>(end_i-i); } // WARN64 +-- +2.44.0 + diff --git a/vcpkg/ports/qhull/include-qhullcpp-shared.patch b/vcpkg/ports/qhull/include-qhullcpp-shared.patch new file mode 100644 index 0000000..f38a8e1 --- /dev/null +++ b/vcpkg/ports/qhull/include-qhullcpp-shared.patch @@ -0,0 +1,26 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f50b187..30109b3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -71,3 +71,3 @@ cmake_minimum_required(VERSION 3.0)
+ project(qhull)
+-cmake_minimum_required(VERSION 3.0)
++cmake_minimum_required(VERSION 3.5..4.0)
+
+@@ -344,7 +344,7 @@ set(qhull_SHAREDP qhull_p) # libqhull and qhull_p are deprecated, use qhull_r i
+
+ set(qhull_TARGETS_APPLICATIONS qhull rbox qconvex qdelaunay qvoronoi qhalf)
+ set(qhull_TARGETS_STATIC ${qhull_CPP} ${qhull_STATIC} ${qhull_STATICR})
+-set(qhull_TARGETS_SHARED ${qhull_SHAREDR})
++set(qhull_TARGETS_SHARED ${qhull_CPP} ${qhull_SHAREDR})
+
+ set(
+ qhull_TARGETS_TEST # Unused
+@@ -474,7 +474,6 @@ set_target_properties(${qhull_CPP} PROPERTIES
+ if(NOT ${BUILD_STATIC_LIBS})
+ set_target_properties(${qhull_STATIC} PROPERTIES EXCLUDE_FROM_ALL TRUE)
+ set_target_properties(${qhull_STATICR} PROPERTIES EXCLUDE_FROM_ALL TRUE)
+- set_target_properties(${qhull_CPP} PROPERTIES EXCLUDE_FROM_ALL TRUE)
+ endif()
+ if(NOT ${BUILD_SHARED_LIBS})
+ set_target_properties(${qhull_SHARED} PROPERTIES EXCLUDE_FROM_ALL TRUE)
diff --git a/vcpkg/ports/qhull/noapp.patch b/vcpkg/ports/qhull/noapp.patch new file mode 100644 index 0000000..9132bee --- /dev/null +++ b/vcpkg/ports/qhull/noapp.patch @@ -0,0 +1,266 @@ +diff -Naur b/CMakeLists.txt ff11b5d37d-0697029c1a.clean/CMakeLists.txt +--- b/CMakeLists.txt 2022-10-17 10:07:06.000000000 +0200 ++++ ff11b5d37d-0697029c1a.clean/CMakeLists.txt 2022-10-17 10:08:40.000000000 +0200 +@@ -113,6 +113,7 @@ + "BUILD_SHARED_LIBS;BUILD_STATIC_LIBS" + ${BUILD_SHARED_LIBS} + ) ++option(BUILD_APPLICATIONS "Build applications" ON) + + if(INCLUDE_INSTALL_DIR) + else() +@@ -517,131 +518,133 @@ + # If LINK_APPS_SHARED, applications are linked to reentrant qhull + # --------------------------------------- + +-if(${LINK_APPS_SHARED}) +- add_executable(qconvex src/qconvex/qconvex_r.c) +- target_link_libraries(qconvex ${qhull_SHAREDR}) +- set_target_properties(qconvex PROPERTIES +- COMPILE_DEFINITIONS "${qconvex_DEFINES}") +- +- add_executable(qdelaunay src/qdelaunay/qdelaun_r.c) +- target_link_libraries(qdelaunay ${qhull_SHAREDR}) +- set_target_properties(qdelaunay PROPERTIES +- COMPILE_DEFINITIONS "${qdelaunay_DEFINES}") +- +- add_executable(qhalf src/qhalf/qhalf_r.c) +- target_link_libraries(qhalf ${qhull_SHAREDR}) +- set_target_properties(qhalf PROPERTIES +- COMPILE_DEFINITIONS "${qhalf_DEFINES}") +- +- add_executable(qhull src/qhull/unix_r.c) +- target_link_libraries(qhull ${qhull_SHAREDR}) +- set_target_properties(qhull PROPERTIES +- COMPILE_DEFINITIONS "${qhull_DEFINES}") +- +- add_executable(qvoronoi src/qvoronoi/qvoronoi_r.c) +- target_link_libraries(qvoronoi ${qhull_SHAREDR}) +- set_target_properties(qvoronoi PROPERTIES +- COMPILE_DEFINITIONS "${qvoronoi_DEFINES}") +- +- add_executable(rbox src/rbox/rbox_r.c) +- target_link_libraries(rbox ${qhull_SHAREDR}) +- set_target_properties(rbox PROPERTIES +- COMPILE_DEFINITIONS "${rbox_DEFINES}") +-else() +- if(NOT ${BUILD_STATIC_LIBS}) +- message(FATAL_ERROR, " Nothing to build -- BUILD_SHARED_LIBS=OFF and BUILD_STATIC_LIBS=OFF") +- endif() +- +- add_executable(qconvex src/qconvex/qconvex.c) +- target_link_libraries(qconvex ${qhull_STATIC}) +- +- add_executable(qdelaunay src/qdelaunay/qdelaun.c) +- target_link_libraries(qdelaunay ${qhull_STATIC}) +- +- add_executable(qhalf src/qhalf/qhalf.c) +- target_link_libraries(qhalf ${qhull_STATIC}) ++if(BUILD_APPLICATIONS) ++ if(${LINK_APPS_SHARED}) ++ add_executable(qconvex src/qconvex/qconvex_r.c) ++ target_link_libraries(qconvex ${qhull_SHAREDR}) ++ set_target_properties(qconvex PROPERTIES ++ COMPILE_DEFINITIONS "${qconvex_DEFINES}") ++ ++ add_executable(qdelaunay src/qdelaunay/qdelaun_r.c) ++ target_link_libraries(qdelaunay ${qhull_SHAREDR}) ++ set_target_properties(qdelaunay PROPERTIES ++ COMPILE_DEFINITIONS "${qdelaunay_DEFINES}") ++ ++ add_executable(qhalf src/qhalf/qhalf_r.c) ++ target_link_libraries(qhalf ${qhull_SHAREDR}) ++ set_target_properties(qhalf PROPERTIES ++ COMPILE_DEFINITIONS "${qhalf_DEFINES}") ++ ++ add_executable(qhull src/qhull/unix_r.c) ++ target_link_libraries(qhull ${qhull_SHAREDR}) ++ set_target_properties(qhull PROPERTIES ++ COMPILE_DEFINITIONS "${qhull_DEFINES}") ++ ++ add_executable(qvoronoi src/qvoronoi/qvoronoi_r.c) ++ target_link_libraries(qvoronoi ${qhull_SHAREDR}) ++ set_target_properties(qvoronoi PROPERTIES ++ COMPILE_DEFINITIONS "${qvoronoi_DEFINES}") ++ ++ add_executable(rbox src/rbox/rbox_r.c) ++ target_link_libraries(rbox ${qhull_SHAREDR}) ++ set_target_properties(rbox PROPERTIES ++ COMPILE_DEFINITIONS "${rbox_DEFINES}") ++ else() ++ if(NOT ${BUILD_STATIC_LIBS}) ++ message(FATAL_ERROR, " Nothing to build -- BUILD_SHARED_LIBS=OFF and BUILD_STATIC_LIBS=OFF") ++ endif() + +- add_executable(qhull src/qhull/unix_r.c) +- target_link_libraries(qhull ${qhull_STATICR}) ++ add_executable(qconvex src/qconvex/qconvex.c) ++ target_link_libraries(qconvex ${qhull_STATIC}) + +- add_executable(qvoronoi src/qvoronoi/qvoronoi.c) +- target_link_libraries(qvoronoi ${qhull_STATIC}) ++ add_executable(qdelaunay src/qdelaunay/qdelaun.c) ++ target_link_libraries(qdelaunay ${qhull_STATIC}) + +- add_executable(rbox src/rbox/rbox.c) +- target_link_libraries(rbox ${qhull_STATIC}) +-endif() ++ add_executable(qhalf src/qhalf/qhalf.c) ++ target_link_libraries(qhalf ${qhull_STATIC}) + +-# #@# 20 +-# --------------------------------------- +-# Define testqset linked to qset.o, mem.o, and usermem.o +-# Define testqset_r linked to qset_r.o, mem_r.o, and usermem.o +-# --------------------------------------- ++ add_executable(qhull src/qhull/unix_r.c) ++ target_link_libraries(qhull ${qhull_STATICR}) + +-add_executable(testqset ${testqset_SOURCES}) +-add_executable(testqset_r ${testqsetr_SOURCES}) ++ add_executable(qvoronoi src/qvoronoi/qvoronoi.c) ++ target_link_libraries(qvoronoi ${qhull_STATIC}) + +-# --------------------------------------- +-# Define user_eg linked to reentrant qhull shared library +-# --------------------------------------- +- +-add_executable(user_eg src/user_eg/user_eg_r.c) ++ add_executable(rbox src/rbox/rbox.c) ++ target_link_libraries(rbox ${qhull_STATIC}) ++ endif() + +-if(${BUILD_SHARED_LIBS}) +- target_link_libraries(user_eg ${qhull_SHAREDR}) +- set_target_properties(user_eg PROPERTIES +- COMPILE_DEFINITIONS "${user_eg_DEFINES}") +-else() +- target_link_libraries(user_eg ${qhull_STATICR}) +-endif() ++ # #@# 20 ++ # --------------------------------------- ++ # Define testqset linked to qset.o, mem.o, and usermem.o ++ # Define testqset_r linked to qset_r.o, mem_r.o, and usermem.o ++ # --------------------------------------- ++ ++ add_executable(testqset ${testqset_SOURCES}) ++ add_executable(testqset_r ${testqsetr_SOURCES}) ++ ++ # --------------------------------------- ++ # Define user_eg linked to reentrant qhull shared library ++ # --------------------------------------- ++ ++ add_executable(user_eg src/user_eg/user_eg_r.c) ++ ++ if(${BUILD_SHARED_LIBS}) ++ target_link_libraries(user_eg ${qhull_SHAREDR}) ++ set_target_properties(user_eg PROPERTIES ++ COMPILE_DEFINITIONS "${user_eg_DEFINES}") ++ else() ++ target_link_libraries(user_eg ${qhull_STATICR}) ++ endif() + +-# --------------------------------------- +-# Define user_eg2 linked to reentrant qhull static library +-# --------------------------------------- ++ # --------------------------------------- ++ # Define user_eg2 linked to reentrant qhull static library ++ # --------------------------------------- + +-add_executable(user_eg2 src/user_eg2/user_eg2_r.c) ++ add_executable(user_eg2 src/user_eg2/user_eg2_r.c) + +-if(${BUILD_STATIC_LIBS}) +- target_link_libraries(user_eg2 ${qhull_STATICR}) +-else() +- target_link_libraries(user_eg2 ${qhull_SHAREDR}) +- set_target_properties(user_eg2 PROPERTIES +- COMPILE_DEFINITIONS "${user_eg2_DEFINES}") +-endif() ++ if(${BUILD_STATIC_LIBS}) ++ target_link_libraries(user_eg2 ${qhull_STATICR}) ++ else() ++ target_link_libraries(user_eg2 ${qhull_SHAREDR}) ++ set_target_properties(user_eg2 PROPERTIES ++ COMPILE_DEFINITIONS "${user_eg2_DEFINES}") ++ endif() + +-# --------------------------------------- +-# Define user_eg3 linked to qhullcpp and qhullstatic_r static libraries +-# +-# user_eg3 is not defined for shared libraries +-# user_eg3 and qhullcpp must be compiled with the same compiler for setjmp/longjmp +-# --------------------------------------- ++ # --------------------------------------- ++ # Define user_eg3 linked to qhullcpp and qhullstatic_r static libraries ++ # ++ # user_eg3 is not defined for shared libraries ++ # user_eg3 and qhullcpp must be compiled with the same compiler for setjmp/longjmp ++ # --------------------------------------- ++ ++ if(${BUILD_STATIC_LIBS}) ++ add_executable(user_eg3 src/user_eg3/user_eg3_r.cpp) ++ # qhull_STATICR must be last, otherwise qh_fprintf,etc. are not loaded from qhull_CPP ++ target_link_libraries(user_eg3 ${qhull_CPP} ${qhull_STATICR}) ++ endif() + +-if(${BUILD_STATIC_LIBS}) +- add_executable(user_eg3 src/user_eg3/user_eg3_r.cpp) +- # qhull_STATICR must be last, otherwise qh_fprintf,etc. are not loaded from qhull_CPP +- target_link_libraries(user_eg3 ${qhull_CPP} ${qhull_STATICR}) ++ # --------------------------------------- ++ # qhullp is qhull/unix.c linked to unsuported qh_QHpointer libqhull_p ++ # Included for testing qh_QHpointer ++ # --------------------------------------- ++ ++ add_executable(qhullp EXCLUDE_FROM_ALL src/qhull/unix.c) ++ target_link_libraries(qhullp ${qhull_SHAREDP}) ++ set_target_properties(qhullp PROPERTIES ++ COMPILE_DEFINITIONS "${qhullp_DEFINES}") ++ ++ # --------------------------------------- ++ # user_egp is user_eg/user_eg.c linked to unsuported qh_QHpointer libqhull_p ++ # Included for compatibility with qhull-2012.1 ++ # --------------------------------------- ++ ++ add_executable(user_egp EXCLUDE_FROM_ALL src/user_eg/user_eg.c) ++ target_link_libraries(user_egp ${qhull_SHAREDP}) ++ set_target_properties(user_egp PROPERTIES ++ COMPILE_DEFINITIONS "${user_egp_DEFINES}") + endif() + + # --------------------------------------- +-# qhullp is qhull/unix.c linked to unsuported qh_QHpointer libqhull_p +-# Included for testing qh_QHpointer +-# --------------------------------------- +- +-add_executable(qhullp EXCLUDE_FROM_ALL src/qhull/unix.c) +-target_link_libraries(qhullp ${qhull_SHAREDP}) +-set_target_properties(qhullp PROPERTIES +- COMPILE_DEFINITIONS "${qhullp_DEFINES}") +- +-# --------------------------------------- +-# user_egp is user_eg/user_eg.c linked to unsuported qh_QHpointer libqhull_p +-# Included for compatibility with qhull-2012.1 +-# --------------------------------------- +- +-add_executable(user_egp EXCLUDE_FROM_ALL src/user_eg/user_eg.c) +-target_link_libraries(user_egp ${qhull_SHAREDP}) +-set_target_properties(user_egp PROPERTIES +- COMPILE_DEFINITIONS "${user_egp_DEFINES}") +- +-# --------------------------------------- + # Define test + # --------------------------------------- + +@@ -676,7 +679,9 @@ + # Define install + # --------------------------------------- + +-set(qhull_TARGETS_INSTALL ${qhull_TARGETS_APPLICATIONS}) ++if(BUILD_APPLICATIONS) ++ set(qhull_TARGETS_INSTALL ${qhull_TARGETS_APPLICATIONS}) ++endif() + if (BUILD_SHARED_LIBS) + list(APPEND qhull_TARGETS_INSTALL ${qhull_TARGETS_SHARED}) + endif() diff --git a/vcpkg/ports/qhull/portfile.cmake b/vcpkg/ports/qhull/portfile.cmake new file mode 100644 index 0000000..2832777 --- /dev/null +++ b/vcpkg/ports/qhull/portfile.cmake @@ -0,0 +1,77 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO qhull/qhull + REF 613debeaea72ee66626dace9ba1a2eff11b5d37d + SHA512 5b8ff9665ba73621a9859a6e86717b980b67f8d79d6c78cbf5672bce66aed671f7d64fcbec457bca79eef2e17e105f136017afdf442bb430b9f4a059d7cb93c3 + HEAD_REF master + PATCHES + include-qhullcpp-shared.patch + fix-missing-symbols.patch # upstream https://github.com/qhull/qhull/pull/93 + noapp.patch # upstream https://github.com/qhull/qhull/pull/124 + fix-qhullcpp-cpp20-support.patch # upstream https://github.com/qhull/qhull/pull/122 +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS) + +if("tools" IN_LIST FEATURES) + list(APPEND QHULL_OPTIONS -DBUILD_APPLICATIONS:BOOL=ON) +else() + list(APPEND QHULL_OPTIONS -DBUILD_APPLICATIONS:BOOL=OFF) +endif() +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS} + ${QHULL_OPTIONS} +) + +vcpkg_cmake_install() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/share/man" + "${CURRENT_PACKAGES_DIR}/share/doc" + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share/man" + "${CURRENT_PACKAGES_DIR}/debug/share/doc" +) + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Qhull) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(WRITE "${CURRENT_PACKAGES_DIR}/share/qhull/QhullTargets-interface.cmake" [[ + add_library(Qhull::qhull_r IMPORTED INTERFACE) + set_target_properties(Qhull::qhull_r PROPERTIES INTERFACE_LINK_LIBRARIES Qhull::qhullstatic_r) +]]) +endif() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(active_basename "qhullstatic") + set(inactive_basename "qhull") +else() + set(active_basename "qhull") + set(inactive_basename "qhullstatic") +endif() +file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${inactive_basename}_r.pc") +file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${inactive_basename}.pc") # qhullstatic.pc in dynamic build +if(NOT DEFINED VCPKG_BUILD_TYPE) + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${inactive_basename}_rd.pc") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${active_basename}_rd.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${active_basename}_r.pc") + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/qhullstatic_d.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/qhullstatic.pc") + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${inactive_basename}.pc") # qhullstatic.pc in dynamic build + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/qhullcpp_d.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/qhullcpp.pc") +endif() +vcpkg_fixup_pkgconfig() + +if("tools" IN_LIST FEATURES) + vcpkg_copy_tools(TOOL_NAMES + qconvex + qdelaunay + qhalf + qhull + qvoronoi + rbox + AUTO_CLEAN + ) +endif() + +file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME usage) +file(INSTALL "${SOURCE_PATH}/COPYING.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/qhull/usage b/vcpkg/ports/qhull/usage new file mode 100644 index 0000000..94dbcaf --- /dev/null +++ b/vcpkg/ports/qhull/usage @@ -0,0 +1,9 @@ +The package qhull provides CMake targets: + + # Reentrant C API + find_package(Qhull CONFIG REQUIRED) + target_link_libraries(main PRIVATE Qhull::qhull_r) + + # C++ API + find_package(Qhull CONFIG REQUIRED) + target_link_libraries(main PRIVATE Qhull::qhullcpp) diff --git a/vcpkg/ports/qhull/vcpkg.json b/vcpkg/ports/qhull/vcpkg.json new file mode 100644 index 0000000..88ac0f0 --- /dev/null +++ b/vcpkg/ports/qhull/vcpkg.json @@ -0,0 +1,23 @@ +{ + "name": "qhull", + "version": "8.0.2", + "port-version": 6, + "description": "computes the convex hull, Delaunay triangulation, Voronoi diagram", + "homepage": "https://github.com/qhull/qhull", + "license": null, + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "tools": { + "description": "Determines whether tools should be built" + } + } +} |