# what is the function \`set\`

**URL:** https://discourse.cmake.org/t/what-is-the-function-set/12988
**Category:** Code
**Tags:** os:windows
**Created:** [November 19, 2024, 2:22am UTC](https://discourse.cmake.org/t/what-is-the-function-set/12988 "2024-11-19T02:22:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sea\_Sea](https://discourse.cmake.org/user_avatar/discourse.cmake.org/sea_sea/32/4025_2.png) [@Sea\_Sea](https://discourse.cmake.org/u/Sea_Sea)
#### Post date: [November 19, 2024, 2:22am UTC](https://discourse.cmake.org/t/what-is-the-function-set/12988/1 "2024-11-19T02:22:00Z")

</div>

set just set the variable.  
Why does it not only declare but also work for add\_executable?  
Because I try to comment the line and the build will fail.  
And `EXAMPLE_SRCS_WINDOWS` was only used on here. I don’t see anywhere to use it.

> <https://github.com/chromiumembedded/cef-project/blob/c3104bd6ab3fce9551edd4d74ed575605f37f4a0/examples/minimal/CMakeLists.txt#L16C1-L18C4>

---

<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: [November 19, 2024, 10:45am UTC](https://discourse.cmake.org/t/what-is-the-function-set/12988/2 "2024-11-19T10:45:07Z")

</div>

I haven’t looked too deeply, but based on the naming, it’s very likely that the variable `EXAMPLE_SRCS_WINDOWS` is used inside the function `APPEND_PLATFORM_SOURCES()` which is called right after the `set()`.
