1
/*=========================================================================
3
Program: Insight Segmentation & Registration Toolkit
4
Module: $RCSfile: cmNMakeMakefileGenerator.h,v $
6
Date: $Date: 2001/12/06 18:32:28 $
7
Version: $Revision: 1.10 $
9
Copyright (c) 2001 Insight Consortium
12
Redistribution and use in source and binary forms, with or without
13
modification, are permitted provided that the following conditions are met:
15
* Redistributions of source code must retain the above copyright notice,
16
this list of conditions and the following disclaimer.
18
* Redistributions in binary form must reproduce the above copyright notice,
19
this list of conditions and the following disclaimer in the documentation
20
and/or other materials provided with the distribution.
22
* The name of the Insight Consortium, nor the names of any consortium members,
23
nor of any contributors, may be used to endorse or promote products derived
24
from this software without specific prior written permission.
26
* Modified source versions must be plainly marked as such, and must not be
27
misrepresented as being the original software.
29
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
30
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
33
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
=========================================================================*/
41
#ifndef cmNMakeMakefileGenerator_h
42
#define cmNMakeMakefileGenerator_h
44
#include "cmUnixMakefileGenerator.h"
46
/** \class cmNMakeMakefileGenerator
47
* \brief Write an NMake makefile.
49
* cmNMakeMakefileGenerator produces a Unix makefile from its
52
class cmNMakeMakefileGenerator : public cmUnixMakefileGenerator
55
///! Set cache only and recurse to false by default.
56
cmNMakeMakefileGenerator();
58
virtual ~cmNMakeMakefileGenerator();
60
///! Get the name for the generator.
61
virtual const char* GetName() {return "NMake Makefiles";}
63
///! virtual copy constructor
64
virtual cmMakefileGenerator* CreateObject()
65
{ return new cmNMakeMakefileGenerator;}
67
///! figure out about the current system information
68
virtual void ComputeSystemInfo();
70
std::string ShortPath(const char* path);
71
std::string ShortPathCommand(const char* command);
72
virtual void OutputMakeVariables(std::ostream&);
73
virtual void BuildInSubDirectory(std::ostream& fout,
74
const char* directory,
77
void OutputMakeRule(std::ostream& fout,
82
const char* command2=0,
83
const char* command3=0,
84
const char* command4=0);
87
virtual void OutputBuildObjectFromSource(std::ostream& fout,
88
const char* shortName,
89
const cmSourceFile& source,
90
const char* extraCompileFlags,
92
virtual void OutputSharedLibraryRule(std::ostream&, const char* name,
94
virtual void OutputModuleLibraryRule(std::ostream&, const char* name,
96
virtual void OutputStaticLibraryRule(std::ostream&, const char* name,
98
virtual void OutputExecutableRule(std::ostream&, const char* name,
100
virtual void OutputLinkLibraries(std::ostream& fout,
101
const char* targetLibrary,
102
const cmTarget &tgt);
103
virtual std::string GetOutputExtension(const char* sourceExtension);
104
virtual void OutputIncludeMakefile(std::ostream&, const char* file);
105
virtual void OutputBuildLibraryInDir(std::ostream& fout,
108
const char* fullpath);
109
///! return true if the two paths are the same (checks short paths)
110
virtual bool SamePath(const char* path1, const char* path2);
111
void SetLibraryPathOption(const char* lib){ m_LibraryPathOption = lib;}
112
void SetLibraryLinkOption(const char* lib){ m_LibraryLinkOption = lib;}
113
virtual std::string ConvertToNativePath(const char* s);
115
std::string m_LibraryPathOption;// option to specifiy a link path -LIBPATH
116
std::string m_LibraryLinkOption; // option to specify a library (like -l, empty for nmake)