2017-08-09 20:46:01 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO jbeder/yaml-cpp
|
2021-08-10 16:11:41 +08:00
|
|
|
REF 0579ae3d976091d7d664aa9d2527e0d0cff25763 # yaml-cpp-0.7.0
|
|
|
|
SHA512 930f13737c23faf06be3fa9821492d6c677359e532212ced495173367a8aec45f87fbf3a5da47d4d1b61a95c25e0101bc7f8d175752434c63b25e097186e1745
|
2017-08-09 20:46:01 +08:00
|
|
|
HEAD_REF master
|
2016-11-22 21:11:57 +08:00
|
|
|
)
|
|
|
|
|
2020-06-03 13:35:48 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
set(YAML_BUILD_SHARED_LIBS ON)
|
|
|
|
else()
|
|
|
|
set(YAML_BUILD_SHARED_LIBS OFF)
|
|
|
|
endif()
|
|
|
|
|
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}
|
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-08-10 16:11:41 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake")
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
|
2018-03-22 03:27:29 +08:00
|
|
|
endif()
|
2021-08-10 16:11:41 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/yaml-cpp")
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/yaml-cpp)
|
2018-03-22 03:27:29 +08:00
|
|
|
endif()
|
2017-08-09 20:46:01 +08:00
|
|
|
|
2016-11-22 21:11:57 +08:00
|
|
|
# Remove debug include files
|
2021-08-10 16:11:41 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2017-08-09 20:46:01 +08:00
|
|
|
|
2021-08-10 16:11:41 +08:00
|
|
|
file(READ "${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h" DLL_H)
|
2021-06-11 02:26:29 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS)
|
2017-08-09 20:46:01 +08:00
|
|
|
string(REPLACE "#ifdef YAML_CPP_DLL" "#if 1" DLL_H "${DLL_H}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "#ifdef YAML_CPP_DLL" "#if 0" DLL_H "${DLL_H}")
|
|
|
|
endif()
|
2021-08-10 16:11:41 +08:00
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/include/yaml-cpp/dll.h" "${DLL_H}")
|
2016-11-22 21:11:57 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
2021-08-10 16:11:41 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|