[cmake-developers] Review request: fix-Qt5-windows-build

Clinton Stimpson clinton at elemtech.com
Wed Mar 12 12:35:47 EDT 2014


On Wednesday, March 12, 2014 05:21:30 PM Stephen Kelly wrote:
> Hi,
> 
> I didn't follow the encoding work done by Clinton, and in my Qt 5 build with
> default settings, the new codepage related definition is not set. However,
> if it is set somehow, then the build would be calling methods which are not
> present in Qt 5.
> 
> I've just pushed a topic fixing that, but would appreciate review from
> Clinton?
> 
> Thanks,
> 
> Steve.

I personally would prefer a Qt version check around the new QTextCodec code.
Perhaps something like this:

#if defined(KWSYS_CP_UTF8)
  QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8");
  QTextCodec::setCodecForLocale(utf8_codec);
#if QT_VERSION < 0x050000
  QTextCodec::setCodecForCStrings(utf8_codec);
  QTextCodec::setCodecForTr(utf8_codec);
#endif
#endif

Does that compile for you?

Clint



More information about the cmake-developers mailing list