From d3232e0c86930174f9c74b6d98c616afd4c2c581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 14 Jan 2019 20:24:38 +0100 Subject: [PATCH] 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. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit ea81c7295c71a2280922034e0929c95496833459) --- modules/TDEMacros.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 0990b88..c48ad19 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -1470,8 +1470,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( ) @@ -1492,6 +1492,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}" ) @@ -1502,7 +1507,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}" )