How do I generate a VS2013 "Universal DLL" and "Universal App"

Sep 2, 2014 at 9:48 PM
Hi,

We have hand-written VS2013 project files for a "Universal Store+Phone project" that I would like to convert to CMake. How do I do this?

Our hand-written VS2013 solution contains these projects:
  1. Visual C++ "Universal DLL" where all of the C++ source files are "Shared" between Windows 8.1 and Windows Phone 8.1.
  2. Visual C++ "Universal App" that references the Universal DLL and where all of the C++ source files are "Shared" between Windows 8.1 and Windows Phone 8.1.
Warmest regards, Matt
Coordinator
Sep 2, 2014 at 10:09 PM
Hi Matt,

The universal template is not supported in CMake as the model doesn't map to other platforms which don't have a notion of a share project. Since CMake allows for cross-platform and cross-project compilation. The best way to target both Windows Phone and Windows Store in CMake is to have generate 2 solutions that share their build environment and sources and target your platforms.

Thank you for your feedback.

~Gilles
Sep 3, 2014 at 12:49 AM
Thank you Gilles - makes sense.

Warmest regards, Matt
Sep 4, 2014 at 4:25 AM
I'll second Gilles and add that if you're using cmake then you're already doing a cmake->project->build for some other platform. In fact, using cmake I can avoid #ifdef'ing a lot of per-os details by simply including a blah_winphone.cpp, blah_winrt.cpp, or blah_otheros.cpp as appropriate in CMakeLists.txt.