From cdf9d9b5d5978d343aada1b0fbc1d5c65bdbdd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Fri, 1 Sep 2023 03:59:42 +0800 Subject: [PATCH] [vcpkg baseline][sdformat13] Fix find dependency urdfdom (#33433) * [sdformat13] Fix find dependency urdfdom * version * fix usage * version * Update ports/sdformat13/portfile.cmake * version --------- Co-authored-by: jyu49 --- ports/sdformat13/fix-find-urdfdom.patch | 24 ++++++++++++++++++++++++ ports/sdformat13/portfile.cmake | 17 ++++++++++++++++- ports/sdformat13/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/s-/sdformat13.json | 5 +++++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 ports/sdformat13/fix-find-urdfdom.patch diff --git a/ports/sdformat13/fix-find-urdfdom.patch b/ports/sdformat13/fix-find-urdfdom.patch new file mode 100644 index 0000000000..4593b083d3 --- /dev/null +++ b/ports/sdformat13/fix-find-urdfdom.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e797e8a..0f652d7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -56,7 +56,18 @@ if (BUILD_SDF) + # 2. if USE_INTERNAL_URDF is set to True, use the internal copy + # 3. if USE_INTERNAL_URDF is set to False, force to search system installation, fail on error + if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF) +- gz_find_package(GzURDFDOM) ++ find_package(urdfdom CONFIG REQUIRED) ++ add_library(GzURDFDOM::GzURDFDOM INTERFACE IMPORTED) ++ target_link_libraries(GzURDFDOM::GzURDFDOM ++ INTERFACE ++ urdfdom::urdfdom_model ++ urdfdom::urdfdom_world ++ urdfdom::urdfdom_sensor ++ urdfdom::urdfdom_model_state ++ ) ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(GzURDFDOM DEFAULT_MSG) ++ + if (NOT GzURDFDOM_FOUND) + if (NOT DEFINED USE_INTERNAL_URDF) + # fallback to internal urdf diff --git a/ports/sdformat13/portfile.cmake b/ports/sdformat13/portfile.cmake index 146dd44ec0..d506d24808 100644 --- a/ports/sdformat13/portfile.cmake +++ b/ports/sdformat13/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES no-absolute.patch cmake-config.patch + fix-find-urdfdom.patch ) # Ruby is required by the sdformat build process @@ -20,7 +21,6 @@ vcpkg_cmake_configure( -DSKIP_PYBIND11=ON -DUSE_INTERNAL_URDF=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON - -DCMAKE_REQUIRE_FIND_PACKAGE_GzURDFDOM=ON -DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON ) @@ -28,6 +28,21 @@ vcpkg_cmake_install() vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/sdformat13") vcpkg_fixup_pkgconfig() +# fix dependency urdfdom +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/sdformat13-config.cmake" "find_package(TINYXML2" [[ +if (NOT TARGET GzURDFDOM::GzURDFDOM) + find_package(urdfdom CONFIG ${gz_package_quiet} ${gz_package_required}) + add_library(GzURDFDOM::GzURDFDOM INTERFACE IMPORTED) + target_link_libraries(GzURDFDOM::GzURDFDOM + INTERFACE + urdfdom::urdfdom_model + urdfdom::urdfdom_world + urdfdom::urdfdom_sensor + urdfdom::urdfdom_model_state + ) +endif() +find_package(TINYXML2]]) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") diff --git a/ports/sdformat13/vcpkg.json b/ports/sdformat13/vcpkg.json index 440bb85124..cd6c3dc4e9 100644 --- a/ports/sdformat13/vcpkg.json +++ b/ports/sdformat13/vcpkg.json @@ -1,6 +1,7 @@ { "name": "sdformat13", "version": "13.5.0", + "port-version": 1, "description": "Simulation Description Format (SDF) parser and description files.", "homepage": "http://sdformat.org/", "license": "Apache-2.0", diff --git a/versions/baseline.json b/versions/baseline.json index f7864d6305..fccab23d3c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7446,7 +7446,7 @@ }, "sdformat13": { "baseline": "13.5.0", - "port-version": 0 + "port-version": 1 }, "sdformat6": { "baseline": "6.2.0", diff --git a/versions/s-/sdformat13.json b/versions/s-/sdformat13.json index ae3c3f2f90..5e08f899ee 100644 --- a/versions/s-/sdformat13.json +++ b/versions/s-/sdformat13.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "88424090fdd3b2122094e75be5c68b3f2f58cda5", + "version": "13.5.0", + "port-version": 1 + }, { "git-tree": "b8f7d3bdbefa0795808f6c9a42764584d6e96f2c", "version": "13.5.0",