cmMakefileGenerator.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. /**
  28. * Try running cmake and building a file. This is used for dynalically
  29. * loaded commands, not as part of the usual build process.
  30. */
  31. virtual int TryCompile(const char *srcdir, const char *bindir,
  32. const char *projectName) = 0;
  33. ///! Get the name for the generator.
  34. virtual const char* GetName() = 0;
  35. ///! virtual copy constructor
  36. virtual cmMakefileGenerator* CreateObject() = 0;
  37. ///! Set the cmMakefile instance from which to generate the makefile.
  38. void SetMakefile(cmMakefile*);
  39. /**
  40. * Generate the makefile using the m_Makefile, m_CustomCommands,
  41. * and m_ExtraSourceFiles. All subclasses of cmMakefileGenerator
  42. * must implement this method.
  43. */
  44. virtual void GenerateMakefile() = 0;
  45. /**
  46. * The local setting indicates that the generator is producing a
  47. * fully configured makefile in the current directory. In Microsoft
  48. * terms it is producing a DSP file if local is true and a DSW file
  49. * if local is false. On UNIX when local is false it skips the
  50. * dependecy check and recurses the full tree building the structure
  51. */
  52. virtual void SetLocal(bool ) {};
  53. /**
  54. * Try to determine system infomation such as shared library
  55. * extension, pthreads, byte order etc.
  56. */
  57. virtual void EnableLanguage(const char*) = 0;
  58. virtual ~cmMakefileGenerator(){};
  59. /**
  60. * Set/Get and Clear the enabled languages.
  61. */
  62. static void SetLanguageEnabled(const char*);
  63. static bool GetLanguageEnabled(const char*);
  64. static void ClearEnabledLanguages();
  65. protected:
  66. cmMakefile* m_Makefile;
  67. private:
  68. static std::map<cmStdString, bool> s_LanguageEnabled;
  69. };
  70. #endif