How can i use CMake to generate Windows 10 universal project(如何使用 CMake 生成 Windows 10 通用项目)
问题描述
我正在尝试使用 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,它是微软的 CMake 分支,但我找不到如何使用它来启用通用应用支持的线索.
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.
使用正常"cmake,当我打开对 windows stope 的支持时,出现错误:
With "normal" cmake when i switch on support for windows stope I get an Error:
错误 MSB3843:项目project1"面向平台Windows",但引用了面向平台UAP"的 SDKVisual 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 通用项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 CMake 生成 Windows 10 通用项目
基础教程推荐
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- CString 到 char* 2021-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
