mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 19:30:13 -06:00
Windows is heading toward making UTF-8 the preferred MBCS. As CMake's internal encoding, `UTF-8` is effectively equivalent to `NONE`, which was CMake's behavior prior to 3.15's accidental change to `AUTO`. Behavior of `ENCODING UTF-8` is independent of CMake's internal encoding, making it in principle a better default than `NONE`. Add policy CMP0176 for compatibility and to document the default's history. Fixes: #26262
12 lines
292 B
CMake
12 lines
292 B
CMake
if(CMP0176 STREQUAL "NEW")
|
|
cmake_policy(SET CMP0176 NEW)
|
|
endif()
|
|
|
|
# Set the console code page.
|
|
execute_process(COMMAND cmd /c chcp ${CODEPAGE})
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/Encoding-common.cmake)
|
|
|
|
# Save our internal UTF-8 representation of the output.
|
|
file(WRITE "out.txt" "${out}")
|