summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cpack.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack/cpack.cxx')
-rw-r--r--Source/CPack/cpack.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index b06bd38..06472c6 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -17,6 +17,9 @@
#include <cmsys/CommandLineArguments.hxx>
#include <cmsys/Encoding.hxx>
+#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+#include <cmsys/ConsoleBuf.hxx>
+#endif
#include <iostream>
#include <map>
#include <sstream>
@@ -84,6 +87,11 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
// this is CPack.
int main(int argc, char const* const* argv)
{
+#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
+ // Replace streambuf so we can output Unicode to console
+ cmsys::ConsoleBuf::Manager consoleOut(std::cout);
+ cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true);
+#endif
cmsys::Encoding::CommandLineArguments args =
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
argc = args.argc();