# swig cmake windows - debug \_d suffix

**URL:** https://discourse.cmake.org/t/swig-cmake-windows-debug-d-suffix/6878
**Category:** Usage
**Created:** [November 16, 2022, 10:12am UTC](https://discourse.cmake.org/t/swig-cmake-windows-debug-d-suffix/6878 "2022-11-16T10:12:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![nitawa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nitawa/32/1438_2.png) [@nitawa](https://discourse.cmake.org/u/nitawa)
#### Post date: [November 16, 2022, 10:12am UTC](https://discourse.cmake.org/t/swig-cmake-windows-debug-d-suffix/6878/1 "2022-11-16T10:12:10Z")

</div>

Dear experts,  
I used to use cmake 3.12 + Swig to generate some C++/Python API in Release/Debug mode.  
I recently moved to cmake 3.24 and I can see that now, in Debug mode, a suffix \_d is added to the generated libraries and python API code source.  
Before checking which cmake version introduced/fixed this, I am wondering whether there is some option which could be set at the CMakeLists.txt file to disable swig from adding \_d suffix to generated Python code ?  
Thanks

---

<div class="post-metadata">

### Author: ![marc.chevrier](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@marc.chevrier](https://discourse.cmake.org/u/marc.chevrier)
#### Post date: [November 16, 2022, 10:33am UTC](https://discourse.cmake.org/t/swig-cmake-windows-debug-d-suffix/6878/2 "2022-11-16T10:33:26Z")

</div>

`UseSWIG` module do not manage any special postfix for debug mode.

Can you provide a simple snippet showing the problem?

---

<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: [November 17, 2022, 2:23pm UTC](https://discourse.cmake.org/t/swig-cmake-windows-debug-d-suffix/6878/3 "2022-11-17T14:23:19Z")

</div>

It seems like `CMAKE_DEBUG_POSTFIX` is set to `_d` somewhere. You can unset it around your SWIG libraries (either the variable or by unsetting the `DEBUG_POSTFIX` target property) explicitly.

---

<div class="post-metadata">

### Author: ![nitawa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nitawa/32/1438_2.png) [@nitawa](https://discourse.cmake.org/u/nitawa)
#### Post date: [November 17, 2022, 2:59pm UTC](https://discourse.cmake.org/t/swig-cmake-windows-debug-d-suffix/6878/4 "2022-11-17T14:59:38Z")

</div>

thanks for your replies. I will try to arrange a small show case. I mean, I did not change anything to the source code nor the visual version - Here I simply moved from cmake 3.12 to cmake 3.24

---

<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: [November 17, 2022, 3:23pm UTC](https://discourse.cmake.org/t/swig-cmake-windows-debug-d-suffix/6878/5 "2022-11-17T15:23:21Z")

</div>

> [@nitawa](#):
>
> cmake 3.42

I assume you mean 3.24 as if you’re reporting a bug about a version not released yet, we can just add a test today to prevent that 😉 . FWIW, CMake’s codebase itself has no `_d` references beyond documentation and temporary variables.

---

<div class="post-metadata">

### Author: ![nitawa](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nitawa/32/1438_2.png) [@nitawa](https://discourse.cmake.org/u/nitawa)
#### Post date: [November 17, 2022, 3:40pm UTC](https://discourse.cmake.org/t/swig-cmake-windows-debug-d-suffix/6878/6 "2022-11-17T15:40:31Z")

</div>

returning back from future 3.24 - fixed typo
