Unable to establish inter-component dependencies with CPack
I have configured my project to generate multiple sub-packages using
set(CPACK_DEB_COMPONENT_INSTALL ON)
Unfortunately, the documented way to declare dependencies between components doesn't work. Please find attached a sample CMakeLists.txt that generates two packages. I want the dev
package to be dependent on the runtime
package, but dpkg --info
reports both to be entirely independent, no matter how I call
set(CPACK_COMPONENT_DEV_DEPENDS runtime)
. Example CMakeLists.txt to demonstrate the problem:
project(demo)
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "joe random")
set(CPACK_COMPONENTS_ALL runtime dev)
set(CPACK_COMPONENT_DEV_DEPENDS runtime) # <- this line doesn't seem to have any effect
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
include(CPack)
file(WRITE a "runtime")
file(WRITE b "dev")
install(FILES a DESTINATION share COMPONENT runtime)
install(FILES b DESTINATION share COMPONENT dev)