# How to get the default suffix of executables?

**URL:** https://discourse.cmake.org/t/how-to-get-the-default-suffix-of-executables/11476
**Category:** Code
**Created:** [August 18, 2024, 12:27pm UTC](https://discourse.cmake.org/t/how-to-get-the-default-suffix-of-executables/11476 "2024-08-18T12:27:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ikspress](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@ikspress](https://discourse.cmake.org/u/ikspress)
#### Post date: [August 18, 2024, 12:27pm UTC](https://discourse.cmake.org/t/how-to-get-the-default-suffix-of-executables/11476/1 "2024-08-18T12:27:34Z")

</div>

After modifying `CMAKE_SHARED_LIBRARY_PREFIX` in CMakeLists.txt, how can I retrieve the default suffix of executables?

---

<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: [July 25, 2025, 4:04pm UTC](https://discourse.cmake.org/t/how-to-get-the-default-suffix-of-executables/11476/2 "2025-07-25T16:04:10Z")

</div>

I’m not sure what `CMAKE_SHARED_LIBRARY_PREFIX` has to do with it, but [`CMAKE_EXECUTABLE_SUFFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_EXECUTABLE_SUFFIX.html) is the variable you’re looking for. Note that these are “platform” variables and not (generally) meant to be edited by projects. You should consider using the [`PREFIX`](https://cmake.org/cmake/help/latest/prop_tgt/PREFIX.html) and [`SUFFIX`](https://cmake.org/cmake/help/latest/prop_tgt/SUFFIX.html) properties instead.
