[cmake-developers] Windows Store generated solution also containing win32 console app?

Brad King brad.king at kitware.com
Wed Jan 28 13:20:38 EST 2015


On 01/27/2015 02:58 PM, Robert Goulet wrote:
> the generator is essentially the same for both Win32 and WinRT
> except for a very few properties.
> 
> This allow me to set the target property VS_WINRT_DISABLE

I think this can work as a feature of this specific generator.
Let's restrict it to executable targets for now.  Also, rather
than a new property, let's define that the VS_WINRT_COMPONENT
property may be *explicitly* set to a false value to disable
WinRT settings on Store targets.  On Windows Store it should
be an error to set VS_WINRT_COMPONENT explicitly to false for
anything but an EXECUTABLE target.

> -     (target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING")))
> +     (target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING") || target->GetPropertyAsBool("VS_WINRT_DISABLE")))

That leaks knowledge of the VS generator features into code
that is not specific to the generator.  Instead you could add
a method to cmTarget like "IsHostExecutable" that can answer
the above question.  Internally it could ask the global gen
for help, which could then be a vtable dispatch to special
knowledge in the VS >= 10 generators.

Thanks,
-Brad



More information about the cmake-developers mailing list