I am able to generate an MSVC project (.vcxproj) from Qt but the project doesn't contain an app manifest file (Package.appxmanifest). I have tried using the qmake variable WINRT_MANIFEST and making sure that CONFIG includes embed_manifest_exe but I must be misunderstanding something.
My question has 2 parts:
- How can I define an app manifest within my Qt project?
- How can this app manifest become part of the MSVC project generated by Qt Creator / qmake?
I am using Qt Creator 4.7.1, Qt 5.11.2 MSVC2017 64bit, on Windows 10 and I have Visual Studio 2017 Community installed.
What I've tried already
Building an MSCV project
Based on the Qt for WinRT documentation and help from the Qt community, I run the following (via QMAKE_POST_LINK
, set in my .pro
):
windeployqt --release --compiler-runtime --qmldir path-to-my-qml-files
qmake -tp vc path-to-my-.pro -o path-to-build-folder/target-name.vcxproj CONFIG+=release
These successfully create an MSVC project and the release folder contains all the libraries needed for deployment and a vcredist_xxx.exe.
Reading Qt documentation on Windows app manifest
Qt documentation for Windows deployment > Manifest files:
When deploying an application compiled with Visual Studio, there are some additional steps to be taken. First, we need to copy the manifest file created when linking the application. ... Since Qt 4.1.3, the following CONFIG options are available for embedding manifests:
embed_manifest_dll
embed_manifest_exe
Both options are enabled by default.
So, by my understanding, if CONFIG option embed_manifest_exe
is enabled, which it is by default, then the manifest should be embedded when qmake is run.
Qt documentation for Qmake variables > WINRT_MANIFEST:
Specifies parameters to be passed to the application manifest.
These are listed, many of which have defaults.
So why is it that an app manifest isn't being generated? Even if I don't specify anything myself, surely the combination of WINRT_MANIFEST
and CONFIG contains embed_manifest_exe
should mean that a default manifest should be embedded.
I have also tried setting WINRT_MANIFEST
properties (e.g. WINRT_MANIFEST.publisher
) and I have tried creating my own Manifest.xml and setting WINRT_MANIFEST=Manifest.xml.
But this makes no difference.