diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index 9e1de250..12480eae 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -58,6 +58,8 @@ if(NOT WIN32) set(XML_DEV_URANDOM 0) endif(XML_DEV_URANDOM) endif() +option(XML_UNICODE "Use UTF-16 encoded chars (two bytes) instead of UTF-8" OFF) +option(XML_UNICODE_WCHAR_T "Use wchar_t to represent UTF-16 instead of unsigned short" OFF) if(XML_DTD) set(XML_DTD 1) @@ -69,6 +71,17 @@ if(XML_NS) else(XML_NS) set(XML_NS 0) endif(XML_NS) +if(XML_UNICODE) + set(XML_UNICODE 1) +else(XML_UNICODE) + set(XML_UNICODE 0) +endif(XML_UNICODE) +if(XML_UNICODE_WCHAR_T) + set(XML_UNICODE_WCHAR_T 1) +else(XML_UNICODE_WCHAR_T) + set(XML_UNICODE_WCHAR_T 0) +endif(XML_UNICODE_WCHAR_T) + if(BUILD_tests) enable_testing() diff --git a/expat/expat_config.h.cmake b/expat/expat_config.h.cmake index d2dcd801..3e23f487 100644 --- a/expat/expat_config.h.cmake +++ b/expat/expat_config.h.cmake @@ -99,6 +99,12 @@ #cmakedefine XML_DEV_URANDOM #endif +/* Define to use UTF-16 chars (two bytes). */ +#cmakedefine XML_UNICODE + +/* Define to use wchar_t as UTF-16 char type instead of unsigned short. */ +#cmakedefine XML_UNICODE_WCHAR_T + /* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ #ifdef _MSC_VER # define __func__ __FUNCTION__