qt_disable_unicode_defines
ターゲット上で、一部のユニコード関連のコンパイラ定義が自動的に設定されるのを防ぎます。
このコマンドは、Qt6 パッケージのCore コンポーネントに定義されており、次のように読み込むことができます:
find_package(Qt6 REQUIRED COMPONENTS Core)このコマンドは Qt 6.2 で導入されました。
概要
qt_disable_unicode_defines(target)バージョン指定のないコマンドが無効になっている場合は、代わりに `qt6_disable_unicode_defines() ` を使用してください。このコマンドと同じ引数セットをサポートしています。
説明
Qt 6 では、Qt モジュールをリンク対象とするターゲットに対して、デフォルトで `UNICODE ` および `_UNICODE ` コンパイラ定義が設定されます。これは qmake の動作と一致していますが、Qt 5 の CMake API の動作とは異なります。target に対して `qt_disable_unicode_defines() ` を呼び出すと、これらのコンパイラ定義が自動的に設定されるのを防ぐことができます。
qt_allow_non_utf8_sources()も参照してください 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.