-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
32 lines (26 loc) · 985 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
28
29
30
31
32
cmake_minimum_required(VERSION 3.0.2)
project(warehouse)
find_package(catkin REQUIRED COMPONENTS gazebo_ros)
catkin_package(DEPENDS gazebo_ros)
# create the appropriate files for tools
set(BUILD_MODEL_DIR ${PROJECT_SOURCE_DIR}/models)
file(GLOB SUBDIRS ${PROJECT_SOURCE_DIR}/3Dwarehouse/tools/*)
foreach(SUBDIR ${SUBDIRS})
get_filename_component(MODEL_NAME ${SUBDIR} NAME)
set(MODEL_DIR ${BUILD_MODEL_DIR}/${MODEL_NAME})
# create the description.sdf for the model
configure_file(
${PROJECT_SOURCE_DIR}/description.sdf.template
${MODEL_DIR}/sdf/description.sdf
)
# move mesh files
file(GLOB MESHES ${SUBDIR}/*.dae)
file(COPY ${MESHES} DESTINATION ${MODEL_DIR}/mesh)
# move texture folders into the mesh directory
file(GLOB TEXTURES ${SUBDIR}/*)
foreach(TEXTURE ${TEXTURES})
if(IS_DIRECTORY ${TEXTURE})
file(COPY ${TEXTURE} DESTINATION ${MODEL_DIR}/mesh)
endif()
endforeach()
endforeach()