Ok, make sense. However, the generator is essentially the same for both Win32 
and WinRT except for a very few properties. Turns out I was able to make a 
patch, however I don't know if that's going to be rejected because of the way I 
did it, but it works really well so far.

This allow me to set the target property VS_WINRT_DISABLE on the projects I 
want, while still targeting Windows Store in the toolchain file. I personally 
find it cleaner to do that in my CMakeLists.txt files rather than using 
multiple CMake root projects. It also works for the add_custom_command rule 
with COMMAND as stated in the documentation: "If COMMAND specifies an 
executable target (created by the add_executable() command) it will 
automatically be replaced by the location of the executable created at build 
time." I can share the same add_custom_command between all platforms instead of 
having a different one just for Windows Store build.

Let me know your thoughts about it.
Thanks!


-----Original Message-----
From: Brad King [mailto:[email protected]] 
Sent: Tuesday, January 27, 2015 12:43 PM
To: Robert Goulet
Cc: [email protected]
Subject: Re: [cmake-developers] Windows Store generated solution also 
containing win32 console app?

On 01/27/2015 12:03 PM, Robert Goulet wrote:
> CMake uses a global variable that essentially means that the generator 
> targets a Windows Store app. This makes it difficult to hack it to 
> control this per project rather than globally.

This is a fundamental limitation of the design of CMake, not just of the VS 
generator.  We only support one target arch/platform at a time.
The entire configuration process runs with one platform in mind, and one 
toolchain per language.  This is the same reason one cannot build host binaries 
while cross compiling.  Even if one were to hack the VS generator to set the 
type of one .vcxproj file, it still would not have proper information to 
generate the other properties in the file.

You could try running CMake with execute_process to generate a second nested 
build tree, and then include_external_msproject to make one of its .vcxproj 
files available in the outer .sln.  I've not tried this though.

-Brad

Attachment: vs-winrt-disable.patch
Description: vs-winrt-disable.patch

-- 

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

Reply via email to