vcpkg/ports/docopt/portfile.cmake
Theodore Tsirpanis ba2298b26c
[docopt] Update to latest version. (#37046)
- [X] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [X] SHA512s are updated for each updated download.
- [ ] The "supports" clause reflects platforms that may be fixed by this
new version.
- [ ] Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.
- [X] Any patches that are no longer applied are deleted from the port's
directory.
- [X] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [X] Only one version is added to each modified port's versions file.
2024-02-29 23:07:01 -08:00

39 lines
1.2 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO docopt/docopt.cpp
REF 400e6dd8e59196c914dcc2c56caf7dae7efa5eb3
SHA512 a9ef466ba40127f636bc20beb7508c4da2dc32c0c37acb5729644f31d4910d9c0253f311457f39ed57605775e72f3370aff4e5ef88e60a49d190bc4760c40ea3
HEAD_REF master
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DWITH_EXAMPLE=OFF
-DWITH_TESTS=OFF
-DUSE_BOOST_REGEX=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/docopt)
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(READ "${CURRENT_PACKAGES_DIR}/include/docopt/docopt.h" _contents)
string(REPLACE "#ifdef DOCOPT_DLL" "#if 1" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/docopt/docopt.h" "${_contents}")
endif()
# Header-only style when DOCOPT_HEADER_ONLY is defined
file(COPY
"${SOURCE_PATH}/docopt.cpp"
DESTINATION "${CURRENT_PACKAGES_DIR}/include/docopt")
# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE-MIT" "${SOURCE_PATH}/LICENSE-Boost-1.0")
vcpkg_copy_pdbs()