[CMake] Unicode path wrecks havoc with VS2013 generator

clinton at elemtech.com clinton at elemtech.com
Sat Nov 9 01:13:43 EST 2013



----- Original Message -----
> On 11/8/2013 4:48 AM, Nagy-Egri Máté Ferenc wrote:
> > Hi!
> >
> > I have the following issue, which I do not know whether it is an issue
> > of CMake or Visual Studio. When I try to generate a Visual Studio
> > project under a path that contains unicode characters, VS fails to
> > compile the simple test file and thus CMake terminates project
> > generation. Visual Studio does have some issues with projects under
> > unicode paths, but generally things work. (For eg. the C++AMP call tree
> > generator breaks, therefore no C++AMP project can be built in such
> > paths) I develop all my applications in my Skydrive folder which is
> > under the Users folder, and since my name holds unicode characters, I
> > have no control over mw home folder under Win 8 if I have a Live-ID user
> > in the OS. This is what happens:
> Clearly you need to change your name.  :)
> 
> Can you create a simple project from the IDE in that directory and get
> it to work?
> 
> If you run CMake with --debug-trycompile, can you load the solution in
> the CMakeTmp directory from the IDE?
> 

This problem can also be reproduced with English as the current language.
Just pick a character between 128 and 256 to include in the name of the build directory.
For example, buildñ, and run cmake in there pointing to any source tree.

For me, the Visual Studio 9 2008 generator works fine and the project file reports an encoding of Windows-1252.
It fails with the the Visual Studio 10 generator where the project file reports a utf-8 encoding, but it really isn't utf-8.
So I get errors like this:
 C:\...\cmake\buildñ\CMakeFiles\CMakeTmp\cmTryCompileExec926
91608.vcxproj(56,110):
 error MSB4025: The project file could not be loaded.  Invalid character in
 the given encoding.  Line 56, position 110.

Modifying cmVisualStudio10TargetGenerator.cxx to set the encoding of the visual studio file to Windows-1252 instead of utf-8 fixes the problem for me.

Clint


More information about the CMake mailing list