Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i use CMake to generate Windows 10 universal project

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".

like image 555
MarcinG Avatar asked Aug 06 '15 13:08

MarcinG


People also ask

Can you use CMake with Visual Studio?

Visual Studio's native support for CMake enables you to edit, build, and debug CMake projects on Windows, the Windows Subsystem for Linux (WSL), and remote systems from the same instance of Visual Studio. CMake project files (such as CMakeLists.

How do I add a CMake project to Visual Studio solution?

On the Visual Studio main menu, choose File > Open > CMake. Navigate to the CMakeLists. txt file in the root of the bullet3 repo you just downloaded. As soon as you open the folder, your folder structure becomes visible in the Solution Explorer.


2 Answers

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

like image 57
MarcinG Avatar answered Oct 10 '22 19:10

MarcinG


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.

like image 32
SalmanKhan Avatar answered Oct 10 '22 19:10

SalmanKhan