# Is CMAKE\_EXE\_LINKER\_FLAGS\_\<CONFIG\>\_INIT supposed to work for user-defined configuration types?

**URL:** https://discourse.cmake.org/t/is-cmake-exe-linker-flags-config-init-supposed-to-work-for-user-defined-configuration-types/4592
**Category:** Usage
**Created:** [December 4, 2021, 5:22am UTC](https://discourse.cmake.org/t/is-cmake-exe-linker-flags-config-init-supposed-to-work-for-user-defined-configuration-types/4592 "2021-12-04T05:22:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Zachary\_Turner](https://discourse.cmake.org/user_avatar/discourse.cmake.org/zachary_turner/32/1551_2.png) [@Zachary\_Turner](https://discourse.cmake.org/u/Zachary_Turner)
#### Post date: [December 4, 2021, 5:22am UTC](https://discourse.cmake.org/t/is-cmake-exe-linker-flags-config-init-supposed-to-work-for-user-defined-configuration-types/4592/1 "2021-12-04T05:22:53Z")

</div>

I define a few of my own build configurations via CMAKE\_CONFIGURATION\_TYPES. One of these is called NoOpt.

I set this before the first call to project(), and I use a toolchain file. In the toolchain file I then do:

```auto
set(CMAKE_EXE_LINKER_FLAGS_NOOPT_INIT "/INCREMENTAL")

```

After the project call returns, I print the value of CMAKE\_EXE\_LINKER\_FLAGS\_NOOPT and it is empty.

Is this a bug in CMake or am I doing something wrong? Strangely, I have another CMake build configuration called Optimized, and this one works.

---

<div class="post-metadata">

### Author: ![Zachary\_Turner](https://discourse.cmake.org/user_avatar/discourse.cmake.org/zachary_turner/32/1551_2.png) [@Zachary\_Turner](https://discourse.cmake.org/u/Zachary_Turner)
#### Post date: [December 4, 2021, 5:29pm UTC](https://discourse.cmake.org/t/is-cmake-exe-linker-flags-config-init-supposed-to-work-for-user-defined-configuration-types/4592/2 "2021-12-04T17:29:12Z")

</div>

It seems like the problem is here: [CMake/CMakeInitializeConfigs.cmake at master · Kitware/CMake · GitHub](https://github.com/Kitware/CMake/blob/master/Modules/CMakeInitializeConfigs.cmake#L15)

This does not respect the value of CMAKE\_CONFIGURATION\_TYPES. I’ll file a bug with this information.

---

<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 5, 2021, 1:52pm UTC](https://discourse.cmake.org/t/is-cmake-exe-linker-flags-config-init-supposed-to-work-for-user-defined-configuration-types/4592/3 "2021-12-05T13:52:24Z")

</div>

I see this issue here: [https://gitlab.kitware.com/cmake/cmake/-/issues/22982](https://gitlab.kitware.com/cmake/cmake/-/issues/22982)

---

<div class="post-metadata">

### Author: ![Zachary\_Turner](https://discourse.cmake.org/user_avatar/discourse.cmake.org/zachary_turner/32/1551_2.png) [@Zachary\_Turner](https://discourse.cmake.org/u/Zachary_Turner)
#### Post date: [December 5, 2021, 7:50pm UTC](https://discourse.cmake.org/t/is-cmake-exe-linker-flags-config-init-supposed-to-work-for-user-defined-configuration-types/4592/4 "2021-12-05T19:50:22Z")

</div>

Yes that’s the issue I filed, sorry I should have followed up myself with a link.
