CPack/DEB: CPACK_DEBIAN_DEBUGINFO_PACKAGE does not work with CPACK_STRIP_FILES
I am trying to use CMake to generate packages that are stripped, but would like to provide debuginfo packages for developers to use, but it seems like CPack checks if the package has debug info after stripping it, so obviously has no debug info. Simple repro (adapted from https://gitlab.com/manuel_wagesreither/dbgsym-cpack):
cmake_minimum_required(VERSION 3.13)
project( demonstrator
DESCRIPTION "Bug demonstrator"
VERSION 1.0.0
)
write_file(${CMAKE_SOURCE_DIR}/code.cpp "int library_function() { return 1; }")
write_file(${CMAKE_SOURCE_DIR}/code.hpp "int library_function();")
add_library( my_library SHARED code.cpp)
set_target_properties ( my_library
PROPERTIES
PUBLIC_HEADER "code.hpp" )
install(
TARGETS my_library
ARCHIVE
DESTINATION lib
COMPONENT runtime
LIBRARY
DESTINATION lib
COMPONENT runtime
PUBLIC_HEADER
DESTINATION include
COMPONENT development
)
set( CPACK_PACKAGE_NAME ${PROJECT_NAME} )
set( CPACK_PACKAGE_CONTACT "Contact name" )
set( CPACK_PACKAGE_VERSION ${PROJECT_VERSION} )
set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Description" )
set( CPACK_GENERATOR DEB )
set( CPACK_DEB_COMPONENT_INSTALL ON )
set( CPACK_DEBIAN_PACKAGE_DEPENDS "" )
set( CPACK_DEBIAN_DEBUGINFO_PACKAGE ON )
# set(CPACK_STRIP_FILES ON)
include( CPack )
As is, it creates a .ddeb
file, but if you uncomment the CPACK_STRIP_FILES
line, it doesn't create one anymore, as I would expect.
Would appreciate any info or workarounds--if this is a useful feature I'm happy to contribute as well.
I'm using cmake 3.20.2
Edited by Brad King