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:[email protected]] Sent: Wednesday, January 28, 2015 1:21 PM To: Robert Goulet Cc: [email protected] 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 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers
