# Why doesn't "cmake --install --strip" doesn't strip binary if MACOSX\_BUNDLE is set on a target?

**URL:** https://discourse.cmake.org/t/why-doesnt-cmake-install-strip-doesnt-strip-binary-if-macosx-bundle-is-set-on-a-target/9628
**Category:** Usage
**Tags:** os:macos
**Created:** [December 13, 2023, 11:15pm UTC](https://discourse.cmake.org/t/why-doesnt-cmake-install-strip-doesnt-strip-binary-if-macosx-bundle-is-set-on-a-target/9628 "2023-12-13T23:15:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![equeim](https://discourse.cmake.org/user_avatar/discourse.cmake.org/equeim/32/4081_2.png) [@equeim](https://discourse.cmake.org/u/equeim)
#### Post date: [December 13, 2023, 11:15pm UTC](https://discourse.cmake.org/t/why-doesnt-cmake-install-strip-doesnt-strip-binary-if-macosx-bundle-is-set-on-a-target/9628/1 "2023-12-13T23:15:30Z")

</div>

Apparently if I set MACOSX\_BUNDLE property on an executable target, CMake will not strip in on installation even if I explicitly request it.

I found where in CMake source code it’s done: [https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmInstallTargetGenerator.cxx#L826](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmInstallTargetGenerator.cxx#L826)

However this code was there since the beginning of time and there is no explanation on why stripping is disabled or how I can work around this.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 19, 2023, 3:19am UTC](https://discourse.cmake.org/t/why-doesnt-cmake-install-strip-doesnt-strip-binary-if-macosx-bundle-is-set-on-a-target/9628/2 "2023-12-19T03:19:56Z")

</div>

This sounds like [an issue](https://gitlab.kitware.com/cmake/cmake/-/issues) to be filed. I expect it will need a policy to change.
