diff options
author | Brad King <brad.king@kitware.com> | 2021-03-31 13:29:56 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-03-31 13:30:02 (GMT) |
commit | 45fae18f7b4bc85f11515153cad6e286c7dd62cc (patch) | |
tree | bdf11099fd18c48ae6b04333da603f7319de520e /Modules | |
parent | cda40a42f1c16ac91b4a3dc158d74b708d4eea06 (diff) | |
parent | d0adb2386a87046e9236b1b2b4d1c2706c78a711 (diff) | |
download | CMake-45fae18f7b4bc85f11515153cad6e286c7dd62cc.zip CMake-45fae18f7b4bc85f11515153cad6e286c7dd62cc.tar.gz CMake-45fae18f7b4bc85f11515153cad6e286c7dd62cc.tar.bz2 |
Merge topic 'cpackrpm-single-package-handling-empty-dir'
d0adb2386a CPackRPM: correctly handle empty dir in single package mode
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5951
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Internal/CPack/CPackRPM.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index 08bbc68..d853189 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -1349,15 +1349,21 @@ function(cpack_rpm_generate_package) continue() endif() - file(GLOB_RECURSE files_for_move_ LIST_DIRECTORIES false RELATIVE + file(GLOB_RECURSE files_for_move_ LIST_DIRECTORIES true RELATIVE "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${component_}" "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${component_}/*") foreach(f_ IN LISTS files_for_move_) - get_filename_component(dir_path_ "${f_}" DIRECTORY) set(src_file_ "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${component_}/${f_}") + if(IS_DIRECTORY "${src_file_}") + file(MAKE_DIRECTORY "${WDIR}/${f_}") + continue() + endif() + + get_filename_component(dir_path_ "${f_}" DIRECTORY) + # check that we are not overriding an existing file that doesn't # match the file that we want to copy if(EXISTS "${src_file_}" AND EXISTS "${WDIR}/${f_}") |