Consider the following CMake project that builds 2 executables with a custom UWP manifest:
set(CMAKE_SYSTEM_NAME "WindowsStore")
set(CMAKE_SYSTEM_VERSION "10.0")
cmake_minimum_required(VERSION 3.20)
project(cmake_uwp CXX)
add_executable(target0
# The source for the application
main.cpp
# The manifest
target0.appxmanifest
# Resources referenced in the manifest
logo.png splash.png square-44x44.png square-150x150.png
)
add_executable(target1
# The source for the application
main.cpp
# The manifest
target1.appxmanifest
# Resources referenced in the manifest
logo.png splash.png square-44x44.png square-150x150.png
)
This project configures fine and builds fine (using the Visual Studio xx
generators),
but when rebuilding the following error appears:
D:\a\cmake-uwp-custom-manifest\cmake-uwp-custom-manifest\build\target0.appxmanifest : error APPX0703: Manifest references file 'target1.exe' which is not part of the payload. [D:\a\cmake-uwp-custom-manifest\cmake-uwp-custom-manifest\build\target0.vcxproj]
target1.vcxproj -> D:\a\cmake-uwp-custom-manifest\cmake-uwp-custom-manifest\build\Debug\target1.exe
target1 -> D:\a\cmake-uwp-custom-manifest\cmake-uwp-custom-manifest\build\AppPackages\target1\target1_1.0.0.0_x64_Debug_Test\target1_1.0.0.0_x64_Debug.msix
Somehow, target0.appxmanifest
is referencing target1.exe
, even though they are part of different targets.
I’ve created this repo that reproduces the issue:
In the CI output, you can see the executables build fine initially, but fail to rebuild the 2nd time.