# CPack / CPACK\_COMPONENTS\_ALL

**URL:** https://discourse.cmake.org/t/cpack-cpack-components-all/1631
**Category:** Usage
**Created:** [July 27, 2020, 3:30pm UTC](https://discourse.cmake.org/t/cpack-cpack-components-all/1631 "2020-07-27T15:30:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![John\_Eivind\_Helset](https://discourse.cmake.org/user_avatar/discourse.cmake.org/john_eivind_helset/32/767_2.png) [@John\_Eivind\_Helset](https://discourse.cmake.org/u/John_Eivind_Helset)
#### Post date: [July 27, 2020, 3:30pm UTC](https://discourse.cmake.org/t/cpack-cpack-components-all/1631/1 "2020-07-27T15:30:27Z")

</div>

CPack clears out CPACK\_COMPONENTS\_ALL if there is only one component in it, event though the component was explicitly specified in the install commands, and CPACK\_EXTERNAL\_COMPONENT\_INSTALL was set to 1 (I was using an external-packaging-script).

The particular line is here:  
[https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/CPack.cmake#L785](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/CPack.cmake#L785)

Am I supposed to add the components after i include CPack like the comment in CPack.cmake seems to suggest?

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [July 28, 2020, 10:58pm UTC](https://discourse.cmake.org/t/cpack-cpack-components-all/1631/2 "2020-07-28T22:58:55Z")

</div>

@kyle.edwards What is the CPack external generator expected to do in this case? I can sorta understand why in general we would ignore components if there is only one defined. Without it, the common case of producing a single package when components are defined might not give the expected result (it might trigger adding the component name into the package name, for example). I assume the external generator just follows that logic and doesn’t change the default behavior?
