2021-09-03 07:05:01 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO nlohmann/json
|
|
|
|
REF v3.10.2
|
|
|
|
SHA512 9a399dfc8aab19c9fc12470e8087895b1c05d48a9bcc731b483d8670c361cffb2adc3ccced822b7f17255e88387a441d619c4e1f1afeb702d1d035ad24fe22ed
|
|
|
|
HEAD_REF master
|
2020-07-10 04:17:32 +08:00
|
|
|
)
|
2019-02-07 00:45:47 +08:00
|
|
|
|
2021-09-03 07:05:01 +08:00
|
|
|
vcpkg_cmake_configure(
|
2019-02-07 00:45:47 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2021-09-03 07:05:01 +08:00
|
|
|
OPTIONS
|
|
|
|
-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
|
2019-02-07 00:45:47 +08:00
|
|
|
)
|
2021-09-03 07:05:01 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME "nlohmann_json" CONFIG_PATH "lib/cmake/nlohmann_json")
|
|
|
|
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
|
|
|
)
|
2019-02-07 00:45:47 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis)
|
|
|
|
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()
|
|
|
|
|
2021-09-03 07:05:01 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/nlohmann_json.natvis")
|
|
|
|
|
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)
|