aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/urdfdom
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/urdfdom')
-rw-r--r--vcpkg/ports/urdfdom/0001_use_math_defines.patch15
-rw-r--r--vcpkg/ports/urdfdom/0005-fix-config-and-install.patch40
-rw-r--r--vcpkg/ports/urdfdom/0006-pc_file_for_windows.patch17
-rw-r--r--vcpkg/ports/urdfdom/portfile.cmake41
-rw-r--r--vcpkg/ports/urdfdom/vcpkg.json21
5 files changed, 134 insertions, 0 deletions
diff --git a/vcpkg/ports/urdfdom/0001_use_math_defines.patch b/vcpkg/ports/urdfdom/0001_use_math_defines.patch
new file mode 100644
index 0000000..5197b56
--- /dev/null
+++ b/vcpkg/ports/urdfdom/0001_use_math_defines.patch
@@ -0,0 +1,15 @@
+diff --git a/urdf_parser/CMakeLists.txt b/urdf_parser/CMakeLists.txt
+index ac7c079..67f175d 100644
+--- a/urdf_parser/CMakeLists.txt
++++ b/urdf_parser/CMakeLists.txt
+@@ -23,6 +23,10 @@ macro(add_urdfdom_library)
+ SOVERSION ${URDF_MAJOR_MINOR_VERSION})
+ endmacro()
+
++if(MSVC)
++ add_definitions(-D_USE_MATH_DEFINES)
++endif()
++
+ if(TARGET console_bridge::console_bridge)
+ set(console_bridge_link_libs "console_bridge::console_bridge")
+ else()
diff --git a/vcpkg/ports/urdfdom/0005-fix-config-and-install.patch b/vcpkg/ports/urdfdom/0005-fix-config-and-install.patch
new file mode 100644
index 0000000..902d633
--- /dev/null
+++ b/vcpkg/ports/urdfdom/0005-fix-config-and-install.patch
@@ -0,0 +1,40 @@
+diff --git a/cmake/urdfdom-config.cmake.in b/cmake/urdfdom-config.cmake.in
+index d8eb93d..3e5c42a 100644
+--- a/cmake/urdfdom-config.cmake.in
++++ b/cmake/urdfdom-config.cmake.in
+@@ -3,8 +3,12 @@ if (@PKG_NAME@_CONFIG_INCLUDED)
+ endif()
+ set(@PKG_NAME@_CONFIG_INCLUDED TRUE)
+
+-set(@PKG_NAME@_INCLUDE_DIRS "${@PROJECT_NAME@_DIR}/@RELATIVE_PATH_CMAKE_DIR_TO_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@" "@TinyXML_INCLUDE_DIRS@")
++get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
++
++set(@PKG_NAME@_INCLUDE_DIRS "${_IMPORT_PREFIX}/include" "@TinyXML_INCLUDE_DIRS@")
+
++if (0)
+ foreach(lib @PKG_LIBRARIES@)
+ set(onelib "${lib}-NOTFOUND")
+ set(onelibd "${lib}-NOTFOUND")
+@@ -29,10 +33,14 @@ foreach(lib @PKG_LIBRARIES@)
+ endif()
+ list(APPEND @PKG_NAME@_TARGETS @PROJECT_NAME@::${lib})
+ endforeach()
++endif()
++
++include(CMakeFindDependencyMacro)
++find_dependency(console_bridge)
+
+ foreach(dep @PKG_DEPENDS@)
+ if(NOT ${dep}_FOUND)
+- find_package(${dep})
++ find_dependency(${dep})
+ endif()
+ list(APPEND @PKG_NAME@_INCLUDE_DIRS ${${dep}_INCLUDE_DIRS})
+ list(APPEND @PKG_NAME@_LIBRARIES ${${dep}_LIBRARIES})
+@@ -41,3 +49,5 @@ endforeach()
+ foreach(exp @PKG_EXPORTS@)
+ include(${@PROJECT_NAME@_DIR}/${exp}Export.cmake)
+ endforeach()
++
++set(@PKG_NAME@_LIBRARIES urdfdom::urdfdom_model urdfdom::urdfdom_world urdfdom::urdfdom_sensor urdfdom::urdfdom_model_state)
diff --git a/vcpkg/ports/urdfdom/0006-pc_file_for_windows.patch b/vcpkg/ports/urdfdom/0006-pc_file_for_windows.patch
new file mode 100644
index 0000000..83471ee
--- /dev/null
+++ b/vcpkg/ports/urdfdom/0006-pc_file_for_windows.patch
@@ -0,0 +1,17 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -89,11 +89,11 @@
+ # Make the package config file
+-if (NOT MSVC)
++
+ set(PKG_DESC "Unified Robot Description Format")
+ set(PKG_DEPENDS "urdfdom_headers console_bridge") # make the list separated by spaces instead of ;
+ set(PKG_URDF_LIBS "-lurdfdom_sensor -lurdfdom_model_state -lurdfdom_model -lurdfdom_world")
+ set(pkg_conf_file "cmake/pkgconfig/urdfdom.pc")
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${pkg_conf_file}.in" "${CMAKE_BINARY_DIR}/${pkg_conf_file}" @ONLY)
+ install(FILES ${CMAKE_BINARY_DIR}/${pkg_conf_file}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/ COMPONENT pkgconfig)
+-endif()
++
+
diff --git a/vcpkg/ports/urdfdom/portfile.cmake b/vcpkg/ports/urdfdom/portfile.cmake
new file mode 100644
index 0000000..fdafe4f
--- /dev/null
+++ b/vcpkg/ports/urdfdom/portfile.cmake
@@ -0,0 +1,41 @@
+vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ros/urdfdom
+ REF ${VERSION}
+ SHA512 6386954bc7883e82d9db7c785ae074b47ca31efb7cc2686101e7813768824bed5b46a774a1296453c39ff76673a9dc77305bb2ac96b86ecf93fab22062ef2258
+ HEAD_REF master
+ PATCHES
+ 0001_use_math_defines.patch
+ 0005-fix-config-and-install.patch
+ 0006-pc_file_for_windows.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_TESTING=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_copy_tools(TOOL_NAMES check_urdf urdf_mem_test urdf_to_graphiz urdf_to_graphviz AUTO_CLEAN)
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
+else()
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/urdfdom/cmake)
+ # Empty folders
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/urdfdom")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/urdfdom")
+endif()
+
+if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
+ vcpkg_fixup_pkgconfig()
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/urdfdom/vcpkg.json b/vcpkg/ports/urdfdom/vcpkg.json
new file mode 100644
index 0000000..f9ef20c
--- /dev/null
+++ b/vcpkg/ports/urdfdom/vcpkg.json
@@ -0,0 +1,21 @@
+{
+ "name": "urdfdom",
+ "version": "3.1.1",
+ "description": "Provides core data structures and a simple XML parsers for populating the class data structures from an URDF file.",
+ "homepage": "https://github.com/ros/urdfdom",
+ "license": "BSD-3-Clause",
+ "supports": "!staticcrt",
+ "dependencies": [
+ "console-bridge",
+ "tinyxml",
+ "urdfdom-headers",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}