# CPack produce multiple RPMs

**URL:** https://discourse.cmake.org/t/cpack-produce-multiple-rpms/7542
**Category:** Usage
**Tags:** cpack:rpm
**Created:** [February 26, 2023, 1:52pm UTC](https://discourse.cmake.org/t/cpack-produce-multiple-rpms/7542 "2023-02-26T13:52:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MM77](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mm77/32/2002_2.png) [@MM77](https://discourse.cmake.org/u/MM77)
#### Post date: [February 26, 2023, 1:52pm UTC](https://discourse.cmake.org/t/cpack-produce-multiple-rpms/7542/1 "2023-02-26T13:52:21Z")

</div>

I have 1 CMake project.  
It produces a number of .so files. Those are then used by Python scripts and by C++ executables.  
I’m interested in generated 4 RPMs and perhaps a 5th RPM that is common.

While reading the doc about CPack and CPackComponent modules, and the RPM generator, I’m a little confused.

1. I am ok to have a 1 single CMake Project? PS: I use the Makefile generator
2. The ADD\_LIBRARY and the ADD\_EXECUTABLE that I have produce the .so and the executables.  
I do not have an install() invocations. I do not want to include all the executables generated into rpms (for e.g. tests).  
Will cpack do nothing if I don’t have install() commands?
3. I have set CPACK\_RPM\_COMPONENT\_INSTALL in the global CMakeLists.txt set to ON.
4. I am confused about the “Component” world in the cpack context.  
In particular `CPACK_RPM_<COMPONENT>_XXXX`.  
I see there is concept of component and component group. Forgoing the “group” part, I expect I would have then 5 components in my case.  
Are these components simply the uppercase versions of the targets defined via ADD\_LIBRARY or ADD\_EXECUTABLE?  
Or do I “define” these components via some cpack way?

Rds,

---

<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: [February 26, 2023, 8:26pm UTC](https://discourse.cmake.org/t/cpack-produce-multiple-rpms/7542/2 "2023-02-26T20:26:22Z")

</div>

The component names are a separate thing to target names. You specify component names as part of calls to `install()`. You need to make calls to `install()` if you want to use CPack, otherwise you have to manually write your own `CPackConfig.cmake` file with all the necessary variables and instructions, and frankly no-one should be doing that except in very unusual circumstances (e.g. packaging something that is not a CMake project).
