diff options
author | Brad King <brad.king@kitware.com> | 2020-10-15 12:10:40 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-15 12:10:51 (GMT) |
commit | 9493532f80f27313e82b64b053fcc7d61626c1b4 (patch) | |
tree | 24787f63bb2ae9ca5ad91870a4c33845fa41d6c9 /Source/CPack | |
parent | 64449c9f949948aa956ea03682530df9317f37ef (diff) | |
parent | f7a5f283188c1e51b0fb549f0a78afaf1d570383 (diff) | |
download | CMake-9493532f80f27313e82b64b053fcc7d61626c1b4.zip CMake-9493532f80f27313e82b64b053fcc7d61626c1b4.tar.gz CMake-9493532f80f27313e82b64b053fcc7d61626c1b4.tar.bz2 |
Merge topic 'cmake-E-cat-binary'
f7a5f28318 cmake: Fix '-E cat' command for binary files on Windows
90b39a5209 cmConsoleBuf: Factor out cout/cerr console buffer management
f1fdd15863 clang-format: Fix include block order in ctest.cxx and cpack.cxx
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5364
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cpack.cxx | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 6c80753..85c13ad 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -1,12 +1,22 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ +#include <cstddef> +#include <iostream> +#include <map> +#include <memory> +#include <sstream> +#include <string> +#include <utility> +#include <vector> + #include "cmsys/CommandLineArguments.hxx" #include "cmsys/Encoding.hxx" #include "cmCPackGenerator.h" #include "cmCPackGeneratorFactory.h" #include "cmCPackLog.h" +#include "cmConsoleBuf.h" #include "cmDocumentation.h" #include "cmDocumentationEntry.h" #include "cmDocumentationFormatter.h" @@ -19,19 +29,6 @@ #include "cmSystemTools.h" #include "cmake.h" -#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP) -# include "cmsys/ConsoleBuf.hxx" -#endif - -#include <cstddef> -#include <iostream> -#include <map> -#include <memory> -#include <sstream> -#include <string> -#include <utility> -#include <vector> - namespace { const char* cmDocumentationName[][2] = { { nullptr, " cpack - Packaging driver provided by CMake." }, @@ -104,13 +101,11 @@ void cpackProgressCallback(const std::string& message, float /*unused*/) int main(int argc, char const* const* argv) { cmSystemTools::EnsureStdPipes(); -#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP) + // Replace streambuf so we can output Unicode to console - cmsys::ConsoleBuf::Manager consoleOut(std::cout); - consoleOut.SetUTF8Pipes(); - cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true); - consoleErr.SetUTF8Pipes(); -#endif + cmConsoleBuf consoleBuf; + consoleBuf.SetUTF8Pipes(); + cmsys::Encoding::CommandLineArguments args = cmsys::Encoding::CommandLineArguments::Main(argc, argv); argc = args.argc(); |