c++ - 如何使用CMake生成Windows 10通用项目

标签 c++ visual-studio-2015 windows-10 windows-10-mobile

我正在尝试使用 CMake 为 Windows 10 生成 Visual Studio 15 项目 C++ 静态库。它应该可以在手机上使用,所以我认为它应该支持 Windows 应用商店。 我可以设置任何标志吗?

我找到了 https://github.com/Microsoft/CMake ,它是 Microsoft 的 CMake 分支,但我找不到如何使用它来启用通用应用程序支持的线索。

使用“正常”cmake,当我打开对 Windows 站点的支持时,出现错误:

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

关于c++ - 如何使用CMake生成Windows 10通用项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31857315/

相关文章:

npm - 发布 ASP.NET Core 项目时出错

c# - Visual Studio - 调试时将多行表达式插入监 window 口

winforms - 为什么这个 WinForms 窗口在拖动时呈现伪像?

c# - 如何删除通用 Windows 平台 (Windows 10) 应用程序中的 InkCanvas 笔画?

C++ 检查结构是否为 NULL 或未设置,即使它的 have 运算符相等

c++ - 在 Eclipse 中使用 gdb 调试 C++ 代码

c++ - 我可以在不创建结构实例的情况下获得结构字段的大小吗?

php - 在 PHP 扩展中从线程使用 emalloc 时出现段错误

c++ - Visual Studio : hotkey/way to automatically sort functions in . h 与.cpp保持一致

windows - Visual Studio 2015 无法构建 Windows 10 通用应用程序?