cmNMakeMakefileGenerator.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 cmNMakeMakefileGenerator_h
  14. #define cmNMakeMakefileGenerator_h
  15. #include "cmUnixMakefileGenerator.h"
  16. /** \class cmNMakeMakefileGenerator
  17. * \brief Write an NMake makefile.
  18. *
  19. * cmNMakeMakefileGenerator produces a Unix makefile from its
  20. * member m_Makefile.
  21. */
  22. class cmNMakeMakefileGenerator : public cmUnixMakefileGenerator
  23. {
  24. public:
  25. ///! Set cache only and recurse to false by default.
  26. cmNMakeMakefileGenerator();
  27. virtual ~cmNMakeMakefileGenerator();
  28. ///! Get the name for the generator.
  29. virtual const char* GetName() {return "NMake Makefiles";}
  30. ///! virtual copy constructor
  31. virtual cmMakefileGenerator* CreateObject()
  32. { return new cmNMakeMakefileGenerator;}
  33. ///! figure out about the current system information
  34. virtual void EnableLanguage(const char*);
  35. protected:
  36. std::string ShortPath(const char* path);
  37. std::string ShortPathCommand(const char* command);
  38. virtual void OutputMakeVariables(std::ostream&);
  39. virtual void BuildInSubDirectory(std::ostream& fout,
  40. const char* directory,
  41. const char* target1,
  42. const char* target2,
  43. bool silent = false);
  44. void OutputMakeRule(std::ostream& fout,
  45. const char* comment,
  46. const char* target,
  47. const char* depends,
  48. const char* command,
  49. const char* command2=0,
  50. const char* command3=0,
  51. const char* command4=0);
  52. virtual void OutputBuildObjectFromSource(std::ostream& fout,
  53. const char* shortName,
  54. const cmSourceFile& source,
  55. const char* extraCompileFlags,
  56. bool sharedTarget);
  57. virtual void OutputSharedLibraryRule(std::ostream&, const char* name,
  58. const cmTarget &);
  59. virtual void OutputModuleLibraryRule(std::ostream&, const char* name,
  60. const cmTarget &);
  61. virtual void OutputStaticLibraryRule(std::ostream&, const char* name,
  62. const cmTarget &);
  63. virtual void OutputExecutableRule(std::ostream&, const char* name,
  64. const cmTarget &);
  65. virtual void OutputLinkLibraries(std::ostream& fout,
  66. const char* targetLibrary,
  67. const cmTarget &tgt);
  68. virtual std::string GetOutputExtension(const char* sourceExtension);
  69. virtual void OutputIncludeMakefile(std::ostream&, const char* file);
  70. virtual void OutputBuildLibraryInDir(std::ostream& fout,
  71. const char* path,
  72. const char* library,
  73. const char* fullpath);
  74. ///! return true if the two paths are the same (checks short paths)
  75. virtual bool SamePath(const char* path1, const char* path2);
  76. void SetLibraryPathOption(const char* lib){ m_LibraryPathOption = lib;}
  77. void SetLibraryLinkOption(const char* lib){ m_LibraryLinkOption = lib;}
  78. virtual std::string ConvertToOutputPath(const char* s);
  79. virtual std::string CreateMakeVariable(const char* s, const char* s2);
  80. private:
  81. std::string m_LibraryPathOption;// option to specifiy a link path -LIBPATH
  82. std::string m_LibraryLinkOption; // option to specify a library (like -l, empty for nmake)
  83. };
  84. #endif