summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CPackRPM.cmake32
-rw-r--r--Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake4
2 files changed, 32 insertions, 4 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 1eb4315..ac2ddc0 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -1415,10 +1415,38 @@ function(cpack_rpm_debugsymbol_check INSTALL_FILES WORKING_DIR)
string(APPEND TMP_RPM_DEBUGINFO_INSTALL "${part_}\n")
endforeach()
+ if(NOT DEFINED CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS)
+ set(CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS /usr /usr/src /usr/src/debug)
+ if(CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS_ADDITION)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: Adding ${CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS_ADDITION} to builtin omit list.")
+ endif()
+ list(APPEND CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS "${CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS_ADDITION}")
+ endif()
+ endif()
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS= ${CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS}")
+ endif()
+
list(REMOVE_DUPLICATES additional_sources_)
+ unset(additional_sources_all_)
+ foreach(source_ IN LISTS additional_sources_)
+ string(REPLACE "/" ";" split_source_ " ${source_}")
+ list(REMOVE_AT split_source_ 0)
+ unset(tmp_path_)
+ # Now generate all segments of the path
+ foreach(segment_ IN LISTS split_source_)
+ string(APPEND tmp_path_ "/${segment_}")
+ list(APPEND additional_sources_all_ "${tmp_path_}")
+ endforeach()
+ endforeach()
+
+ list(REMOVE_DUPLICATES additional_sources_all_)
+ list(REMOVE_ITEM additional_sources_all_ ${CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS})
+
unset(TMP_DEBUGINFO_ADDITIONAL_SOURCES)
- foreach(part_ IN LISTS additional_sources_)
- string(APPEND TMP_DEBUGINFO_ADDITIONAL_SOURCES "${part_}\n")
+ foreach(source_ IN LISTS additional_sources_all_)
+ string(APPEND TMP_DEBUGINFO_ADDITIONAL_SOURCES "${source_}\n")
endforeach()
set(TMP_RPM_DEBUGINFO_INSTALL "${TMP_RPM_DEBUGINFO_INSTALL}" PARENT_SCOPE)
diff --git a/Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake
index 9e62a62..a583e32 100644
--- a/Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/RPM/DEBUGINFO-ExpectedFiles.cmake
@@ -9,6 +9,6 @@ set(EXPECTED_FILE_3 "debuginfo*-libs.rpm")
set(EXPECTED_FILE_CONTENT_3 "^/usr/bas${whitespaces_}/usr/bas/libtest_lib.so$")
set(EXPECTED_FILE_4 "debuginfo-applications-debuginfo*.rpm")
-set(EXPECTED_FILE_CONTENT_4 ".*/src/src_1/main.cpp.*")
+set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*")
set(EXPECTED_FILE_5 "debuginfo-libs-debuginfo*.rpm")
-set(EXPECTED_FILE_CONTENT_5 ".*/src/src_1/test_lib.cpp.*")
+set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*")