1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmNMakeMakefileGenerator.h,v $
6 Date: $Date: 2002-07-31 17:45:07 $
7 Version: $Revision: 1.17 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmNMakeMakefileGenerator_h
18 #define cmNMakeMakefileGenerator_h
20 #include "cmUnixMakefileGenerator.h"
22 /** \class cmNMakeMakefileGenerator
23 * \brief Write an NMake makefile.
25 * cmNMakeMakefileGenerator produces a Unix makefile from its
28 class cmNMakeMakefileGenerator
: public cmUnixMakefileGenerator
31 ///! Set cache only and recurse to false by default.
32 cmNMakeMakefileGenerator();
34 virtual ~cmNMakeMakefileGenerator();
36 ///! Get the name for the generator.
37 virtual const char* GetName() {return "NMake Makefiles";}
39 ///! virtual copy constructor
40 virtual cmMakefileGenerator
* CreateObject()
41 { return new cmNMakeMakefileGenerator
;}
43 ///! figure out about the current system information
44 virtual void EnableLanguage(const char*);
46 std::string
ShortPath(const char* path
);
47 std::string
ShortPathCommand(const char* command
);
48 virtual void OutputMakeVariables(std::ostream
&);
49 virtual void BuildInSubDirectory(std::ostream
& fout
,
50 const char* directory
,
54 void OutputMakeRule(std::ostream
& fout
,
59 const char* command2
=0,
60 const char* command3
=0,
61 const char* command4
=0);
64 virtual void OutputBuildObjectFromSource(std::ostream
& fout
,
65 const char* shortName
,
66 const cmSourceFile
& source
,
67 const char* extraCompileFlags
,
69 virtual void OutputSharedLibraryRule(std::ostream
&, const char* name
,
71 virtual void OutputModuleLibraryRule(std::ostream
&, const char* name
,
73 virtual void OutputStaticLibraryRule(std::ostream
&, const char* name
,
75 virtual void OutputExecutableRule(std::ostream
&, const char* name
,
77 virtual void OutputLinkLibraries(std::ostream
& fout
,
78 const char* targetLibrary
,
80 virtual std::string
GetOutputExtension(const char* sourceExtension
);
81 virtual void OutputIncludeMakefile(std::ostream
&, const char* file
);
82 virtual void OutputBuildTargetInDir(std::ostream
& fout
,
86 const char* outputPath
);
87 ///! return true if the two paths are the same (checks short paths)
88 virtual bool SamePath(const char* path1
, const char* path2
);
89 void SetLibraryPathOption(const char* lib
){ m_LibraryPathOption
= lib
;}
90 void SetLibraryLinkOption(const char* lib
){ m_LibraryLinkOption
= lib
;}
91 virtual std::string
ConvertToOutputPath(const char* s
);
93 virtual std::string
CreateMakeVariable(const char* s
, const char* s2
);
94 virtual std::string
LowerCasePath(const char* path
);
96 std::string m_LibraryPathOption
;// option to specifiy a link path -LIBPATH
97 std::string m_LibraryLinkOption
; // option to specify a library (like -l, empty for nmake)