~ubuntu-branches/ubuntu/intrepid/cmake/intrepid-backports

« back to all changes in this revision

Viewing changes to Source/cmNMakeMakefileGenerator.h

  • Committer: Bazaar Package Importer
  • Author(s): Maitland Bottoms
  • Date: 2002-02-14 18:36:25 UTC
  • Revision ID: james.westby@ubuntu.com-20020214183625-8m44isdas2k4l0f7
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Insight Segmentation & Registration Toolkit
 
4
  Module:    $RCSfile: cmNMakeMakefileGenerator.h,v $
 
5
  Language:  C++
 
6
  Date:      $Date: 2001/12/06 18:32:28 $
 
7
  Version:   $Revision: 1.10 $
 
8
 
 
9
Copyright (c) 2001 Insight Consortium
 
10
All rights reserved.
 
11
 
 
12
Redistribution and use in source and binary forms, with or without
 
13
modification, are permitted provided that the following conditions are met:
 
14
 
 
15
 * Redistributions of source code must retain the above copyright notice,
 
16
   this list of conditions and the following disclaimer.
 
17
 
 
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.
 
21
 
 
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.
 
25
 
 
26
  * Modified source versions must be plainly marked as such, and must not be
 
27
    misrepresented as being the original software.
 
28
 
 
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.
 
39
 
 
40
=========================================================================*/
 
41
#ifndef cmNMakeMakefileGenerator_h
 
42
#define cmNMakeMakefileGenerator_h
 
43
 
 
44
#include "cmUnixMakefileGenerator.h"
 
45
 
 
46
/** \class cmNMakeMakefileGenerator
 
47
 * \brief Write an NMake makefile.
 
48
 *
 
49
 * cmNMakeMakefileGenerator produces a Unix makefile from its
 
50
 * member m_Makefile.
 
51
 */
 
52
class cmNMakeMakefileGenerator : public cmUnixMakefileGenerator
 
53
{
 
54
public:
 
55
  ///! Set cache only and recurse to false by default.
 
56
  cmNMakeMakefileGenerator();
 
57
 
 
58
  virtual ~cmNMakeMakefileGenerator();
 
59
  
 
60
  ///! Get the name for the generator.
 
61
  virtual const char* GetName() {return "NMake Makefiles";}
 
62
 
 
63
  ///! virtual copy constructor
 
64
  virtual cmMakefileGenerator* CreateObject() 
 
65
    { return new cmNMakeMakefileGenerator;}
 
66
 
 
67
  ///! figure out about the current system information
 
68
  virtual void ComputeSystemInfo(); 
 
69
protected:
 
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,
 
75
                                   const char* target1,
 
76
                                   const char* target2);
 
77
  void OutputMakeRule(std::ostream& fout, 
 
78
                      const char* comment,
 
79
                      const char* target,
 
80
                      const char* depends, 
 
81
                      const char* command,
 
82
                      const char* command2=0,
 
83
                      const char* command3=0,
 
84
                      const char* command4=0); 
 
85
  
 
86
  
 
87
  virtual void OutputBuildObjectFromSource(std::ostream& fout,
 
88
                                           const char* shortName,
 
89
                                           const cmSourceFile& source,
 
90
                                           const char* extraCompileFlags,
 
91
                                           bool sharedTarget); 
 
92
  virtual void OutputSharedLibraryRule(std::ostream&, const char* name,
 
93
                                       const cmTarget &);
 
94
  virtual void OutputModuleLibraryRule(std::ostream&, const char* name, 
 
95
                                       const cmTarget &);
 
96
  virtual void OutputStaticLibraryRule(std::ostream&, const char* name,
 
97
                                       const cmTarget &);
 
98
  virtual void OutputExecutableRule(std::ostream&, const char* name,
 
99
                                    const cmTarget &);
 
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,
 
106
                                       const char* path,
 
107
                                       const char* library,
 
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);
 
114
private:
 
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)
 
117
};
 
118
 
 
119
#endif