diff options
Diffstat (limited to 'Source/CPack/cpack.cxx')
-rw-r--r-- | Source/CPack/cpack.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 5c45b14..06472c6 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -10,13 +10,16 @@ #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStateTypes.h" #include "cmSystemTools.h" -#include "cmTypeMacro.h" #include "cm_auto_ptr.hxx" #include "cmake.h" #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(); @@ -415,9 +423,7 @@ int main(int argc, char const* const* argv) } doc.SetSection("Generators", v); -#undef cout return doc.PrintRequestedDocumentation(std::cout) ? 0 : 1; -#define cout no_cout_use_cmCPack_Log } if (cmSystemTools::GetErrorOccuredFlag()) { |