[libsbml] Update to 5.20.0 (#31149)

* [libsbml] Update to 5.20.0

* update version

* fix incorrect option

* update version

* install usage

* update version

* apply suggestions

* update version

* fix depends libxml2

* update version
This commit is contained in:
Lily Wang 2023-05-11 02:40:02 +08:00 committed by GitHub
parent 2f1d20a769
commit b049e49516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 72 additions and 9 deletions

View File

@ -0,0 +1,38 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42b3bd6..34e9a4c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -442,17 +442,15 @@ endif(WITH_EXPAT)
set(USE_LIBXML OFF)
if(WITH_LIBXML)
- find_package(LIBXML REQUIRED)
+ find_package(LibXml2 REQUIRED)
add_definitions( -DUSE_LIBXML )
list(APPEND SWIG_EXTRA_ARGS -DUSE_LIBXML)
set(USE_LIBXML ON)
- set(LIBSBML_XML_LIBRARY "libxml2")
- set(LIBSBML_XML_LIBRARY_INCLUDE ${LIBXML_INCLUDE_DIR})
- set(LIBSBML_XML_LIBRARY_LIBS ${LIBXML_LIBRARY})
+ set(LIBSBML_XML_LIBRARY "LibXml2::LibXml2")
+ set(LIBSBML_XML_LIBRARY_LIBS ${LIBSBML_XML_LIBRARY})
- list(APPEND LIBSBML_FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/FindLIBXML.cmake")
endif(WITH_LIBXML)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 79301a6..985f6cb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -423,7 +423,7 @@ if(WITH_LIBXML)
sbml/xml/LibXMLParser.h
sbml/xml/LibXMLTranscode.h
)
- set(LIBSBML_LIBS ${LIBSBML_LIBS} LIBXML::LIBXML)
+ set(LIBSBML_LIBS ${LIBSBML_LIBS} LibXml2::LibXml2)
endif(WITH_LIBXML)

View File

@ -0,0 +1,6 @@
include(CMakeFindDependencyMacro)
find_dependency(libsbml-static CONFIG)
if(NOT TARGET libsbml)
add_library(libsbml INTERFACE IMPORTED)
target_link_libraries(libsbml INTERFACE libsbml-static)
endif()

View File

@ -1,13 +1,16 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO sbmlteam/libsbml
REF 118ffbf11f1a5245cc544c1eac71019d979ecb20 #libSBML-5.19.0
SHA512 7fe8b4d594876c6408e01c646187cb1587d0b4e12707a43286150d4e4646841e547bde971de917de1cdfbbb9365172aeac43c8e02f7d354400f9166f0f1c2c3d
REF "v${VERSION}"
SHA512 c40f164ebd05a36f140ce2684dedb4bbccc51a2732383d3935fca1258738a9b9ba5bc1be2061f3b113b213e5cbb7fe22e9dca43ff78d91964c79cad093e55466
HEAD_REF development
PATCHES
fix-deps-libxml.patch
)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_RUNTIME)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC_LIBRARY)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" DYNAMIC_LIBRARY)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
@ -53,11 +56,17 @@ vcpkg_cmake_configure(
-DENABLE_L3V2EXTENDEDMATH:BOOL=ON
-DWITH_STATIC_RUNTIME=${STATIC_RUNTIME}
-DLIBSBML_SKIP_SHARED_LIBRARY=${STATIC_LIBRARY}
-DLIBSBML_SKIP_STATIC_LIBRARY=${DYNAMIC_LIBRARY}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake)
else()
vcpkg_cmake_config_fixup(PACKAGE_NAME libsbml-static CONFIG_PATH lib/cmake)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/libsbml-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
endif()
vcpkg_copy_pdbs()
@ -84,5 +93,6 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/README.md")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/README.md")
endif()
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
vcpkg_fixup_pkgconfig()

4
ports/libsbml/usage Normal file
View File

@ -0,0 +1,4 @@
libsbml provides CMake targets:
find_package(libsbml CONFIG REQUIRED)
target_link_libraries(main PRIVATE libsbml)

View File

@ -1,8 +1,9 @@
{
"name": "libsbml",
"version": "5.19.0",
"port-version": 2,
"version": "5.20.0",
"description": "A library for reading / writing SBML files",
"homepage": "https://github.com/sbmlteam/libsbml",
"license": "LGPL-2.1",
"supports": "!uwp",
"dependencies": [
{
@ -16,7 +17,6 @@
],
"default-features": [
"comp",
"expat",
"fbc",
"groups",
"layout",

View File

@ -4461,8 +4461,8 @@
"port-version": 1
},
"libsbml": {
"baseline": "5.19.0",
"port-version": 2
"baseline": "5.20.0",
"port-version": 0
},
"libsbsms": {
"baseline": "2.3.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6b592087185a6576e30cc29e129bec77d12c4aeb",
"version": "5.20.0",
"port-version": 0
},
{
"git-tree": "9793402aaa4679187a9a703f189239544e3daf77",
"version": "5.19.0",