Fix tde_create_tarball macro

+ The destination path for the installation was not properly used.
+ Dependency on source files was wrong when SOURCEDIR was used.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/15/head
Slávek Banko 5 years ago
parent 5c09613711
commit ea81c7295c
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1620,8 +1620,8 @@ macro( tde_create_tarball )
# found directive "DESTINATION"
if( "+${_arg}" STREQUAL "+DESTINATION" )
unset( _dest )
set( _var _dest )
unset( _destination )
set( _var _destination )
set( _directive 1 )
endif( )
@ -1642,6 +1642,11 @@ macro( tde_create_tarball )
file( GLOB_RECURSE _files RELATIVE ${_sourcedir} "${_sourcedir}/*" )
endif( )
unset( _files_deps )
foreach( _file ${_files} )
list( APPEND _files_deps "${_sourcedir}/${_file}" )
endforeach( )
get_filename_component( _target_path "${CMAKE_CURRENT_BINARY_DIR}/${_target}" ABSOLUTE )
file( RELATIVE_PATH _target_path "${CMAKE_BINARY_DIR}" "${_target_path}" )
string( REPLACE "/" "+" _target_name "${_target_path}" )
@ -1652,7 +1657,7 @@ macro( tde_create_tarball )
COMMAND ${CMAKE_COMMAND} -E tar "cfz" "${CMAKE_CURRENT_BINARY_DIR}/${_target}" -- ${_files}
WORKING_DIRECTORY "${_sourcedir}"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_target}"
DEPENDS ${_files}
DEPENDS ${_files_deps}
COMMENT "Create tarball ${_target_path}"
)

Loading…
Cancel
Save