Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[antlr4] Fix CMake files export #24157

Merged
merged 5 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 28 additions & 27 deletions ports/antlr4/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,57 +26,58 @@ vcpkg_extract_source_archive_ex(
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DANTLR4_INSTALL=ON
OPTIONS_DEBUG -DLIB_OUTPUT_DIR=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/dist
OPTIONS_RELEASE -DLIB_OUTPUT_DIR=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/dist
)

vcpkg_cmake_install()
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)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc
${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/debug/include
)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")

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
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/antlr4-runtime-static.lib"
"${CURRENT_PACKAGES_DIR}/debug/lib/antlr4-runtime-static.lib"
)

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)
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")
LilyWangLL marked this conversation as resolved.
Show resolved Hide resolved
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
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"
)

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)
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()
else()
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/libantlr4-runtime.a
${CURRENT_PACKAGES_DIR}/debug/lib/libantlr4-runtime.a
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}
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
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()
endif()

vcpkg_copy_pdbs()

file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${LICENSE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
7 changes: 6 additions & 1 deletion ports/antlr4/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "antlr4",
"version": "4.9.3",
"port-version": 1,
"port-version": 2,
"description": "ANother Tool for Language Recognition",
"homepage": "https://www.antlr.org",
"license": "BSD-3-Clause",
"supports": "!uwp",
"dependencies": [
{
Expand All @@ -13,6 +14,10 @@
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
5 changes: 5 additions & 0 deletions versions/a-/antlr4.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e2b495653072ea1cc06aef961f21d6659885b6b1",
"version": "4.9.3",
"port-version": 2
},
{
"git-tree": "0a3fbd320c22b3c017fe13fb4cac5fe330c0df99",
"version": "4.9.3",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
},
"antlr4": {
"baseline": "4.9.3",
"port-version": 1
"port-version": 2
},
"any-lite": {
"baseline": "0.4.0",
Expand Down