cmMakefileGenerator.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 cmMakefileGenerator_h
  14. #define cmMakefileGenerator_h
  15. #include "cmStandardIncludes.h"
  16. class cmMakefile;
  17. class cmClassFile;
  18. /** \class cmMakefileGenerator
  19. * \brief Provide an abstract interface for classes generating makefiles.
  20. *
  21. * Subclasses of this abstract class generate makefiles for various
  22. * platforms.
  23. */
  24. class cmMakefileGenerator
  25. {
  26. public:
  27. ///! Create a named generator
  28. static cmMakefileGenerator* CreateGenerator(const char* name);
  29. ///! Register a generator
  30. static void RegisterGenerator(cmMakefileGenerator*);
  31. ///! delete all registered generators, useful for clean up
  32. static void UnRegisterGenerators();
  33. ///! Get the names of the current registered generators
  34. static void GetRegisteredGenerators(std::vector<std::string>& names);
  35. ///! Get the name for the generator.
  36. virtual const char* GetName() = 0;
  37. ///! virtual copy constructor
  38. virtual cmMakefileGenerator* CreateObject() = 0;
  39. ///! Set the cmMakefile instance from which to generate the makefile.
  40. void SetMakefile(cmMakefile*);
  41. /**
  42. * Generate the makefile using the m_Makefile, m_CustomCommands,
  43. * and m_ExtraSourceFiles. All subclasses of cmMakefileGenerator
  44. * must implement this method.
  45. */
  46. virtual void GenerateMakefile() = 0;
  47. /**
  48. * The local setting indicates that the generator is producing a
  49. * fully configured makefile in the current directory. In Microsoft
  50. * terms it is producing a DSP file if local is true and a DSW file
  51. * if local is false. On UNIX when local is false it skips the
  52. * dependecy check and recurses the full tree building the structure
  53. */
  54. virtual void SetLocal(bool ) {};
  55. /**
  56. * Try to determine system infomation such as shared library
  57. * extension, pthreads, byte order etc.
  58. */
  59. virtual void EnableLanguage(const char*) = 0;
  60. virtual ~cmMakefileGenerator(){};
  61. /**
  62. * Set/Get and Clear the enabled languages.
  63. */
  64. static void SetLanguageEnabled(const char*);
  65. static bool GetLanguageEnabled(const char*);
  66. static void ClearEnabledLanguages();
  67. protected:
  68. cmMakefile* m_Makefile;
  69. private:
  70. static std::map<cmStdString, cmMakefileGenerator*> s_RegisteredGenerators;
  71. static std::map<cmStdString, bool> s_LanguageEnabled;
  72. };
  73. #endif