View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014680CMakeCMakepublic2014-01-02 15:482015-11-02 09:13
ReporterVince Harron 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSWindowsOS Version7
Product VersionCMake 2.8.12 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0014680: Generating project on VMware workstation mounted shared folder outputs lots of warnings/errors
DescriptionZ:\vharron\dev3\vendor\unbundled_google\libs\liquidfun\Box2D>cmake --version
cmake version 2.8.12.1

I'm running CMake on a Windows 7 VM. (OSX 10.9.1 host) I am running CMake in a folder that is a share from the OSX host. I'm getting a lot of these "Could not copy" error messages:

Z:\vharron\dev3\vendor\unbundled_google\libs\liquidfun\Box2D>cmake -G"Visual Studio 10"
-- The C compiler identification is MSVC 16.0.40219.1
-- The CXX compiler identification is MSVC 16.0.40219.1
-- Check for working C compiler using: Visual Studio 10
Could not copy from: C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CMakeVSMacros2.vsmacros
                 to: //vmware-host/shared folders/Documents/Visual Studio 2010/Projects/VSMacros80/CMakeMacros/CMakeVSMacros2.vsmacros

-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
Could not copy from: C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CMakeVSMacros2.vsmacros
                 to: //vmware-host/shared folders/Documents/Visual Studio 2010/Projects/VSMacros80/CMakeMacros/CMakeVSMacros2.vsmacros

-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
Could not copy from: C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Templates/CMakeVSMacros2.vsmacros
                 to: //vmware-host/shared folders/Documents/Visual Studio 2010/Projects/VSMacros80/CMakeMacros/CMakeVSMacros2.vsmacros
[snip]

Why is it trying to copy to a documents folder at //vmware-host/shared folders? That doesn't make any sense to me.
Steps To ReproduceI have a feeling you could reproduce this by running on any network drive or on a second drive?

net use z: \\hostname\mountpoint
z:
git clone https://github.com/google/liquidfun.git [^]
cd liquidfun\Box2D
cmake -G"Visual Studio 10"

TagsNo tags attached.
Attached Files

 Relationships
related to 0011258closedBrad King VS 2010 CMake plugin is broken 
related to 0011440closedKitware Robot VS Plugin doesn't reload the solution in VS 2008 

  Notes
(0034901)
David Cole (manager)
2014-01-02 17:39

The function cmGlobalVisualStudio10Generator::GetUserMacrosDirectory() is responsible for providing the destination location of the *.vsmacros file copy operation. (Found in cmGlobalVisualStudio10Generator.cxx)

It uses:
  // base begins with the VisualStudioProjectsLocation reg value...
  if (cmSystemTools::ReadRegistryValue(
    "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\10.0;"
    "VisualStudioProjectsLocation",
    base))

to figure out where to copy the *.vsmacros file.

Your Visual Studio installation must have "//vmware-host/..." as its VisualStudioProjectsLocation value.

The question is: why does that yield an error? Do you not have write privileges in that folder?

CMake uses the *.vsmacros file to attempt to provide an automatic reload when projects get regenerated. That feature does not even work very well, and one could argue it should be removed... (See also 0011258 and 0011440)
(0034902)
Vince Harron (reporter)
2014-01-02 17:53

Mine is set to

%USERPROFILE%\Documents\Visual Studio 2010

Which I imagine is the default. Here is my setting for USERPROFILE

USERPROFILE=C:\Users\vharron

For whatever reason, cmake is evaluating USERPROFILE to an empty string and doing operations on \Documents\Visual Studio 2010\...

Since the command prompt current volume is Z:

Z:\Documents\Visual Studio 2010\...

Which is the same as

//vmware-host/shared folders/Documents/Visual Studio 2010/...

The expansion of USERPROFILE is the problem.
(0034903)
Vince Harron (reporter)
2014-01-02 17:54

BTW, I manually copied the file and I'm able to use the generated projects.
(0034907)
David Cole (manager)
2014-01-03 09:33

Glad you have a workaround....... but this seems odd.

If you run regedit and look at that reg value, is the type REG_SZ or REG_EXPAND_SZ? I have VS 11.0 installed, and mine is REG_EXPAND_SZ.

If you put this in your CMakeLists file, what does it emit?

    message(STATUS "USERPROFILE='$ENV{USERPROFILE}'")

Seems like somehow, CMake does not recognize the value as a REG_EXPAND_SZ, or it's running in an environment where the USERPROFILE env var is not set correctly.

How are you running CMake to get this result? (Looks like command line from your report... Is it a Visual Studio cmd prompt, or a plain old Windows cmd prompt...?)
(0034908)
Vince Harron (reporter)
2014-01-03 16:21

I just checked again and either VisualStudioProjectsLocation it set to

//vmware-host/shared folders/Documents/Visual Studio 2010

Either has changed or (more likely) I was reporting the value of VisualStudioLocation

%USERPROFILE%\Documents\Visual Studio 2010

Sorry about that. I don't know how "//vmware-host/shared folders" got set as my project location. (Maybe the first VS project I ever opened was on that device so VS chose that as my default.)

Anyway, setting my projects folder to C:\Users\vharron\Documents\Visual Studio 2010 fixed the problem for me. If you want to fix cmake for copying to paths beginning with \\ you should keep this bug open.
(0036101)
David Cole (manager)
2014-06-03 06:09

I think the right solution to this problem is to remove the feature moving forward.

The more recent versions of Visual Studio do better with reloading and prompting less in general anyhow, and this feature in CMake is at this point more problems than it's worth.

Perhaps it could be left "as is" for legacy versions of VS (say back to VS 10 or 11), and simply omitted with more recent versions...?
(0038518)
Brad King (manager)
2015-04-15 10:10

Re 0014680:0036101: I've dropped the feature for VS 10. It was never enabled for VS >= 11 anyway:

 VS: Drop reload macros for VS >= 10
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=885ab9ab [^]
(0039773)
Robert Maynard (manager)
2015-11-02 09:13

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-01-02 15:48 Vince Harron New Issue
2014-01-02 16:09 Brad King Assigned To => David Cole
2014-01-02 16:09 Brad King Status new => assigned
2014-01-02 17:39 David Cole Note Added: 0034901
2014-01-02 17:40 David Cole Relationship added related to 0011258
2014-01-02 17:40 David Cole Relationship added related to 0011440
2014-01-02 17:53 Vince Harron Note Added: 0034902
2014-01-02 17:54 Vince Harron Note Added: 0034903
2014-01-03 09:33 David Cole Note Added: 0034907
2014-01-03 16:21 Vince Harron Note Added: 0034908
2014-06-03 06:09 David Cole Note Added: 0036101
2014-06-03 06:09 David Cole Assigned To David Cole => Brad King
2015-04-15 10:10 Brad King Note Added: 0038518
2015-04-15 10:10 Brad King Status assigned => resolved
2015-04-15 10:10 Brad King Resolution open => fixed
2015-04-15 10:10 Brad King Fixed in Version => CMake 3.3
2015-04-15 10:10 Brad King Target Version => CMake 3.3
2015-11-02 09:13 Robert Maynard Note Added: 0039773
2015-11-02 09:13 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team