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>
(cherry picked from commit ea81c7295c)
v3.5.13-sru
Slávek Banko 6 years ago
parent 34a74a33cf
commit d3232e0c86
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1470,8 +1470,8 @@ macro( tde_create_tarball )
# found directive "DESTINATION" # found directive "DESTINATION"
if( "+${_arg}" STREQUAL "+DESTINATION" ) if( "+${_arg}" STREQUAL "+DESTINATION" )
unset( _dest ) unset( _destination )
set( _var _dest ) set( _var _destination )
set( _directive 1 ) set( _directive 1 )
endif( ) endif( )
@ -1492,6 +1492,11 @@ macro( tde_create_tarball )
file( GLOB_RECURSE _files RELATIVE ${_sourcedir} "${_sourcedir}/*" ) file( GLOB_RECURSE _files RELATIVE ${_sourcedir} "${_sourcedir}/*" )
endif( ) 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 ) get_filename_component( _target_path "${CMAKE_CURRENT_BINARY_DIR}/${_target}" ABSOLUTE )
file( RELATIVE_PATH _target_path "${CMAKE_BINARY_DIR}" "${_target_path}" ) file( RELATIVE_PATH _target_path "${CMAKE_BINARY_DIR}" "${_target_path}" )
string( REPLACE "/" "+" _target_name "${_target_path}" ) string( REPLACE "/" "+" _target_name "${_target_path}" )
@ -1502,7 +1507,7 @@ macro( tde_create_tarball )
COMMAND ${CMAKE_COMMAND} -E tar "cfz" "${CMAKE_CURRENT_BINARY_DIR}/${_target}" -- ${_files} COMMAND ${CMAKE_COMMAND} -E tar "cfz" "${CMAKE_CURRENT_BINARY_DIR}/${_target}" -- ${_files}
WORKING_DIRECTORY "${_sourcedir}" WORKING_DIRECTORY "${_sourcedir}"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_target}" OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_target}"
DEPENDS ${_files} DEPENDS ${_files_deps}
COMMENT "Create tarball ${_target_path}" COMMENT "Create tarball ${_target_path}"
) )

Loading…
Cancel
Save