2021-09-14 11:20:15 +08:00
|
|
|
vcpkg_from_github(
|
2020-10-09 04:49:37 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-09-14 11:20:15 +08:00
|
|
|
REPO sbmlteam/libsbml
|
2023-05-11 02:40:02 +08:00
|
|
|
REF "v${VERSION}"
|
2023-10-25 00:09:15 +08:00
|
|
|
SHA512 2770c1d3295e22ed8fb8dfa2480efa160fc61fbeeca3a9e214e210acb3fd6531a5cfb22eeb72c5334158bf8ba21c27015d0910487a7ef060f594a708f197676c
|
2021-09-14 11:20:15 +08:00
|
|
|
HEAD_REF development
|
2023-05-11 02:40:02 +08:00
|
|
|
PATCHES
|
2023-10-25 00:09:15 +08:00
|
|
|
dependencies.diff
|
|
|
|
dirent.diff
|
|
|
|
no-docs.diff
|
|
|
|
test-shared.diff
|
2020-10-09 04:49:37 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_RUNTIME)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC_LIBRARY)
|
2023-05-11 02:40:02 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" DYNAMIC_LIBRARY)
|
2020-10-09 04:49:37 +08:00
|
|
|
|
2023-10-25 00:09:15 +08:00
|
|
|
if("expat" IN_LIST FEATURES AND "libxml2" IN_LIST FEATURES)
|
|
|
|
message("Feature expat conflicts with feature libxml2. Selecting libxml2.")
|
|
|
|
list(REMOVE_ITEM FEATURES "expat")
|
|
|
|
endif()
|
|
|
|
|
2020-10-09 04:49:37 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-09-14 11:20:15 +08:00
|
|
|
FEATURES
|
|
|
|
comp ENABLE_COMP
|
|
|
|
fbc ENABLE_FBC
|
|
|
|
groups ENABLE_GROUPS
|
|
|
|
layout ENABLE_LAYOUT
|
|
|
|
multi ENABLE_MULTI
|
|
|
|
qual ENABLE_QUAL
|
|
|
|
render ENABLE_RENDER
|
|
|
|
bzip2 WITH_BZIP2
|
2023-10-25 00:09:15 +08:00
|
|
|
expat WITH_EXPAT
|
|
|
|
libxml2 WITH_LIBXML
|
2021-09-14 11:20:15 +08:00
|
|
|
zlib WITH_ZLIB
|
|
|
|
test WITH_CHECK
|
|
|
|
namespace WITH_CPP_NAMESPACE
|
2020-10-09 04:49:37 +08:00
|
|
|
)
|
|
|
|
|
2021-09-14 11:20:15 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-10-25 00:09:15 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2020-10-09 04:49:37 +08:00
|
|
|
-DENABLE_L3V2EXTENDEDMATH:BOOL=ON
|
|
|
|
-DWITH_STATIC_RUNTIME=${STATIC_RUNTIME}
|
|
|
|
-DLIBSBML_SKIP_SHARED_LIBRARY=${STATIC_LIBRARY}
|
2023-05-11 02:40:02 +08:00
|
|
|
-DLIBSBML_SKIP_STATIC_LIBRARY=${DYNAMIC_LIBRARY}
|
2023-10-25 00:09:15 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
WITH_STATIC_RUNTIME
|
2020-10-09 04:49:37 +08:00
|
|
|
)
|
|
|
|
|
2021-09-14 11:20:15 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-10-09 04:49:37 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2023-10-25 00:09:15 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2020-10-09 04:49:37 +08:00
|
|
|
|
2023-10-25 00:09:15 +08:00
|
|
|
foreach(name IN ITEMS libsbml libsbml-static sbml sbml-static)
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/${name}-config.cmake")
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME "${name}" CONFIG_PATH lib/cmake)
|
|
|
|
if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake")
|
|
|
|
configure_file("${CURRENT_PORT_DIR}/libsbml-config.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake" @ONLY)
|
|
|
|
endif()
|
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sbml/common/extern.h" "defined LIBSBML_STATIC" "1")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sbml/xml/XMLExtern.h" "defined(LIBLAX_STATIC)" "1")
|
2021-09-14 11:20:15 +08:00
|
|
|
endif()
|
|
|
|
|
2023-10-25 00:09:15 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2020-10-09 04:49:37 +08:00
|
|
|
|
2023-05-11 02:40:02 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
|