MSVS2019 UWP set windows sdk version using CMAKE_SYSTEM_VERSION
Hello I noticed that it is impossible to select windows sdk version for UWP app using cmake 3.14.4.
I run cmake this way:
cmake . -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.15063.0
however I have error:
Project "C:\code\2\CMakeFiles\3.14.4\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(775,5): error : The OutputPath property is not set for project 'VCTargetsPath.vcx
proj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='Win32'. You may be seeing this message becau
se you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [C:\code\2\CMakeFiles\3.14.4\VCTargetsPath.vcxp
roj]
Done Building Project "C:\code\2\CMakeFiles\3.14.4\VCTargetsPath.vcxproj" (default targets) -- FAILED.
I noticed that cmake compiler check is trying to use invalid ApplicationTypeRevision in vcxproj:
<ApplicationTypeRevision>10.0.15063.0</ApplicationTypeRevision>
I tried to set windows sdk using MSVS. My vcxproj has those lines:
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
I tried to select SDK using "CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION" variable. I noticed it does not affect generated vcxproj. According to docs it is used for reporting used sdk version only.
I created minimal CMakeLists.txt to reproduce issue
cmake_minimum_required(VERSION 3.14.4)
project(uwp)
add_library(uwp SHARED main.cpp)
I am not sure how to fix it