cemu-vcpkg/ports/json-spirit/portfile.cmake
smlee-hdactech 89c6f6ff89 [json-spirit] Add initial port (#5157)
* [json-spirit] Add initial port

* Modify PR to using pn85, enable some features

json-spirit is a weird case because the main repo that package managers
tend to use appears to not be actively maintained. Nevertheless, vcpkg
tries to use the "official" source of a repository if at all possible.

In order to do this, I've made the following changes to the PR:
- I've changed the upstream REPO, REF, and SHA512.
- I've passed options to disable building the demos and tests
- I've made the project build only as a static library.

The reason for this is that vcpkg does not support dynamical linkin.
Another reason is that the library as it is in the repo does not have
all the definitions correctly annotated.smlee-hdactech has made a PR
against the major upstream repo to fix this, butwe are going to defer
to the main repo until that change is accepted.
2019-01-26 12:55:11 -08:00

24 lines
775 B
CMake

include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO png85/json_spirit
REF 5e16cca59b31d8beda0f07e3917ce11dcd43b3db
SHA512 6ac0f15726391c9003e516213535c8d30e98b6c33bca0b03e9bf38e7085824bfc6cfaab267b1dfccbfcc567638d26f722d7e331f4e3b60d3acd5c717cb1fafcc
HEAD_REF master
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS -DBUILD_STATIC_LIBS=on -DJSON_SPIRIT_DEMOS=off -DJSON_SPIRIT_TESTS=off)
vcpkg_install_cmake()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/json-spirit RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_copy_pdbs()