summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-17 18:14:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-11-17 18:14:54 (GMT)
commit0b47e940cf4be6f806210214afba1b4a16011eeb (patch)
treeba1b90e16f55e6240e5e514485768158ee949462
parent0c0e7525c450a7fa70ca799dea033c6e08415bf8 (diff)
parentc826745f5af81c3b1eb9448a102ca247752aa760 (diff)
downloadCMake-0b47e940cf4be6f806210214afba1b4a16011eeb.zip
CMake-0b47e940cf4be6f806210214afba1b4a16011eeb.tar.gz
CMake-0b47e940cf4be6f806210214afba1b4a16011eeb.tar.bz2
Merge topic 'cpack-deb-no-dbgsyms'
c826745f5a CPack/DEB: Do not crash when asked for debug symbols when there are none Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5443
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake4
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx3
-rw-r--r--Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake5
4 files changed, 15 insertions, 2 deletions
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index 431b074..48d451a 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -768,6 +768,10 @@ function(cpack_deb_prepare_package_vars)
set(GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME "${CPACK_DBGSYM_OUTPUT_FILE_NAME}" PARENT_SCOPE)
list(JOIN BUILD_IDS " " BUILD_IDS)
set(GEN_BUILD_IDS "${BUILD_IDS}" PARENT_SCOPE)
+ else()
+ unset(GEN_DBGSYMDIR PARENT_SCOPE)
+ unset(GEN_CPACK_DBGSYM_OUTPUT_FILE_NAME PARENT_SCOPE)
+ unset(GEN_BUILD_IDS PARENT_SCOPE)
endif()
endfunction()
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 560e5c1..6f21d87 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -507,7 +507,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME"));
packageFileNames.push_back(std::move(packageFileName));
- if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE")) {
+ if (this->IsOn("GEN_CPACK_DEBIAN_DEBUGINFO_PACKAGE") &&
+ this->GetOption("GEN_DBGSYMDIR")) {
cmsys::Glob gl;
std::string findExpr(this->GetOption("GEN_DBGSYMDIR"));
findExpr += "/*";
diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake
index cf2e8ac..cf4aa51 100644
--- a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake
@@ -1,6 +1,6 @@
set(whitespaces_ "[\t\n\r ]*")
-set(EXPECTED_FILES_COUNT "5")
+set(EXPECTED_FILES_COUNT "6")
set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE)
if(GENERATOR_TYPE STREQUAL "RPM")
@@ -39,3 +39,6 @@ elseif(GENERATOR_TYPE STREQUAL "DEB")
set(EXPECTED_FILE_5 "TestDinfo-pkg-libs-dbgsym.ddeb")
set(EXPECTED_FILE_CONTENT_5 ".*/usr/lib/debug/.build-id/.*\.debug.*")
endif()
+
+set(EXPECTED_FILE_6 "TestDinfo-pkg*-appheaders.${PKG}")
+set(EXPECTED_FILE_CONTENT_6_LIST "/include;/include/test_lib.hpp")
diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake
index 161a36a..d270005 100644
--- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake
+++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake
@@ -23,6 +23,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
target_link_libraries(test_prog test_lib)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" DESTINATION include COMPONENT appheaders)
install(TARGETS test_prog DESTINATION foo COMPONENT applications)
install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers)
install(TARGETS test_lib DESTINATION bas COMPONENT libs)
@@ -40,6 +41,10 @@ set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON)
set(CPACK_DEBIAN_PACKAGE_NAME "Debuginfo")
set(CPACK_DEBIAN_LIBS_DEBUGINFO_PACKAGE ON)
+# Test that a component with debug info requested but without any debug info produces none
+set(CPACK_RPM_APPHEADERS_DEBUGINFO_PACKAGE ON)
+set(CPACK_DEBIAN_APPHEADERS_DEBUGINFO_PACKAGE ON)
+
# test debuginfo package rename
set(CPACK_RPM_DEBUGINFO_FILE_NAME
"@cpack_component@-DebugInfoPackage.rpm")