1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #ifndef cmLocalVisualStudio6Generator_h
13 #define cmLocalVisualStudio6Generator_h
15 #include "cmLocalVisualStudioGenerator.h"
20 class cmCustomCommand;
22 /** \class cmLocalVisualStudio6Generator
23 * \brief Write a LocalUnix makefiles.
25 * cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
26 * member this->Makefile.
28 class cmLocalVisualStudio6Generator : public cmLocalVisualStudioGenerator
31 ///! Set cache only and recurse to false by default.
32 cmLocalVisualStudio6Generator();
34 virtual ~cmLocalVisualStudio6Generator();
36 virtual void AddHelperCommands();
37 virtual void AddCMakeListsRules();
40 * Generate the makefile for this directory.
42 virtual void Generate();
46 enum BuildType {STATIC_LIBRARY, DLL, EXECUTABLE, WIN32_EXECUTABLE, UTILITY};
49 * Specify the type of the build: static, dll, or executable.
51 void SetBuildType(BuildType, const char* libName, cmTarget&);
53 virtual std::string GetTargetDirectory(cmTarget const& target) const;
54 virtual std::string ComputeLongestObjectDirectory(cmTarget&) const;
56 std::string DSPHeaderTemplate;
57 std::string DSPFooterTemplate;
59 void CreateSingleDSP(const char *lname, cmTarget &tgt);
60 void WriteDSPFile(std::ostream& fout, const char *libName,
62 void WriteDSPBeginGroup(std::ostream& fout,
65 void WriteDSPEndGroup(std::ostream& fout);
67 void WriteDSPHeader(std::ostream& fout, const char *libName,
68 cmTarget &tgt, std::vector<cmSourceGroup> &sgs);
70 void WriteDSPFooter(std::ostream& fout);
71 void AddDSPBuildRule(cmTarget& tgt);
72 void WriteCustomRule(std::ostream& fout,
74 const cmCustomCommand& command,
76 void AddUtilityCommandHack(cmTarget& target, int count,
77 std::vector<std::string>& depends,
78 const cmCustomCommand& origCommand);
79 void WriteGroup(const cmSourceGroup *sg, cmTarget& target,
80 std::ostream &fout, const char *libName);
82 friend class EventWriter;
83 cmsys::auto_ptr<cmCustomCommand>
84 MaybeCreateOutputDir(cmTarget& target, const char* config);
85 std::string CreateTargetRules(cmTarget &target,
86 const char* configName,
88 void ComputeLinkOptions(cmTarget& target, const char* configName,
89 const std::string extraOptions,
90 std::string& options);
91 void OutputObjects(cmTarget& target, const char* tool,
92 std::string& options);
93 std::string GetTargetIncludeOptions(cmTarget &target, const char *config);
94 std::vector<std::string> Configurations;
96 std::string GetConfigName(std::string const& configuration) const;
98 // Special definition check for VS6.
99 virtual bool CheckDefinition(std::string const& define) const;