# How to run script AFTER \*.pbxproj is generated?

**URL:** https://discourse.cmake.org/t/how-to-run-script-after-pbxproj-is-generated/13675
**Category:** Usage
**Tags:** os:ios
**Created:** [March 5, 2025, 2:23pm UTC](https://discourse.cmake.org/t/how-to-run-script-after-pbxproj-is-generated/13675 "2025-03-05T14:23:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![shokarta](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@shokarta](https://discourse.cmake.org/u/shokarta)
#### Post date: [March 5, 2025, 2:23pm UTC](https://discourse.cmake.org/t/how-to-run-script-after-pbxproj-is-generated/13675/1 "2025-03-05T14:23:52Z")

</div>

0

basicaly I made a shell script which I need to run always when cmake finish configuration and its after generation phase (so when pbxproj is generated).

so far i tried **add\_custom\_command()** which does not do anything, or at least does not show it into xcode console what it has started. I also tried **execute\_process()** which always tries to run JUST before cmake finishes generation of the pbxproj archive.

what options do I have to automate the process and not needing to run this shell script always manualy?

---

<div class="post-metadata">

### Author: ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)
#### Post date: [March 5, 2025, 3:08pm UTC](https://discourse.cmake.org/t/how-to-run-script-after-pbxproj-is-generated/13675/2 "2025-03-05T15:08:07Z")

</div>

[Requests for a post-generation hook](https://discourse.cmake.org/t/run-tool-automatically-after-generation-phase/13132/3), such as yours, do come up from time to time. However, CMake currently intentionally doesn’t support such a feature, so unfortunately, there is no way to do this in a reliable & automatic way.

---

<div class="post-metadata">

### Author: ![shokarta](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@shokarta](https://discourse.cmake.org/u/shokarta)
#### Post date: [March 5, 2025, 3:22pm UTC](https://discourse.cmake.org/t/how-to-run-script-after-pbxproj-is-generated/13675/3 "2025-03-05T15:22:32Z")

</div>

hmm, not happy…

can at least post-configure script shell file run async? so in the WORST case scenarion i will have some sleep time to wait 1min after configuration to do its magic (which will be far after generation)? or execute\_process() works only sync so it waits for the shell to finish?

---

<div class="post-metadata">

### Author: ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)
#### Post date: [March 5, 2025, 3:33pm UTC](https://discourse.cmake.org/t/how-to-run-script-after-pbxproj-is-generated/13675/4 "2025-03-05T15:33:50Z")

</div>

`execute_process()` waits for the executed command to finish.

---

<div class="post-metadata">

### Author: ![shokarta](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@shokarta](https://discourse.cmake.org/u/shokarta)
#### Post date: [March 6, 2025, 4:32pm UTC](https://discourse.cmake.org/t/how-to-run-script-after-pbxproj-is-generated/13675/5 "2025-03-06T16:32:05Z")

</div>

at the end via execute\_process() i opened shell script file which inside also opens another terminal windows with their own script files which run on their own, so execute\_process() does not wait for it to finish as the main termianl window finished…

in each own shell script file there is a sleeper waiting for \*.pbxproj appear and then do some modification which Cmake can not do on its own
