1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmLocalVisualStudio6Generator.h,v $
6 Date: $Date: 2009-06-16 15:57:18 $
7 Version: $Revision: 1.24 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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 cmLocalVisualStudio6Generator_h
18 #define cmLocalVisualStudio6Generator_h
20 #include "cmLocalVisualStudioGenerator.h"
25 class cmCustomCommand
;
27 /** \class cmLocalVisualStudio6Generator
28 * \brief Write a LocalUnix makefiles.
30 * cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
31 * member this->Makefile.
33 class cmLocalVisualStudio6Generator
: public cmLocalVisualStudioGenerator
36 ///! Set cache only and recurse to false by default.
37 cmLocalVisualStudio6Generator();
39 virtual ~cmLocalVisualStudio6Generator();
41 virtual void AddHelperCommands();
44 * Generate the makefile for this directory.
46 virtual void Generate();
50 enum BuildType
{STATIC_LIBRARY
, DLL
, EXECUTABLE
, WIN32_EXECUTABLE
, UTILITY
};
53 * Specify the type of the build: static, dll, or executable.
55 void SetBuildType(BuildType
, const char* libName
, cmTarget
&);
58 * Return array of created DSP names in a STL vector.
59 * Each executable must have its own dsp.
61 std::vector
<std::string
> GetCreatedProjectNames()
63 return this->CreatedProjectNames
;
65 virtual std::string
GetTargetDirectory(cmTarget
const& target
) const;
66 void GetTargetObjectFileDirectories(cmTarget
* target
,
67 std::vector
<std::string
>&
70 std::string DSPHeaderTemplate
;
71 std::string DSPFooterTemplate
;
72 std::vector
<std::string
> CreatedProjectNames
;
74 void CreateSingleDSP(const char *lname
, cmTarget
&tgt
);
75 void WriteDSPFile(std::ostream
& fout
, const char *libName
,
77 void WriteDSPBeginGroup(std::ostream
& fout
,
80 void WriteDSPEndGroup(std::ostream
& fout
);
82 void WriteDSPHeader(std::ostream
& fout
, const char *libName
,
83 cmTarget
&tgt
, std::vector
<cmSourceGroup
> &sgs
);
85 void WriteDSPFooter(std::ostream
& fout
);
86 void AddDSPBuildRule(cmTarget
& tgt
);
87 void WriteCustomRule(std::ostream
& fout
,
89 const cmCustomCommand
& command
,
91 void AddUtilityCommandHack(cmTarget
& target
, int count
,
92 std::vector
<std::string
>& depends
,
93 const cmCustomCommand
& origCommand
);
94 void WriteGroup(const cmSourceGroup
*sg
, cmTarget
& target
,
95 std::ostream
&fout
, const char *libName
);
97 friend class EventWriter
;
98 std::string
CreateTargetRules(cmTarget
&target
,
99 const char* configName
,
100 const char *libName
);
101 void ComputeLinkOptions(cmTarget
& target
, const char* configName
,
102 const std::string extraOptions
,
103 std::string
& options
);
104 std::string IncludeOptions
;
105 std::vector
<std::string
> Configurations
;
107 std::string
GetConfigName(std::string
const& configuration
) const;
109 // Special definition check for VS6.
110 virtual bool CheckDefinition(std::string
const& define
) const;