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

[sdformat6] no absolute paths #21305

Merged
merged 1 commit into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
36 changes: 19 additions & 17 deletions ports/sdformat6/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,43 @@ get_filename_component(RUBY_PATH ${RUBY} DIRECTORY)
set(_path $ENV{PATH})
vcpkg_add_to_path(${RUBY_PATH})

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS -DBUILD_TESTING=OFF
-DUSE_EXTERNAL_URDF=ON
-DUSE_EXTERNAL_TINYXML=ON
)

vcpkg_install_cmake()
vcpkg_cmake_install()

# Restore original path
set(ENV{PATH} ${_path})

# Move location of sdformat.dll from lib to bin
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/sdformat.dll)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/sdformat.dll
${CURRENT_PACKAGES_DIR}/bin/sdformat.dll)
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/sdformat.dll")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/sdformat.dll"
"${CURRENT_PACKAGES_DIR}/bin/sdformat.dll")
endif()

if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/sdformat.dll)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/sdformat.dll
${CURRENT_PACKAGES_DIR}/debug/bin/sdformat.dll)
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/sdformat.dll")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/sdformat.dll"
"${CURRENT_PACKAGES_DIR}/debug/bin/sdformat.dll")
endif()

# Fix cmake targets location
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/sdformat")
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/sdformat")

# Remove debug files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/lib/cmake
${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/lib/cmake"
"${CURRENT_PACKAGES_DIR}/debug/share")

vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/ignition/sdformat6.yaml" "${CURRENT_PACKAGES_DIR}" "../..")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sdformat-6.2/sdf/sdf_config.h" "#define SDF_SHARE_PATH \"${CURRENT_PACKAGES_DIR}/share/\"" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sdformat-6.2/sdf/sdf_config.h" "#define SDF_VERSION_PATH \"${CURRENT_PACKAGES_DIR}/share/sdformat/\"" "")
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

vcpkg_fixup_pkgconfig()
12 changes: 10 additions & 2 deletions ports/sdformat6/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sdformat6",
"version": "6.2.0",
"port-version": 3,
"port-version": 4,
"description": "Simulation Description Format (SDF) parser and description files.",
"homepage": "http://sdformat.org/",
"supports": "!(arm | uwp)",
Expand All @@ -10,6 +10,14 @@
"boost-variant",
"ignition-math4",
"tinyxml",
"urdfdom"
"urdfdom",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6094,7 +6094,7 @@
},
"sdformat6": {
"baseline": "6.2.0",
"port-version": 3
"port-version": 4
},
"sdformat9": {
"baseline": "9.4.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/sdformat6.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "dc94f6d1e0351bb777ccd1823470fe22ad896c34",
"version": "6.2.0",
"port-version": 4
},
{
"git-tree": "1273532dcedd66beb82c6ce89024abac0e385761",
"version": "6.2.0",
Expand Down