diff options
author | Wouter Klouwen <wouter.klouwen@youview.com> | 2018-01-20 15:13:21 (GMT) |
---|---|---|
committer | Wouter Klouwen <wouter.klouwen@youview.com> | 2018-01-23 18:56:42 (GMT) |
commit | e6a80ccfc440ac8dd5e9e5405744c2423560fc02 (patch) | |
tree | 22b68d9379421a8a84ff5dab35e9689654334b04 /Source/CPack | |
parent | ff62b00522d1ddaeb88be241ab4a022f935b5c00 (diff) | |
download | CMake-e6a80ccfc440ac8dd5e9e5405744c2423560fc02.zip CMake-e6a80ccfc440ac8dd5e9e5405744c2423560fc02.tar.gz CMake-e6a80ccfc440ac8dd5e9e5405744c2423560fc02.tar.bz2 |
Make use of std::chrono throughout every component
This commit continues the changes made in CTest to support std::chrono
by
applying it throughout every component where a duration was used.
No functional change intended.
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/CPack/cmCPackDragNDropGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 19 | ||||
-rw-r--r-- | Source/CPack/cmCPackOSXX11Generator.cxx | 7 | ||||
-rw-r--r-- | Source/CPack/cmCPackPackageMakerGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/CPack/cmCPackProductBuildGenerator.cxx | 7 |
7 files changed, 41 insertions, 32 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 86c6981..9f1a15e 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -9,6 +9,7 @@ #include "cmCPackIFWPackage.h" #include "cmCPackIFWRepository.h" #include "cmCPackLog.h" // IWYU pragma: keep +#include "cmDuration.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" @@ -84,9 +85,9 @@ int cmCPackIFWGenerator::PackageFiles() std::string output; int retVal = 1; cmCPackIFWLogger(OUTPUT, "- Generate repository" << std::endl); - bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, - &output, &retVal, nullptr, - this->GeneratorVerbose, 0); + bool res = cmSystemTools::RunSingleCommand( + ifwCmd.c_str(), &output, &output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); if (!res || retVal) { cmGeneratedFileStream ofs(ifwTmpFile.c_str()); ofs << "# Run command: " << ifwCmd << std::endl @@ -194,9 +195,9 @@ int cmCPackIFWGenerator::PackageFiles() std::string output; int retVal = 1; cmCPackIFWLogger(OUTPUT, "- Generate package" << std::endl); - bool res = cmSystemTools::RunSingleCommand(ifwCmd.c_str(), &output, - &output, &retVal, nullptr, - this->GeneratorVerbose, 0); + bool res = cmSystemTools::RunSingleCommand( + ifwCmd.c_str(), &output, &output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); if (!res || retVal) { cmGeneratedFileStream ofs(ifwTmpFile.c_str()); ofs << "# Run command: " << ifwCmd << std::endl diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index bb35623..e95b96df 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -4,6 +4,7 @@ #include "cmCPackGenerator.h" #include "cmCPackLog.h" +#include "cmDuration.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" @@ -242,9 +243,9 @@ bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command, { int exit_code = 1; - bool result = cmSystemTools::RunSingleCommand(command.str().c_str(), output, - output, &exit_code, nullptr, - this->GeneratorVerbose, 0); + bool result = cmSystemTools::RunSingleCommand( + command.str().c_str(), output, output, &exit_code, nullptr, + this->GeneratorVerbose, cmDuration::zero()); if (!result || exit_code) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Error executing: " << command.str() diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index ea0e899..9590aa2 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -12,6 +12,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" #include "cmCryptoHash.h" +#include "cmDuration.h" #include "cmFSPermissions.h" #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" @@ -277,9 +278,9 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << ic << std::endl); std::string output; int retVal = 1; - bool resB = - cmSystemTools::RunSingleCommand(ic.c_str(), &output, &output, &retVal, - nullptr, this->GeneratorVerbose, 0); + bool resB = cmSystemTools::RunSingleCommand( + ic.c_str(), &output, &output, &retVal, nullptr, this->GeneratorVerbose, + cmDuration::zero()); if (!resB || retVal) { std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/InstallOutput.log"; @@ -601,7 +602,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( int retVal = 1; bool resB = cmSystemTools::RunSingleCommand( buildCommand.c_str(), &output, &output, &retVal, - installDirectory.c_str(), this->GeneratorVerbose, 0); + installDirectory.c_str(), this->GeneratorVerbose, + cmDuration::zero()); if (!resB || retVal) { std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/PreinstallOutput.log"; diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index ddf104c..965283d 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -5,6 +5,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackGenerator.h" #include "cmCPackLog.h" +#include "cmDuration.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" @@ -301,9 +302,9 @@ int cmCPackNSISGenerator::PackageFiles() cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd << std::endl); std::string output; int retVal = 1; - bool res = - cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal, - nullptr, this->GeneratorVerbose, 0); + bool res = cmSystemTools::RunSingleCommand( + nsisCmd.c_str(), &output, &output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); if (!res || retVal) { cmGeneratedFileStream ofs(tmpFile.c_str()); ofs << "# Run command: " << nsisCmd << std::endl @@ -400,9 +401,9 @@ int cmCPackNSISGenerator::InitializeInternal() << std::endl); std::string output; int retVal = 1; - bool resS = - cmSystemTools::RunSingleCommand(nsisCmd.c_str(), &output, &output, &retVal, - nullptr, this->GeneratorVerbose, 0); + bool resS = cmSystemTools::RunSingleCommand( + nsisCmd.c_str(), &output, &output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); cmsys::RegularExpression versionRex("v([0-9]+.[0-9]+)"); cmsys::RegularExpression versionRexCVS("v(.*)\\.cvs"); if (!resS || retVal || @@ -737,9 +738,9 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( zipListFileName.c_str()); std::string output; int retVal = -1; - int res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &output, - &retVal, dirName.c_str(), - cmSystemTools::OUTPUT_NONE, 0); + int res = cmSystemTools::RunSingleCommand( + cmd.c_str(), &output, &output, &retVal, dirName.c_str(), + cmSystemTools::OUTPUT_NONE, cmDuration::zero()); if (!res || retVal) { std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/CompressZip.log"; diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 8d3c40c..e750de3 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -6,6 +6,7 @@ #include "cmCPackGenerator.h" #include "cmCPackLog.h" +#include "cmDuration.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cm_sys_stat.h" @@ -154,9 +155,9 @@ int cmCPackOSXX11Generator::PackageFiles() int numTries = 10; bool res = false; while (numTries > 0) { - res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, - &output, &retVal, nullptr, - this->GeneratorVerbose, 0); + res = cmSystemTools::RunSingleCommand( + dmgCmd.str().c_str(), &output, &output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); if (res && !retVal) { numTries = -1; break; diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index dbcb022..c515b85 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -13,6 +13,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" +#include "cmDuration.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" #include "cmXMLWriter.h" @@ -295,9 +296,9 @@ int cmCPackPackageMakerGenerator::PackageFiles() int numTries = 10; bool res = false; while (numTries > 0) { - res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output, - &output, &retVal, nullptr, - this->GeneratorVerbose, 0); + res = cmSystemTools::RunSingleCommand( + dmgCmd.str().c_str(), &output, &output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); if (res && !retVal) { numTries = -1; break; @@ -467,7 +468,8 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command, std::string output; int retVal = 1; bool res = cmSystemTools::RunSingleCommand( - command, &output, &output, &retVal, nullptr, this->GeneratorVerbose, 0); + command, &output, &output, &retVal, nullptr, this->GeneratorVerbose, + cmDuration::zero()); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running package maker" << std::endl); if (!res || retVal) { diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index 6a6dc82..57cf7ea 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -8,6 +8,7 @@ #include "cmCPackComponentGroup.h" #include "cmCPackLog.h" +#include "cmDuration.h" #include "cmGeneratedFileStream.h" #include "cmSystemTools.h" @@ -145,9 +146,9 @@ bool cmCPackProductBuildGenerator::RunProductBuild(const std::string& command) cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << command << std::endl); std::string output, error_output; int retVal = 1; - bool res = cmSystemTools::RunSingleCommand(command.c_str(), &output, - &error_output, &retVal, nullptr, - this->GeneratorVerbose, 0); + bool res = cmSystemTools::RunSingleCommand( + command.c_str(), &output, &error_output, &retVal, nullptr, + this->GeneratorVerbose, cmDuration::zero()); cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running command" << std::endl); if (!res || retVal) { cmGeneratedFileStream ofs(tmpFile.c_str()); |