cmLocalGenerator.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #ifndef cmLocalGenerator_h
  14. #define cmLocalGenerator_h
  15. #include "cmStandardIncludes.h"
  16. class cmMakefile;
  17. class cmGlobalGenerator;
  18. class cmTarget;
  19. /** \class cmLocalGenerator
  20. * \brief Create required build files for a directory.
  21. *
  22. * Subclasses of this abstract class generate makefiles, DSP, etc for various
  23. * platforms. This class should never be constructued directly. A
  24. * GlobalGenerator will create it and invoke the appropriate commands on it.
  25. */
  26. class cmLocalGenerator
  27. {
  28. public:
  29. cmLocalGenerator();
  30. virtual ~cmLocalGenerator();
  31. /**
  32. * Generate the makefile for this directory. fromTheTop indicates if this
  33. * is being invoked as part of a global Generate or specific to this
  34. * directory. The difference is that when done from the Top we might skip
  35. * some steps to save time, such as dependency generation for the
  36. * makefiles. This is done by a direct invocation from make.
  37. */
  38. virtual void Generate(bool /* fromTheTop */) {};
  39. /**
  40. * Process the CMakeLists files for this directory to fill in the
  41. * m_Makefile ivar
  42. */
  43. virtual void Configure();
  44. /**
  45. * Perform any final calculations prior to generation
  46. */
  47. virtual void ConfigureFinalPass();
  48. /**
  49. * Generate the install rules files in this directory.
  50. */
  51. virtual void GenerateInstallRules();
  52. ///! Get the makefile for this generator
  53. cmMakefile *GetMakefile() {
  54. return this->m_Makefile; };
  55. ///! Get the GlobalGenerator this is associated with
  56. cmGlobalGenerator *GetGlobalGenerator() {
  57. return m_GlobalGenerator; };
  58. ///! Set the Global Generator, done on creation by the GlobalGenerator
  59. void SetGlobalGenerator(cmGlobalGenerator *gg);
  60. /** Get the full name of the target's file, without path. */
  61. std::string GetFullTargetName(const char* n, const cmTarget& t);
  62. virtual const char* GetSafeDefinition(const char*);
  63. std::string ConvertToRelativeOutputPath(const char* p);
  64. protected:
  65. virtual void AddInstallRule(std::ostream& fout, const char* dest, int type,
  66. const char* files, bool optional = false);
  67. bool m_FromTheTop;
  68. cmMakefile *m_Makefile;
  69. cmGlobalGenerator *m_GlobalGenerator;
  70. // members used for relative path function ConvertToMakefilePath
  71. std::string m_RelativePathToSourceDir;
  72. std::string m_RelativePathToBinaryDir;
  73. std::string m_CurrentOutputDirectory;
  74. std::string m_HomeOutputDirectory;
  75. std::string m_HomeDirectory;
  76. std::string m_HomeOutputDirectoryNoSlash;
  77. };
  78. #endif