2022-01-14 01:23:06 +08:00
|
|
|
set(VERSION 4.9.3)
|
2016-12-25 18:44:20 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2022-01-13 04:13:55 +08:00
|
|
|
URLS "https://www.antlr.org/download/antlr4-cpp-runtime-${VERSION}-source.zip"
|
2017-03-22 11:53:26 +08:00
|
|
|
FILENAME "antlr4-cpp-runtime-${VERSION}-source.zip"
|
2022-01-14 01:23:06 +08:00
|
|
|
SHA512 23995a6fa661ff038142fa7220a195db3a9a26744d516011dedc3192f152b06a8e31f6cc8f969f8927b86392a960d03e89572e753f033f950839a5bd38d4c722
|
2016-12-25 18:44:20 +08:00
|
|
|
)
|
2017-02-15 10:34:59 +08:00
|
|
|
|
|
|
|
# license not exist in antlr folder.
|
|
|
|
vcpkg_download_distfile(LICENSE
|
2017-03-22 11:53:26 +08:00
|
|
|
URLS https://raw.githubusercontent.com/antlr/antlr4/${VERSION}/LICENSE.txt
|
2019-03-09 14:09:33 +08:00
|
|
|
FILENAME "antlr4-copyright-${VERSION}"
|
2018-12-12 18:59:01 +08:00
|
|
|
SHA512 1e8414de5fdc211e3188a8ec3276c6b3c55235f5edaf48522045ae18fa79fd9049719cb8924d25145016f223ac9a178defada1eeb983ccff598a08b0c0f67a3b
|
2017-02-15 10:34:59 +08:00
|
|
|
)
|
|
|
|
|
2018-12-19 08:12:19 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
NO_REMOVE_ONE_LEVEL
|
2019-03-09 14:09:33 +08:00
|
|
|
REF ${VERSION}
|
2022-01-26 02:31:15 +08:00
|
|
|
PATCHES
|
2021-04-02 01:31:47 +08:00
|
|
|
fixed_build.patch
|
|
|
|
uuid_discovery_fix.patch
|
|
|
|
export_guid.patch
|
2016-12-25 18:44:20 +08:00
|
|
|
)
|
|
|
|
|
2022-01-14 01:23:06 +08:00
|
|
|
vcpkg_cmake_configure(
|
2022-04-19 07:44:47 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
-DANTLR4_INSTALL=ON
|
2019-03-09 14:09:33 +08:00
|
|
|
OPTIONS_DEBUG -DLIB_OUTPUT_DIR=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/dist
|
|
|
|
OPTIONS_RELEASE -DLIB_OUTPUT_DIR=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/dist
|
2016-12-25 18:44:20 +08:00
|
|
|
)
|
|
|
|
|
2022-01-14 01:23:06 +08:00
|
|
|
vcpkg_cmake_install()
|
2022-04-19 07:44:47 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME antlr4-generator CONFIG_PATH lib/cmake/antlr4-generator DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME antlr4-runtime CONFIG_PATH lib/cmake/antlr4-runtime)
|
2019-03-09 14:09:33 +08:00
|
|
|
|
2022-04-19 07:44:47 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
2016-12-25 18:44:20 +08:00
|
|
|
|
2019-03-09 14:09:33 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-04-19 07:44:47 +08:00
|
|
|
file(INSTALL "${LICENSE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|