Create UWP package using cmake

ⅰ亾dé卋堺 提交于 2019-12-11 07:17:31

问题


I'm working on simple hello world application:

// main.cpp
#include <iostream>
int main(int argc, char ** argv) {
    std::cout << "Hello world!" << std::endl;
    return 0;
}

// CMakeLists.txt
cmake_minimum_required(VERSION 3.0.0)
project(hello)
add_executable(${PROJECT_NAME} main.cpp)

I'm trying to build it using:

cmake -G "Ninja" "-DCMAKE_SYSTEM_NAME=WindowsStore" "-DCMAKE_SYSTEM_VERSION=10.0"
ninja

And it seems to build, but I'd like to additionally generate UWP package (.appx) to be able to deploy it on xbox.

How can I create UWP package with this example, that will be deployable to xbox?


回答1:


And it seems to build, but I'd like to additionally generate UWP package (.appx).

CMake is a cross-platform open-source tool for defining build processes that run across multiple platforms by abstracting away native build environments and compilers. CMake interprets a CMakeLists.txt script the user authors and generates a build plan in a build environment of choice.

It can't be use to generate UWP package. However, you could use make.exe or Visual Studio to generate UWP package. For more you could refer to Create an app package with the MakeAppx.exe tool and Package a UWP app with Visual Studio.

to be able to deploy it on xbox.

Currently, the only way to deploy a UWP to an Xbox console is to use Visual Studio to deploy loose application payload. And you could get the tutorial form Getting started with UWP app development on Xbox One.



来源:https://stackoverflow.com/questions/46484558/create-uwp-package-using-cmake

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!