[CMake] How to avoid having /D _MBCS ?

John Drescher drescherjm at gmail.com
Thu Mar 21 10:29:18 EDT 2013


On Thu, Mar 21, 2013 at 10:20 AM, Martin Koller <martin.koller at etm.at> wrote:
> In my win project, when I use the visual studio generator (64bit), I always get the /D _MBCS flag in the compiler options
> (started with msbuild).
> When I generate Makefiles with the same project (JOM NMakefiles), _MBCS is not defined.
> I do not want to have it defined. How can I avoid it and still using vcxproj files ?
> --

I would use remove_definitions(-D_MBCS)

x:\x64\VC.110>cmake --help-command remove_definitions
cmake version 2.8.10.2
  remove_definitions
       Removes -D define flags added by add_definitions.

         remove_definitions(-DFOO -DBAR ...)

       Removes flags (added by add_definitions) from the compiler command
       line for sources in the current directory and below.

John


More information about the CMake mailing list