# rpm cpack debuginfo package generation getting warning "no source files were found!" and no debuginfo package

**URL:** https://discourse.cmake.org/t/rpm-cpack-debuginfo-package-generation-getting-warning-no-source-files-were-found-and-no-debuginfo-package/1725
**Category:** Usage
**Created:** [August 19, 2020, 1:24pm UTC](https://discourse.cmake.org/t/rpm-cpack-debuginfo-package-generation-getting-warning-no-source-files-were-found-and-no-debuginfo-package/1725 "2020-08-19T13:24:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![garybirnhak](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/c0e974/32.png) [@garybirnhak](https://discourse.cmake.org/u/garybirnhak)
#### Post date: [August 19, 2020, 1:24pm UTC](https://discourse.cmake.org/t/rpm-cpack-debuginfo-package-generation-getting-warning-no-source-files-were-found-and-no-debuginfo-package/1725/1 "2020-08-19T13:24:39Z")

</div>

I have a problem with cpackrpm and have been banging my head against the wall for several days. I am on Centos 7.6 and using cmake/cpack 3.18.1. I can create a binary rpm, however, I keep getting “CPackRPM:Warning: debuginfo package was requested but will not be generated as no source files were found!” when I try to create a debuginfo package. With a small test project, I get a debuginfo package. However, with my production code I get the error. I have been trying to set CPACK\_BUILD\_SOURCE\_DIRS with all combinations I can think of, to no avail, and I have not been able to see any examples of what it needs.  
Not sure if this is relevant, but my CMAKE\_BUILD\_DIR is blank ("")

---

<div class="post-metadata">

### Author: ![ferdnyc](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ferdnyc/32/267_2.png) [@ferdnyc](https://discourse.cmake.org/u/ferdnyc)
#### Post date: [August 21, 2020, 10:27am UTC](https://discourse.cmake.org/t/rpm-cpack-debuginfo-package-generation-getting-warning-no-source-files-were-found-and-no-debuginfo-package/1725/2 "2020-08-21T10:27:07Z")

</div>

> [@garybirnhak](#):
>
> I have a problem with cpackrpm and have been banging my head against the wall for several days. I am on Centos 7.6 and using cmake/cpack 3.18.1. I can create a binary rpm, however, I keep getting “CPackRPM:Warning: debuginfo package was requested but will not be generated as no source files were found!” when I try to create a debuginfo package.

At the risk of stating the obvious, nobody here is going to be able to read your mind to determine _how_ you’re trying to create the debuginfo package, so to get any help you’re probably going to need to show your **code** instead. Command lines, relevant snippets of `CMakeLists.txt`, cut-and-paste terminal sessions showing exactly what went in that led to the failure message coming _out_, etc.

> [@garybirnhak](#):
>
> With a small test project, I get a debuginfo package. However, with my production code I get the error. I have been trying to set CPACK\_BUILD\_SOURCE\_DIRS with all combinations I can think of, to no avail, and I have not been able to see any examples of what it needs.

According to [the documentation](https://cmake.org/cmake/help/latest/cpack_gen/rpm.html#variable:CPACK_BUILD_SOURCE_DIRS):

> ### Note
> 
> For CMake project [`CPACK_BUILD_SOURCE_DIRS`](https://cmake.org/cmake/help/latest/cpack_gen/rpm.html#variable:CPACK_BUILD_SOURCE_DIRS) is set by default to point to [`CMAKE_SOURCE_DIR`](https://cmake.org/cmake/help/latest/variable/CMAKE_SOURCE_DIR.html#variable:CMAKE_SOURCE_DIR) and [`CMAKE_BINARY_DIR`](https://cmake.org/cmake/help/latest/variable/CMAKE_BINARY_DIR.html#variable:CMAKE_BINARY_DIR) paths.

So if you’re using CMake, I wouldn’t expect it to need anything. You may be messing things up by _trying_ to set it.

> [@garybirnhak](#):
>
> Not sure if this is relevant, but my CMAKE\_BUILD\_DIR is blank (“”)

That’s probably fine, since `CMAKE_BUILD_DIR` means nothing, it’s not a supported CMake variable. Did you mean `CMAKE_BINARY_DIR`? (This is why showing actual code is helpful…)

---

<div class="post-metadata">

### Author: ![garybirnhak](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/c0e974/32.png) [@garybirnhak](https://discourse.cmake.org/u/garybirnhak)
#### Post date: [August 21, 2020, 7:33pm UTC](https://discourse.cmake.org/t/rpm-cpack-debuginfo-package-generation-getting-warning-no-source-files-were-found-and-no-debuginfo-package/1725/3 "2020-08-21T19:33:25Z")

</div>

This is the output that contains the error:

…  
CPack: Create package using RPM  
CPack: Install projects  
CPack: - Run preinstall target for: BuickSim  
CPack: - Install project: BuickSim []  
CPack: Create package  
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/Internal/CPack/CPackRPM.cmake:1411 (message):  
CPackRPM:Warning: debuginfo package was requested but will not be generated  
as no source files were found!  
Call Stack (most recent call first):  
/usr/local/share/cmake-3.18/Modules/Internal/CPack/CPackRPM.cmake:1887 (cpack\_rpm\_generate\_package)  
This warning is for project developers. Use -Wno-dev to suppress it.

CPackRPM: Will use GENERATED spec file: /home/user/buick\_framework/Software/Buick\_cmake\_build/\_CPack\_Packages/Linux/RPM/SPECS/Buicksim.spec  
CPack: - package: /home/user/buick\_framework/Software/Buick\_cmake\_build/BuickSim-1.2-Linux.rpm generated.

* * *

Here is the cpack statements I am using in my top-level CMakeLists.txt:

cmake\_minimum\_required(VERSION 3.18)  
set(CMAKE\_BUILD\_TYPE “Debug”)  
…  
set(CPACK\_RPM\_DEBUGINFO\_PACKAGE ON)  
set(CPACK\_GENERATOR “RPM”)  
set(CPACK\_RPM\_DEBUGINFO\_SINGLE\_PACKAGE ON)  
set(CPACK\_RPM\_BUILD\_SOURCE\_DIRS\_PREFIX /usr/src/debug/BCK/abcde)  
include(CPack)

I appreciate any help! Thanks
