2020-10-17 18:01:36 +09:00
|
|
|
vcpkg_fail_port_install(ON_TARGET "uwp")
|
2017-03-21 20:53:26 -07:00
|
|
|
|
2020-10-17 18:01:36 +09:00
|
|
|
set(VERSION 4.8)
|
2016-12-25 18:44:20 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2019-03-08 22:09:33 -08:00
|
|
|
URLS "http://www.antlr.org/download/antlr4-cpp-runtime-${VERSION}-source.zip"
|
2017-03-21 20:53:26 -07:00
|
|
|
FILENAME "antlr4-cpp-runtime-${VERSION}-source.zip"
|
2020-10-17 18:01:36 +09:00
|
|
|
SHA512 df76a724e8acf29018ad122d909e1d43e7c8842e1c0df8022a3e8c840cb2b99de49cc148f75fef519b65ece9bd27b92cf0067c9099b664c127e80559c6492322
|
2016-12-25 18:44:20 +08:00
|
|
|
)
|
2017-02-14 18:34:59 -08:00
|
|
|
|
|
|
|
# license not exist in antlr folder.
|
|
|
|
vcpkg_download_distfile(LICENSE
|
2017-03-21 20:53:26 -07:00
|
|
|
URLS https://raw.githubusercontent.com/antlr/antlr4/${VERSION}/LICENSE.txt
|
2019-03-08 22:09:33 -08:00
|
|
|
FILENAME "antlr4-copyright-${VERSION}"
|
2018-12-12 02:59:01 -08:00
|
|
|
SHA512 1e8414de5fdc211e3188a8ec3276c6b3c55235f5edaf48522045ae18fa79fd9049719cb8924d25145016f223ac9a178defada1eeb983ccff598a08b0c0f67a3b
|
2017-02-14 18:34:59 -08:00
|
|
|
)
|
|
|
|
|
2018-12-18 16:12:19 -08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
NO_REMOVE_ONE_LEVEL
|
2019-03-08 22:09:33 -08:00
|
|
|
REF ${VERSION}
|
|
|
|
PATCHES fixed_build.patch
|
|
|
|
uuid_discovery_fix.patch
|
|
|
|
export_guid.patch
|
2016-12-25 18:44:20 +08:00
|
|
|
)
|
|
|
|
|
2019-03-08 22:09:33 -08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
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
|
|
|
)
|
|
|
|
|
2019-03-08 22:09:33 -08:00
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/share
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/include
|
|
|
|
)
|
2016-12-25 18:44:20 +08:00
|
|
|
|
2019-03-08 22:09:33 -08:00
|
|
|
if (NOT VCPKG_CMAKE_SYSTEM_NAME)
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/antlr4-runtime-static.lib
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/antlr4-runtime-static.lib
|
|
|
|
)
|
2016-12-25 18:44:20 +08:00
|
|
|
|
2019-03-08 22:09:33 -08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/antlr4-runtime.dll ${CURRENT_PACKAGES_DIR}/bin/antlr4-runtime.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/antlr4-runtime.dll ${CURRENT_PACKAGES_DIR}/debug/bin/antlr4-runtime.dll)
|
|
|
|
else()
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/antlr4-runtime.lib
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/antlr4-runtime.dll
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/antlr4-runtime.lib
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/antlr4-runtime.dll
|
|
|
|
)
|
2016-12-25 18:44:20 +08:00
|
|
|
|
2019-03-08 22:09:33 -08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/antlr4-runtime-static.lib ${CURRENT_PACKAGES_DIR}/lib/antlr4-runtime.lib)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/antlr4-runtime-static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/antlr4-runtime.lib)
|
|
|
|
endif()
|
2016-12-25 18:44:20 +08:00
|
|
|
else()
|
2019-03-08 22:09:33 -08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libantlr4-runtime.a
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/libantlr4-runtime.a
|
|
|
|
)
|
|
|
|
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL Linux)
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libantlr4-runtime.so
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/libantlr4-runtime.so.${VERSION}
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/libantlr4-runtime.so
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/libantlr4-runtime.so.${VERSION}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libantlr4-runtime.dylib
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/libantlr4-runtime.${VERSION}.dylib
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/libantlr4-runtime.dylib
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/libantlr4-runtime.${VERSION}.dylib
|
|
|
|
)
|
|
|
|
endif()
|
2016-12-25 18:44:20 +08:00
|
|
|
endif()
|
|
|
|
|
2019-03-08 22:09:33 -08:00
|
|
|
file(GLOB HDRS LIST_DIRECTORIES true ${CURRENT_PACKAGES_DIR}/include/antlr4-runtime/*)
|
|
|
|
file(COPY ${HDRS} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/antlr4-runtime)
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2020-10-17 18:01:36 +09:00
|
|
|
file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2016-12-25 18:44:20 +08:00
|
|
|
|
2019-03-08 22:09:33 -08:00
|
|
|
message(STATUS "Installing done")
|