2021-09-03 07:05:01 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO nlohmann/json
|
2023-12-01 18:13:48 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 7df19b621de34f08d5d5c0a25e8225975980841ef2e48536abcf22526ed7fb99f88ad954a2cb823115db59ccc88d1dbe74fe6c281b5644b976b33fb78db9d717
|
2021-09-03 07:05:01 +08:00
|
|
|
HEAD_REF master
|
2020-07-10 04:17:32 +08:00
|
|
|
)
|
2019-02-07 00:45:47 +08:00
|
|
|
|
2022-03-24 03:57:59 +08:00
|
|
|
if(NOT DEFINED nlohmann-json_IMPLICIT_CONVERSIONS)
|
|
|
|
set(nlohmann-json_IMPLICIT_CONVERSIONS ON)
|
|
|
|
endif()
|
|
|
|
|
2022-05-14 07:52:17 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
"diagnostics" JSON_Diagnostics
|
|
|
|
)
|
|
|
|
|
2021-09-03 07:05:01 +08:00
|
|
|
vcpkg_cmake_configure(
|
2022-05-14 07:52:17 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
2021-09-03 07:05:01 +08:00
|
|
|
-DJSON_Install=ON
|
2020-07-10 04:17:32 +08:00
|
|
|
-DJSON_MultipleHeaders=ON
|
2021-09-03 07:05:01 +08:00
|
|
|
-DJSON_BuildTests=OFF
|
2022-03-24 03:57:59 +08:00
|
|
|
-DJSON_ImplicitConversions=${nlohmann-json_IMPLICIT_CONVERSIONS}
|
2019-02-07 00:45:47 +08:00
|
|
|
)
|
2021-09-03 07:05:01 +08:00
|
|
|
vcpkg_cmake_install()
|
2022-08-16 00:42:24 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME "nlohmann_json" CONFIG_PATH "share/cmake/nlohmann_json")
|
2021-09-03 07:05:01 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2019-02-07 00:45:47 +08:00
|
|
|
|
|
|
|
vcpkg_replace_string(
|
2021-09-03 07:05:01 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/share/nlohmann_json/nlohmann_jsonTargets.cmake"
|
2019-02-07 00:45:47 +08:00
|
|
|
"{_IMPORT_PREFIX}/nlohmann_json.natvis"
|
|
|
|
"{_IMPORT_PREFIX}/share/nlohmann_json/nlohmann_json.natvis"
|
2017-12-17 22:01:07 +08:00
|
|
|
)
|
2022-05-14 07:52:17 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis")
|
2019-02-07 00:45:47 +08:00
|
|
|
file(RENAME
|
2021-09-03 07:05:01 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/nlohmann_json/nlohmann_json.natvis"
|
2019-02-07 00:45:47 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-08-16 00:42:24 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
|
2021-09-03 07:05:01 +08:00
|
|
|
|
2019-02-07 00:45:47 +08:00
|
|
|
# Handle copyright
|
2021-09-03 07:05:01 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE.MIT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2022-03-24 03:57:59 +08:00
|
|
|
|
|
|
|
# Handle usage
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|