'Set CMAKE_MFC_FLAG for a specific target in CMake

I want to set the CMAKE_MFC_FLAG flag for a specific target in VS project using CMake. I have multiple targets (libraries) and I don't want this flag to be applied to them as well. Setting it as follows set(CMAKE_MFC_FLAG 2) propagats the option to all my targets.

How can I set it just for a specific one? Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source