cmConfigureFileCommand.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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. #ifndef cmConfigureFileCommand_h
  14. #define cmConfigureFileCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. class cmConfigureFileCommand : public cmCommand
  18. {
  19. public:
  20. virtual cmCommand* Clone()
  21. {
  22. return new cmConfigureFileCommand;
  23. }
  24. /**
  25. * This is called when the command is first encountered in
  26. * the input file.
  27. */
  28. virtual bool InitialPass(std::vector<std::string> const& args);
  29. /**
  30. * The name of the command as specified in CMakeList.txt.
  31. */
  32. virtual const char* GetName() { return "CONFIGURE_FILE";}
  33. /**
  34. * Succinct documentation.
  35. */
  36. virtual const char* GetTerseDocumentation()
  37. {
  38. return "Create a file from an autoconf style file.in file.";
  39. }
  40. /**
  41. * Longer documentation.
  42. */
  43. virtual const char* GetFullDocumentation()
  44. {
  45. return
  46. "CONFIGURE_FILE(InputFile OutputFile [COPYONLY] [ESCAPE_QUOTES] [IMMEDIATE] [@ONLY])\n"
  47. "The Input and Ouput files have to have full paths.\n"
  48. "They can also use variables like CMAKE_BINARY_DIR,CMAKE_SOURCE_DIR. "
  49. "This command replaces any variables in the input file with their "
  50. "values as determined by CMake. If a variables in not defined, it "
  51. "will be replaced with nothing. If COPYONLY is passed in, then "
  52. "then no varible expansion will take place. If ESCAPE_QUOTES is "
  53. "passed in then any substitued quotes will be C style escaped. "
  54. "If IMMEDIATE is specified, then the file will be configured with "
  55. "the current values of CMake variables instead of waiting until the "
  56. "end of CMakeLists processing. If @ONLY is present, only variables "
  57. "of the form @var@ will be replaces and ${var} will be ignored. "
  58. "This is useful for configuring tcl scripts that use ${var}.";
  59. }
  60. virtual void FinalPass();
  61. private:
  62. void ConfigureFile();
  63. std::string m_InputFile;
  64. std::string m_OuputFile;
  65. bool m_CopyOnly;
  66. bool m_EscapeQuotes;
  67. bool m_Immediate;
  68. bool m_AtOnly;
  69. };
  70. #endif