From 886c559518ebf39ac91d6048c9c92320a9cde82e Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Fri, 2 Jun 2006 11:26:10 -0400 Subject: ENH: Display cmake install information when in verbose mode --- Source/CPack/cmCPackGenericGenerator.cxx | 15 +++++++++++++++ Source/CPack/cmCPackGenericGenerator.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx index 0d122cb..9a8280e 100644 --- a/Source/CPack/cmCPackGenericGenerator.cxx +++ b/Source/CPack/cmCPackGenericGenerator.cxx @@ -43,6 +43,20 @@ cmCPackGenericGenerator::~cmCPackGenericGenerator() } //---------------------------------------------------------------------- +void cmCPackGenericGeneratorProgress(const char *msg, float prog, void* ptr) +{ + cmCPackGenericGenerator* self = static_cast(ptr); + self->DisplayVerboseOutput(msg, prog); +} + +//---------------------------------------------------------------------- +void cmCPackGenericGenerator::DisplayVerboseOutput(const char* msg, + float progress) +{ + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "" << msg << std::endl); +} + +//---------------------------------------------------------------------- int cmCPackGenericGenerator::PrepareNames() { this->SetOption("CPACK_GENERATOR", this->Name.c_str()); @@ -381,6 +395,7 @@ int cmCPackGenericGenerator::InstallProject() cmCPackLogger(cmCPackLog::LOG_OUTPUT, "- Install project: " << installProjectName << std::endl); cmake cm; + cm.SetProgressCallback(cmCPackGenericGeneratorProgress, this); cmGlobalGenerator gg; gg.SetCMakeInstance(&cm); std::auto_ptr lg(gg.CreateLocalGenerator()); diff --git a/Source/CPack/cmCPackGenericGenerator.h b/Source/CPack/cmCPackGenericGenerator.h index 6867613..0d46064 100644 --- a/Source/CPack/cmCPackGenericGenerator.h +++ b/Source/CPack/cmCPackGenericGenerator.h @@ -87,6 +87,9 @@ public: //! Set the logger void SetLogger(cmCPackLog* log) { this->Logger = log; } + //! Display verbose information via logger + void DisplayVerboseOutput(const char* msg, float progress); + protected: int PrepareNames(); int InstallProject(); -- cgit v0.12