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

Update system.yml #208

Open
wants to merge 14 commits into
base: iron
Choose a base branch
from
Open
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
19 changes: 0 additions & 19 deletions .github/workflows/ros1.yaml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/ros2.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: urdfdom ROS2 CI
name: urdfdom ROS 2 CI

on:
push:
Expand All @@ -8,13 +8,13 @@ on:
jobs:

build_ros2:
name: ROS2 CI
runs-on: ubuntu-20.04
name: ROS 2 CI
runs-on: ubuntu-22.04
steps:
- uses: ros-tooling/setup-ros@v0.2
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: galactic
- uses: ros-tooling/action-ros-ci@v0.2
required-ros-distributions: rolling
- uses: ros-tooling/action-ros-ci@v0.3
with:
package-name: urdfdom
target-ros2-distro: galactic
target-ros2-distro: rolling
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ jobs:
cxx: "g++",
}
- {
name: "Ubuntu Bionic GCC",
os: ubuntu-18.04,
name: "Ubuntu Focal GCC",
os: ubuntu-20.04,
build_type: "Release",
cc: "gcc",
cxx: "g++",
}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'Ubuntu')
run: |
sudo apt-get -qq update
sudo apt-get -qq upgrade -y
sudo apt-get -qq install -y build-essential cmake libconsole-bridge-dev liburdfdom-headers-dev libtinyxml-dev
sudo apt-get -qq install -y build-essential cmake libconsole-bridge-dev liburdfdom-headers-dev libtinyxml2-dev
cmake --version
gcc --version

Expand Down
66 changes: 33 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required( VERSION 3.5 FATAL_ERROR )
project (urdfdom CXX C)

set (URDF_MAJOR_VERSION 3)
set (URDF_MAJOR_VERSION 4)
set (URDF_MINOR_VERSION 0)
set (URDF_PATCH_VERSION 2)
set (URDF_PATCH_VERSION 1)

set (URDF_VERSION ${URDF_MAJOR_VERSION}.${URDF_MINOR_VERSION}.${URDF_PATCH_VERSION})
set (URDF_MAJOR_MINOR_VERSION ${URDF_MAJOR_VERSION}.${URDF_MINOR_VERSION})
Expand Down Expand Up @@ -43,18 +43,11 @@ if(MSVC OR MSVC90 OR MSVC10)
set(MSVC ON)
endif (MSVC OR MSVC90 OR MSVC10)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

find_package(tinyxml_vendor QUIET)
find_package(TinyXML)
# bionic has not cmake module, workaround
if (NOT TinyXML_FOUND AND UNIX)
include(FindPkgConfig)
pkg_check_modules (TinyXML tinyxml)
else()
# Make it fail in platforms without pkgconfig
find_package(TinyXML REQUIRED) # bionic has not cmake module
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

find_package(tinyxml2_vendor QUIET)
find_package(TinyXML2 REQUIRED)

find_package(urdfdom_headers 1.0 REQUIRED)
find_package(console_bridge_vendor QUIET) # Provides console_bridge 0.4.0 on platforms without it.
find_package(console_bridge REQUIRED)
Expand All @@ -66,36 +59,43 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}"

enable_testing()

if(WIN32 AND NOT CYGWIN)
set(CMAKE_CONFIG_INSTALL_DIR CMake)
else()
set(CMAKE_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake)
endif()
set(CMAKE_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake)
string(REGEX REPLACE "[^/]+" ".." RELATIVE_PATH_CMAKE_DIR_TO_PREFIX "${CMAKE_CONFIG_INSTALL_DIR}")
string(REGEX REPLACE "[^/]+" ".." RELATIVE_PATH_LIBDIR_TO_PREFIX "${CMAKE_INSTALL_LIBDIR}")

add_subdirectory(urdf_parser)

set(PKG_NAME ${PROJECT_NAME})
set(PKG_LIBRARIES urdfdom_sensor urdfdom_model_state urdfdom_model urdfdom_world)
set(PKG_DEPENDS urdfdom_headers console_bridge)
set(PKG_DEPENDS urdfdom_headers)
set(PKG_EXPORTS urdfdom)
set(cmake_conf_file "cmake/urdfdom-config.cmake")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${cmake_conf_file}.in" "${CMAKE_BINARY_DIR}/${cmake_conf_file}" @ONLY)
set(cmake_conf_file "cmake/urdfdom-config")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}Version.cmake"
VERSION ${URDF_VERSION}
COMPATIBILITY SameMajorVersion
)
configure_package_config_file("${cmake_conf_file}.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}.cmake"
INSTALL_DESTINATION ${CMAKE_CONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}Version.cmake"
DESTINATION ${CMAKE_CONFIG_INSTALL_DIR}
)

install(FILES package.xml DESTINATION share/${PROJECT_NAME})
install(FILES ${CMAKE_BINARY_DIR}/${cmake_conf_file}
DESTINATION ${CMAKE_CONFIG_INSTALL_DIR} COMPONENT cmake)

# 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()
set(PKG_DESC "Unified Robot Description Format")
set(PKG_DEPENDS "urdfdom_headers") # 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)


# Add uninstall target
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ urdfdom
The URDF (U-Robot Description Format) library provides core data structures and a simple XML parsers for populating the class data structures from an URDF file.

For now, the details of the URDF specifications reside on http://ros.org/wiki/urdf

