cmNMakeMakefileGenerator.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 ComputeSystemInfo();
  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. void OutputMakeRule(std::ostream& fout,
  44. const char* comment,
  45. const char* target,
  46. const char* depends,
  47. const char* command,
  48. const char* command2=0,
  49. const char* command3=0,
  50. const char* command4=0);
  51. virtual void OutputBuildObjectFromSource(std::ostream& fout,
  52. const char* shortName,
  53. const cmSourceFile& source,
  54. const char* extraCompileFlags,
  55. bool sharedTarget);
  56. virtual void OutputSharedLibraryRule(std::ostream&, const char* name,
  57. const cmTarget &);
  58. virtual void OutputModuleLibraryRule(std::ostream&, const char* name,
  59. const cmTarget &);
  60. virtual void OutputStaticLibraryRule(std::ostream&, const char* name,
  61. const cmTarget &);
  62. virtual void OutputExecutableRule(std::ostream&, const char* name,
  63. const cmTarget &);
  64. virtual void OutputLinkLibraries(std::ostream& fout,
  65. const char* targetLibrary,
  66. const cmTarget &tgt);
  67. virtual std::string GetOutputExtension(const char* sourceExtension);
  68. virtual void OutputIncludeMakefile(std::ostream&, const char* file);
  69. virtual void OutputBuildLibraryInDir(std::ostream& fout,
  70. const char* path,
  71. const char* library,
  72. const char* fullpath);
  73. ///! return true if the two paths are the same (checks short paths)
  74. virtual bool SamePath(const char* path1, const char* path2);
  75. void SetLibraryPathOption(const char* lib){ m_LibraryPathOption = lib;}
  76. void SetLibraryLinkOption(const char* lib){ m_LibraryLinkOption = lib;}
  77. virtual std::string ConvertToNativePath(const char* s);
  78. private:
  79. std::string m_LibraryPathOption;// option to specifiy a link path -LIBPATH
  80. std::string m_LibraryLinkOption; // option to specify a library (like -l, empty for nmake)
  81. };
  82. #endif