View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016106CMakeCMakepublic2016-05-19 09:032016-06-10 14:31
ReporterMerlin1st 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformWindowsOSWindowsOS VersionWindows 7
Product VersionCMake 3.5.2 
Target VersionFixed in Version 
Summary0016106: Error generating UWP project with latest Visual Studio 2015
DescriptionCommand

cmake -G "Visual Studio 14 2015" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0

Always fails.
Steps To ReproduceCreate cmake project file CMakeLists.txt with content:

project(test)
add_library(${PROJECT_NAME} STATIC test.cpp)

then run command
cmake -G "Visual Studio 14 2015" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0

Generating fails.
TagsNo tags attached.
Attached Fileslog file icon CMakeError.log [^] (9,777 bytes) 2016-05-19 09:03
log file icon CMakeOutput.log [^] (4,862 bytes) 2016-05-19 09:03
patch file icon uwp_fix.patch [^] (1,115 bytes) 2016-05-20 07:30 [Show Content]
patch file icon uwp_fix2.patch [^] (1,327 bytes) 2016-05-30 06:50 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0041074)
Brad King (manager)
2016-05-19 09:49

It works for me (VS 2015 Update 2, Windows 10 host).

The content at the top of the CMakeError.log you attached shows what happens when CMake tries building a tiny test project. The first error-looking output is:

_ExpandProjectPriFile:
  C:\Program Files (x86)\Windows Kits\10\bin\x64\MakePri.exe Dump -IndexFile resources.pri -OutputFile cmTC_896fb.dir\Debug\resources.pri.xml -Verbose -Overwrite
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(1446,5): error APPX0002: Task 'ExpandPriContent' failed. The path is not of a legal form.

I'm not familiar enough with these MS tools to interpret that though.
(0041077)
Merlin1st (reporter)
2016-05-20 07:29

I created patch that fixes this issue.
Please check attached file "uwp_fix.patch"
(0041078)
Brad King (manager)
2016-05-20 08:48

Re 0016106:0041077: Thanks. Can you explain what was wrong with the old code such that it works in some environments and not others, and why the new code will work in all environments? This will be useful for the commit message.
(0041082)
Merlin1st (reporter)
2016-05-23 08:04

This is a Microsoft Visual Studio behaviour. MsBuild looking for resources.pri in the intermediates folder.
(0041083)
Brad King (manager)
2016-05-23 09:26

Re 0016106:0041082: Okay, but then why does it work on my machine (and the machines of those who contributed this feature in the first place) with the old code?

What version of MSBuild are you running?
(0041084)
Brad King (manager)
2016-05-23 09:30

For reference, the "$(TargetDir)resources.pri" path was added here:

 VS: Mark Windows Phone and Store targets as App Containers
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8e40538 [^]
(0041086)
Merlin1st (reporter)
2016-05-23 09:46

Really, I don't know. In my opinion, it is better to suppress both parameters <AppxPackageArtifactsDir> and <ProjectPriFullPath>. Let Visual Studio uses default values.
(0041087)
Merlin1st (reporter)
2016-05-23 09:49

The msbuild version is 14.0.25123.0
(0041088)
Brad King (manager)
2016-05-23 09:56

Re 0016106:0041086: Perhaps, but I don't understand these tools myself and the original code came from Microsoft.

Gilles?
(0041089)
Merlin1st (reporter)
2016-05-23 10:00

I see, and I have no idea. ))
(0041109)
Merlin1st (reporter)
2016-05-30 06:49

I figured out that under windows 8.1 and upper everything is work fine.
Because msbuild (?) sets the internal variable AppxUseResourceIndexerApi into "true" and then skips build step which fails in other case:

Log:
Target "_ExpandProjectPriFile" skipped, due to false condition; ('$(AppxPackage)' == 'true' and '$(AppxUseResourceIndexerApi)' == 'false') was evaluated as ('True' == 'true' and 'true' == 'false').

With the default settings, the build is successful under all versions of Windows.
(0041110)
Merlin1st (reporter)
2016-05-30 06:51

I uploaded updated patch (uwp_fix2.patch)
(0041111)
Brad King (manager)
2016-05-31 10:15

Re 0016106:0041110: Thanks. The uwp_fix2.patch change leaves the artifactDir variable unused. This led me to the surrounding context of the patch where the variable is set with a comment:

    https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVisualStudio10TargetGenerator.cxx;hb=v3.5.2#l3105 [^]
    // Move the manifest to a project directory to avoid clashes
    std::string artifactDir = ...

This explains the reason that the non-default value is used. We cannot simply drop it.
(0043004)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

- Issue History
Date Modified Username Field Change
2016-05-19 09:03 Merlin1st New Issue
2016-05-19 09:03 Merlin1st File Added: CMakeError.log
2016-05-19 09:03 Merlin1st File Added: CMakeOutput.log
2016-05-19 09:49 Brad King Note Added: 0041074
2016-05-20 07:29 Merlin1st Note Added: 0041077
2016-05-20 07:30 Merlin1st File Added: uwp_fix.patch
2016-05-20 08:48 Brad King Note Added: 0041078
2016-05-23 08:04 Merlin1st Note Added: 0041082
2016-05-23 09:26 Brad King Note Added: 0041083
2016-05-23 09:30 Brad King Note Added: 0041084
2016-05-23 09:46 Merlin1st Note Added: 0041086
2016-05-23 09:49 Merlin1st Note Added: 0041087
2016-05-23 09:56 Brad King Note Added: 0041088
2016-05-23 10:00 Merlin1st Note Added: 0041089
2016-05-30 06:49 Merlin1st Note Added: 0041109
2016-05-30 06:50 Merlin1st File Added: uwp_fix2.patch
2016-05-30 06:51 Merlin1st Note Added: 0041110
2016-05-31 10:15 Brad King Note Added: 0041111
2016-06-10 14:29 Kitware Robot Note Added: 0043004
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker