mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 03:10:57 +08:00
[qhull] Fix copyright, pc files, cmake usage (#23129)
* Modernize portfile * Install COPYING.txt for copyright * Create uniform pc file names for all configurations * Provide uniform and documented CMake config * Update versions * Use version field * Update versions * CI
This commit is contained in:
parent
0749a327b6
commit
61ae96ea06
@ -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)
|
||||
|
9
ports/qhull/usage
Normal file
9
ports/qhull/usage
Normal file
@ -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)
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -5558,7 +5558,7 @@
|
||||
},
|
||||
"qhull": {
|
||||
"baseline": "8.0.2",
|
||||
"port-version": 2
|
||||
"port-version": 3
|
||||
},
|
||||
"qnnpack": {
|
||||
"baseline": "2021-02-26",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "afe7d7f235d72db1da52a99ebe085cafd21577b3",
|
||||
"version": "8.0.2",
|
||||
"port-version": 3
|
||||
},
|
||||
{
|
||||
"git-tree": "574301a0f60d743f5ea7165dda5e45bd0f1082ba",
|
||||
"version-string": "8.0.2",
|
||||
|
Loading…
x
Reference in New Issue
Block a user