[CMake] Remove _MBCS

YanmingZou ymzou at hotmail.com
Wed Feb 20 10:18:08 EST 2013


Hi Niels, Thanks for your example. It works well on my PC. So there should be something wrong in my files. I will check and let you know the reason when I find it.  Best regards and thanks again.Yanming
 > Date: Wed, 20 Feb 2013 15:36:21 +0100
> From: niels_dekker_address_until_2014 at xs4all.nl
> To: cmake at cmake.org
> Subject: Re: [CMake] Remove _MBCS
> 
> 
> On 2013-02-18 10:00, YanmingZou wrote:
> > I am developing an application on windows with VS2012 and CMake
> > (2.8.10.2). I want to use unicode in my program, so I add UNICODE and
> > _UNICODE with ADD_DEFINITIONS. However, there is always a _MBCS marco in
> > the generated project file. The project can be compiled, but I am not
> > happy with that. Could someone can tell me how to remove the _MBCS?
> 
> On 2013-02-20 14:35, Patrick Johnmeyer wrote:
> > Did you try remove_definitions?
> 
> 
> Still I'm surprised that in your case, add_definitions(-D_UNICODE) does 
> not automatically remove the definition of _MBCS. Do you even have _MBCS 
> for a simple CMakeLists.txt as follows?
> 
>    ############################################################
>    # CMakeLists.txt
>    project( MyCMakeMfcUnicodeApp )
>    cmake_minimum_required(VERSION 2.8)
>    set(CMAKE_MFC_FLAG 2)
>    add_definitions(-D_UNICODE)
>    add_executable(${PROJECT_NAME} MySourceFile.cpp)
>    ############################################################
> 
> Having the following "MySourceFile.cpp":
> 
>    ////////////////////////////////////////////////////////////
>    // MySourceFile.cpp
>    #ifdef _MBCS
>    #  error "_MBCS should not be defined!"
>    #endif
>    ////////////////////////////////////////////////////////////
> 
> 
> Kind regards,
> 
>   Niels
> -- 
> Niels Dekker
> http://www.xs4all.nl/~nd/dekkerware
> Scientific programmer at LKEB, Leiden University Medical Center
> --
> 
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130220/78d0e1db/attachment.htm>


More information about the CMake mailing list