我如何使用CMake生成Windows 10通用项目 [英] How can i use CMake to generate Windows 10 universal project
问题描述
我正在尝试使用CMake为Windows 10生成Visual Studio 15项目c ++静态库.它应该在手机上可用,因此我认为它应该支持Windows存储.我可以设置任何标志吗?
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?
我发现 https://github.com/Microsoft/CMake ,它是Microsoft CMake的分支,但我找不到如何使用它来启用uniwersal应用程序支持的线索.
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.
当我打开对Windows Stop的支持时,使用正常" cmake会出现错误:
With "normal" cmake when i switch on support for windows stope I get an Error:
错误MSB3843:项目"project1"以平台"Windows"为目标,但引用了以平台"UAP"为目标的SDK"Visual C ++ 2015 Runtime for Universal Windows Platform Apps v14.0".
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".
推荐答案
CMake -G"Visual Studio 14 2015" -DCMAKE_SYSTEM_NAME = WindowsStore -DCMAKE_SYSTEM_VERSION = 10.0
CMake -G "Visual Studio 14 2015" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0
这篇关于我如何使用CMake生成Windows 10通用项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!