[CMake] cmake and wxwidgets on windows

Werner Smekal smekal at iap.tuwien.ac.at
Sat Nov 22 07:33:31 EST 2008


Hi Miguel,

> Well, it seems that UNICODE and _UNICODE are platform defined and if
> these have been defined, then wxUSE_UNICODE is forced. As a wxWidgets
> user you should set the wxUSE_UNICODE if you need UNICODE support.
> 
> Now the question remains: Should we set wxUSE_UNICODE in the
> FindwxWidgets module when using mswu configuration (i.e., unicode
> libraries)?
> 
> I think that this will depend on whether or not there is a legitimate
> use of unicode libraries with the wxUSE_UNICODE set to 0. John, could
> you ask this in the wxWidgets mailing list and cc me to keep track of
> the thread?
> 
> Any other thoughts?

Since the same problems happened now to me for an unicode enabled
program, I asked the wxWidgets mailing list, how this should be handled,
and I got the following answer from Vadim Zeitlin:

"It is safer to always define UNICODE and _UNICODE on the compiler
command line because all headers are affected by these symbols under
Windows and so if you don't define them you must somehow ensure that
wxWidgets headers are always included absolutely before anything else
which is not always possible.

As for wxUSE_UNICODE, it is indeed set to 1 automatically if _UNICODE is
defined as a convenience and so it is not necessary to edit setup.h if
you do define _UNICODE on the command line."

So from that I would suggest, that UNICODE and _UNICODE is defined for
unicode builds of wxWidgets for all Win32 compilers at the compiler
command line.

Regards,
Werner

-- 
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: smekal at iap.tuwien.ac.at
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
       +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499



More information about the CMake mailing list