View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015867CMakeCMakepublic2015-11-30 05:172016-06-10 14:21
ReporterMarcel Beister 
Assigned ToClinton Stimpson 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Platformx64OSMicrosoft WindowsOS Version7
Product VersionCMake 3.4 
Target VersionFixed in Version 
Summary0015867: Meta-projects generated for Visual Studio 2013 solutions are always multi-byte
DescriptionExpected Behavior:
If "add_definitions(-D_UNICODE -DUNICODE)" was added to the CMakeList.txt, all project files for Visual Studio solutions should be marked as unicode.

Real Behavior:
While the behavior is as expected in Visual Studio 2008, at least Visual Studio 2013 does not show the expected behavior and sets meta projects (e.g. ZERO_CHECK) to multi-byte.

Problem:
Starting with Visual Studio 2013, MFC with multi-byte character set is marked deprecated and no longer possible without installing additional software.
Steps To Reproduce* Create a simple CMake project
* Add "add_definitions(-D_UNICODE -DUNICODE)" to the CMakeList.txt
* Generate a Visual Studio 2013 solution
* Open the generate solution with Visual Studio
* Verify the character set of meta projects (e.g. ZERO_CHECK)
Additional Informationhttp://stackoverflow.com/questions/22011610/how-do-i-set-unicode-as-character-set-in-the-all-build-and-zero-check-visual-stu?lq=1 [^]
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0039919)
Clinton Stimpson (developer)
2015-11-30 10:27
edited on: 2015-11-30 10:28

What is the problem? Are you getting a warning, error, unable to compile, or something else?

https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVisualStudio10TargetGenerator.cxx;h=6e1fb5 [^]

From cmVisualStudio10TargetGenerator.cxx line 751 to 768, it appears CharacterSet will always be set to MultiByte for a UTILITY target. It seems that logic needs changed.

(0039920)
Marcel Beister (reporter)
2015-11-30 11:20

With a plain Visual Studio 2013 installation I get the following error for all meta projects (if MFC is used and enabled in the project):

Error 1 error MSB8031: Use of MBCS encoding in MFC projects require an additional library to be downloaded and installed. Please see http://go.microsoft.com/fwlink/?LinkId=286820 [^] for more information. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\v120\Microsoft.CppBuild.targets

This forces me to either
* manually switch all meta projects from multi-byte to unicode (and do this every time when CMake detected changes)
* install the additional library although i do not use MFC with multi-byte characters (of course this is possible, but unnecessary; also this feature might be completely removed in future VS version)

The same problem is described here:
http://stackoverflow.com/questions/19603680/mbcs-error-building-mfc-c-project-with-visual-studio [^]
(0039922)
Clinton Stimpson (developer)
2015-11-30 11:27

Ok. So does that mean your simple cmake project is setting CMAKE_MFC_FLAG?
(0039923)
Marcel Beister (reporter)
2015-11-30 11:29

Yes, I have "set(CMAKE_MFC_FLAG 2)" in my root CMakeList.txt file.
Sorry for not-mentioning this in my "Steps To Reproduce".
(0040272)
Clinton Stimpson (developer)
2016-01-19 16:07

https://cmake.org/gitweb?p=cmake.git;a=commit;h=a15e375c [^]
(0041277)
Kitware Robot (administrator)
2016-06-10 14:21

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
2015-11-30 05:17 Marcel Beister New Issue
2015-11-30 09:48 Brad King Assigned To => Clinton Stimpson
2015-11-30 09:48 Brad King Status new => assigned
2015-11-30 10:27 Clinton Stimpson Note Added: 0039919
2015-11-30 10:28 Clinton Stimpson Note Edited: 0039919
2015-11-30 11:20 Marcel Beister Note Added: 0039920
2015-11-30 11:27 Clinton Stimpson Note Added: 0039922
2015-11-30 11:29 Marcel Beister Note Added: 0039923
2016-01-19 16:07 Clinton Stimpson Note Added: 0040272
2016-01-19 16:07 Clinton Stimpson Status assigned => resolved
2016-01-19 16:07 Clinton Stimpson Resolution open => fixed
2016-06-10 14:21 Kitware Robot Note Added: 0041277
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team