-
Notifications
You must be signed in to change notification settings - Fork 19
/
CMakeLists.txt
40 lines (31 loc) · 1.31 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 2.8.11)
project(icub-gazebo)
# Add models (this are tipically contained in a models subdirectory,
# but for the time being we keep them in the main folder to
# preserve back-compatibility)
# List the subdirectories (http://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory)
macro(SUBDIRLIST result curdir)
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
foreach(child ${children})
if(IS_DIRECTORY ${curdir}/${child})
list(APPEND dirlist ${child})
endif()
endforeach()
set(${result} ${dirlist})
endmacro()
# Get list of models
subdirlist(subdirs ${CMAKE_CURRENT_SOURCE_DIR})
# Remove the worlds directory that is not a model
list(REMOVE_ITEM subdirs "worlds")
# Remove the urdf directory that is not a Gazebo-ready model
list(REMOVE_ITEM subdirs "urdf")
# Install each model
foreach (dir ${subdirs})
install (DIRECTORY ${dir} DESTINATION share/gazebo/models)
endforeach ()
# Add worlds
add_subdirectory(worlds)
# Install legacy URDF models roughly corresponding to iCub (no hands),
# see https://github.com/robotology/yarp-wholebodyinterface/issues/84 for more info
install(FILES urdf/model.urdf DESTINATION share/iCub/robots/icubGazeboSim)