fix rosbuild_untar_file bug #3034

This commit is contained in:
Brian Gerkey 2010-12-30 16:35:31 +00:00
parent 2dc4267f6c
commit 04ab3aacec
1 changed files with 4 additions and 0 deletions

View File

@ -919,6 +919,10 @@ endmacro(rosbuild_download_test_data)
# depend on the result of untarring the file (can be ALL).
macro(rosbuild_untar_file _filename _unpacked_name)
get_filename_component(unpack_dir ${_filename} PATH)
# Check whether the filename has a directory component, #3034
if(NOT unpack_dir)
set(unpack_dir ${PROJECT_SOURCE_DIR})
endif(NOT unpack_dir)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/${_unpacked_name}
COMMAND rm -rf ${PROJECT_SOURCE_DIR}/${_unpacked_name}
COMMAND tar xvCf ${unpack_dir} ${PROJECT_SOURCE_DIR}/${_filename}