forked from ToyotaResearchInstitute/hsr_description
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
27 lines (21 loc) · 969 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (C) 2016 Toyota Motor Corporation
# vim: fileencoding=utf-8 :
cmake_minimum_required(VERSION 2.8.3)
project(hsr_description)
find_package(catkin REQUIRED COMPONENTS rosbash xacro)
file(GLOB _robot_xacros "${PROJECT_SOURCE_DIR}/robots/*.urdf.xacro")
file(GLOB_RECURSE _component_xacros "${PROJECT_SOURCE_DIR}/urdf/*.xacro")
# Generate robot URDFs from each *.urdf.xacro files.
foreach(_xacro ${_robot_xacros})
get_filename_component(_dir ${_xacro} PATH)
get_filename_component(_name ${_xacro} NAME_WE)
set(_urdf ${_dir}/${_name}.urdf)
add_custom_command(
OUTPUT ${_urdf}
DEPENDS ${_xacro} ${_component_xacros}
COMMAND ${CATKIN_DEVEL_PREFIX}/env.sh rosrun xacro xacro ${_xacro} > ${_urdf})
add_custom_target(${PROJECT_NAME}_${_name}_gen_urdf ALL DEPENDS ${_urdf})
endforeach()
catkin_package(CATKIN_DEPENDS xacro)
install(DIRECTORY launch robots urdf
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/)