# CMAKE\_MFC\_FLAG for individual targets?

**URL:** https://discourse.cmake.org/t/cmake-mfc-flag-for-individual-targets/8262
**Category:** Usage
**Created:** [June 5, 2023, 7:13pm UTC](https://discourse.cmake.org/t/cmake-mfc-flag-for-individual-targets/8262 "2023-06-05T19:13:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![johan556](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johan556/32/788_2.png) [@johan556](https://discourse.cmake.org/u/johan556)
#### Post date: [June 5, 2023, 7:13pm UTC](https://discourse.cmake.org/t/cmake-mfc-flag-for-individual-targets/8262/1 "2023-06-05T19:13:19Z")

</div>

There is a CMake variable CMAKE\_MFC\_FLAG that affects how an EXE/DLL links with Microsoft Foundation Class library (e.g. dynamic / static).

Unlike many other variables, there seem to be no corresponding target property (perhaps would have been called “MFC\_FLAG”). My conclusion is that this variable setting can only be done at directory level, and all targets build in the same directory will be affected by the same value of CMAKE\_MFC\_FLAG. Is this correct?

Is there some other way to control the linking of MFC libraries for individual targets?

---

<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: [June 7, 2023, 12:07pm UTC](https://discourse.cmake.org/t/cmake-mfc-flag-for-individual-targets/8262/2 "2023-06-07T12:07:48Z")

</div>

It certainly seems to be directory-level. Making it per-target seems like a [reasonable feature request](https://gitlab.kitware.com/cmake/cmake/-/issues) though.
