cmCPackSTGZGenerator.cxx 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "cmCPackSTGZGenerator.h"
  14. #include "cmake.h"
  15. #include "cmGlobalGenerator.h"
  16. #include "cmLocalGenerator.h"
  17. #include "cmSystemTools.h"
  18. #include "cmMakefile.h"
  19. //----------------------------------------------------------------------
  20. cmCPackSTGZGenerator::cmCPackSTGZGenerator()
  21. {
  22. }
  23. //----------------------------------------------------------------------
  24. cmCPackSTGZGenerator::~cmCPackSTGZGenerator()
  25. {
  26. }
  27. //----------------------------------------------------------------------
  28. int cmCPackSTGZGenerator::ProcessGenerator()
  29. {
  30. return this->Superclass::ProcessGenerator();
  31. }
  32. //----------------------------------------------------------------------
  33. int cmCPackSTGZGenerator::Initialize(const char* name)
  34. {
  35. return this->Superclass::Initialize(name);
  36. }
  37. //----------------------------------------------------------------------
  38. int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
  39. {
  40. *os
  41. << "#!/bin/sh" << std::endl
  42. << "echo \"" << this->GetOption("ProjectName")
  43. << " - self-extracting archive.\"" << std::endl
  44. << "echo \"If you want to stop extracting, please press <ctrl-C>.\"" << std::endl
  45. << "read line" << std::endl
  46. << "echo \"Extracting... Please wait...\"" << std::endl
  47. << "echo \"\"" << std::endl
  48. << "" << std::endl
  49. << "# take the archive portion of this file and pipe it to tar" << std::endl
  50. << "# the NUMERIC parameter in this command should be one more" << std::endl
  51. << "# than the number of lines in this header file" << std::endl
  52. << "tail +18 $0 | gunzip | tar xf -" << std::endl
  53. << "" << std::endl
  54. << "exit 0" << std::endl
  55. << "echo \"\"" << std::endl
  56. << "#-----------------------------------------------------------" << std::endl
  57. << "# Start of TAR.GZ file" << std::endl
  58. << "#-----------------------------------------------------------" << std::endl;
  59. return 1;
  60. }