# CPACK\_PRODUCTBUILD\_RESOURCES\_DIR files not added to pkg

**URL:** https://discourse.cmake.org/t/cpack-productbuild-resources-dir-files-not-added-to-pkg/3460
**Category:** Usage
**Tags:** os:macos
**Created:** [June 1, 2021, 11:52am UTC](https://discourse.cmake.org/t/cpack-productbuild-resources-dir-files-not-added-to-pkg/3460 "2021-06-01T11:52:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Will](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/90ced4/32.png) [@Will](https://discourse.cmake.org/u/Will)
#### Post date: [June 1, 2021, 11:52am UTC](https://discourse.cmake.org/t/cpack-productbuild-resources-dir-files-not-added-to-pkg/3460/1 "2021-06-01T11:52:22Z")

</div>

I’m trying to add some additional files to the macos installer.

So I am using CPACK\_PRODUCTBUILD\_RESOURCES\_DIR that should add the files in the directory to the Resource folder in the pkg.  
And then add a script that copies the files to the correct folder on the users computer.

But the files does not show up in the Resource filer. I have a \_CPack\_Packages folder in my build tree where I can see that the files are added together with the license readme and welcome files. But in the final pkg file they are not added.

What could be the problem?

---

<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: [June 1, 2021, 9:42pm UTC](https://discourse.cmake.org/t/cpack-productbuild-resources-dir-files-not-added-to-pkg/3460/2 "2021-06-01T21:42:49Z")

</div>

[Known issue](https://gitlab.kitware.com/cmake/cmake/-/issues/17968), but unfortunately no-one working on a fix that I’m aware of.

---

<div class="post-metadata">

### Author: ![Will](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/90ced4/32.png) [@Will](https://discourse.cmake.org/u/Will)
#### Post date: [June 2, 2021, 8:46am UTC](https://discourse.cmake.org/t/cpack-productbuild-resources-dir-files-not-added-to-pkg/3460/3 "2021-06-02T08:46:32Z")

</div>

Thanks for the reply! 👍  
So a workaround could be to add a custom CPack.distribution.dist.in where I add the files manually?  
Where should I put it and How do I add it? do you know?

edit:  
I did a workaround script using  
pkgutil --expand to unpack the pkg and then copy the files the files  
and then pkgutil --flatten to restore the pkg again.  
I think it will be good for me.

---

<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: [June 2, 2021, 9:40pm UTC](https://discourse.cmake.org/t/cpack-productbuild-resources-dir-files-not-added-to-pkg/3460/4 "2021-06-02T21:40:33Z")

</div>

I don’t know the details and haven’t had time to explore it (and likely won’t for some time). Not sure if your workaround will break code signing, but I’ll have to leave you to explore that.
