Hi. I’m new to using CMake to prepare an app for the Microsoft Store.
Can you help or direct me to a tutorial that walks through the process?
Background: I’m a Qt developer. I’ve published to the Microsoft Store using Qt’s old qmake build system but not CMake. And I’ve worked out how to publish to the App Store using Qt + CMake, which was not straightforward and involved help from @craig.scott and others.
CMake code:
Qt’s own documentation only goes as far as mentioning that I need to include
set_target_properties(MyApp PROPERTIES
WIN32_EXECUTABLE ON
)
From my own research, I think that the following should package the AppxManifest.xml and associated assets, ready for the Microsoft Store, in this way… but I’m not sure:
set_property(SOURCE AppxManifest.xml PROPERTY VS_DEPLOYMENT_CONTENT 1)
foreach(asset ${ASSET_FILES})
set_property(SOURCE "${asset}" PROPERTY VS_DEPLOYMENT_CONTENT 1)
set_property(SOURCE "${asset}" PROPERTY VS_DEPLOYMENT_LOCATION "Assets")
endforeach()
Help requested:
I would be grateful for help with the following:
- Any CMake commands that I ought to be including when prepping for the Microsoft Store.
- A tutorial of step by step process from running CMake to uploading the package.
- Any Qt-specific idiosyncrasies I should be aware of, or additional steps I should do.
Other useful info about my situation:
- I already have a Qt app that is complete and runs on Windows.
- I have already prepared the AppxManifest.xml and assets (icons, splash screen).
- I believe I need to run Qt’s
windeployqt
to compile a list of dependencies, so I have added that to my build steps. - When I used to build using qmake, I would get this far in Qt Creator and then finish off, packaging & code signing the app, within Visual Studio. I have Visual Studio Community 2022 installed, but I’m unclear whether/how I’ll need to use that now that I’m using CMake.
- By default Qt Creator uses Ninja, so I’ve been using that.
- If I need to use Visual Studio, can CMake generate a VS project?