diff options
author | Brad King <brad.king@kitware.com> | 2019-01-30 13:10:19 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-30 13:10:27 (GMT) |
commit | c30f9b1cdefc2fa26d89bc692001a4f1050f6038 (patch) | |
tree | 2c862b3be88b4b600f6ac515d4c76fb039c8df2f /Source/CPack | |
parent | bcec7d0778eb87ea58d720d9e20710dc2cdfdab6 (diff) | |
parent | 8c92db829b41243790c7dcc5300227f591a727a8 (diff) | |
download | CMake-c30f9b1cdefc2fa26d89bc692001a4f1050f6038.zip CMake-c30f9b1cdefc2fa26d89bc692001a4f1050f6038.tar.gz CMake-c30f9b1cdefc2fa26d89bc692001a4f1050f6038.tar.bz2 |
Merge topic 'functional-callbacks'
8c92db829b MessageCallback: Remove unused bool& argument
bcee24aecc Use `std::function` for callbacks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: vvs31415 <vstakhovsky@fastmail.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !2872
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/CPack/cpack.cxx | 8 |
2 files changed, 5 insertions, 13 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 90d38fc..57c0545 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -43,12 +43,6 @@ cmCPackGenerator::~cmCPackGenerator() this->MakefileMap = nullptr; } -void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr) -{ - cmCPackGenerator* self = static_cast<cmCPackGenerator*>(ptr); - self->DisplayVerboseOutput(msg, prog); -} - void cmCPackGenerator::DisplayVerboseOutput(const char* msg, float progress) { (void)progress; @@ -695,7 +689,9 @@ int cmCPackGenerator::InstallCMakeProject( cm.SetHomeOutputDirectory(""); cm.GetCurrentSnapshot().SetDefaultDefinitions(); cm.AddCMakePaths(); - cm.SetProgressCallback(cmCPackGeneratorProgress, this); + cm.SetProgressCallback([this](const char* msg, float prog) { + this->DisplayVerboseOutput(msg, prog); + }); cm.SetTrace(this->Trace); cm.SetTraceExpand(this->TraceExpand); cmGlobalGenerator gg(&cm); diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index d4c867b..0413422 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -90,12 +90,8 @@ int cpackDefinitionArgument(const char* argument, const char* cValue, return 1; } -static void cpackProgressCallback(const char* message, float progress, - void* clientdata) +static void cpackProgressCallback(const char* message, float /*unused*/) { - (void)progress; - (void)clientdata; - std::cout << "-- " << message << std::endl; } @@ -212,7 +208,7 @@ int main(int argc, char const* const* argv) cmake cminst(cmake::RoleScript, cmState::CPack); cminst.SetHomeDirectory(""); cminst.SetHomeOutputDirectory(""); - cminst.SetProgressCallback(cpackProgressCallback, nullptr); + cminst.SetProgressCallback(cpackProgressCallback); cminst.GetCurrentSnapshot().SetDefaultDefinitions(); cmGlobalGenerator cmgg(&cminst); cmMakefile globalMF(&cmgg, cminst.GetCurrentSnapshot()); |