[cmake-developers] Review request: fix-Qt5-windows-build
Clinton Stimpson
clinton at elemtech.com
Wed Mar 12 14:27:21 EDT 2014
On Wednesday, March 12, 2014 05:50:09 PM Stephen Kelly wrote:
> Clinton Stimpson wrote:
> > I personally would prefer a Qt version check
>
> This compiles:
>
> diff --git a/Source/QtDialog/CMakeSetup.cxx
> b/Source/QtDialog/CMakeSetup.cxx
> index 995929e..d1fbe9f 100644
> --- a/Source/QtDialog/CMakeSetup.cxx
> +++ b/Source/QtDialog/CMakeSetup.cxx
> @@ -79,12 +79,14 @@ int main(int argc, char** argv)
>
> QApplication app(argc, argv);
>
> -#if defined(KWSYS_CP_UTF8)
> +// #if defined(KWSYS_CP_UTF8)
> QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8");
> - QTextCodec::setCodecForCStrings(utf8_codec);
> QTextCodec::setCodecForLocale(utf8_codec);
> +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
> + QTextCodec::setCodecForCStrings(utf8_codec);
> QTextCodec::setCodecForTr(utf8_codec);
> #endif
> +// #endif
>
> // clean out standard Qt paths for plugins, which we don't use anyway
> // when creating Mac bundles, it potentially causes problems
>
>
> but I don't think it's better, I didn't runtime-test it, and I don't know
> what would trigger the KWSYS_CP_UTF8 to be defined anyway as it is not on my
> system. I just wanted to compile-out the new code.
>
> If you can runtime-test the behavior of the new lines with Qt 5, I'd say go
> ahead and commit that.
>
Thanks. I can also do a runtime check on this code with Qt5.
By the way, can you confirm that you are not currently seeing compile errors?
I don't think anyone would see these compile errors unless they manually add a
cmake variable to the cache to enable the utf-8 encoding.
Are you concerned because you saw Qt4 apis by visual inspection?
Clint
More information about the cmake-developers
mailing list