cmLocalNMakeMakefileGenerator.h 3.9 KB

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