Skip to content

Cmake 3.1.x generates WinMD reference HintPaths with unnecessary quotes #4

Open

Description

We've been using a build of cmake 3.1.x for some time now to build Windows Phone 8.1 and Store apps. If we add a reference to a winmd file on disk and the path contains spaces, the resulting entry in the vcxproj is incorrectly quoted.

Here's where we add the reference:

set_property(TARGET MyTarget
  PROPERTY VS_WINRT_REFERENCES
  "C:/ProgramData/Application\ Data/some/path/to/Component.winmd"
)

And the resulting section of the vcxproj is:

<Reference Include="Component">
      <IsWinMDFile>true</IsWinMDFile>
      <HintPath>"C:\ProgramData\Application Data\some\path\to\Component.winmd"</HintPath>    </Reference>

So when we run MSBuild, we get errors about being unable to resolve the reference, notably:

For SearchPath "{HintPathFromItem}".
                 Considered ""C:\ProgramData\Application Data\some\path\to\Component.winmd"", but it didn't exist.

Activity

  1. sgtcoolguy commented on Jun 4, 2015

    @sgtcoolguy
    Author

    For now, we work around this issue by "hacking" the contents of the vcxproj after it's generated by cmake, but before we run MSBuild - to remove the quotes.

  2. khouzam commented on Jun 5, 2015

    @khouzam

    Thanks for reporting this. Looking at the code, the HintPath is not output in the vcxproj, but the whole path is added to the include. I'll look at this some more and see where that HintPath is being created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions