diff options
author | Kitware Robot <kwrobot@kitware.com> | 2018-06-01 13:53:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-06-01 13:53:42 (GMT) |
commit | d7204e649ed4ebb19bb341b4e49eb51514364922 (patch) | |
tree | d9ac3ded5ae6899be7188795011743fe3e6da0a6 /Source/CPack/cmCPackNSISGenerator.cxx | |
parent | 12fed3edb107c949671043196fa94c542b45452a (diff) | |
download | CMake-d7204e649ed4ebb19bb341b4e49eb51514364922.zip CMake-d7204e649ed4ebb19bb341b4e49eb51514364922.tar.gz CMake-d7204e649ed4ebb19bb341b4e49eb51514364922.tar.bz2 |
Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`. Use `clang-format` version 6.0.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Diffstat (limited to 'Source/CPack/cmCPackNSISGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 115 |
1 files changed, 64 insertions, 51 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 3f7164a..a893a0f 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -20,9 +20,9 @@ /* NSIS uses different command line syntax on Windows and others */ #ifdef _WIN32 -#define NSIS_OPT "/" +# define NSIS_OPT "/" #else -#define NSIS_OPT "-" +# define NSIS_OPT "-" #endif cmCPackNSISGenerator::cmCPackNSISGenerator(bool nsis64) @@ -81,8 +81,8 @@ int cmCPackNSISGenerator::PackageFiles() str << " Delete \"" << outputDir << "\\" << fileN << "\"" << std::endl; } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: " << str.str() - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Uninstall Files: " << str.str() << std::endl); this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str().c_str()); std::vector<std::string> dirs; this->GetListOfSubdirectories(toplevel.c_str(), dirs); @@ -117,12 +117,13 @@ int cmCPackNSISGenerator::PackageFiles() this->Components[componentName].Directories.push_back(std::move(fileN)); } } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: " << dstr.str() - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Uninstall Dirs: " << dstr.str() << std::endl); this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", dstr.str().c_str()); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " - << nsisInFileName << " to " << nsisFileName << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Configure file: " << nsisInFileName << " to " << nsisFileName + << std::endl); if (this->IsSet("CPACK_NSIS_MUI_ICON") || this->IsSet("CPACK_NSIS_MUI_UNIICON")) { std::string installerIconCode; @@ -308,10 +309,11 @@ int cmCPackNSISGenerator::PackageFiles() ofs << "# Run command: " << nsisCmd << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running NSIS command: " - << nsisCmd << std::endl - << "Please check " << tmpFile << " for errors" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running NSIS command: " << nsisCmd << std::endl + << "Please check " + << tmpFile << " for errors" + << std::endl); return 0; } return 1; @@ -329,28 +331,31 @@ int cmCPackNSISGenerator::InitializeInternal() this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", nullptr); } - cmCPackLogger(cmCPackLog::LOG_DEBUG, "cmCPackNSISGenerator::Initialize()" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "cmCPackNSISGenerator::Initialize()" << std::endl); std::vector<std::string> path; std::string nsisPath; bool gotRegValue = false; #ifdef _WIN32 if (Nsis64) { - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", - nsisPath, cmsys::SystemTools::KeyWOW64_64)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath, + cmsys::SystemTools::KeyWOW64_64)) { gotRegValue = true; } - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, - cmsys::SystemTools::KeyWOW64_64)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, + cmsys::SystemTools::KeyWOW64_64)) { gotRegValue = true; } } - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", - nsisPath, cmsys::SystemTools::KeyWOW64_32)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath, + cmsys::SystemTools::KeyWOW64_32)) { gotRegValue = true; } if (!gotRegValue && @@ -358,13 +363,15 @@ int cmCPackNSISGenerator::InitializeInternal() "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS\\Unicode", nsisPath)) { gotRegValue = true; } - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, - cmsys::SystemTools::KeyWOW64_32)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath, + cmsys::SystemTools::KeyWOW64_32)) { gotRegValue = true; } - if (!gotRegValue && cmsys::SystemTools::ReadRegistryValue( - "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath)) { + if (!gotRegValue && + cmsys::SystemTools::ReadRegistryValue( + "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", nsisPath)) { gotRegValue = true; } @@ -395,8 +402,8 @@ int cmCPackNSISGenerator::InitializeInternal() } std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION"; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: " << nsisCmd - << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Test NSIS version: " << nsisCmd << std::endl); std::string output; int retVal = 1; bool resS = cmSystemTools::RunSingleCommand( @@ -413,17 +420,18 @@ int cmCPackNSISGenerator::InitializeInternal() ofs << "# Run command: " << nsisCmd << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger( - cmCPackLog::LOG_ERROR, "Problem checking NSIS version with command: " - << nsisCmd << std::endl - << "Please check " << tmpFile << " for errors" << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem checking NSIS version with command: " + << nsisCmd << std::endl + << "Please check " << tmpFile << " for errors" + << std::endl); return 0; } if (versionRex.find(output)) { double nsisVersion = atof(versionRex.match(1).c_str()); double minNSISVersion = 2.09; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: " << nsisVersion - << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "NSIS Version: " << nsisVersion << std::endl); if (nsisVersion < minNSISVersion) { cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack requires NSIS Version 2.09 or greater. " @@ -434,8 +442,8 @@ int cmCPackNSISGenerator::InitializeInternal() } if (versionRexCVS.find(output)) { // No version check for NSIS cvs build - cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: CVS " - << versionRexCVS.match(1) << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "NSIS Version: CVS " << versionRexCVS.match(1) << std::endl); } this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str()); this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin"); @@ -447,8 +455,9 @@ int cmCPackNSISGenerator::InitializeInternal() this->GetOption("CPACK_NSIS_EXECUTABLES_DIRECTORY"); std::vector<std::string> cpackPackageDesktopLinksVector; if (cpackPackageDeskTopLinks) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: " - << cpackPackageDeskTopLinks << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "CPACK_CREATE_DESKTOP_LINKS: " << cpackPackageDeskTopLinks + << std::endl); cmSystemTools::ExpandListArgument(cpackPackageDeskTopLinks, cpackPackageDesktopLinksVector); @@ -457,7 +466,8 @@ int cmCPackNSISGenerator::InitializeInternal() "CPACK_CREATE_DESKTOP_LINKS: " << cpdl << std::endl); } } else { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "CPACK_CREATE_DESKTOP_LINKS: " + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "CPACK_CREATE_DESKTOP_LINKS: " << "not set" << std::endl); } @@ -465,8 +475,9 @@ int cmCPackNSISGenerator::InitializeInternal() std::ostringstream deleteStr; if (cpackPackageExecutables) { - cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: " - << cpackPackageExecutables << "." << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "The cpackPackageExecutables: " << cpackPackageExecutables + << "." << std::endl); std::vector<std::string> cpackPackageExecutablesVector; cmSystemTools::ExpandListArgument(cpackPackageExecutables, cpackPackageExecutablesVector); @@ -683,8 +694,9 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( << std::endl); if (cmSystemTools::FileExists(archiveFile, true)) { if (!cmSystemTools::RemoveFile(archiveFile)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to remove archive file " - << archiveFile << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Unable to remove archive file " << archiveFile + << std::endl); return ""; } } @@ -694,8 +706,8 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( this->ReadListFile("CPackZIP.cmake"); if (!this->IsSet("ZIP_EXECUTABLE")) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Unable to find ZIP program" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Unable to find ZIP program" << std::endl); return ""; } } @@ -746,10 +758,11 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( ofs << "# Run command: " << cmd << std::endl << "# Output:" << std::endl << output << std::endl; - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running zip command: " - << cmd << std::endl - << "Please check " << tmpFile << " for errors" - << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem running zip command: " << cmd << std::endl + << "Please check " + << tmpFile << " for errors" + << std::endl); return ""; } |