### Build Status
[![Build Status](https://travis-ci.org/ros/urdfdom.png)](https://travis-ci.org/ros/urdfdom)

### Using with ROS

Expand Down
74 changes: 0 additions & 74 deletions cmake/FindTinyXML.cmake

This file was deleted.

78 changes: 78 additions & 0 deletions cmake/FindTinyXML2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# TinyXML2_FOUND
# TinyXML2_INCLUDE_DIRS
# TinyXML2_LIBRARIES

# try to find the CMake config file for TinyXML2 first
if(NOT TinyXML2_FOUND)
find_package(TinyXML2 CONFIG QUIET)
endif()
if(TinyXML2_FOUND)
message(STATUS "Found TinyXML2 via Config file: ${TinyXML2_DIR}")
if(NOT TINYXML2_LIBRARY)
# in this case, we're probably using TinyXML2 version 5.0.0 or greater
# in which case tinyxml2 is an exported target and we should use that
if(TARGET tinyxml2)
set(TINYXML2_LIBRARY tinyxml2)
elseif(TARGET tinyxml2::tinyxml2)
set(TINYXML2_LIBRARY tinyxml2::tinyxml2)
elseif(TinyXML2_FIND_REQUIRED)
message(FATAL_ERROR "Unable to determine target for TinyXML2")
endif()
list(APPEND TinyXML2_TARGETS ${TINYXML2_LIBRARY})
else()
# Only perform that logic once
if(NOT TARGET tinyxml2::tinyxml2)
# TINYXML2_LIBRARY is composed of debug;<path\to\debug.lib>;optimized;<path\to\release.lib>
# we have to extract the appropriate component based on the current configuration.
list(LENGTH TINYXML2_LIBRARY TINYXML_LIBRARY_LIST_LENGTH)
if(NOT ${TINYXML_LIBRARY_LIST_LENGTH} EQUAL 4)
message(FATAL_ERROR "Unable to extract the library file path from ${TINYXML2_LIBRARY}")
endif()
if(CMAKE_BUILD_TYPE MATCHES DEBUG)
list(GET TINYXML2_LIBRARY 0 ASSERT_DEBUG)
if(NOT ${ASSERT_DEBUG} STREQUAL "debug")
message(FATAL_ERROR "could not parse debug library path from ${TINYXML2_LIBRARY}")
endif()
list(GET TINYXML2_LIBRARY 1 TINYXML2_LIBRARY_PATH)
else()
list(GET TINYXML2_LIBRARY 2 ASSERT_OPTIMIZED)
if(NOT ${ASSERT_OPTIMIZED} STREQUAL "optimized")
message(FATAL_ERROR "could not parse library path from ${TINYXML2_LIBRARY}")
endif()
list(GET TINYXML2_LIBRARY 3 TINYXML2_LIBRARY_PATH)
endif()
if(NOT EXISTS ${TINYXML2_LIBRARY_PATH})
message(FATAL_ERROR "library file path ${TINYXML2_LIBRARY_PATH} does not exist")
endif()

add_library(tinyxml2::tinyxml2 UNKNOWN IMPORTED)
set_property(TARGET tinyxml2::tinyxml2 PROPERTY IMPORTED_LOCATION ${TINYXML2_LIBRARY_PATH})
set_property(TARGET tinyxml2::tinyxml2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${TINYXML2_INCLUDE_DIR})
list(APPEND TinyXML2_TARGETS tinyxml2::tinyxml2)
endif()
endif()
else()
find_path(TINYXML2_INCLUDE_DIR NAMES tinyxml2.h)

find_library(TINYXML2_LIBRARY tinyxml2)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR)

mark_as_advanced(TINYXML2_INCLUDE_DIR TINYXML2_LIBRARY)

if(NOT TARGET tinyxml2::tinyxml2)
add_library(tinyxml2::tinyxml2 UNKNOWN IMPORTED)
set_property(TARGET tinyxml2::tinyxml2 PROPERTY IMPORTED_LOCATION ${TINYXML2_LIBRARY})
set_property(TARGET tinyxml2::tinyxml2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${TINYXML2_INCLUDE_DIR})
list(APPEND TinyXML2_TARGETS tinyxml2::tinyxml2)
endif()
endif()

# Set mixed case INCLUDE_DIRS and LIBRARY variables from upper case ones.
if(NOT TinyXML2_INCLUDE_DIRS)
set(TinyXML2_INCLUDE_DIRS ${TINYXML2_INCLUDE_DIR})
endif()
if(NOT TinyXML2_LIBRARIES)
set(TinyXML2_LIBRARIES ${TINYXML2_LIBRARY})
endif()
10 changes: 9 additions & 1 deletion cmake/urdfdom-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
@PACKAGE_INIT@

if (@PKG_NAME@_CONFIG_INCLUDED)
return()
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@")
set(CMAKE_MODULE_PATH_BACKUP_URDFDOM ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH "${@PROJECT_NAME@_DIR}")

set(@PKG_NAME@_INCLUDE_DIRS "${@PROJECT_NAME@_DIR}/@RELATIVE_PATH_CMAKE_DIR_TO_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@")

foreach(lib @PKG_LIBRARIES@)
set(onelib "${lib}-NOTFOUND")
Expand All @@ -30,6 +35,7 @@ foreach(lib @PKG_LIBRARIES@)
list(APPEND @PKG_NAME@_TARGETS @PROJECT_NAME@::${lib})
endforeach()

find_package(tinyxml2_vendor QUIET)
foreach(dep @PKG_DEPENDS@)
if(NOT ${dep}_FOUND)
find_package(${dep})
Expand All @@ -41,3 +47,5 @@ endforeach()
foreach(exp @PKG_EXPORTS@)
include(${@PROJECT_NAME@_DIR}/${exp}Export.cmake)
endforeach()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH_BACKUP_URDFDOM})
Loading