12

I'm trying to use CMake to generate Visual Studio 15 project c++ static library for Windows 10. It should be usable on phones so I think it should have support for windows store. Are there any flags I can set?

I've found https://github.com/Microsoft/CMake, it is Microsoft's fork of CMake, but I can't find a clue how to use it to enable uniwersal app support.

With "normal" cmake when i switch on support for windows stope I get an Error:

error MSB3843: Project "project1" targets platform "Windows", but references SDK "Visual C++ 2015 Runtime for Universal Windows Platform Apps v14.0" which targets platform "UAP".

m.s.
  • 16,063
  • 7
  • 53
  • 88
MarcinG
  • 840
  • 6
  • 21

2 Answers2

15

CMake -G "Visual Studio 14 2015" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0

MarcinG
  • 840
  • 6
  • 21
  • 2
    One additional hint. With growing Windows 10 (sub)version numbers and littering of SDK versions, you might need to write something like 10.0.14393.0 instead of 10. Otherwise the desired C++ compiler might not be found. – yau Aug 04 '17 at 15:23
  • 10.0 will select the latest installed SDK (with later cmake versions) – Mo0gles Oct 11 '17 at 12:05
2

The support for Universal Windows project is provided from cmake version 3.4.0 onwards. Older versions don't support it. The above command works with cmake 3.4.0.

SalmanKhan
  • 103
  • 1
  • 11