diff --git a/ports/sdformat13/cmake-config.patch b/ports/sdformat13/cmake-config.patch new file mode 100644 index 00000000000000..34970b6dc6bd98 --- /dev/null +++ b/ports/sdformat13/cmake-config.patch @@ -0,0 +1,23 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3465a8f..2b57440 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -26,6 +26,7 @@ else() + target_link_libraries(using_parser_urdf INTERFACE + GzURDFDOM::GzURDFDOM) + endif() ++install(TARGETS using_parser_urdf EXPORT ${PROJECT_LIBRARY_TARGET_NAME} COMPONENT libraries) + + if (BUILD_TESTING) + # Build this test file only if Gazebo Tools is installed. + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,6 +58,6 @@ + if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF) +- gz_find_package(GzURDFDOM VERSION 1.0 QUIET) ++ gz_find_package(GzURDFDOM) + if (NOT GzURDFDOM_FOUND) + if (NOT DEFINED USE_INTERNAL_URDF) + # fallback to internal urdf + set(USE_INTERNAL_URDF ON) diff --git a/ports/sdformat13/no-absolute.patch b/ports/sdformat13/no-absolute.patch new file mode 100644 index 00000000000000..42ea51baa8cedf --- /dev/null +++ b/ports/sdformat13/no-absolute.patch @@ -0,0 +1,38 @@ +diff --git a/include/sdf/config.hh.in b/include/sdf/config.hh.in +index d1b3db53..9a9ce91d 100644 +--- a/include/sdf/config.hh.in ++++ b/include/sdf/config.hh.in +@@ -48,5 +48,3 @@ + #cmakedefine SDFORMAT_DISABLE_CONSOLE_LOGFILE 1 + +-#define SDF_SHARE_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/" +-#define SDF_VERSION_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/sdformat${SDF_MAJOR_VERSION}/${SDF_PKG_VERSION}" + +diff --git a/src/SDF.cc b/src/SDF.cc +index 20dcd4c6..802cbde3 100644 +--- a/src/SDF.cc ++++ b/src/SDF.cc +@@ -97,22 +97,6 @@ std::string findFile(const std::string &_filename, bool _searchLocalPath, + filename = filename.substr(idx + sep.length()); + } + +- // Next check the install path. +- std::string path = sdf::filesystem::append(SDF_SHARE_PATH, filename); +- if (sdf::filesystem::exists(path)) +- { +- return path; +- } +- +- // Next check the versioned install path. +- path = sdf::filesystem::append(SDF_SHARE_PATH, +- "sdformat" SDF_MAJOR_VERSION_STR, +- sdf::SDF::Version(), filename); +- if (sdf::filesystem::exists(path)) +- { +- return path; +- } +- + // Next check to see if the given file exists. +- path = filename; ++ std::string path = filename; + if (sdf::filesystem::exists(path)) diff --git a/ports/sdformat13/portfile.cmake b/ports/sdformat13/portfile.cmake new file mode 100644 index 00000000000000..146dd44ec0df89 --- /dev/null +++ b/ports/sdformat13/portfile.cmake @@ -0,0 +1,34 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO gazebosim/sdformat + REF "sdformat13_${VERSION}" + SHA512 adc555527aadaede84d6fde11555bf4872028d9e895fc47c89f4077452fde9a52b233d60d0cbff5a098e261c7810aa2dc38a6275ec9f37ba4d0161af98e2aade + HEAD_REF sdf13 + PATCHES + no-absolute.patch + cmake-config.patch +) + +# Ruby is required by the sdformat build process +vcpkg_find_acquire_program(RUBY) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "-DRUBY=${RUBY}" + -DBUILD_TESTING=OFF + -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 +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/sdformat13") +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/sdformat13/vcpkg.json b/ports/sdformat13/vcpkg.json new file mode 100644 index 00000000000000..440bb85124adcb --- /dev/null +++ b/ports/sdformat13/vcpkg.json @@ -0,0 +1,23 @@ +{ + "name": "sdformat13", + "version": "13.5.0", + "description": "Simulation Description Format (SDF) parser and description files.", + "homepage": "http://sdformat.org/", + "license": "Apache-2.0", + "supports": "!uwp", + "dependencies": [ + "gz-math7", + "gz-tools2", + "gz-utils2", + "tinyxml2", + "urdfdom", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 6b4dc362ba019a..6c23270df283d9 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7444,6 +7444,10 @@ "baseline": "10.0.0", "port-version": 3 }, + "sdformat13": { + "baseline": "13.5.0", + "port-version": 0 + }, "sdformat6": { "baseline": "6.2.0", "port-version": 6 diff --git a/versions/s-/sdformat13.json b/versions/s-/sdformat13.json new file mode 100644 index 00000000000000..ae3c3f2f9006f6 --- /dev/null +++ b/versions/s-/sdformat13.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "b8f7d3bdbefa0795808f6c9a42764584d6e96f2c", + "version": "13.5.0", + "port-version": 0 + } + ] +}