# configure\_file(): cmakedefine default value

**URL:** https://discourse.cmake.org/t/configure-file-cmakedefine-default-value/6427
**Category:** Usage
**Created:** [September 6, 2022, 8:15pm UTC](https://discourse.cmake.org/t/configure-file-cmakedefine-default-value/6427 "2022-09-06T20:15:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Achpile](https://discourse.cmake.org/user_avatar/discourse.cmake.org/achpile/32/680_2.png) [@Achpile](https://discourse.cmake.org/u/Achpile)
#### Post date: [September 6, 2022, 8:15pm UTC](https://discourse.cmake.org/t/configure-file-cmakedefine-default-value/6427/1 "2022-09-06T20:15:51Z")

</div>

Good day!

Could you help me please? Is there any way to use ‘default’ values in .in files or some other logic?

For example  
#cmakedefine TIME\_FORMAT @TIME\_FORMAT@ “%b %e %T”

So if TIME\_FORMAT is set - it uses its value for #define, otherwise it uses “%b %e %T”

PS: I know, i can check it in CMakeLists.txt and set this default value in it. But looking for a solution, where this login will be inside .in file

Thanks!

---

<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: [September 6, 2022, 8:25pm UTC](https://discourse.cmake.org/t/configure-file-cmakedefine-default-value/6427/2 "2022-09-06T20:25:59Z")

</div>

No, there’s no functionality for this. I don’t think it should be done anyways because then there’s yet another “language” for logic available through CMake code. Just put the logic in the CMake code around the `configure_file` and it can be as complex as you want.

---

<div class="post-metadata">

### Author: ![Achpile](https://discourse.cmake.org/user_avatar/discourse.cmake.org/achpile/32/680_2.png) [@Achpile](https://discourse.cmake.org/u/Achpile)
#### Post date: [September 6, 2022, 8:40pm UTC](https://discourse.cmake.org/t/configure-file-cmakedefine-default-value/6427/3 "2022-09-06T20:40:50Z")

</div>

Thank you for a quick reply.
