summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackCygwinSourceGenerator.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/CPack/cmCPackCygwinSourceGenerator.cxx
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz
CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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/cmCPackCygwinSourceGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackCygwinSourceGenerator.cxx76
1 files changed, 33 insertions, 43 deletions
diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
index 132ebcf..5fcfaf4 100644
--- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx
+++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx
@@ -25,8 +25,8 @@
// system tools because it is not implemented robustly enough to move
// files across directories.
#ifdef _WIN32
-# include <sys/stat.h>
-# include <windows.h>
+#include <sys/stat.h>
+#include <windows.h>
#endif
cmCPackCygwinSourceGenerator::cmCPackCygwinSourceGenerator()
@@ -46,8 +46,8 @@ int cmCPackCygwinSourceGenerator::InitializeInternal()
int cmCPackCygwinSourceGenerator::PackageFiles()
{
// Create a tar file of the sources
- std::string packageDirFileName
- = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
+ std::string packageDirFileName =
+ this->GetOption("CPACK_TEMPORARY_DIRECTORY");
packageDirFileName += ".tar.bz2";
packageFileNames[0] = packageDirFileName;
std::string output;
@@ -55,10 +55,9 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
// to create tar.bz2 file with the list of source
// files
this->Compress = cmArchiveWrite::CompressBZip2;
- if ( !this->cmCPackTarBZip2Generator::PackageFiles() )
- {
+ if (!this->cmCPackTarBZip2Generator::PackageFiles()) {
return 0;
- }
+ }
// Now create a tar file that contains the above .tar.bz2 file
// and the CPACK_CYGWIN_PATCH_FILE and CPACK_TOPLEVEL_DIRECTORY
// files
@@ -76,47 +75,41 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
// to the toplevel cpack temp dir
// copy the patch file into place
- if(!this->GetOption("CPACK_CYGWIN_PATCH_FILE"))
- {
+ if (!this->GetOption("CPACK_CYGWIN_PATCH_FILE")) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"No patch file specified for cygwin sources.");
return 0;
- }
- if(!cmSystemTools::CopyFileAlways(
- this->GetOption("CPACK_CYGWIN_PATCH_FILE"),
- this->GetOption("CPACK_TOPLEVEL_DIRECTORY")))
- {
+ }
+ if (!cmSystemTools::CopyFileAlways(
+ this->GetOption("CPACK_CYGWIN_PATCH_FILE"),
+ this->GetOption("CPACK_TOPLEVEL_DIRECTORY"))) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "problem copying: ["
- << this->GetOption("CPACK_CYGWIN_PATCH_FILE") << "]\nto\n["
- << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "]\n");
+ << this->GetOption("CPACK_CYGWIN_PATCH_FILE") << "]\nto\n["
+ << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "]\n");
return 0;
- }
- if(!this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"))
- {
+ }
+ if (!this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT")) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"No build script specified for cygwin sources.");
return 0;
- }
+ }
// copy the build script into place
- if(!cmSystemTools::CopyFileAlways(
- this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"),
- this->GetOption("CPACK_TOPLEVEL_DIRECTORY")))
- {
+ if (!cmSystemTools::CopyFileAlways(
+ this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"),
+ this->GetOption("CPACK_TOPLEVEL_DIRECTORY"))) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "problem copying: "
- << this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT") << "\nto\n"
- << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "]\n");
+ << this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT") << "\nto\n"
+ << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "]\n");
return 0;
- }
- std::string outerTarFile
- = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
+ }
+ std::string outerTarFile = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
outerTarFile += "-";
const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
- if(!patch)
- {
+ if (!patch) {
cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
- << " not specified, defaulting to 1\n");
+ << " not specified, defaulting to 1\n");
patch = "1";
- }
+ }
outerTarFile += patch;
outerTarFile += "-src.tar.bz2";
std::string tmpDir = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
@@ -126,8 +119,8 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"));
std::string patchFile = tmpDir;
patchFile += "/";
- patchFile += cmSystemTools::GetFilenameName(
- this->GetOption("CPACK_CYGWIN_PATCH_FILE"));
+ patchFile +=
+ cmSystemTools::GetFilenameName(this->GetOption("CPACK_CYGWIN_PATCH_FILE"));
std::string file = cmSystemTools::GetFilenameName(compressOutFile);
std::string sourceTar = cmSystemTools::GetFilenamePath(compressOutFile);
@@ -146,10 +139,9 @@ int cmCPackCygwinSourceGenerator::PackageFiles()
packageFileNames[0] = outerTarFile;
/* update the toplevel dir */
toplevel = tmpDir;
- if ( !this->cmCPackTarBZip2Generator::PackageFiles() )
- {
+ if (!this->cmCPackTarBZip2Generator::PackageFiles()) {
return 0;
- }
+ }
return 1;
}
@@ -164,14 +156,12 @@ const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
{
this->OutputExtension = "-";
const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
- if(!patch)
- {
+ if (!patch) {
cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
- << " not specified, defaulting to 1\n");
+ << " not specified, defaulting to 1\n");
patch = "1";
- }
+ }
this->OutputExtension += patch;
this->OutputExtension += "-src.tar.bz2";
return this->OutputExtension.c_str();
}
-