2017-08-09 20:46:01 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO jbeder/yaml-cpp
|
2023-11-02 03:40:17 +08:00
|
|
|
REF "${VERSION}"
|
|
|
|
SHA512 aae9d618f906117d620d63173e95572c738db518f4ff1901a06de2117d8deeb8045f554102ca0ba4735ac0c4d060153a938ef78da3e0da3406d27b8298e5f38e
|
2017-08-09 20:46:01 +08:00
|
|
|
HEAD_REF master
|
2023-11-02 03:40:17 +08:00
|
|
|
PATCHES
|
|
|
|
"yaml-cpp-pr-1212.patch"
|
2016-11-22 21:11:57 +08:00
|
|
|
)
|
|
|
|
|
2021-09-08 05:17:18 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" YAML_BUILD_SHARED_LIBS)
|
2020-06-03 13:35:48 +08:00
|
|
|
|
2021-08-10 16:11:41 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2017-08-09 20:46:01 +08:00
|
|
|
OPTIONS
|
|
|
|
-DYAML_CPP_BUILD_TOOLS=OFF
|
2018-02-22 23:54:18 +08:00
|
|
|
-DYAML_CPP_BUILD_TESTS=OFF
|
2020-06-03 13:35:48 +08:00
|
|
|
-DYAML_BUILD_SHARED_LIBS=${YAML_BUILD_SHARED_LIBS}
|
2023-11-02 03:40:17 +08:00
|
|
|
-DYAML_CPP_INSTALL_CMAKEDIR=share/${PORT}
|
2016-11-22 21:11:57 +08:00
|
|
|
)
|
|
|
|
|
2021-08-10 16:11:41 +08:00
|
|
|
vcpkg_cmake_install()
|
2016-11-22 21:11:57 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-09-08 05:17:18 +08:00
|
|
|
|
2023-11-02 03:40:17 +08:00
|
|
|
vcpkg_cmake_config_fixup()
|
2021-09-08 05:17:18 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/yaml-cpp.pc" "-lyaml-cpp" "-lyaml-cppd")
|
2018-03-22 03:27:29 +08:00
|
|
|
endif()
|
2021-09-08 05:17:18 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2017-08-09 20:46:01 +08:00
|
|
|
|
2023-11-02 03:40:17 +08:00
|
|
|
# Remove debug include
|
2021-08-10 16:11:41 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2017-08-09 20:46:01 +08:00
|
|
|
|
2023-11-02 03:40:17 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h" "#ifdef YAML_CPP_STATIC_DEFINE" "#if 0")
|
2017-08-09 20:46:01 +08:00
|
|
|
else()
|
2023-11-02 03:40:17 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h" "#ifdef YAML_CPP_STATIC_DEFINE" "#if 1")
|
2017-08-09 20:46:01 +08:00
|
|
|
endif()
|
2016-11-22 21:11:57 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
2023-11-02 03:40:17 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|