diff --git a/ports/qhull/portfile.cmake b/ports/qhull/portfile.cmake index 5584c7b1926e04..6aa76096c6ea59 100644 --- a/ports/qhull/portfile.cmake +++ b/ports/qhull/portfile.cmake @@ -11,38 +11,45 @@ vcpkg_from_github( string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS} ) -vcpkg_install_cmake() +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 + "${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_fixup_cmake_targets(CONFIG_PATH lib/cmake/Qhull) -file(REMOVE - ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/qhullstatic.pc - ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/qhullstatic_d.pc -) +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Qhull) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE - ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/qhull_r.pc - ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/qhull_rd.pc - ) + 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() - file(REMOVE - ${CURRENT_PACKAGES_DIR}/lib/pkgconfig/qhullstatic_r.pc - ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/qhullstatic_rd.pc - ) + 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() @@ -56,4 +63,5 @@ vcpkg_copy_tools(TOOL_NAMES AUTO_CLEAN ) -file(INSTALL ${SOURCE_PATH}/README.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +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/ports/qhull/usage b/ports/qhull/usage new file mode 100644 index 00000000000000..94dbcafa689fcb --- /dev/null +++ b/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/ports/qhull/vcpkg.json b/ports/qhull/vcpkg.json index b115f1331af5ef..7f6e7e32fcb21d 100644 --- a/ports/qhull/vcpkg.json +++ b/ports/qhull/vcpkg.json @@ -1,7 +1,18 @@ { "name": "qhull", - "version-string": "8.0.2", - "port-version": 2, + "version": "8.0.2", + "port-version": 3, "description": "computes the convex hull, Delaunay triangulation, Voronoi diagram", - "homepage": "https://github.com/qhull/qhull" + "homepage": "https://github.com/qhull/qhull", + "license": null, + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] } diff --git a/versions/baseline.json b/versions/baseline.json index 64bd50ebc112bb..6445d3d2f43584 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5554,7 +5554,7 @@ }, "qhull": { "baseline": "8.0.2", - "port-version": 2 + "port-version": 3 }, "qnnpack": { "baseline": "2021-02-26", diff --git a/versions/q-/qhull.json b/versions/q-/qhull.json index 52eb5af94685cc..69b98685f1cdbc 100644 --- a/versions/q-/qhull.json +++ b/versions/q-/qhull.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "afe7d7f235d72db1da52a99ebe085cafd21577b3", + "version": "8.0.2", + "port-version": 3 + }, { "git-tree": "574301a0f60d743f5ea7165dda5e45bd0f1082ba", "version-string": "8.0.2",