[cmake-developers] Windows Store generated solution also containing win32 console app?
Robert Goulet
Robert.Goulet at autodesk.com
Wed Jan 28 13:36:08 EST 2015
Nice, I'm glad you think this can be part of CMake, since it I think it is extremely useful to be able to run standard executables that are part of the CMake project within a Windows Store solution, for any preprocessing that could be needed.
I agree let's restrict it only to executables for now. And I will use the VS_WINRT_COMPONENT target property as you are suggesting.
Also I will try to see how I can move that last change into the specifics of the VS generator, I knew it was pretty bad to put that code there but I wasn't sure how to implement it.
Thanks!
-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Wednesday, January 28, 2015 1:21 PM
To: Robert Goulet
Cc: cmake-developers at cmake.org
Subject: Re: [cmake-developers] Windows Store generated solution also containing win32 console app?
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